Jacoco coverage report has 0 coverage, although junit tests run with 100% coverage

Avatar

Avatar
Applaud 5
Level 3
anjali_biddanda
Level 3

Likes

23 likes

Total Posts

88 posts

Correct reply

8 solutions
Top badges earned
Applaud 5
Give Back 10
Ignite 1
Validate 10
Validate 1
View profile

Avatar
Applaud 5
Level 3
anjali_biddanda
Level 3

Likes

23 likes

Total Posts

88 posts

Correct reply

8 solutions
Top badges earned
Applaud 5
Give Back 10
Ignite 1
Validate 10
Validate 1
View profile
anjali_biddanda
Level 3

01-10-2020

Hi Everyone,

 

I have a workflow process class and a junit test class for it. Junit tests run successfully. However, Jacoco reports 0% coverage. It seems to ignore this class because of the annotation:

@RunWith(MockitoJUnitRunner.class)

 I'd like to use the new @ExtendWith(MockitoExtension.class), but I'm not successful in getting the tests to run successfully. I haven't seen an example of this Junit5 notation used for Workflow processes. There are recent unit test examples for workflow processes here: https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/test/java/com/ad... , but that's using the Junit 4 too.

 

Any help with how to get Jacoco to pick up this notation.

 

Thanks.

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Applaud 5
Level 3
anjali_biddanda
Level 3

Likes

23 likes

Total Posts

88 posts

Correct reply

8 solutions
Top badges earned
Applaud 5
Give Back 10
Ignite 1
Validate 10
Validate 1
View profile

Avatar
Applaud 5
Level 3
anjali_biddanda
Level 3

Likes

23 likes

Total Posts

88 posts

Correct reply

8 solutions
Top badges earned
Applaud 5
Give Back 10
Ignite 1
Validate 10
Validate 1
View profile
anjali_biddanda
Level 3

01-10-2020

Hi guys, I changed the junit4 syntax (@RunWith(MockitoJUnitRunner.class)) to use @ExtendWith(MockitoExtension.class) and this fixes it. Jacoco doesn't understand the old syntax.

Answers (0)