@Bean(name = BEAN_CONFIGURER_ASPECT_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public AnnotationBeanConfigurerAspect beanConfigurerAspect() { return AnnotationBeanConfigurerAspect.aspectOf(); }
@Test public void injection() { try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class)) { ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring(); assertEquals("Rod", myObject.getName()); } }
@Bean(name = BEAN_CONFIGURER_ASPECT_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public AnnotationBeanConfigurerAspect beanConfigurerAspect() { return AnnotationBeanConfigurerAspect.aspectOf(); }
@Test public void injection() { try (ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "org/springframework/beans/factory/aspectj/beanConfigurerTests.xml")) { ShouldBeConfiguredBySpring myObject = new ShouldBeConfiguredBySpring(); assertEquals("Rod", myObject.getName()); } }
@Bean(name = BEAN_CONFIGURER_ASPECT_BEAN_NAME) @Role(BeanDefinition.ROLE_INFRASTRUCTURE) public AnnotationBeanConfigurerAspect beanConfigurerAspect() { return AnnotationBeanConfigurerAspect.aspectOf(); }