DefaultRequestWrapper implements RequestWrapper { public OutputStream getOutputStream() throws IOException { return context.getOutputStream(); } DefaultRequestWrapper(Request context); Request getWrappedRequest(); Map<String, String> getHeader(); Map<String, String[]> getHeaderValues(); Addable<String> getResponseHeaders(); ApplicationContext getApplicationContext(); OutputStream getOutputStream(); Writer getWriter(); PrintWriter getPrintWriter(); boolean isResponseCommitted(); Map<String, String> getParam(); Map<String, String[]> getParamValues(); Locale getRequestLocale(); boolean isUserInRole(String role); Map<String, Object> getContext(String scope); List<String> getAvailableScopes();  }
@Test public void testGetOutputStream() throws IOException { Request wrappedRequest = createMockRequest(); OutputStream stream = createMock(OutputStream.class); expect(wrappedRequest.getOutputStream()).andReturn(stream); replay(wrappedRequest, stream); RequestWrapper request = createRequestWrapper(wrappedRequest); assertEquals(stream, request.getOutputStream()); verify(wrappedRequest, stream); }