MockMvc ignores MultipartFile registrations when both files and parts are registered #26166
Labels
in: test
Issues in the test module
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: regression
A bug that is also a regression
Milestone
In my code I am doing something like:
which is supposed to create a request with both a part, named
data
, and a file, namedfile
.This was supported in Spring 5.2, but it is not supported anymore in Spring 5.3 since #25602
I am not sure if it was a "wrong" use case, not meant to be working, or if the fix introduced in the linked PR is a regression, since
TestDispatcherServlet
simply creates aStandardMultipartHttpServletRequest
without copying the files over, asMockMultipartHttpServletRequestBuilder
was originally doing.https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/multipart/support/StandardMultipartHttpServletRequest.java#L95 simply copies the
parts
, but not thefiles
The text was updated successfully, but these errors were encountered: