AbstractJestClient implements JestClient { @VisibleForTesting Set<String> scrubServerURIs(Set<String> servers) { final ImmutableSet.Builder<String> scrubbedServers = ImmutableSet.builder(); for (String server : servers) { final URI originalURI = URI.create(server); try { final URI scrubbedURI = new URI(originalURI.getScheme(), null, originalURI.getHost(), originalURI.getPort(), originalURI.getPath(), originalURI.getQuery(), originalURI.getFragment()); scrubbedServers.add(scrubbedURI.toString()); } catch (URISyntaxException e) { log.debug("Couldn't scrub server URI " + originalURI, e); } } return scrubbedServers.build(); }  void setNodeChecker(NodeChecker nodeChecker); void setIdleConnectionReaper(IdleConnectionReaper idleConnectionReaper); void setServers(Set<String> servers); @Override void shutdownClient(); @Override void close(); boolean isRequestCompressionEnabled(); void setRequestCompressionEnabled(boolean requestCompressionEnabled); static final String ELASTIC_SEARCH_DATE_FORMAT; }
@Test public void testScrubServerURIs() { final Set<String> set = ImmutableSet.of( "http: "http: final Set<String> scrubbedURIs = client.scrubServerURIs(set); assertEquals(2, scrubbedURIs.size()); assertTrue(scrubbedURIs.contains("http: assertTrue(scrubbedURIs.contains("http: }