![1d082ac61bb3062b23c0601affaa1465.gif](https://i-blog.csdnimg.cn/blog_migrate/8b4a617505eaddcfceca7efd34164dce.gif)
Spring Boot 整合 Junit 单元测试
SpringBoot2.x 使用 Junit5 作为测试平台
![d8074a4cddbb734d980f64d9bdbecfe2.png](https://i-blog.csdnimg.cn/blog_migrate/adc7f807c76006e8392823d21e2d9578.png)
修改 POM 文件添加 Test 启动器
一般用官网创建或者是IDEA工具创建的都自带了
注意一下如果配置了这个,就不能用5一下的junit了
![2cb172de52cbd4a1fc4d235bdb5a2d4d.png](https://i-blog.csdnimg.cn/blog_migrate/fb997ede0cd622a29e2dd608b43876f7.png)
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<!--junit-vintage-engine 提