MimeResponseDelegate implements ResponseDelegate { public Writer getWriter() throws IOException { return response.getWriter(); } MimeResponseDelegate(MimeResponse response); OutputStream getOutputStream(); PrintWriter getPrintWriter(); Writer getWriter(); boolean isResponseCommitted(); void setContentType(String contentType);  }
@Test public void testGetWriter() throws IOException { PrintWriter os = createMock(PrintWriter.class); expect(response.getWriter()).andReturn(os); replay(response, os); assertEquals(os, delegate.getWriter()); verify(response, os); }