ServletInputStreamWrapper extends ServletInputStream { @Override public int read(byte[] b) throws IOException { return content.read(b); } ServletInputStreamWrapper(InputStream content); @Override int read(byte[] b); @Override int read(byte[] b, int off, int len); @Override int read(); @Override boolean isFinished(); @Override boolean isReady(); @Override void setReadListener(ReadListener listener);  }
@Test public void read() throws IOException { when(content.read()).thenReturn(1); int result = underTest.read(); assertThat(result, is(1)); }