【发布时间】:2018-03-07 07:41:08
【问题描述】:
我有一个简单的 Spring 测试
@Test
public void getAllUsers_AsPublic() throws Exception {
doGet("/api/users").andExpect(status().isForbidden());
}
public ResultActions doGet(String url) throws Exception {
return mockMvc.perform(get(url).header(header[0],header[1])).andDo(print());
}
我想验证响应正文是否为空。例如。做类似.andExpect(content().isEmpty())
【问题讨论】:
标签: spring spring-test spring-test-mvc