Search in sources :

Example 16 with AutowiredAnnotationBeanPostProcessor

use of org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor in project spring-framework by spring-projects.

the class SpringHandlerInstantiatorTests method setup.

@Before
public void setup() {
    DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
    AutowiredAnnotationBeanPostProcessor bpp = new AutowiredAnnotationBeanPostProcessor();
    bpp.setBeanFactory(bf);
    bf.addBeanPostProcessor(bpp);
    bf.registerBeanDefinition("capitalizer", new RootBeanDefinition(Capitalizer.class));
    instantiator = new SpringHandlerInstantiator(bf);
    objectMapper = Jackson2ObjectMapperBuilder.json().handlerInstantiator(instantiator).build();
}
Also used : AutowiredAnnotationBeanPostProcessor(org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor) DefaultListableBeanFactory(org.springframework.beans.factory.support.DefaultListableBeanFactory) RootBeanDefinition(org.springframework.beans.factory.support.RootBeanDefinition) Before(org.junit.Before)

Aggregations

AutowiredAnnotationBeanPostProcessor (org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor)16 RootBeanDefinition (org.springframework.beans.factory.support.RootBeanDefinition)14 Test (org.junit.Test)13 DefaultListableBeanFactory (org.springframework.beans.factory.support.DefaultListableBeanFactory)3 NoSuchBeanDefinitionException (org.springframework.beans.factory.NoSuchBeanDefinitionException)2 WebApplicationContext (org.springframework.web.context.WebApplicationContext)2 Before (org.junit.Before)1 ScopedObject (org.springframework.aop.scope.ScopedObject)1 BeanCreationException (org.springframework.beans.factory.BeanCreationException)1 ITestBean (org.springframework.tests.sample.beans.ITestBean)1