ReferenceAnnotationBeanPostProcessor extends AbstractAnnotationBeanPostProcessor implements
        ApplicationContextAware { public Collection<ReferenceBean<?>> getReferenceBeans() { return referenceBeanCache.values(); } ReferenceAnnotationBeanPostProcessor(); Collection<ReferenceBean<?>> getReferenceBeans(); Map<InjectionMetadata.InjectedElement, ReferenceBean<?>> getInjectedFieldReferenceBeanMap(); Map<InjectionMetadata.InjectedElement, ReferenceBean<?>> getInjectedMethodReferenceBeanMap(); @Override void setApplicationContext(ApplicationContext applicationContext); @Override void destroy(); static final String BEAN_NAME; }
@Test public void testGetReferenceBeans() { ReferenceAnnotationBeanPostProcessor beanPostProcessor = context.getBean(BEAN_NAME, ReferenceAnnotationBeanPostProcessor.class); Collection<ReferenceBean<?>> referenceBeans = beanPostProcessor.getReferenceBeans(); Assert.assertEquals(4, referenceBeans.size()); ReferenceBean<?> referenceBean = referenceBeans.iterator().next(); Assert.assertNotNull(ReferenceConfigCache.getCache().get(referenceBean)); }
@Test public void testReferenceBeansMethodAnnotation() { ReferenceAnnotationBeanPostProcessor beanPostProcessor = context.getBean(BEAN_NAME, ReferenceAnnotationBeanPostProcessor.class); Collection<ReferenceBean<?>> referenceBeans = beanPostProcessor.getReferenceBeans(); Assert.assertEquals(4, referenceBeans.size()); ReferenceBean<?> referenceBean = referenceBeans.iterator().next(); if ("helloService".equals(referenceBean.getId())) { Assert.assertNotNull(referenceBean.getMethods()); } }