@Override
  public void prepareTestInstance(SpringTestContext testContext) throws Exception {
    Object testInstance = testContext.getTestInstance();
    if (!(testInstance instanceof Specification)) return;

    injectSpies(testContext);
  }
This {@link TestExecutionListener} takes care of attaching and detaching the
mocks to the current {@link Specification}.

@author Leonard Bruenings
spock-spring/src/main/java/org/spockframework/spring/SpringMockTestExecutionListener.java