2

I am using maven jacoco pugin to generate code coverage report. I am using Powermock for my Junits. I am getting this message at the time of build:

Classes in bundle "XYZ" do not match with execution data. For report generation, same class files must be used at runtime.
[WARNING] Execution data for class "com/abc/example/testEmail" does not match ...

As per my analysis,wherever I have used @PrepareForTest on a particular class, that class is not showing up in the code coverage report.

I am using the following version of Jacoco and Powermock:

Jacoco - 0.7.9 PowerMock - 1.7.1

som6233
  • 47
  • 6
  • 1
    I think I understand the problem. jacoco takes each line of code and understand the what bytecode related to it. what PrepareForTest does is change the bytecode when you compile. so there is no match between your code and the bytecode. https://stackoverflow.com/a/56430390/588532 – Uriel Frankel Sep 15 '20 at 07:30
  • Yes. How do I resolve this issue. Any indicators would be helpful. – som6233 Sep 15 '20 at 09:34
  • I went through https://www.jacoco.org/jacoco/trunk/doc/classids.html (What workarounds exist to deal with runtime-modified classes?) but any example fo the 3 workarounds would be helpful. – som6233 Sep 15 '20 at 09:39

0 Answers0