ViewItemsPageController extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<Item> items = itemService.findAll(); request.setAttribute("all", items); request.getRequestDispatcher("viewItems.jsp").forward(request, response); }    }
@Test public void doGet() throws Exception { viewPageController.doGet(httpServletRequest, httpServletResponse); verify(httpServletRequest).setAttribute("all", items); verify(requestDispatcher).forward(httpServletRequest, httpServletResponse); }