java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @Context

一时失言乱红尘 2022-05-15 15:54 510阅读 0赞

springboot单元测试出现

java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test

通过将测试类的包名改成和普通类 的包名一样。就ok了
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-pFXcRt2U-1571389495329)(https://i.imgur.com/AAR4D7Q.png)\]

发表评论

表情:
评论列表 (有 0 条评论,510人围观)

还没有评论,来说两句吧...

相关阅读