SpringJUnit4ClassRunner class not found

前端 未结 7 869
长发绾君心
长发绾君心 2021-01-07 18:16

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.

         


        
7条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-07 18:39

    Go to pom.xml and make sure your file contain this dependency:

    
        org.springframework
        spring-test
        5.1.7.RELEASE
    
    

    Also make sure that in this dependency is no "scope" node:

    test
    

提交回复
热议问题