spring - Replace ScheduledAnnotationBeanPostProcessor in integration tests - Stack Overflow
My mistake was that I didn't name the bean correctly. I ended up finding where this bean was being built(in org.springframework.scheduling.annotation.SchedulingConfiguration) and I copied it's configuration.
This method demonstrates the proper names/config:
@Bean(name=AnnotationConfigUtils.SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) BeanPostProcessor scheduledAnnotationBeanPostProcessor(){ return new BeanPostProcessor(){ @Override Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { return bean } @Override Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { return bean } } }
Read full article from spring - Replace ScheduledAnnotationBeanPostProcessor in integration tests - Stack Overflow
No comments:
Post a Comment