Skip to content

MockPart in request is not recieved in RequestPart in controller #26501

@LickIt

Description

@LickIt

Affects version: 5.3.3
Related to: #26261

I have a controller method that accepts multipart/form-data requests with 2 parameters: a file and a @RequestPart String label.
Previously in my tests I was creating a MockPart for the label and it was working fine: new MockPart("label", "mainImage".getBytes(UTF_8)).

With the latest changes in 5.3.3 the MockPart is converted to a request parameter instead of a multipart boundary and I don't receive anything for the RequestPart in the controller thus breaking the tests.

Why is it necessary to convert MockParts to parameters in a multipart request?
I'm not sure if this is strictly related to the value being a parameter of if there is another underlying issue. I thought that I should receive the value by using either RequestPart or RequestParam just using different converters.

Metadata

Metadata

Assignees

Labels

in: testIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions