@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("用户管理"));
}