title: Spring MVC test Mulitple file upload
body: <p>I have controller, which handles multiple file upload:</p>
  
  <pre><code> @PostMapping("/import")
   public void import(@RequestParam("files") MultipartFile[] files, HttpServletRequest request) {
      assertUploadFilesNotEmpty(files);
      ...
  }
  </code></pre>
  
  <p>And I want to test it</p>
  
  <pre><code>    @Test
  public void importTest() throws Exception {
      MockMultipartFile file = new MockMultipartFile("file", "list.xlsx", MIME_TYPE_EXCEL, Files.readAllBytes(Paths.get(excelFile.getURI())));
      mvc.perform(fileUpload("/import").file(file).contentType(MIME_TYPE_EXCEL)).andExpect(status().isOk());
  }
  </code></pre>
  
  <p>Problem is that MockMvc, creates MockHttpRequest with multipartFiles as a name for param that holds uploaded files. And my controller expects those files will be in 'files' param.</p>
  
  <p>Is it possible to tell spring that multiple files should be passed in request under given name?</p>