-
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
java.lang.ClassCastException: java.lang.Class cannot be cast to {Mock method return type} #717
Comments
Do you have a code example? What do you use |
I'm in an effort of fixing this flaky symptom over a couple of tests. It happens on One of the cases we can put it like this:
It occurs both with or without an expectation. I'm looking into the source code trying to make sense of it. Even so, I still can make sense of it on the case shown above. Much appreciated your help, even if you can only guide me on where to look for on the code. |
Narrowing down a little bit more with additional details:
So far I managed to reverse engineer the
Seems to me that this |
Adding up on the findings... I spotted that within certain circumstances, like the case where a task continues to run after the end of the test case, the |
Why hasn't this problem been fixed yet? |
Please provide the following information:
Version of JMockit that was used: 1.35 and 1.49
Description of the problem or enhancement request: from time to time, we get a "java.lang.ClassCastException: java.lang.Class cannot be cast to {Mock method return type}" on either a local variable initialization or a method call argument.
I couldn't yet determine a specific deterministic use case.
The text was updated successfully, but these errors were encountered: