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

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

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

问题描述:在写springboot的测试类测时候,可能会出现这个错误,是因为没有添加启动导致的,解决方法如下:

1添加一个启动

2)在测试类上添加@SpringBootConfiguration注解

以上两种方式二选一即可。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/4693184.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-07
下一篇 2022-11-07

发表评论

登录后才能评论

评论列表(0条)

保存