use of org.spockframework.spring.mock.SpockMockPostprocessor in project spock by spockframework.
the class SpringMockTestExecutionListener method prepareTestInstance.
@Override
public void prepareTestInstance(SpringTestContext testContext) throws Exception {
Object testInstance = testContext.getTestInstance();
if (!(testInstance instanceof Specification))
return;
ApplicationContext applicationContext = testContext.getApplicationContext();
if (applicationContext.containsBean(SpockMockPostprocessor.class.getName())) {
SpockMockPostprocessor mockPostprocessor = applicationContext.getBean(SpockMockPostprocessor.class);
mockPostprocessor.injectSpies(testInstance);
}
}
Aggregations