I am using jmockit to test out a class which has some complex dependecies. I have marked this class as @Mocked in the test. The test runs fine. I generate a jacoco html report from the output. I do not see any coverage for the "Mocked" class under test.

Am I not seeing coverage becuase the class is 'Mocked' (partially)?

有帮助吗?

解决方案

jacoco does not give coverage for jmockit mocked objects (even "partially"). I created the test with the object under Test as "Tested" (instead of "Mocked") and it solved the problem.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top