title: Spring testing and JsonPath probblem
body: <p>I am having an issue with testing and json path</p>
  
  <p>I am just trying to perform a simple test and check the value of id:</p>
  
  <pre><code>mockMvc.perform(get("/applications/")).andExpect(status().isOk())
         .andDo(print())
         .andExpect(content().contentType(TestUtils.APPLICATION_JSON_UTF8))
         .andExpect(jsonPath("$", hasSize(4)))
         .andExpect(jsonPath("$.id",is(1)));
  </code></pre>
  
  <p>But I get an error like the following.  Seems like my code should be checking the id value. Am I not being specific enough since there are multiple items in the returned JSON?  Any help is appreciated. Thanks.</p>
  
  <pre><code>     Content type = application/json;charset=UTF-8
               Body = [{"id":1,"name":"test2"},{"id":2,"name":"test2"}]
     Forwarded URL = null
     Redirected URL = null
            Cookies = []
  
  java.lang.AssertionError: No value at JSON path "$.id", exception: Expected to find an object with property ['id'] in path $ but found 'net.minidev.json.JSONArray'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.
      at org.springframework.test.util.JsonPathExpectationsHelper.evaluateJsonPath(JsonPathExpectationsHelper.java:258)
      at ...
  </code></pre>