关于@SpringBootTest的问题 想在单元测试中使用注入的对象,请用@SpringBootTest 更多spring测试参考文档: Spring Boot Junit 单元测试. Spring Boot Test 注解详解