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
Why the mockito is not compatible with jacoco? #969
Comments
Mockito should be compatible with jacoco. What is the version you are loading and could you create a minimal reproducible gist? |
Thanks for reply. In maven configuration I use
the source code is
the test code is
then I use EDITED by @bric3 : reformatted with proper markdown |
@Nymph-fan Note this may depend on the jacoco version as well. |
@bric3 @TimvdLippe I update |
@Nymph-fan I cannot say what's wrong, however we don't support mockito 1.x anymore, the mock generation engine was CGLIB and may have issues regarding coverage. Mockito 2.x now uses ByteBuddy instead. |
Since 1.x is not supported anymore and we have not received any issues with Mockito 2.x + Jacoco, I am going to close this issue. If you do encounter any issues with 2.x, please reopen. Thank you for your time! |
Even with mockito2.x+jacoco we are not getting coverage ,Coudl you please provide sample projecst |
For me the issue was in the Jacoco gradle task. The |
I'm using Mockito 2.0.2-beta and no jacoco coverage is counted via the Maven Surefire plugin. Update: Able to do it by using spy() to create a copy of object. That actually invokes the method on the original object. |
Hello:
I'm glad to use mockito ,but when I use jacoco to count the coverage of unit test. The coverage always be 0.Is there any way to solve it?
The text was updated successfully, but these errors were encountered: