Clearly I\'m not using this test fixture right. My servlet works just fine in tomcat, but when I try to use this mock, the multi-part boundary is not found. \"the request
My way to test multipart/form-data via mock MVC sending params and files is the following:
@Test
void testSendFeedback() throws Exception {
var builder = MockMvcRequestBuilders.multipart(URL_PATH);
Path path = Files.createTempFile("test-file", "tmp");
builder = builder.part(new MockPart("image", path.toFile().getName(), Files.readAllBytes(path)));
builder.param("field1", "value1")
.param("fields2", "value2");
mockMvc.perform(builder.header(HttpHeaders.AUTHORIZATION, YOUR_AUTH_VALUE).contentType(MediaType.MULTIPART_FORM_DATA_VALUE))
.andDo(print())
.andExpect(status().isNoContent());
}