DelegatingResponse implements Response { public InputStream asStream() throws Exception { return delegate.asStream(); } DelegatingResponse(Response delegate); Request getRequest(); int getStatusCode(); String getContentType(); Charset getCharset(); String getContentEncoding(); Type getExpectedGenericType(); Class<?> getExpectedType(); T deserialize(); T to(Class<T> type); T to(Class<T> type, Type genericType); InputStream asStream(); void dispose();  }
@Test public void asStreamShouldDelegates() throws Exception { InputStream expected = mock(InputStream.class); when(mockResponse.asStream()).thenReturn(expected); assertSame(expected, toTest.asStream()); }