Fix test
Contribution was not applied on the actual use case See gh-28915
This commit is contained in:
parent
34266f22c7
commit
e5f9574800
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue