DispatcherServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { stubResponseWriter.writeResponse(req, resp); } @Autowired  DispatcherServlet(StubResponseWriter stubResponseWriter);   }
@Test public void testDoGetShouldCallWriteResponse() throws ServletException, IOException { underTest.doGet(request, response); verify(stubResponseWriter).writeResponse(request, response); }