每个圣人都有过去,每个罪人都有未来。 ――王尔德
我们在开发中经常会进行测试,如果是需要springboot环境,我们就可以使用spring-boot-starter-test
引入依赖
|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1 2 3 4 5 6 7 8 9 10 11 | hljs xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> |
然后编写测试类

就可以正常进行测试了,例如引用mapper

51工具盒子