0
我想将输入文件传递给MockMVC执行语句。请从下面的代码片段:MockMVC |需要通过JSON文件作为输入
@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());
}
当我试图使用PATHINFO变量,我得到了如下错误:
HttpMessageNotReadableException:必需请求体丢失:
我猜它意味着有效载荷没有通过?
任何建议会帮助我。
的问候,苏尼尔