springboot测试时Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
解决方法:
那是因为@SpringBootTest中缺少classes属性配置,加上启动类的class即可,如下:
@RunWith(SpringRunner.class)
@SpringBootTest(classes = AdminApplication.class)