RegistrationController { @RequestMapping(params = "remove_me", method = RequestMethod.GET) public String removeUserFromGame(HttpServletRequest request, Model model) { String ip = request.getRemoteAddr(); playerService.removePlayerByIp(ip); return "redirect:/"; } RegistrationController();   RegistrationController(TetrisPlayerService playerService, GameSettings gameSettingsService); @RequestMapping(method = RequestMethod.GET) String openRegistrationForm(HttpServletRequest request, Model model); @RequestMapping(params = "remove_me", method = RequestMethod.GET) String removeUserFromGame(HttpServletRequest request, Model model); @RequestMapping(method = RequestMethod.POST) String submitRegistrationForm(Player player, BindingResult result, HttpServletRequest request);  }
@Test public void shouldRemoveUserByIp() { when(request.getRemoteAddr()).thenReturn("IP"); String jsp = controller.removeUserFromGame(request, model); assertEquals("redirect:/", jsp); verify(playerService).removePlayerByIp("IP"); }