verify(proxyFactory, times(1)).getAutodetectProxy();
}
@Test
public void shouldDelegateToProxyFactoryWhenCreatingManualProxyWithAllValuesSpecified() {
final ProxyHostPort http = new ProxyHostPort("http", 1);
final ProxyHostPort https = new ProxyHostPort("https", 2);
final ProxyHostPort ftp = new ProxyHostPort("ftp", 3);
final ProxyHostPort socks = new ProxyHostPort("socks", 4);
final String noProxy = "host1, host2";
config.setHttpHost(http.getHost());
config.setHttpPort(http.getPort());
config.setUseHttpSettingsForAllProtocols(false);
config.setHttpsHost(https.getHost());
config.setHttpsPort(https.getPort());
config.setFtpHost(ftp.getHost());
config.setFtpPort(ftp.getPort());
config.setSocksHost(socks.getHost());
config.setSocksPort(socks.getPort());
config.setNoProxyHost(noProxy);
when(proxyFactory.getManualProxy(http, https, ftp, socks, noProxy)).thenReturn(new Proxy());
config.setProxyType(ProxyType.MANUAL);
Proxy proxy = config.createProxy();