MockAsWarServlet extends HttpServlet { protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { getMockServletCore().dispatchRequest(request, response); } catch (DispatchException ex) { logger.log(Level.SEVERE, null, ex); } }  void init(); void destroy(); void printMaster(HttpServletRequest request, HttpServletResponse response, List<MockRunner> mockRunners); void printDisabledLogFrameset(HttpServletRequest request, HttpServletResponse response); void printFrameset(HttpServletRequest request, HttpServletResponse response); void printDetail(HttpServletRequest request, HttpServletResponse response); void printLog(HttpServletRequest request, HttpServletResponse response);  }
@Test public void shouldWriteResponse() throws Exception { String path = "/numeric/numericpath"; when(reqeust.getPathInfo()).thenReturn(path); when(reqeust.getMethod()).thenReturn(RestRequestInterface.HttpMethod.GET.name()); stubMockAsWarServlet.service(reqeust, response); verify(reqeust, atLeastOnce()).getPathInfo(); verify( response, atLeastOnce()).getOutputStream(); }