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

╰半夏微凉° 2022-05-25 01:26 502阅读 0赞

springboot测试时出现:java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test

70

是因为我没在根目录下写一个springboot的启动类:写个App.class,再在test测试类跑起来就不会出现这个错误了

70 1

我的座右铭:不会,我可以学;落后,我可以追赶;跌倒,我可以站起来;我一定行。

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTIyMDQ3Mg_size_16_color_FFFFFF_t_70

发表评论

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

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

相关阅读