diff --git a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpLoggingInterceptorTest.java b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpLoggingInterceptorTest.java index 6a4ba33221b..0e3a86f62b0 100644 --- a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpLoggingInterceptorTest.java +++ b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpLoggingInterceptorTest.java @@ -43,6 +43,7 @@ import java.util.Queue; import java.util.concurrent.TimeUnit; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; @@ -181,6 +182,18 @@ public void httpResponseBodyLogged() throws Exception { inOrder.verify(logger).trace("-HTTP END-"); } + @Test + @DisplayName("Interceptor doesn't consume response bytes") + public void responseBodyIsNotConsumed() throws Exception { + server.expect().withPath("/response-body") + .andReturn(200, "This is the response body") + .always(); + HttpResponse httpResponse = httpClient.sendAsync(httpClient.newHttpRequestBuilder() + .uri(server.url("/response-body")) + .build(), String.class).get(10, TimeUnit.SECONDS); + assertThat(httpResponse.bodyString()).isEqualTo("This is the response body"); + } + @Test @DisplayName("HTTP large response body is logged") public void httpLargeResponseBodyLogged() throws Exception {