OrderController { @RequestMapping(value="/orders", method=RequestMethod.GET) public String listOrders(ModelMap modelMap) { List<Order> orders = orderService.getOrders(); modelMap.addAttribute("orders", orders); return "orders/orders"; }  @RequestMapping(value = "/orders/create", method=RequestMethod.GET) String showCreateOrdersForm(ModelMap modelMap, @RequestParam("customerId") int customerId); @RequestMapping(value = "orders/createOrder", method = RequestMethod.POST) ModelAndView createOrder(@ModelAttribute("createOrderForm") Order order, BindingResult result); @RequestMapping(value="/orders", method=RequestMethod.GET) String listOrders(ModelMap modelMap);  }
@Test public void testListOrders() { Mockito.when(orderService.getOrders()).thenReturn(Collections.emptyList()); assertEquals("orders/orders", orderController.listOrders(new ModelMap())); }