Minha classe de teste:
import org.junit.Assert;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@SpringBootTest
@RunWith(SpringRunner.class)
class ApplicationTests {
@Test
void contextLoads() {
Assert.assertTrue(true);
}
}
Erro: Incompatible types. Found: 'java.lang.Class<org.springframework.test.context.junit4.SpringRunner>', required: 'java.lang.Class<? extends org.junit.runner.Runner>'
Dependencias relacionadas:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
Utilizo a versão 2.5.2 do Maven