@Override
    @Test
    @DisplayName("Proxied HttpClient with basic authorization adds required headers to the request")
    protected void proxyConfigurationBasicAuthAddsRequiredHeaders() throws Exception {
        server.expect().get().withPath("/").andReply(new ResponseProvider<Object>() {
            @Override
            public String getBody(RecordedRequest request) {
                return "\n";
            }

            @Override
            public void setHeaders(Headers headers) {
            }

            @Override
            public int getStatusCode(RecordedRequest request) {
                return request.getHeader(StandardHttpHeaders.PROXY_AUTHORIZATION) != null ? 200 : 407;
            }

            @Override
            public Headers getHeaders() {
                return new Headers.Builder().add("Proxy-Authenticate", "Basic").build();
            }
        }).always();
        // Given
        final HttpClient.Builder builder =
                getHttpClientFactory().newBuilder()
                                      .proxyAddress(new InetSocketAddress("localhost", server.getPort()))
                                      .proxyAuthorization(basicCredentials("auth", "cred"));
        try (HttpClient client = builder.build()) {
            // When
            try {
                client.sendAsync(client.newHttpRequestBuilder()
                                       .uri(String.format("http://0.0.0.0:%s/not-found", server.getPort()))
                                       .build(), String.class)
                      .get(10L, TimeUnit.SECONDS);
            } catch (ExecutionException e) {
                // HttpProxyHandler raises an exception when the response is not 200 OK.
                assertThat(e.getCause()).isInstanceOf(UnprocessedRequestException.class);
            }
            // Then
            assertThat(server.getLastRequest())
                    .extracting(RecordedRequest::getHeaders)
                    .returns("0.0.0.0:" + server.getPort(), h -> h.get("Host"))
                    .returns("Basic YXV0aDpjcmVk", h -> h.get("Proxy-Authorization"));
        }
    }
Forked the upstream test case and wrapped client.sendAsync() with try-catch.
kubernetes/src/test/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpClientProxyTest.java