use of org.openqa.selenium.Proxy in project jmeter-plugins by undera.
the class WebDriverConfigTest method shouldDelegateToProxyFactoryWhenCreatingManualProxyWithHttpAsDefault.
@Test
public void shouldDelegateToProxyFactoryWhenCreatingManualProxyWithHttpAsDefault() {
final ProxyHostPort http = new ProxyHostPort("http", 1);
final String noProxy = "host1, host2";
config.setHttpHost(http.getHost());
config.setHttpPort(http.getPort());
config.setUseHttpSettingsForAllProtocols(true);
config.setNoProxyHost(noProxy);
when(proxyFactory.getManualProxy(http, http, http, http, noProxy)).thenReturn(new Proxy());
config.setProxyType(ProxyType.MANUAL);
Proxy proxy = config.createProxy();
assertThat(proxy, is(notNullValue()));
verify(proxyFactory, times(1)).getManualProxy(http, http, http, http, noProxy);
}
use of org.openqa.selenium.Proxy in project jmeter-plugins by undera.
the class WebDriverConfigTest method shouldDelegateToProxyFactoryWhenCreatingSystemProxy.
@Test
public void shouldDelegateToProxyFactoryWhenCreatingSystemProxy() {
when(proxyFactory.getSystemProxy()).thenReturn(new Proxy());
config.setProxyType(ProxyType.SYSTEM);
Proxy proxy = config.createProxy();
assertThat(proxy, is(notNullValue()));
verify(proxyFactory, times(1)).getSystemProxy();
}
use of org.openqa.selenium.Proxy in project jmeter-plugins by undera.
the class WebDriverConfigTest method shouldDelegateToProxyFactoryWhenCreatingProxyPacProxy.
@Test
public void shouldDelegateToProxyFactoryWhenCreatingProxyPacProxy() throws MalformedURLException {
String url = "http://proxy/pac.url";
when(proxyFactory.getConfigUrlProxy(url)).thenReturn(new Proxy());
config.setProxyPacUrl(url);
config.setProxyType(ProxyType.PROXY_PAC);
Proxy proxy = config.createProxy();
assertThat(proxy, is(notNullValue()));
verify(proxyFactory, times(1)).getConfigUrlProxy(Mockito.isA(String.class));
}
use of org.openqa.selenium.Proxy in project jmeter-plugins by undera.
the class WebDriverConfigTest method shouldDelegateToProxyFactoryWhenCreatingAutoDetectProxy.
@Test
public void shouldDelegateToProxyFactoryWhenCreatingAutoDetectProxy() {
when(proxyFactory.getAutodetectProxy()).thenReturn(new Proxy());
config.setProxyType(ProxyType.AUTO_DETECT);
Proxy proxy = config.createProxy();
assertThat(proxy, is(notNullValue()));
verify(proxyFactory, times(1)).getAutodetectProxy();
}
use of org.openqa.selenium.Proxy in project jmeter-plugins by undera.
the class WebDriverConfigTest method shouldDelegateToProxyFactoryWhenCreatingManualProxyWithAllValuesSpecified.
@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();
assertThat(proxy, is(notNullValue()));
verify(proxyFactory, times(1)).getManualProxy(http, https, ftp, socks, noProxy);
}
Aggregations