HttpChannelResponseHttpResource implements HttpResource { public InputStream getEntity() throws IOException { return inputStream; } HttpChannelResponseHttpResource(HttpChannel.Response response); String getContentType(); Charset getCharset(); String getContentEncoding(); InputStream getEntity(); String getStatusMessage(); int getStatusCode(); void close();  }
@Test public void getEntityShouldReturnResponseEntity() throws Exception { InputStream expected = mock(InputStream.class); when(mockResponse.getEntity()).thenReturn(expected); HttpChannelResponseHttpResource toTest = newToTest(); assertSame(expected, toTest.getEntity()); }