测试上传文件
@Test
public void recognize() throws Exception {
ResultActions resultActions = mvc.perform(
MockMvcRequestBuilders.fileUpload("/api/v1/face/upload").
file(new MockMultipartFile("image", "5229311390.jpg", "", new FileInputStream(new File("D:\\106581562729311390.jpg"))))
.param("some", "461353212"));
MvcResult mvcResult = resultActions.andDo(MockMvcResultHandlers.print()).andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(jsonPath("$.code").value("10001")).andReturn();
String result = mvcResult.getResponse().getContentAsString();
Assert.assertNotNull(result);
}