I'm using powermock to mock some static methods inside one of the project and I decided to use clover as the code coverage reporting tools since it seems that it can be compatible with the instrumental of powermock.
However, when I tried to trigger clover with the following command in the project:
>mvn clean clover:setup test clover:aggregate clover:clover
During the test phase, the log showed that 9 test methods detected, but only one of them was actually running and generated the results(the only one without powermock).
the current configurations in my pom.xml is as follows:
clover-plugin:
<plugin>
<groupId>org.openclover</groupId>
<artifactId>clover-maven-plugin</artifactId>
<version>${clover.version}</version>
<configuration>
<flushPolicy>interval</flushPolicy>
<flushInterval>5000</flushInterval>
</configuration>
</plugin>
Powermock:
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
</exclusion>
</exclusions>
</dependency>
I would be really appreciated if anyone could help me with the issue. Thank you.