AdminController { @RequestMapping(method = RequestMethod.POST) public String saveSettings(AdminSettings settings, BindingResult result, Model model) { if (!result.hasErrors()) { gameSettingsService.setGameLevels(settings.getSelectedLevels()); gameSettingsService.setCurrentProtocol(settings.getSelectedProtocol()); } playerService.updatePlayers(settings.getPlayers()); return getAdminPage(model); } AdminController();   AdminController(TimerService timerService, GameSettingsService gameSettingsService, PlayerService playerService); @RequestMapping(params = "save", method = RequestMethod.GET) String savePlayerGame(@RequestParam("save") String name, Model model); @RequestMapping(params = "load", method = RequestMethod.GET) String loadPlayerGame(@RequestParam("load") String name, Model model); @RequestMapping(params = "remove", method = RequestMethod.GET) String removePlayer(@RequestParam("remove") String name, Model model); @RequestMapping(params = "pause", method = RequestMethod.GET) String pauseGame(Model model); @RequestMapping(params = "resume", method = RequestMethod.GET) String resumeGame(Model model); @RequestMapping(method = RequestMethod.POST) String saveSettings(AdminSettings settings, BindingResult result, Model model); @RequestMapping(method = RequestMethod.GET) String getAdminPage(Model model);  }
@Test public void shouldSaveSettingsOnServiceWhenSaveSettings() { String jsp = controller.saveSettings(adminSettings("level"), bindingResult, model); shouldGetAdminPageWhenCallAdmin(); verify(gameSettingsService).setGameLevels("level"); }