-
Notifications
You must be signed in to change notification settings - Fork 586
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
Regression: MethodNotFoundException #717
Comments
As far as I see, it reaches
This is from |
Thank you for investigation! You're welcome to provide a pull request with fix :) |
Hmm, I'm not sure how the fix should look. I did however found an answer on how to properly identify cglib proxies. import net.sf.cglib.proxy.Enhancer;
private static boolean isEasyMocked(Object mock) {
return Enhancer.isEnhanced(mock.getClass()) || Proxy.isProxyClass(mock.getClass());
} This would mean that |
Unfortunately, we cannot introduce a new dependencies to I snooped the approach with Now, I think the right way will be to implement the same approach as in
|
Indeed, as I've already tried the |
I wonder how should I handle the unit test, as the project level is set to 1.6, which doesn't allow lambdas. |
You can handle the test as it did in mockito case. Just create a new module Thank you a lot for your help! |
Hmm, |
It's a really good question. I meant create a module a put in it a test for your case. Case: using EasyMock + PowerMock with class with lambda (and maybe create a same case for Mockito). But, you're right. |
I have this exception too, in 2 places in my code. The tests did work previously with mockito 1.6.5 but started to fail when I switched to 1.6.6. The first occurrence was when mocking a Map. I got around the problem by using a real map and just filling it with mock objects. The second occurrence was when calling next() on a mock of java.sql.ResultSet. I've spent all afternoon trying to solve it but have now given up and switched back to 1.6.5 (which is a shame as going to 1.6.6 fixed some issues I was experiencing using EclEmma with Eclipse to get code coverage). I wonder if it is anything to do with Map and ResultSet both being interfaces? NB - I'm using mockito 1.10.19 and junit 4.10 |
@andrei-ivanov Are you still working on this? If not, I'd be willing to work on a fix. |
Signed-off-by: Arthur Zagretdinov <[email protected]>
Signed-off-by: Arthur Zagretdinov <[email protected]>
I have encountered the similar error. BUT I NEED TO USE POWERMOCKITO 1.6.6 AND ABOVE VERSION FOR COMPATIBLITY WITH OTHER TOOLS IN THE PROJECT. Is this issue fixed in POWERMOCKITO 1.6.7 ? |
@rushikeshr the issue is fixed in PowerMock 1.7.0 (Release notes). In Maven Central available PowerMock 1.7.0RC2 with this fix. |
Tested 1.7.0RC2 and it is fixed. This issue gave me headaches. |
* Spring IO Athens-BUILD-SNAPSHOT -> Cairo-BUILD-SNAPSHOT * CGLib 3.1 -> 3.2.5 latest release Issue related to ASM cglib/cglib#20 * AssertJ 2.2.0 -> 3.6.2 latest release * PowerMock 1.6.2 -> 1.6.5 latest release is 1.6.6 but has regression Issue powermock/powermock#717
* Spring IO Athens-BUILD-SNAPSHOT -> Cairo-BUILD-SNAPSHOT * CGLib 3.1 -> 3.2.5 latest release Issue related to ASM cglib/cglib#20 * AssertJ 2.2.0 -> 3.6.2 latest release * PowerMock 1.6.2 -> 1.6.5 latest release is 1.6.6 but has regression Issue powermock/powermock#717 * Update maven-compiler-plugin source/target to 1.8
Trying to upgrade from 1.6.4 to 1.6.6, I ran into this error:
The text was updated successfully, but these errors were encountered: