-
Notifications
You must be signed in to change notification settings - Fork 59
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 cannot mock this class: class scala.xml.Elem #518
Comments
A kind soul gave me a work around for this issue on stackoverflow: The work around was to use the following style initialisation: This works but it is not obvious why it works and the other does not. I'm leaving this issue open as it would still be good to fix the original style bug, or at the very least improve the generated error to include suggesting using this alternate style. |
I am upgrading an old service that had fallen behind on lib updates.
After upgrading to "mockito-scala ->1.17.29" (and even tried specifying "mockito-core -> 2.22.0") I am now seeing this mockito error message when running my tests.
What is odd is that I'm not asking mockito to mock an instance of scala.xml.Elem, just to mock a class method that returns one.
Here is a minimal example of this issue:
And here is the runtime error:
Can someone advise if this is a bug or am I missing something?
Thanks
The text was updated successfully, but these errors were encountered: