@Test
    void testProxyConfigShouldBeResolved() throws Exception {
        try (TestDnsServer server = new TestDnsServer(ImmutableMap.of(
                new DefaultDnsQuestion("a.com.", A),
                new DefaultDnsResponse(0).addRecord(ANSWER, newAddressRecord("a.com.", "127.0.0.1"))))
        ) {
            final InetSocketAddress proxySocketAddress = new InetSocketAddress(
                    "a.com", httpProxyServer.address().getPort());
            try (ClientFactory clientFactory =
                         ClientFactory.builder()
                                      .addressResolverGroupFactory(
                                              DNSResolverFacadeUtils.getAddressResolverGroupForTest(server))
                                      .proxyConfig(ProxyConfig.connect(proxySocketAddress))
                                      .useHttp2Preface(true)
                                      .build()) {

                final WebClient webClient = WebClient.builder(SessionProtocol.H1C, backendServer.httpEndpoint())
                                                     .factory(clientFactory)
                                                     .decorator(LoggingClient.newDecorator())
                                                     .build();
                final CompletableFuture<AggregatedHttpResponse> responseFuture =
                        webClient.get(PROXY_PATH).aggregate();
                final AggregatedHttpResponse response = responseFuture.join();
                assertThat(response.status()).isEqualTo(HttpStatus.OK);
                assertThat(response.contentUtf8()).isEqualTo(SUCCESS_RESPONSE);
                assertThat(numSuccessfulProxyRequests).isEqualTo(1);
            }
        }
    }
Tests if a request is failed with {@link SessionProtocolNegotiationException} if a session negotiation
with the backend server takes longer than a connection timeout.

<p>Cleartext protocol are not used because the session could immediately complete when a connection is
established with the proxy server.
core/src/test/java/com/linecorp/armeria/client/proxy/ProxyClientIntegrationTest.java