Introduce basic unit test for AutowiredAnnotationBeanPostProcessor.processInjection()
This commit is contained in:
@@ -118,6 +118,20 @@ class AutowiredAnnotationBeanPostProcessorTests {
|
||||
.withRootCauseInstanceOf(IllegalStateException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void processInjection() {
|
||||
ResourceInjectionBean bean = new ResourceInjectionBean();
|
||||
assertThat(bean.getTestBean()).isNull();
|
||||
assertThat(bean.getTestBean2()).isNull();
|
||||
|
||||
TestBean tb = new TestBean();
|
||||
bf.registerSingleton("testBean", tb);
|
||||
bpp.processInjection(bean);
|
||||
|
||||
assertThat(bean.getTestBean()).isSameAs(tb);
|
||||
assertThat(bean.getTestBean2()).isSameAs(tb);
|
||||
}
|
||||
|
||||
@Test
|
||||
void resourceInjection() {
|
||||
RootBeanDefinition bd = new RootBeanDefinition(ResourceInjectionBean.class);
|
||||
|
||||
Reference in New Issue
Block a user