spring boot junit测试时报错
解决方法:
private MediaType contentType = new MediaType("application", "hal+json", Charset.forName("UTF-8"));
@Test
public void testGetUsers() throws Exception {
mockMvc.perform(get("/api/user")).andExpect(status().isOk()).andExpect(content().contentType(contentType))
.andExpect(jsonPath("$.errcode", is(0))).andExpect(jsonPath("$.p2pdata", notNullValue()));
}