-
Notifications
You must be signed in to change notification settings - Fork 239
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
Thrown UnexpectedInvocation exception turns partially mocks into strict mocks #66
Comments
Exception is thrown by third call of bigDecimal.intValue(). |
Yes, but this exception is catched and ignored. If you remove the last line of the test
the test will be green. |
You are right. |
Of course you are right:) But still I would consider this a bug. In all other cases I was able to catch JMockit exceptions and proceed just normally. Background: Currently I'm working on the JMockit-Xtend bridge (https://github.com/borisbrodski/jmockit-xtend). In order to test it, I have to do such "crazy" things, like producing errors and then catch the JMockit exceptions. |
I agree with you, This may be a bug. final BigDecimal bigDecimal1 = new BigDecimal(0); |
Yes, the test fails on JMockit 1.10, indicating a bug. But on JMockit 1.11, it passes, so I suppose this is already fixed. Anyways, thanks for the report! |
This is working with JMockit 1.11. Thank you. |
I closed this too soon; there was indeed a bug to fix. |
JMockit: 1.10
Here is a code snippet
As you can see, til
UnexpectedInvocation
was thrown theBigDecimal
class was partially mocked. But afterUnexpectedInvocation
was thrownBigDecimal
turns into non-partially and also strict mocked class.The text was updated successfully, but these errors were encountered: