i am trying to create a unit test using SpringJUnit4ClassRunner but everytime i execute the test it says it cannot find SpringJUnit4ClassRunner using mvn install.
If you are using linux, open the termial and work the command below. Do not forget to add the user in the place where the "user-name" is
cd /home/you-user/.m2/repository/
sudo rm -r junit
Go to pom.xml and make sure your file contain this dependency:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.1.7.RELEASE</version>
</dependency>
Also make sure that in this dependency is no "scope" node:
<scope>test</scope>
FYI, Add this in your pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
Maybe you lost the package
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.1.7.RELEASE</version>
</dependency>
I had to put sprint-test jar at the "TOP" of Java Build Path
I fixed this one by
Sourced from the appfuse forums