test_class.declarator: ERROR_RESPONSE = "Test error response"
test_class.modifier: private static final
test_class.original_string: private static final String ERROR_RESPONSE = "Test error response";
test_class.type: String
test_class.var_name: ERROR_RESPONSE
test_class.declarator: mockResponseBodyString = "{\n" +
              "        \"has_next\" : false,\n" +
              "        \"next_offset\" : 0,\n" +
              "        \"limit\" : 2000,\n" +
              "        \"offset\" : 0,\n" +
              "        \"sdb_count_in_result\" : 1,\n" +
              "        \"total_sdbcount\" : 1,\n" +
              "        \"safe_deposit_box_metadata\" : [ {\n" +
              "            \"name\" : \"test sdb\",\n" +
              "            \"path\" : \"test/path/app\",\n" +
              "            \"category\" : \"Applications\",\n" +
              "            \"owner\" : \"Test.Owner\",\n" +
              "            \"description\" : \"test sdb\",\n" +
              "            \"created_ts\" : \"2019-05-13T20:13:56.799Z\",\n" +
              "            \"created_by\" : \"test.user@nike.com\",\n" +
              "            \"last_updated_ts\" : \"2019-05-13T20:13:56.799Z\",\n" +
              "            \"last_updated_by\" : \"arn:aws:iam::111111111111:role/example/role\",\n" +
              "            \"user_group_permissions\" : {  },\n" +
              "            \"iam_role_permissions\" : {\n" +
              "               \"arn:aws:iam::111111111111:role/example/role\" : \"read\"\n" +
              "          },\n" +
              "       \"data\" : null\n" +
              "      }]\n" +
              "}"
test_class.modifier: private static final
test_class.original_string: private static final String mockResponseBodyString = "{\n" +
              "        \"has_next\" : false,\n" +
              "        \"next_offset\" : 0,\n" +
              "        \"limit\" : 2000,\n" +
              "        \"offset\" : 0,\n" +
              "        \"sdb_count_in_result\" : 1,\n" +
              "        \"total_sdbcount\" : 1,\n" +
              "        \"safe_deposit_box_metadata\" : [ {\n" +
              "            \"name\" : \"test sdb\",\n" +
              "            \"path\" : \"test/path/app\",\n" +
              "            \"category\" : \"Applications\",\n" +
              "            \"owner\" : \"Test.Owner\",\n" +
              "            \"description\" : \"test sdb\",\n" +
              "            \"created_ts\" : \"2019-05-13T20:13:56.799Z\",\n" +
              "            \"created_by\" : \"test.user@nike.com\",\n" +
              "            \"last_updated_ts\" : \"2019-05-13T20:13:56.799Z\",\n" +
              "            \"last_updated_by\" : \"arn:aws:iam::111111111111:role/example/role\",\n" +
              "            \"user_group_permissions\" : {  },\n" +
              "            \"iam_role_permissions\" : {\n" +
              "               \"arn:aws:iam::111111111111:role/example/role\" : \"read\"\n" +
              "          },\n" +
              "       \"data\" : null\n" +
              "      }]\n" +
              "}";
test_class.type: String
test_class.var_name: mockResponseBodyString
test_class.declarator: emptyMetadataResponseBodyString = "{  \n" +
              "   \"has_next\":false,\n" +
              "   \"next_offset\":0,\n" +
              "   \"limit\":2000,\n" +
              "   \"offset\":0,\n" +
              "   \"sdb_count_in_result\":1723,\n" +
              "   \"total_sdbcount\":1723,\n" +
              "   \"safe_deposit_box_metadata\":[  \n" +
              "\n" +
              "   ]\n" +
              "}"
test_class.modifier: private static final
test_class.original_string: private static final String emptyMetadataResponseBodyString = "{  \n" +
              "   \"has_next\":false,\n" +
              "   \"next_offset\":0,\n" +
              "   \"limit\":2000,\n" +
              "   \"offset\":0,\n" +
              "   \"sdb_count_in_result\":1723,\n" +
              "   \"total_sdbcount\":1723,\n" +
              "   \"safe_deposit_box_metadata\":[  \n" +
              "\n" +
              "   ]\n" +
              "}";
test_class.type: String
test_class.var_name: emptyMetadataResponseBodyString
test_class.declarator: cerberusMetadataLookup = new CerberusMetadataLookup()
test_class.modifier: private
test_class.original_string: private CerberusMetadataLookup cerberusMetadataLookup = new CerberusMetadataLookup();
test_class.type: CerberusMetadataLookup
test_class.var_name: cerberusMetadataLookup
test_class.file: cerberus-ip-translator-lambda/src/test/java/com.nike.cerberus.lambda.waf/CerberusMetadataLookupTest.java
test_class.identifier: CerberusMetadataLookupTest
test_case.body: @Test
      public void test_search_cerberus_metadata_parameters_empty() throws IOException {
          HashMap result = new ObjectMapper().readValue(mockResponseBodyString, HashMap.class);
          ArrayList<Map<String, String>> sdbMetadata = (ArrayList<Map<String, String>>) result.get("safe_deposit_box_metadata");
  
          ArrayList<String> results = cerberusMetadataLookup.searchCerberusMetadata(sdbMetadata, "", "");
          assertTrue(results.contains("No owner found"));
      }
test_case.class_method_signature: CerberusMetadataLookupTest.test_search_cerberus_metadata_parameters_empty()
test_case.full_signature: @Test public void test_search_cerberus_metadata_parameters_empty()
test_case.identifier: test_search_cerberus_metadata_parameters_empty
test_case.invocations: readValue get searchCerberusMetadata assertTrue contains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_search_cerberus_metadata_parameters_empty()
focal_class.declarator: DEFAULT_TIMEOUT = 60_000
focal_class.modifier: private static final
focal_class.original_string: private static final int DEFAULT_TIMEOUT = 60_000;
focal_class.type: int
focal_class.var_name: DEFAULT_TIMEOUT
focal_class.declarator: DEFAULT_TIMEOUT_UNIT = TimeUnit.MILLISECONDS
focal_class.modifier: private static final
focal_class.original_string: private static final TimeUnit DEFAULT_TIMEOUT_UNIT = TimeUnit.MILLISECONDS;
focal_class.type: TimeUnit
focal_class.var_name: DEFAULT_TIMEOUT_UNIT
focal_class.declarator: CERBERUS_TOKEN = "X-Cerberus-Token"
focal_class.modifier: private static final
focal_class.original_string: private static final String CERBERUS_TOKEN = "X-Cerberus-Token";
focal_class.type: String
focal_class.var_name: CERBERUS_TOKEN
focal_class.declarator: EMAIL_SYMBOL = "@"
focal_class.modifier: private static final
focal_class.original_string: private static final String EMAIL_SYMBOL = "@";
focal_class.type: String
focal_class.var_name: EMAIL_SYMBOL
focal_class.declarator: logger = Logger.getLogger(getClass())
focal_class.modifier: private final
focal_class.original_string: private final Logger logger = Logger.getLogger(getClass());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: TLS_1_2_OR_NEWER = new ConnectionSpec.Builder(MODERN_TLS)
              .tlsVersions(TlsVersion.TLS_1_3, TlsVersion.TLS_1_2)
              .build()
focal_class.modifier: private static final
focal_class.original_string: private static final ConnectionSpec TLS_1_2_OR_NEWER = new ConnectionSpec.Builder(MODERN_TLS)
              .tlsVersions(TlsVersion.TLS_1_3, TlsVersion.TLS_1_2)
              .build();
focal_class.type: ConnectionSpec
focal_class.var_name: TLS_1_2_OR_NEWER
focal_class.file: cerberus-ip-translator-lambda/src/main/java/com.nike.cerberus.lambda.waf/CerberusMetadataLookup.java
focal_class.identifier: CerberusMetadataLookup
focal_class.class_method_signature: CerberusMetadataLookup.createHttpClient()
focal_class.full_signature: private OkHttpClient createHttpClient()
focal_class.identifier: createHttpClient
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: OkHttpClient
focal_class.signature: OkHttpClient createHttpClient()
focal_class.class_method_signature: CerberusMetadataLookup.getCerberusMetadata(String environment)
focal_class.full_signature: public ArrayList<Map<String, String>> getCerberusMetadata(String environment)
focal_class.identifier: getCerberusMetadata
focal_class.modifiers: public
focal_class.parameters: (String environment)
focal_class.return: ArrayList<Map<String, String>>
focal_class.signature: ArrayList<Map<String, String>> getCerberusMetadata(String environment)
focal_class.class_method_signature: CerberusMetadataLookup.searchCerberusMetadata(ArrayList<Map<String, String>> sdbMetadata, String sdbName, String principalName)
focal_class.full_signature: public ArrayList<String> searchCerberusMetadata(ArrayList<Map<String, String>> sdbMetadata, String sdbName, String principalName)
focal_class.identifier: searchCerberusMetadata
focal_class.modifiers: public
focal_class.parameters: (ArrayList<Map<String, String>> sdbMetadata, String sdbName, String principalName)
focal_class.return: ArrayList<String>
focal_class.signature: ArrayList<String> searchCerberusMetadata(ArrayList<Map<String, String>> sdbMetadata, String sdbName, String principalName)
focal_class.class_method_signature: CerberusMetadataLookup.executeRequest(OkHttpClient httpClient, DefaultCerberusCredentialsProviderChain chain,
                                     String cerberusUrl, String offset)
focal_class.full_signature: private HashMap executeRequest(OkHttpClient httpClient, DefaultCerberusCredentialsProviderChain chain,
                                     String cerberusUrl, String offset)
focal_class.identifier: executeRequest
focal_class.modifiers: private
focal_class.parameters: (OkHttpClient httpClient, DefaultCerberusCredentialsProviderChain chain,
                                     String cerberusUrl, String offset)
focal_class.return: HashMap
focal_class.signature: HashMap executeRequest(OkHttpClient httpClient, DefaultCerberusCredentialsProviderChain chain,
                                     String cerberusUrl, String offset)
focal_method.body: public ArrayList<String> searchCerberusMetadata(ArrayList<Map<String, String>> sdbMetadata, String sdbName, String principalName) {
  
          if (sdbMetadata == null) {
              throw new NullPointerException("SDB Metadata is empty");
          }
  
          ArrayList<String> owner = new ArrayList<>();
  
          for (Map<String, String> entry : sdbMetadata) {
  
              if (entry.get("path").contains(sdbName) && !sdbName.isEmpty()) {
                  owner.add(entry.get("owner"));
                  if (entry.get("created_by").contains(EMAIL_SYMBOL)) owner.add(entry.get("created_by"));
                  if (entry.get("last_updated_by").contains(EMAIL_SYMBOL)
                          && !entry.get("last_updated_by").equals(entry.get("created_by"))) {
                      owner.add(entry.get("last_updated_by"));
                  }
                  return owner;
              } else {
                  if (entry.containsValue(principalName)) {
                      owner.add(entry.get("owner"));
                      if (entry.get("created_by").contains(EMAIL_SYMBOL)) owner.add(entry.get("created_by"));
                      if (entry.get("last_updated_by").contains(EMAIL_SYMBOL)
                              && !entry.get("last_updated_by").equals(entry.get("created_by"))) {
                          owner.add(entry.get("last_updated_by"));
                      }
                      return owner;
                  }
              }
          }
  
          owner.add("No owner found");
          return owner;
      }
focal_method.class_method_signature: CerberusMetadataLookup.searchCerberusMetadata(ArrayList<Map<String, String>> sdbMetadata, String sdbName, String principalName)
focal_method.full_signature: public ArrayList<String> searchCerberusMetadata(ArrayList<Map<String, String>> sdbMetadata, String sdbName, String principalName)
focal_method.identifier: searchCerberusMetadata
focal_method.invocations: contains get isEmpty add get contains get add get contains get equals get get add get containsValue add get contains get add get contains get equals get get add get add
focal_method.modifiers: public
focal_method.parameters: (ArrayList<Map<String, String>> sdbMetadata, String sdbName, String principalName)
focal_method.return: ArrayList<String>
focal_method.signature: ArrayList<String> searchCerberusMetadata(ArrayList<Map<String, String>> sdbMetadata, String sdbName, String principalName)