When I run mvn test -Dtest=ClassTest
it works however when I run just mvn test
it fails because classes that should be mocked by PowerMock are null.
Following some details:
jdk 1.7 mvn 3.6.3
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency>
Tests in error:
Test.souldExecute:99 NullPointer
Test.souldExecute:99 NullPointer
Test.souldExecute:99 NullPointer