DefaultRequestWrapper implements RequestWrapper { public PrintWriter getPrintWriter() throws IOException { return context.getPrintWriter(); } 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 testGetPrintWriter() throws IOException { Request wrappedRequest = createMockRequest(); PrintWriter writer = createMock(PrintWriter.class); expect(wrappedRequest.getPrintWriter()).andReturn(writer); replay(wrappedRequest, writer); RequestWrapper request = createRequestWrapper(wrappedRequest); assertEquals(writer, request.getPrintWriter()); verify(wrappedRequest, writer); }