我使用以下测试在我的Spring-Boot应用程序中测试我的API端点:
public void getFreeProducts200() throws Exception {
final MockHttpServletRequestBuilder request = MockMvcRequestBuilders.get("/api/v1/events/528409/").accept(MediaType.APPLICATION_JSON_UTF8);
final ResultActions mvcResponse = this.mvc.perform(request);
mvcResponse.andExpect(MockMvcResultMatchers.status().isOk()).andReturn();
}
路径/ api / v1 / events / {0} /被映射到调用另一个REST服务的方法。 我想模拟这个基础的REST接口。我该怎么办?