@Test
public void testNewClientWithProxySettings() {

    String host = "localhost";
    int port = 8080;
    ProxySettings proxySettings = ProxySettings.useProxy(host, port);
    HttpClientConfig config = HttpClientConfig.basicConfig()
            .withProxySettings(proxySettings);
    HttpClientImpl client = createClient(config);
    Proxy proxy = client.getClient().proxy();
    assertThat(proxy).isNotNull();
    assertThat(proxy.address()).isInstanceOf(InetSocketAddress.class);
    InetSocketAddress address = (InetSocketAddress) proxy.address();
    assertThat(address.getHostName()).isEqualTo(host);
    assertThat(address.getPort()).isEqualTo(port);
    assertThat(proxy.type()).isEqualTo(Proxy.Type.HTTP);
}