有人有任何提示吗,或者有人知道我如何测试 HTTP 响应对象返回的“错误消息”吗?
@Autowired
private WebApplicationContext ctx;
private MockMvc mockMvc;
@Before
public void setUp() throws Exception {
mockMvc = MockMvcBuilders.webAppContextSetup(ctx).build();
}
回复:
MockHttpServletResponse:
Status = 200
Error message = null
Headers = {Content-Type=[application/json;charset=UTF-8]}
Content type = application/json;charset=UTF-8