public void injectSpies(Object testInstance) {
    for (Map.Entry<String, SpyDefinition> spyDefinitionEntry : spies.entrySet()) {
      FieldInfo fieldInfo = spyDefinitionEntry.getValue().getFieldInfo();
      Object spy = beanFactory.getBean(spyDefinitionEntry.getKey(), fieldInfo.getType());
      fieldInfo.writeValue(testInstance, spy);
    }
  }
Register the processor with a {@link BeanDefinitionRegistry}. Not required when
using the Spocks {@link spock.lang.Specification} as registration is automatic.

@param registry the bean definition registry
@param postProcessor the post processor class to register
@param definitions the initial mock/spy definitions
spock-spring/src/main/java/org/spockframework/spring/mock/SpockMockPostprocessor.java