-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Misleading error message when mocking and a class (of a parameter) is not found #2692
Comments
I don't think 1 or 2 are practical, since Mockito can fail for a lot of reasons here that are unrelated to Mockito. Therefore, I think number 3 makes a lot of sense, thanks for suggesting! Do you mind submitting a PR with a rewording? Something along the lines of:
|
Thanks, Tim. Will provide a PR. |
Yeah let's do that as well, thanks! |
- makes the proposed error reason less narrow - points to check the stack trace
- changes suggestion to get assistance from mailing list to GitHub
sorry, was too hectic with closing the PR ;-) ... |
Situation:
we're using a dependency that contains the following code (abbreviated):
When trying to mock this interface like this:
the following misleading error message is created:
The misleading message on top states
This is not related to a final or private class, but to a missing class (due to a problem within our dependencies), as the last chained exception states.
Before checking all the chained exceptions it lead us into a totally wrong direction, and had us puzzled for quite a while: in our case it's because of the parameter
MultivaluedMap
which used to live injavax.ws
, but has been moved tojakarta.ws
...It would be great if Mockito could
Thanks for considering!
The text was updated successfully, but these errors were encountered: