MacroController { @ModelAttribute public MacroForm createMacroForm(@RequestParam(required=false) String name, @RequestParam(required=false) String code) { return new MacroForm(name, code); }  @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 createMacroForm() { MacroForm result = controller.createMacroForm(MACRO, CODE); assertEquals(MACRO, result.getName()); assertEquals(CODE, result.getCode()); }