Project, with Java 11 and JUnit 5 stack, keeps outputting "No tests were found" in IntelliJ IDEA, if running tests (accordingly, not running any test if tried via maven's surefire plugin mvn test).
I've tried many variations, and finally figured out the solution. If the pom.xml has
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version> //I suppose this is important entry in this problem
</parent>
then tests won't run and instead IntelliJ would always print "No tests were found"; however, this is immediately resolved if I simply remove <parent/> element from the pom.xml or change its version to 2.3.0.RELEASE
OK, the problem is solved like that, and it seems like some plugin or transitive dependency problem; however, any ideas what exactly mismatches with JUnit5 engine?
In your JAVA test file, make sure you import org.junit.jupiter.api.Test; and not import org.junit.Test;.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With