title: How to use MockMvcResultMatchers.jsonpath to do test?
body: <p>I am writing some tests for spring mvc application.</p>
  
  <p>I got the response as follows.</p>
  
  <pre><code>-&gt; curl -X POST -H"Content-type:application/json; charset=utf-8" localhost:8080/mvc/addBlacklist.do -d '{"id": "1", "imsi": "test"}'
  
  {"id":0,"imsi":"18192729090","name":"xiaoshao","monitors":null}
  </code></pre>
  
  <p>But when my test like this one.</p>
  
  <pre><code>Blacklist blackList = new Blacklist();
      blackList.setId(0);
      blackList.setImsi("18192729090");
      blackList.setName("xiaoshao");
  
      when(blacklistService.add(any())).thenReturn(blackList);
  
      mockMvc.perform(post("/addBlacklist")
              .content(TestUtil.convertObjectToJsonBytes(blackList))
              .contentType(TestUtil.APPLICATION_JSON_UTF8))
              .andExpect(status().is(200))
              .andExpect(jsonPath("$.imsi", is("xiaoshao")));
  </code></pre>
  
  <p>It emit an exception like this.</p>
  
  <pre><code>java.lang.NoClassDefFoundError: com/jayway/jsonpath/InvalidPathException
  at org.springframework.test.web.servlet.result.JsonPathResultMatchers.&lt;init&gt;(JsonPathResultMatchers.java:53)
  </code></pre>