Does anybody have any tips, or does anybody know how I can test the \"error message\" returned by the HTTP response object?
@Autowired
private WebApplicationCont
This is the solution I found using JsonPath and MockMvc
this.mvc.perform(post(BASE_URL).contentType(MediaType.APPLICATION_JSON).content(responseJson)).andDo(print())
.andExpect(status().is5xxServerError())
.andExpect(jsonPath("$.message", is("There is an error while executing this test request ")));
Hope this helps.