List of usage examples for org.springframework.mock.web DelegatingServletOutputStream DelegatingServletOutputStream
public DelegatingServletOutputStream(OutputStream targetStream)
From source file:de.science.hack.jetstream.web.controller.DownloadControllerTest.java
@Before public void setUp() throws IOException { classUnderTest = new DownloadController(); cache = new ResultCache(); setField(classUnderTest, "resultCache", cache); response = mock(HttpServletResponse.class); ServletOutputStream outputStream = new DelegatingServletOutputStream(new ByteArrayOutputStream()); when(response.getOutputStream()).thenReturn(outputStream); }
From source file:pt.webdetails.cpk.testUtils.HttpServletResponseForTesting.java
@Override public ServletOutputStream getOutputStream() throws IOException { return new DelegatingServletOutputStream(outputStream); }