Introduce processInjection() in CommonAnnotationBeanPostProcessor
To align with the existing processInjection() method in AutowiredAnnotationBeanPostProcessor, this commit introduces an analogous method in CommonAnnotationBeanPostProcessor. Closes gh-31956
This commit is contained in:
@@ -52,6 +52,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Chris Beams
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
class CommonAnnotationBeanPostProcessorTests {
|
||||
|
||||
@@ -65,6 +66,20 @@ class CommonAnnotationBeanPostProcessorTests {
|
||||
bf.addBeanPostProcessor(bpp);
|
||||
}
|
||||
|
||||
@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 postConstructAndPreDestroy() {
|
||||
bf.registerBeanDefinition("annotatedBean", new RootBeanDefinition(AnnotatedInitDestroyBean.class));
|
||||
|
||||
Reference in New Issue
Block a user