### Question:
UserController { @RequestMapping(value = "/update/{id}", method = RequestMethod.GET) public String getUser(@PathVariable Long id, ModelMap map) { map.addAttribute("user", userService.findById(id)); map.addAttribute("action", "update"); return "userForm"; }  @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 getUser() throws Exception { MvcResult result= mockMvc.perform(get("/users/update/{id}/", 1)) .andExpect(status().isOk()) .andExpect(view().name("userForm")) .andExpect(MockMvcResultMatchers.model().attributeExists("action")) .andExpect(model().attribute("user", hasProperty("id", is(1L)))) .andExpect(model().attribute("user", hasProperty("name", is("Sergey")))) .andExpect(model().attribute("user", hasProperty("age", is(24)))) .andExpect(model().attribute("user", hasProperty("birthday", is("1994-01-01")))) .andReturn(); MockHttpServletResponse mockResponse=result.getResponse(); assertThat(mockResponse.getContentType()).isEqualTo("text/html;charset=UTF-8"); Collection<String> responseHeaders = mockResponse.getHeaderNames(); assertNotNull(responseHeaders); assertEquals(2, responseHeaders.size()); assertEquals("Check for Content-Type header", "Accept-Language", responseHeaders.iterator().next()); String responseAsString=mockResponse.getContentAsString(); assertTrue(responseAsString.contains("用户管理")); }