UserController { @RequestMapping(value="/add", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") public String addUser(Model model) { UserForm form = new UserForm(StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, null); model.addAttribute("userForm", form); return "/user/edit"; }  @RequestMapping(value="/add", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") String addUser(Model model); @RequestMapping(value="/save", method=RequestMethod.POST) @PreAuthorize("hasApplicationPermission(ADMIN)") String saveUser(@ModelAttribute @Valid UserForm form, BindingResult bindingResult,
			Authentication authentication); @RequestMapping(value="/edit/{loginName:" + DocumentrConstants.USER_LOGIN_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") String editUser(@PathVariable String loginName, Model model); @RequestMapping(value="/delete/{loginName:" + DocumentrConstants.USER_LOGIN_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN) and !isAdmin(#loginName)") String deleteUser(@PathVariable String loginName, Authentication authentication); @ModelAttribute UserForm createUserForm(@RequestParam(required=false) String loginName,
			@RequestParam(required=false) String originalLoginName,
			@RequestParam(required=false) String password1, @RequestParam(required=false) String password2,
			@RequestParam(required=false) String email, @RequestParam(required=false) boolean disabled,
			@RequestParam(required=false) String authorities);  }
@Test public void addUser() { String view = userController.addUser(model); assertEquals("/user/edit", view); verify(model).addAttribute(eq("userForm"), argUserForm(StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false)); }