/** * Gets HTTP proxy host. * * @return HTTP proxy host. */ public String getProxyHost() { return cfg.getProxyHost(); }
public String getProxyHost() { return config.getProxyHost(); }
String proxyHost = config.getProxyHost(); int proxyPort = config.getProxyPort();
public String getProxyHost() { return config.getProxyHost(); }
this.proxyProtocol = other.getProxyProtocol(); this.proxyDomain = other.getProxyDomain(); this.proxyHost = other.getProxyHost(); this.proxyPassword = other.getProxyPassword(); this.proxyPort = other.getProxyPort();
String proxyHost = config.getProxyHost(); int proxyPort = config.getProxyPort();
/** * Gets HTTP proxy host. * * @return HTTP proxy host. */ public String getProxyHost() { return cfg.getProxyHost(); }
final String proxyHost = config.getProxyHost(); final int proxyPort = config.getProxyPort(); if (proxyHost != null && proxyPort > 0) {
public String getProxyHost() { return config.getProxyHost(); }
this.proxyProtocol = other.getProxyProtocol(); this.proxyDomain = other.getProxyDomain(); this.proxyHost = other.getProxyHost(); this.proxyPassword = other.getProxyPassword(); this.proxyPort = other.getProxyPort();
assertEquals(c.isPreemptiveBasicProxyAuth(), n.isPreemptiveBasicProxyAuth()); assertEquals(c.getProtocol(), n.getProtocol()); assertEquals(c.getProxyHost(), n.getProxyHost()); assertEquals(c.getProxyPassword(), n.getProxyPassword()); assertEquals(c.getProxyPort(), n.getProxyPort());
@Override public PutObjectResult answer(InvocationOnMock invocation) throws Throwable { AmazonS3Client amazonS3Client = invocation.getArgument(1); ClientConfiguration clientConfiguration = (ClientConfiguration) ReflectionTestUtils.getField(amazonS3Client, "clientConfiguration"); assertNull(clientConfiguration.getProxyHost()); return new PutObjectResult(); } });
@Override public PutObjectResult answer(InvocationOnMock invocation) throws Throwable { AmazonS3Client amazonS3Client = invocation.getArgument(1); ClientConfiguration clientConfiguration = (ClientConfiguration) ReflectionTestUtils.getField(amazonS3Client, "clientConfiguration"); assertNull(clientConfiguration.getProxyHost()); return new PutObjectResult(); } });
@Override public PutObjectResult answer(InvocationOnMock invocation) throws Throwable { AmazonS3Client amazonS3Client = invocation.getArgument(1); ClientConfiguration clientConfiguration = (ClientConfiguration) ReflectionTestUtils.getField(amazonS3Client, "clientConfiguration"); assertEquals(httpProxyHost, clientConfiguration.getProxyHost()); assertEquals(httpProxyPort.intValue(), clientConfiguration.getProxyPort()); return new PutObjectResult(); } });
@Test public void testAwsClientConfigs() { Map<String, String> kv = new HashMap<>(); String system = "kinesis"; String systemConfigPrefix = String.format("systems.%s.", system); // Aws Client Configs kv.put(systemConfigPrefix + "aws.clientConfig.ProxyHost", "hostName"); kv.put(systemConfigPrefix + "aws.clientConfig.ProxyPort", "8080"); Config config = new MapConfig(kv); KinesisConfig kConfig = new KinesisConfig(config); assertEquals("hostName", kConfig.getAWSClientConfig(system).getProxyHost()); assertEquals(8080, kConfig.getAWSClientConfig(system).getProxyPort()); }
assertEquals(c.getProxyHost(), "host"); c.setProxyHost("two"); assertEquals(c.getProxyHost(), "two");
@Test public void setsClientConfigurationProxyHostAndPortWhenBothAreSupplied() { setTestProxyHostAndPort(conf); client.applyProxyConfiguration(clientConf, conf); Assert.assertEquals(TEST_PROXY_HOST, clientConf.getProxyHost()); Assert.assertEquals(TEST_PROXY_PORT, clientConf.getProxyPort()); }
@Test public void getEmrClientAssertClientConfigurationNotSetWhenProxyPortIsNull() throws Exception { String httpProxyHost = "httpProxyHost"; Integer httpProxyPort = null; AwsParamsDto awsParamsDto = getAwsParamsDto(); awsParamsDto.setHttpProxyHost(httpProxyHost); awsParamsDto.setHttpProxyPort(httpProxyPort); AmazonElasticMapReduceClient amazonElasticMapReduceClient = emrDao.getEmrClient(awsParamsDto); ClientConfiguration clientConfiguration = (ClientConfiguration) ReflectionTestUtils.getField(amazonElasticMapReduceClient, "clientConfiguration"); assertNotNull(clientConfiguration); assertNull(clientConfiguration.getProxyHost()); }
@Test public void getEmrClientAssertClientConfigurationSet() throws Exception { String httpProxyHost = "httpProxyHost"; Integer httpProxyPort = 1234; AwsParamsDto awsParamsDto = getAwsParamsDto(); awsParamsDto.setHttpProxyHost(httpProxyHost); awsParamsDto.setHttpProxyPort(httpProxyPort); AmazonElasticMapReduceClient amazonElasticMapReduceClient = emrDao.getEmrClient(awsParamsDto); ClientConfiguration clientConfiguration = (ClientConfiguration) ReflectionTestUtils.getField(amazonElasticMapReduceClient, "clientConfiguration"); assertNotNull(clientConfiguration); assertEquals(httpProxyHost, clientConfiguration.getProxyHost()); assertEquals(httpProxyPort.intValue(), clientConfiguration.getProxyPort()); }
@Test public void getEmrClientAssertClientConfigurationNotSetWhenProxyHostIsBlank() throws Exception { String httpProxyHost = ""; Integer httpProxyPort = 1234; AwsParamsDto awsParamsDto = getAwsParamsDto(); awsParamsDto.setHttpProxyHost(httpProxyHost); awsParamsDto.setHttpProxyPort(httpProxyPort); AmazonElasticMapReduceClient amazonElasticMapReduceClient = emrDao.getEmrClient(awsParamsDto); ClientConfiguration clientConfiguration = (ClientConfiguration) ReflectionTestUtils.getField(amazonElasticMapReduceClient, "clientConfiguration"); assertNotNull(clientConfiguration); assertNull(clientConfiguration.getProxyHost()); }