### Question:
UserController { @RequestMapping(value = "/create", method = RequestMethod.POST) public String postUser(ModelMap map, @ModelAttribute @Valid User user, BindingResult bindingResult) { if (bindingResult.hasErrors()) { map.addAttribute("action", "create"); return "userForm"; } userService.insertByUser(user); return "redirect:/users/"; }  @RequestMapping(method = RequestMethod.GET) String getUserList(ModelMap map); @RequestMapping(value = "/create", method = RequestMethod.GET) String createUserForm(ModelMap map); @RequestMapping(value = "/create", method = RequestMethod.POST) String postUser(ModelMap map,
                           @ModelAttribute @Valid User user,
                           BindingResult bindingResult); @RequestMapping(value = "/update/{id}", method = RequestMethod.GET) String getUser(@PathVariable Long id, ModelMap map); @RequestMapping(value = "/update", method = RequestMethod.POST) String putUser(ModelMap map,
                          @ModelAttribute @Valid User user,
                          BindingResult bindingResult); @RequestMapping(value = "/delete/{id}", method = RequestMethod.DELETE) String deleteUser(@PathVariable Long id);  }### Answer:
@Test public void postUser() throws Exception { User user = createUser(); assertNotNull(user); MultiValueMap parameters = new LinkedMultiValueMap<String, String>(); Map<String, String> maps = objectMapper.convertValue(user, new TypeReference<Map<String, String>>() { }); parameters.setAll(maps); mockMvc.perform(post("/users/create").params(parameters)) .andDo(print()) .andExpect(status().is(HttpServletResponse.SC_FOUND)) .andDo(print()) .andExpect(view().name("redirect:/users/")) .andDo(print()) .andReturn(); }