@Test public void testDefaultHttpClientFactory() { ServiceFactory factory = new ServiceFactory(); HttpClient httpClient = factory.createHttpClient(false, null, 0); assertThat(httpClient.getClass().getSimpleName()).isEqualTo("HttpClientImpl"); }
public HttpClient createHttpClient(boolean useProxy, String proxyHost, int proxyPort) { ProxySettings proxySettings = ProxySettings.fromConfig(useProxy, proxyHost, proxyPort); return httpClients.computeIfAbsent(proxySettings, this::createHttpClient); }
ServiceFactory { public HttpClient createHttpClient(boolean useProxy, String proxyHost, int proxyPort) { ProxySettings proxySettings = ProxySettings.fromConfig(useProxy, proxyHost, proxyPort); return httpClients.computeIfAbsent(proxySettings, this::createHttpClient); } }
ServiceFactory { public HttpClient createHttpClient(boolean useProxy, String proxyHost, int proxyPort) { ProxySettings proxySettings = ProxySettings.fromConfig(useProxy, proxyHost, proxyPort); return httpClients.computeIfAbsent(proxySettings, this::createHttpClient); } ServiceFactory();   ServiceFactory(HttpClientFactory httpClientFactory); }
ServiceFactory { public HttpClient createHttpClient(boolean useProxy, String proxyHost, int proxyPort) { ProxySettings proxySettings = ProxySettings.fromConfig(useProxy, proxyHost, proxyPort); return httpClients.computeIfAbsent(proxySettings, this::createHttpClient); } ServiceFactory();   ServiceFactory(HttpClientFactory httpClientFactory); static ObjectMapper getObjectMapper(); HttpClient createHttpClient(boolean useProxy, String proxyHost, int proxyPort); }
ServiceFactory { public HttpClient createHttpClient(boolean useProxy, String proxyHost, int proxyPort) { ProxySettings proxySettings = ProxySettings.fromConfig(useProxy, proxyHost, proxyPort); return httpClients.computeIfAbsent(proxySettings, this::createHttpClient); } ServiceFactory();   ServiceFactory(HttpClientFactory httpClientFactory); static ObjectMapper getObjectMapper(); HttpClient createHttpClient(boolean useProxy, String proxyHost, int proxyPort);  }