报错详情
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
报错原因
test目录下的Test类所在的包级别与main目录下的包名不一致。
解决方案
修改为一致即可:
测试启动成功:
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
test目录下的Test类所在的包级别与main目录下的包名不一致。
修改为一致即可:
测试启动成功: