Testing with spring-test-mvc jsonpath returns null
问题 I am using Spring's "spring-test-mvc" library to test web controllers. I have a very simple controller that returns a JSON array. Then in my test I have: @Test public void shouldGetAllUsersAsJson() throws Exception { mockMvc.perform(get("/v1/users").accept(MediaType.APPLICATION_JSON)) .andExpect(content().mimeType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("fName").exists()); } The above test returns: java.lang.AssertionError: No value for JSON path: fName To quickly check what I