I have updated the Spring boot version to 2.6.2 from 2.3.12.RELEASE to incorporate log4j change. Now when I executed mvn clean install to build my code, it is executing only one unit test. I have a test suite of around 423 tests that are all executing and passing with 2.3.12.RELEASE. But now even tests are not executing fine. I haven't seen any such incident reported so I am reporting one.
I am executing my tests with PowerMockRunner
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
<type>pom</type>
</dependency>
PowerMock dependencies
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
CodePudding user response:
What version of maven you are using and have you use the junit maven plugin.
CodePudding user response:
Starting from Springboot 2.4 they removed JUnit4. If you're using JUnit4 you need to add this dependency in your pom:
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>