i have spring boot rest api application, and tests for controllers actions for it, but all my test cases its a positive request validation cases. And now i want to make some test for invalid request json body. As u know Spring make json response automatically if u throw something, and return it to client. But then i try to check this response into test method
val result = mockMvc.perform(request)
.andExpect(MockMvcResultMatchers.status().is5xxServerError)
.andReturn().response.contentAsString
my test case throw this (which i see as json as a client) exception when
perform
method called