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.NoSuchMethodException on mock(Timestamp.class) #256
Comments
This looks like a dependency issue. It should work perfectly. I tried you dependencies and it worked. My guess is that you have more than that. For example, an old cglib version. If I do a
What do you see? |
That's my dependecy tree from the example, same as yours:
That's the complete pom.xml:
Maven 3.6.3, Java 11.0.6 |
With that version of java it is running fine:
|
Ah. I missed that. Java 11. Indeed it fails. On the entire java.sql package. I'm suspecting some problem about where the mock is created. I will look into it. |
First thing I can say, without powermock it works perfectly. It's a classloader issue. The mock is created in the powermock classloader. And the requested Callback is not from the same classloader as the one used to create the mock. Not sure why yet... |
Hey @henri-tremblay , any update on this? |
No sorry. And I'm not sure I will have the time soon. Any help is appreciated. |
When i try to mock Timestamp.class with easymock's mock(), i get the following error:
This is the test-setup
4.0.0
Running with adopt-openjdk-11.0.6
The text was updated successfully, but these errors were encountered: