use of kong.unirest.Proxy in project target-java-sdk by adobe.
the class DefaultTargetHttpClientTest method testProxyConfigNotSet.
@Test
void testProxyConfigNotSet() {
ClientConfig clientConfig = ClientConfig.builder().organizationId(TEST_ORG_ID).build();
DefaultTargetHttpClient targetClient = new DefaultTargetHttpClient(clientConfig);
UnirestInstance unirestInstance = targetClient.getUnirestInstance();
Proxy unirestProxy = unirestInstance.config().getProxy();
assertNull(unirestProxy);
targetClient.close();
}
use of kong.unirest.Proxy in project target-java-sdk by adobe.
the class DefaultTargetHttpClientTest method testProxyConfigSetWithNoAuthentication.
@Test
void testProxyConfigSetWithNoAuthentication() {
ClientConfig clientConfig = ClientConfig.builder().organizationId(TEST_ORG_ID).proxyConfig(new ClientProxyConfig(PROXY_HOST, PROXY_PORT)).build();
DefaultTargetHttpClient targetClient = new DefaultTargetHttpClient(clientConfig);
UnirestInstance unirestInstance = targetClient.getUnirestInstance();
Proxy unirestProxy = unirestInstance.config().getProxy();
assertNotNull(unirestProxy);
assertEquals(PROXY_HOST, unirestProxy.getHost());
assertEquals(PROXY_PORT, unirestProxy.getPort());
assertNull(unirestProxy.getUsername());
assertNull(unirestProxy.getPassword());
targetClient.close();
}
use of kong.unirest.Proxy in project target-java-sdk by adobe.
the class DefaultTargetHttpClientTest method testProxyConfigSetWithAuthentication.
@Test
void testProxyConfigSetWithAuthentication() {
ClientConfig clientConfig = ClientConfig.builder().organizationId(TEST_ORG_ID).proxyConfig(new ClientProxyConfig(PROXY_HOST, PROXY_PORT, PROXY_USERNAME, PROXY_PASSWORD)).build();
DefaultTargetHttpClient targetClient = new DefaultTargetHttpClient(clientConfig);
UnirestInstance unirestInstance = targetClient.getUnirestInstance();
Proxy unirestProxy = unirestInstance.config().getProxy();
assertNotNull(unirestProxy);
assertEquals(PROXY_HOST, unirestProxy.getHost());
assertEquals(PROXY_PORT, unirestProxy.getPort());
assertEquals(PROXY_USERNAME, unirestProxy.getUsername());
assertEquals(PROXY_PASSWORD, unirestProxy.getPassword());
targetClient.close();
}
Aggregations