Closed
Description
When using MockMultipartFile
with an empty originalFilename
(""
), it now gets added to multi part requests just as a part, not as a file. When migrating from Spring Boot 2.3 to 2.4.1, this made my MockMvc
test fail for a controller using a @RequestPart MultipartFile
parameter causing a longer debugging session :-) It would be nice, if there had been a check (exception), that empty originalFilename
s are no longer supported for MockMultipartFile
s.
If the nullability of the originalFilename
in MultipartFile
is intended, org.springframework.web.multipart.support.StandardMultipartHttpServletRequest#parseRequest
seems to be broken as it recognizes parts without filename not as files, so that they don't match MultipartFile
parameters.