
单元测试
杰杰椒
教是学的最好方法
展开
-
Springboot中的test
spring-boot-starter-test整合了spring-test和junit,简化了test,好用极了。直接贴代码讲解吧 1.maven配置:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <!--原创 2017-12-06 11:12:54 · 6069 阅读 · 0 评论 -
单元测试报错Unable to find a @SpringBootConfiguration
单元测试时报错:java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test原因:单元测试项目的包路径和Springboot项目路径不匹配...原创 2019-03-20 17:37:16 · 646 阅读 · 0 评论