Affects: 5.3.1

as servlet3.0 says: For parts with form-data as the Content-Disposition, but without a filename, the string value of the part will also be available via the getParameter / getParameterValues methods on HttpServletRequest, using the name of the part.

but when use MockHttpServletRequest ,I can't not get parameter which i filled by MockPart.And there is not association between parameters and parts in MockHttpServletRequest

Comment From: jhoeller

That's arguably by design since MockHttpServletRequest is a static mock object, not an HTTP request parser. As a consequence, getPart will return exactly what you registered via addPart, whereas getParameter will return exactly what you registered via addParameter, just like when instructing a Mockito object. This also avoids the rather involved conversion of byte body content to a String, taking into account the charset in the multipart content type etc; that's what runtime multipart request parsers do, but we'd rather avoid that for a mock request object that is really only meant to expose certain request state to a handler implementation.

Comment From: rstoyanchev

Indeed at the level of MockHttpServletRequest what you set up is what you get. It's only at a level above, in MockMvc, where we emulate some Servlet container behavior.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.