I would like to pass an input file to MockMVC perform statement. Please find the code snippet below:
@Test
public void test() throws Exception {
this.mockMvc.perform(post("/tax_rates/v1/quotations")
.contentType(MediaType.APPLICATION_JSON_UTF8).pathInfo("/src/main/resources/input.json"))
.andExpect((ResultMatcher) status().is2xxSuccessful());
}
When I tried using pathInfo variable I get the error as below:
HttpMessageNotReadableException: Required request body is missing:
which i guess it means payload is not getting passed?
Any suggestions would help me.
Regards, Sunil