错误分析
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test
原因是测试类在测试包test下的包名和类路径java下的包名不一致导致的
解决1
修改包名一致即可
解决 2
参考https://blog.csdn.net/wwwwwww31311/article/details/115461920
在注解上加上@SpringBootTest(classes = xxx.class),来告诉springboot这是一个独立的测试类