springboot单元测试时报错:
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test
怎么解决这个异常?
确定两个条件:
1、项目根目录下有启动类
2、测试目录根项目目录一致
springboot单元测试时报错:
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test
怎么解决这个异常?
确定两个条件:
1、项目根目录下有启动类
2、测试目录根项目目录一致