I am using Springboot version-2.4.13 and below junit dependency:-
junit-jupiter-api -5.7.2
junit-bom- 5.7.2
junit-platform-suite-api-1.8.0
junit-platform-suite- 1.8.0
I am using below Test suite:-
package org.onap.so;
import org.junit.platform.suite.api.ExcludeTags;
import org.junit.platform.suite.api.IncludeClassNamePatterns;
import org.junit.platform.suite.api.SelectPackages;
import org.junit.platform.suite.api.Suite;
@Suite
@ExcludeTags("spring-aware")
@IncludeClassNamePatterns(".*Test")
@SelectPackages("org.onap.so")
public class NonSpringSuite {
}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<version>3.1.0</version>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/**NonSpringSuite.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
But all my junit5 tests are not getting discovered.
I tried some solutions but nothing works.
Error
WARNING: Third-party TestEngine implementations are forbidden to use the reserved ‘junit-‘ prefix for their ID: ‘junit-platform-suite’
[ERROR] TestEngine with ID ‘junit-platform-suite’ failed to discover tests