只需为整个TestExecutionListener添加自动装配。
@Overridepublic void beforeTestClass(TestContext testContext) throws Exception { testContext.getApplicationContext() .getAutowireCapableBeanFactory() .autowireBean(this); // your pre that uses autowired fields}检查github中的示例项目。



