0

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
ibrz
  • 1
  • Without giving more detailed information it's impossible to even guess... a full test the full error output also upgrade Maven, JDK and plugins ..and reconsider using powermock... – khmarbaise Dec 09 '22 at 13:19
  • Please provide enough code so others can better understand or reproduce the problem. – Community Dec 10 '22 at 17:55

0 Answers0