使用springboot test的时候出现的问题
Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test
这里就是你的main里的包结构和test里的包结构不一样
- 比如启动类的包结构为:com.ws.springboot.xxx
- 那么测试类的包结构也要为com.ws.springboot.xxxtest