title: mockMvc - Test Error Message
body: <p>Does anybody have any tips, or does anybody know how I can test the "error message" returned by the HTTP response object?</p>
  
  <pre><code>@Autowired
  private WebApplicationContext ctx;
  
  private MockMvc mockMvc;
  
  @Before
  public void setUp() throws Exception {
      mockMvc = MockMvcBuilders.webAppContextSetup(ctx).build();
  }
  </code></pre>
  
  <p>Response:</p>
  
  <pre><code>MockHttpServletResponse:
                Status = 200
         Error message = null
               Headers = {Content-Type=[application/json;charset=UTF-8]}
          Content type = application/json;charset=UTF-8
  </code></pre>