Mock MVC - Add Request Parameter to test
问题 I am using spring 3.2 mock mvc to test my controller.My code is @Autowired private Client client; @RequestMapping(value = "/user", method = RequestMethod.GET) public String initUserSearchForm(ModelMap modelMap) { User user = new User(); modelMap.addAttribute("User", user); return "user"; } @RequestMapping(value = "/byName", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public @ResponseBody String getUserByName(@RequestParam("firstName") String firstName, @RequestParam("lastName")