SpringBoot导入junit包错误

![图片说明](https://img-ask.csdn.net/upload/201808/14/1534259210_807133.png)图片说明
如图所示:本地仓库已经有了junit包,在SpringBoot中编写测试类却找不到

梳理一下:
1、如果想在main包下使用,pom.xml文件配置文件应该:将scope注释起来,说明不只在测试路径下使用
    <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <!-- <scope>test</scope> -->
    </dependency>
2、如果在test包下,则不用,直接就可以了

图片说明

https://blog.csdn.net/u013360850/article/details/71075565/

springboot有测试类,为什么还需要导入Junit?如果要用,可以参照测试类进行注解配置

图片说明

在pom.xml里面下面这样设置以后

org.springframework.boot
spring-boot-starter-test
<!-- test -->

等import完了,再这样写就不报错了

https://blog.csdn.net/zhangpan_soft/article/details/76887601

g.csdn.net/u013360850/artg.csdn.net/u013360850/article/details/71075565/icle/details/71g.csdn.net/u013360850/article/details/71075565/075g.csdn.net/u013360850/article/details/71075565/565/