WithoutBodyStrategy implements Strategy { @Override public HttpRequest process(final HttpRequest request) { return request.withoutBody(); }  @Override HttpRequest process(final HttpRequest request); @Override HttpResponse process(final HttpRequest request, final HttpResponse response);  }
@Test void shouldWriteRequestWithoutBody() throws IOException { unit.process(request).write(); final ArgumentCaptor<HttpRequest> captor = ArgumentCaptor.forClass(HttpRequest.class); verify(sink).write(any(), captor.capture()); assertThat(captor.getValue().getBodyAsString(), is(emptyString())); }
@Test void shouldWriteResponseWithoutBody() throws IOException { unit.process(request).write().process(response).write(); final ArgumentCaptor<HttpResponse> captor = ArgumentCaptor.forClass(HttpResponse.class); verify(sink).write(any(), any(), captor.capture()); assertThat(captor.getValue().getBodyAsString(), is(emptyString())); }