springboot启动类报错

java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use
@ContextConfiguration or @SpringBootTest(classes=...) with your test at org.springframework.util.Assert.state(Assert.java:76) at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.g
etOrFindConfigurationClasses(SpringBootTestContextBoo
注意测试单元路径要与主启动类包路径要一直

 

不然你就要指定你的主启动类在哪
@SpringBootTest(classes=...)

 

posted @ 2022-12-24 22:22  余生请多指教ANT  阅读(29)  评论(0编辑  收藏  举报