@Test
public void closeInputStream_withException_delegateResponseIsClosed() throws Exception {

    final InputStream originalStream = mock(InputStream.class);
    final WrappedResponseInputStream streamUnderTest =
            new WrappedResponseInputStream(originalStream, mockRawResponseDelegate);
    doThrow(new ProcessingException("Exception")).when(originalStream).close();
    try {
        streamUnderTest.close();
        fail("ProcessingException should have been thrown");
    } catch (Throwable t) {
        assertThat(
                "Exception thrown should be a ProcessingException",
                t,
                instanceOf(ProcessingException.class));
        verify(mockRawResponseDelegate).close();
    }
}