Junit插件 Maven导入Junit依赖 <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> goto生成Junit 4 测试类 会生成如Test类 测试类注解 必须添加@SpringBootTest注解,@SpringBootTest注解将会告诉Spring加载容器内所有Bean 方法上添加@Test注解