-
Notifications
You must be signed in to change notification settings - Fork 12
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
Mocking a bean in a Spy does not always work #12
Closed
Comments
Closed
Closed
has this been fixed? |
Not yet in master. It's quite an edge case but will push a fix for it in the coming weeks. |
Merged
Fixed in version Let me know if you still have issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes works and sometimes does not because of the non-deterministic aspect of MockInBean / SpyInbean definition parsing.
This is because the Spy does not delegate to the original object but creates a copy (as documented in https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Spy.html).
Could be fixed by also injecting mocks into spies.
The text was updated successfully, but these errors were encountered: