AuthenticationType.java

1
/*
2
 *
3
 *  * Copyright OpenSearch Contributors
4
 *  * SPDX-License-Identifier: Apache-2.0
5
 *
6
 */
7
8
package org.opensearch.sql.catalog.model.auth;
9
10
import java.util.Collections;
11
import java.util.HashMap;
12
import java.util.Map;
13
import java.util.concurrent.ConcurrentHashMap;
14
15
public enum AuthenticationType {
16
17
  BASICAUTH("basicauth"), AWSSIGV4AUTH("awssigv4");
18
19
  private String name;
20
21
  private static final Map<String, AuthenticationType> ENUM_MAP;
22
23
  AuthenticationType(String name) {
24
    this.name = name;
25
  }
26
27
  public String getName() {
28 1 1. getName : replaced return value with "" for org/opensearch/sql/catalog/model/auth/AuthenticationType::getName → NO_COVERAGE
    return this.name;
29
  }
30
31
  static {
32
    Map<String, AuthenticationType> map = new HashMap<>();
33
    for (AuthenticationType instance : AuthenticationType.values()) {
34
      map.put(instance.getName().toLowerCase(), instance);
35
    }
36
    ENUM_MAP = Collections.unmodifiableMap(map);
37
  }
38
39
  public static AuthenticationType get(String name) {
40 1 1. get : replaced return value with null for org/opensearch/sql/catalog/model/auth/AuthenticationType::get → NO_COVERAGE
    return ENUM_MAP.get(name.toLowerCase());
41
  }
42
}

Mutations

28

1.1
Location : getName
Killed by : none
replaced return value with "" for org/opensearch/sql/catalog/model/auth/AuthenticationType::getName → NO_COVERAGE

40

1.1
Location : get
Killed by : none
replaced return value with null for org/opensearch/sql/catalog/model/auth/AuthenticationType::get → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.9.0