PropertiesBasedChainedProxy extends ChainedProxyAdapter { public boolean applies(HttpRequest request) { LOG.debug("Checking {} ", request); return request.getUri().matches(filter); } PropertiesBasedChainedProxy(String forName); String name(); boolean applies(HttpRequest request); void url(String url); void filter(String filter); void ntlm(); void basic(); void user(String user); void pass(String pass); void domain(String domain); @Override InetSocketAddress getChainedProxyAddress(); @Override TransportProtocol getTransportProtocol(); @Override boolean requiresEncryption(); @Override SSLEngine newSslEngine(); @Override void filterRequest(HttpObject httpObject); @Override void connectionSucceeded(); @Override void connectionFailed(Throwable cause); @Override NtlmHandler getNtlmHandler(); String toString();  }
@Test public void should_filterPositivel() { assertThat(proxy.applies(new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "anything/do")), is(false)); }
@Test public void should_filterNegatively() { assertThat(proxy.applies(new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "bluecoat/do")), is(true)); }