@Test public void testNoRetriesOnBadHttpResponseCode() { mockReturnCode = 503; try { configServerApi.get("/path", TestPojo.class); fail("Expected failure"); } catch (Exception e) { } assertLogStringContainsGETForAHost(); }
@Override public <T> T get(String path, Class<T> wantedReturnType, Params paramsOrNull) { Optional<RequestConfig> requestConfig = getRequestConfigOverride(paramsOrNull); return tryAllConfigServers(configServer -> { HttpGet get = new HttpGet(configServer.resolve(path)); requestConfig.ifPresent(get::setConfig); return get; }, wantedReturnType); }
ConfigServerApiImpl implements ConfigServerApi { @Override public <T> T get(String path, Class<T> wantedReturnType, Params paramsOrNull) { Optional<RequestConfig> requestConfig = getRequestConfigOverride(paramsOrNull); return tryAllConfigServers(configServer -> { HttpGet get = new HttpGet(configServer.resolve(path)); requestConfig.ifPresent(get::setConfig); return get; }, wantedReturnType); } }
ConfigServerApiImpl implements ConfigServerApi { @Override public <T> T get(String path, Class<T> wantedReturnType, Params paramsOrNull) { Optional<RequestConfig> requestConfig = getRequestConfigOverride(paramsOrNull); return tryAllConfigServers(configServer -> { HttpGet get = new HttpGet(configServer.resolve(path)); requestConfig.ifPresent(get::setConfig); return get; }, wantedReturnType); } private  ConfigServerApiImpl(Collection<URI> configServers,
                                HostnameVerifier verifier,
                                ServiceIdentityProvider identityProvider); private  ConfigServerApiImpl(Collection<URI> configServers, CloseableHttpClient client); }
ConfigServerApiImpl implements ConfigServerApi { @Override public <T> T get(String path, Class<T> wantedReturnType, Params paramsOrNull) { Optional<RequestConfig> requestConfig = getRequestConfigOverride(paramsOrNull); return tryAllConfigServers(configServer -> { HttpGet get = new HttpGet(configServer.resolve(path)); requestConfig.ifPresent(get::setConfig); return get; }, wantedReturnType); } private  ConfigServerApiImpl(Collection<URI> configServers,
                                HostnameVerifier verifier,
                                ServiceIdentityProvider identityProvider); private  ConfigServerApiImpl(Collection<URI> configServers, CloseableHttpClient client); static ConfigServerApiImpl create(ConfigServerInfo info,
                                             ServiceIdentityProvider provider,
                                             HostnameVerifier hostnameVerifier); static ConfigServerApiImpl createFor(ConfigServerInfo info,
                                                ServiceIdentityProvider provider,
                                                HostnameVerifier hostnameVerifier,
                                                HostName configServerHostname); static ConfigServerApiImpl createForTesting(List<URI> configServerHosts); @Override T put(String path, Optional<Object> bodyJsonPojo, Class<T> wantedReturnType, Params paramsOrNull); @Override T patch(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params paramsOrNull); @Override T delete(String path, Class<T> wantedReturnType, Params paramsOrNull); @Override T get(String path, Class<T> wantedReturnType, Params paramsOrNull); @Override T post(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params paramsOrNull); @Override void close(); }
ConfigServerApiImpl implements ConfigServerApi { @Override public <T> T get(String path, Class<T> wantedReturnType, Params paramsOrNull) { Optional<RequestConfig> requestConfig = getRequestConfigOverride(paramsOrNull); return tryAllConfigServers(configServer -> { HttpGet get = new HttpGet(configServer.resolve(path)); requestConfig.ifPresent(get::setConfig); return get; }, wantedReturnType); } private  ConfigServerApiImpl(Collection<URI> configServers,
                                HostnameVerifier verifier,
                                ServiceIdentityProvider identityProvider); private  ConfigServerApiImpl(Collection<URI> configServers, CloseableHttpClient client); static ConfigServerApiImpl create(ConfigServerInfo info,
                                             ServiceIdentityProvider provider,
                                             HostnameVerifier hostnameVerifier); static ConfigServerApiImpl createFor(ConfigServerInfo info,
                                                ServiceIdentityProvider provider,
                                                HostnameVerifier hostnameVerifier,
                                                HostName configServerHostname); static ConfigServerApiImpl createForTesting(List<URI> configServerHosts); @Override T put(String path, Optional<Object> bodyJsonPojo, Class<T> wantedReturnType, Params paramsOrNull); @Override T patch(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params paramsOrNull); @Override T delete(String path, Class<T> wantedReturnType, Params paramsOrNull); @Override T get(String path, Class<T> wantedReturnType, Params paramsOrNull); @Override T post(String path, Object bodyJsonPojo, Class<T> wantedReturnType, Params paramsOrNull); @Override void close();  }