SpringBoot 结合 testng 注入依赖为 null

因为工作业务需要实现自动化测试项目,采用 SpringBoot 结合 testng 实现 又因为中间需要依赖外部服务,在注入服务的时候发现注入为 null 最后网上搜到需要加上 @SpringBootTest 注解 && 继承 AbstractTestNGSpringContextTests 类,如下:
相关文章
相关标签/搜索