I am trying to run a junit test on my spring boot application. Here is my pom.xml
:
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
and then in the test class i have the below code:
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.boot.test.SpringApplicationConfiguration;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = SeleniumApplication.class)
public class DataExtractorTest {
}
Unfortunatly, in the line
@SpringApplicationConfiguration(classes = SeleniumApplication.class)
it complains with
SpringApplicationConfiguration cannot be resolved to a type
and even when i added the
import org.springframework.boot.test.SpringApplicationConfiguration
it complains with
The import org.springframework.boot.test.SpringApplicationConfiguration cannot be resolved
I have cleaned my project, and updated my maven project several times, even closed the STS and try again but none of them worked.