-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Mocking MockMultipartFile no longer working in 5.3.2 #26324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is a duplicate of #26261. I tried with the sample and switching to 5.3.3 snapshots makes the test pass. |
@rstoyanchev i tried adding |
I also added:
|
Looks like using |
This seems to be meant to be closed with the "status: duplicate" label. |
Thanks for the nudge Johnny. |
Mocking a
MockMultipartFile
does not work in multipart request in spring-test 5.3.2Affects: spring-test 5.3.2
See sample project here
If you check out the test, you can see I am spying a
MockMultipartFile
to force it to throw anIOException
ongetInputstream()
hereThis works fine in spring-test 5.3.1 but does not work in 5.3.2. I confirmed this by excluding spring-test from spring-boot-starter-test and directly importing spring-test 5.3.1, which resolves the issue.
Throwing a breakpoint in the controller method you can see that the
MockMultipartFile
is not a mock when on 5.3.2Possibly caused by d82cb15 as fix for #26166
The text was updated successfully, but these errors were encountered: