Hiya,

I'm not sure if it is a regression from the correction of #26166 but in version 5.3.2 using the method file of MockMultipartHttpServletRequestBuilder to attach multiple MockMultipartFile seems to generate a request with only the last file.

This ends up generating a MissingServletRequestParameterException in a web controller configured with multiple @RequestParam for each MultipartFile in its method signature.

Note: My dependency to this framework is from Spring boot version 2.4.1 Switching back to Spring boot 2.3.7.RELEASE which relies on Spring Framework 5.2.12.RELEASE solve the issue.

Best regards

Comment From: rstoyanchev

Is it possible that this is a duplicate of #26261, in other words that files are missing depending on whether they are created with an originalFilename?

Comment From: asa-git

I have just updated my test to force a filename to one the MockMultipartFile which was set to null ( a JSON content generated dynamically) and indeed it did resolve the issue.

Comment From: rstoyanchev

Okay I'll mark this as a duplicate then. There is a fix in the latest 5.3.3 snapshot if you want to give it a try to see if everything works for you.