List<String> descriptions = Lists.newArrayList();
for (Proxy proxy : proxies) {
if (proxy.type() != Proxy.Type.DIRECT) {
- descriptions.add("proxy: " + proxy.address());
+ descriptions.add(proxy.type() + " proxy: " + proxy.address());
}
}
public void shouldGetProxySynthesis() throws URISyntaxException {
ProxySelector proxySelector = mock(ProxySelector.class);
when(proxySelector.select(any(URI.class))).thenReturn(Arrays.<Proxy>asList(new FakeProxy()));
- assertThat(HttpDownloader.BaseHttpDownloader.getProxySynthesis(new URI("http://an_url"), proxySelector)).isEqualTo("proxy: http://proxy_url:4040");
+ assertThat(HttpDownloader.BaseHttpDownloader.getProxySynthesis(new URI("http://an_url"), proxySelector)).isEqualTo("HTTP proxy: /123.45.67.89:4040");
}
@Test
class FakeProxy extends Proxy {
public FakeProxy() {
- super(Type.HTTP, new InetSocketAddress("http://proxy_url", 4040));
+ super(Type.HTTP, new InetSocketAddress("123.45.67.89", 4040));
}
}