@Test
    void testWebsocketClientClose() throws Exception {
        server.expect().withPath("/wsclose")
              .andUpgradeToWebSocket()
              .open()
              .expect("never sent").andEmit("response").always().done().always();

        final CompletableFuture<String> closeReason = new CompletableFuture<>();

        final CompletableFuture<WebSocket> startedFuture =
                client.getHttpClient().newWebSocketBuilder()
                      .uri(URI.create(webSocketMasterUrl() + "wsclose"))
                      .buildAsync(new Listener() {
                          @Override
                          public void onClose(WebSocket webSocket, int code, String reason) {
                              closeReason.complete(reason);
                          }
                      });

        startedFuture.thenAccept(w -> w.sendClose(1000, "I'm done"));

        assertEquals("I'm done", closeReason.get(10, TimeUnit.SECONDS));
    }
Tests a {@link HttpClient} at or below the {@link KubernetesClient} level.
kubernetes/src/test/java/com/linecorp/armeria/client/kubernetes/ArmeriaHttpClientTest.java