BoardController { @RequestMapping(value = "/board",method = RequestMethod.GET) public String boardAll(ModelMap model) { model.addAttribute("players", playerService.getPlayers()); model.addAttribute("allPlayersScreen", true); return "board"; } BoardController();   BoardController(PlayerService playerService); @RequestMapping(value = "/board/{playerName}",method = RequestMethod.GET) String board(ModelMap model, @PathVariable("playerName") String playerName); @RequestMapping(value = "/board",method = RequestMethod.GET) String boardAll(ModelMap model); @RequestMapping(value = "/leaderboard",method = RequestMethod.GET) String leaderBoard(); @RequestMapping(value = "/help") String help(); static final ArrayList<Object> EMPTY_LIST; }
@Test public void shouldReturnAllPlayersWhenAllBoard() { when(playerService.getPlayers()).thenReturn(Arrays.asList(getDummyPlayer(), getDummyPlayer())); boardController.boardAll(model); assertEquals(2, getPlayers().size()); }