MacroController { @RequestMapping(value="/create", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") public String createMacro(Model model) { MacroForm form = new MacroForm(StringUtils.EMPTY, StringUtils.EMPTY); model.addAttribute("macroForm", form); return "/macro/edit"; }  @RequestMapping(value="/create", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") String createMacro(Model model); @RequestMapping(value="/edit/{name:" + DocumentrConstants.MACRO_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") String editMacro(@PathVariable String name, Model model); @RequestMapping(value="/verify/json", method=RequestMethod.POST) @PreAuthorize("hasApplicationPermission(ADMIN)") @ResponseBody Map<String, Object> verifyMacro(@RequestParam String code); @RequestMapping(value="/save", method=RequestMethod.POST) @PreAuthorize("hasApplicationPermission(ADMIN)") String saveMacro(@ModelAttribute @Valid MacroForm form, BindingResult bindingResult); @RequestMapping(value="/delete/{name:" + DocumentrConstants.MACRO_NAME_PATTERN + "}", method=RequestMethod.GET) @PreAuthorize("hasApplicationPermission(ADMIN)") String deleteMacro(@PathVariable String name); @ModelAttribute MacroForm createMacroForm(@RequestParam(required=false) String name,
			@RequestParam(required=false) String code);  }
@Test public void createMacro() { String result = controller.createMacro(model); assertEquals("/macro/edit", result); verify(model).addAttribute(eq("macroForm"), argMacroForm(StringUtils.EMPTY, StringUtils.EMPTY)); }