SpringBoot测试类启动错误 java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you ne

报错

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

 

我当时运行SpringBoot测试类的时候踩这个坑,当时的解决办法就是,本来的包名为test如今改成panfeng就好了.

这里的主配置类也就是`PanfengUploadApplication`所在包是 java 下的 `panfeng`java

因此测试类的`FastDFSTest`也要在 java 下的 `panfeng`包测试

相关文章
相关标签/搜索