title: Spring MVC Test missing imports from MockMvc example
body: <p>I'm trying to test using <a href="https://stackoverflow.com/questions/54867824/how-to-check-json-response-in-spring-mvc-test">Spring MVC</a>, but even when using example from <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/MockMvc.html" rel="nofollow noreferrer">MockMvc</a>:</p>
  
  <blockquote>
  <pre><code>.andExpect(status().isOk())
  .andExpect(content().mimeType("text/html"))
  </code></pre>
  </blockquote>
  
  <p>Using <code>MockHttpServletRequestBuilder</code>:</p>
  
  <pre><code>MockHttpServletRequestBuilder mockHttpServletRequestBuilder = MockMvcRequestBuilders
          .post("/servlet/api/update")
  </code></pre>
  
  <p>I'm getting 2 exceptions:</p>
  
  <blockquote>
  <pre><code>The method andExpect(ResultMatcher) is undefined for the type MockHttpServletRequestBuilder
  
  The method mimeType(String) is undefined for the type ContentResultMatchers
  </code></pre>
  </blockquote>
  
  <p>I'm using the import from example (below), but still seems that I'm missing other imports</p>
  
  <blockquote>
  <pre><code> import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
   import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
   import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*;
  </code></pre>
  </blockquote>