You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When MockMultipartHttpServletRequestBuilder is initialized with Part (rather than MultipartFile) instances, it correctly creates a MockHttpServletRequest as per its contract. However in order for this to work correctly the request must then be wrapped with StandardMultipartHttpServletRequest which works out which parts are files (and exposed also as MultipartPartFile) and which ones are not files (and must be exposed as request parameters).
Currently MockMultipartHttpServletRequestBuilderdoes this which ensures that file parts are recognized but it doesn't ensure the rest are exposed as request parameters which can also cause issues for @RequestPart arguments.
Existing tests appear to be using a filename which makes it work but masks the problem.
The text was updated successfully, but these errors were encountered:
When
MockMultipartHttpServletRequestBuilder
is initialized withPart
(rather thanMultipartFile
) instances, it correctly creates aMockHttpServletRequest
as per its contract. However in order for this to work correctly the request must then be wrapped withStandardMultipartHttpServletRequest
which works out which parts are files (and exposed also asMultipartPartFile
) and which ones are not files (and must be exposed as request parameters).Currently
MockMultipartHttpServletRequestBuilder
does this which ensures that file parts are recognized but it doesn't ensure the rest are exposed as request parameters which can also cause issues for@RequestPart
arguments.Existing tests appear to be using a filename which makes it work but masks the problem.
The text was updated successfully, but these errors were encountered: