@Test public void failedToRetrieveStoredConfig() { when(mockStatusLine.getStatusCode()).thenReturn(HttpStatus.SC_NOT_FOUND); Map<String, ComprehendConfiguration> configMap = test.retrieveStoredConfig(); verifyZeroInteractions(mockConfigSerializer); assertEquals(Collections.EMPTY_MAP, configMap); }
public Map<String, ComprehendConfiguration> retrieveStoredConfig() { Response esConfigResponse = esClient.performRequest(HttpGet.METHOD_NAME, String.format("%s%s", Constants.CONFIG_PATH, "/_source")); if (esConfigResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { return Collections.emptyMap(); } String retrievedConfig = HTTPTransformer.transformHttpEntityToString(esConfigResponse.getEntity()); PreprocessingConfigRequest retrievedConfigRequest = configSerializer.deserialize(retrievedConfig); return ConfigSerializer.transformConfigRequestToConfigMap(retrievedConfigRequest); }
ConfigRetriever { public Map<String, ComprehendConfiguration> retrieveStoredConfig() { Response esConfigResponse = esClient.performRequest(HttpGet.METHOD_NAME, String.format("%s%s", Constants.CONFIG_PATH, "/_source")); if (esConfigResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { return Collections.emptyMap(); } String retrievedConfig = HTTPTransformer.transformHttpEntityToString(esConfigResponse.getEntity()); PreprocessingConfigRequest retrievedConfigRequest = configSerializer.deserialize(retrievedConfig); return ConfigSerializer.transformConfigRequestToConfigMap(retrievedConfigRequest); } }
ConfigRetriever { public Map<String, ComprehendConfiguration> retrieveStoredConfig() { Response esConfigResponse = esClient.performRequest(HttpGet.METHOD_NAME, String.format("%s%s", Constants.CONFIG_PATH, "/_source")); if (esConfigResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { return Collections.emptyMap(); } String retrievedConfig = HTTPTransformer.transformHttpEntityToString(esConfigResponse.getEntity()); PreprocessingConfigRequest retrievedConfigRequest = configSerializer.deserialize(retrievedConfig); return ConfigSerializer.transformConfigRequestToConfigMap(retrievedConfigRequest); }  }
ConfigRetriever { public Map<String, ComprehendConfiguration> retrieveStoredConfig() { Response esConfigResponse = esClient.performRequest(HttpGet.METHOD_NAME, String.format("%s%s", Constants.CONFIG_PATH, "/_source")); if (esConfigResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { return Collections.emptyMap(); } String retrievedConfig = HTTPTransformer.transformHttpEntityToString(esConfigResponse.getEntity()); PreprocessingConfigRequest retrievedConfigRequest = configSerializer.deserialize(retrievedConfig); return ConfigSerializer.transformConfigRequestToConfigMap(retrievedConfigRequest); }  Map<String, ComprehendConfiguration> retrieveStoredConfig(); }
ConfigRetriever { public Map<String, ComprehendConfiguration> retrieveStoredConfig() { Response esConfigResponse = esClient.performRequest(HttpGet.METHOD_NAME, String.format("%s%s", Constants.CONFIG_PATH, "/_source")); if (esConfigResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { return Collections.emptyMap(); } String retrievedConfig = HTTPTransformer.transformHttpEntityToString(esConfigResponse.getEntity()); PreprocessingConfigRequest retrievedConfigRequest = configSerializer.deserialize(retrievedConfig); return ConfigSerializer.transformConfigRequestToConfigMap(retrievedConfigRequest); }  Map<String, ComprehendConfiguration> retrieveStoredConfig();  }