@Test
public void testResponseIsClosedEvenIfProcessorThrowsAnException() throws IOException {

    Response response = createResponseMock();
    CompletableFuture<Object> future = new CompletableFuture<>();
    IOException exception = new IOException("Boo");
    ResponseProcessor<Object> processor = createProcessorMock();
    when(processor.process(any())).thenThrow(exception);
    Callback callback = httpClient.createCallback(processor, future);
    callback.onResponse(createCallMock(), response);
    expectFailure(future, exception);
    verify(response).close();
}