springboot测试单元中@RunWith(SpringRunner.class)报错解决方法

解决办法:在pom.xml中要有下面两个依赖

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

 


版权声明:本文为LJH_laura_li原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。