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
Mockito remains in unfinished stubbing state if a stubbing fails #1514
Labels
Comments
A fix (if this is an issue) might be simple:
|
@dmitry-timofeev, do you want to take a stab at it? Please provide top level test that demonstrates the problem, too. It would be really helpful. Thank you! |
Hi @mockitoguy , thank you for having a look. I'm a little busy at work, therefore I won't be able to in the coming weeks. |
That's fair, we will try find time to work on this. Thank you for reporting! |
mockitoguy
added a commit
that referenced
this issue
Nov 27, 2018
When stubbing with bad throwables we were leaving state behind. Fixes #1514
SamBarker
pushed a commit
to SamBarker/mockito
that referenced
this issue
Feb 25, 2019
When stubbing with bad throwables we were leaving state behind. Fixes mockito#1514
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If one of
doThrow
instructions failed due to InstantiationError, Mockito remains in "unfinished stubbing" state and can no longer mock anything.I had this issue in a single JUnit 4 test, but the fact that Mockito remained in "unfinished stubbing" state used to result in all tests being marked as failed (I couldn't reproduce the last effect with the latest Mockito neither in JUnit 4 nor with JUnit 5 now, so the issue is applicable to a single test invocation only).
Mockito version 2.23.0
check that
Note that some configuration are impossible to mock via Mockito
(same as any question on stackoverflow.com)
The text was updated successfully, but these errors were encountered: