-
Notifications
You must be signed in to change notification settings - Fork 31
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
Mocks aren't cleared when using Junit 5's @Nested classes #12
Comments
Thanks for the kind words. It's indeed a Spring Boot problem.
|
Any reason not to submit this extension to mockk or to include in springmockk itself? |
This extension is specific to JUnit 5, and is quite easy to create, so I'm not sure MockK would create a JUnit5 module or additional dependency just to host this extension. Adding it to SpringMockK has the same problem: I would have to add a module, or an optional dependency, just to contain this workaround for a Spring Boot bug (that doesn't work in all cases). Hopefully this bug will be fixed soon, and the workaround won't be needed anymore. |
Fixed in Spring Boot 2.4.0 / SpringMockK 3.0.0 |
I'm super excited about leveraging
@MockkBean
. Thanks for creating it!I ran into a bug where my mocks weren't being cleared when using
@Nested
I was able to work around it by avoiding
@Nested
classes for testing. It appears that@MockBean
had a similar problem: spring-projects/spring-boot#12470The text was updated successfully, but these errors were encountered: