RoleController { @RequestMapping(value="/add", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") public String addRole(Model model) { RoleForm form = new RoleForm(null, null, Collections.<String>emptySet()); model.addAttribute("roleForm", form); return "/user/role/edit"; }  @RequestMapping(value="/add", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") String addRole(Model model); @RequestMapping(value="/edit/{roleName:" + DocumentrConstants.ROLE_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") String editRole(@PathVariable String roleName, Model model); @RequestMapping(value="/save", method=RequestMethod.POST) @PreAuthorize("hasApplicationPermission(ADMIN)") String saveRole(@ModelAttribute @Valid RoleForm form, BindingResult bindingResult,
			Authentication authentication); @RequestMapping(value="/delete/{roleName:" + DocumentrConstants.ROLE_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN) and !isLastAdminRole(#roleName)") String deleteRole(@PathVariable String roleName, Authentication authentication); @ModelAttribute RoleForm createRoleForm(@RequestParam(required=false) String name,
			@RequestParam(required=false) String originalName,
			@RequestParam(required=false) Set<String> permissions);  }
@Test public void addRole() { String view = roleController.addRole(model); assertEquals("/user/role/edit", view); verify(model).addAttribute(eq("roleForm"), DocumentrMatchers.argRoleForm(null, Sets.<String>newHashSet())); }