Maven not running Spring Boot tests
The code in the class you named TestController
isn't a controller, it's a test, but the convention says that it's a controller (perhaps used in testing). By default, Surefire will be looking for tests matching *Test
; rename the class to ControllerTest
.
Use the below maven jar. It fixed my issue.
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
try checking if you are using the correct package for @Test annotation. In Spring Boot 2.3.6 is org.junit.jupiter.api.Test