编写了测试类
运行时报错SpringBoot Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration,
查了一下各种说法都有,最后在https://blog.csdn.net/qq_25406669/article/details/87966497这里找到解决方案,那就是启动类和运行类不在同一个目录下,原先启动类DemoApplicationTests在包com.example.demo下,修改为com.example包下,测试正常。