Contribution was not applied on the actual use case

See gh-28915
This commit is contained in:
Stephane Nicoll 2022-08-04 09:32:45 +02:00
parent 34266f22c7
commit e5f9574800
1 changed files with 3 additions and 3 deletions

View File

@ -94,13 +94,13 @@ class ConfigurationClassPostProcessorAotContributionTests {
@Test
void applyToWhenHasImportAwareConfigurationRegistersBeanPostProcessorAfterApplicationContextAwareProcessor() {
BeanFactoryInitializationAotContribution contribution = getContribution(
ImportConfiguration.class);
TestAwareCallbackConfiguration.class);
contribution.applyTo(this.generationContext, this.beanFactoryInitializationCode);
compile((initializer, compiled) -> {
GenericApplicationContext freshContext = new AnnotationConfigApplicationContext();
GenericApplicationContext freshContext = new GenericApplicationContext();
DefaultListableBeanFactory freshBeanFactory = freshContext.getDefaultListableBeanFactory();
initializer.accept(freshBeanFactory);
freshContext.registerBean(TestAwareCallbackConfiguration.class);
freshContext.registerBean(TestAwareCallbackBean.class);
freshContext.refresh();
TestAwareCallbackBean bean = freshContext.getBean(TestAwareCallbackBean.class);
assertThat(bean.instances).hasSize(2);