Example usage for org.springframework.mock.web DelegatingServletOutputStream DelegatingServletOutputStream

List of usage examples for org.springframework.mock.web DelegatingServletOutputStream DelegatingServletOutputStream

Introduction

In this page you can find the example usage for org.springframework.mock.web DelegatingServletOutputStream DelegatingServletOutputStream.

Prototype

public DelegatingServletOutputStream(OutputStream targetStream) 

Source Link

Document

Create a DelegatingServletOutputStream for the given target stream.

Usage

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);
}