|
90 | 90 | import org.springframework.integration.config.GlobalChannelInterceptor;
|
91 | 91 | import org.springframework.integration.config.IntegrationConverter;
|
92 | 92 | import org.springframework.integration.config.SpelFunctionFactoryBean;
|
| 93 | +import org.springframework.integration.context.IntegrationContextUtils; |
93 | 94 | import org.springframework.integration.core.MessageSource;
|
94 | 95 | import org.springframework.integration.core.MessagingTemplate;
|
95 | 96 | import org.springframework.integration.endpoint.AbstractEndpoint;
|
|
136 | 137 | /**
|
137 | 138 | * @author Artem Bilan
|
138 | 139 | * @author Gary Russell
|
| 140 | + * @author Michael Wiles |
139 | 141 | *
|
140 | 142 | * @since 4.0
|
141 | 143 | */
|
@@ -471,27 +473,35 @@ public void testMessagingGateway() throws InterruptedException {
|
471 | 473 | }
|
472 | 474 |
|
473 | 475 | /**
|
474 |
| - * Just creates an interim context to confirm that the DefaultConfiguringBeanFactoryPostProcessor |
475 |
| - * does not fail when there is an extra application context in the hierarchy. |
| 476 | + * Just creates an interim context to confirm that the |
| 477 | + * DefaultConfiguringBeanFactoryPostProcessor does not fail when there is an extra |
| 478 | + * application context in the hierarchy. |
476 | 479 | */
|
477 | 480 | @Test
|
478 | 481 | public void testDoubleParentChildAnnotationConfiguration() {
|
| 482 | + |
| 483 | + assertThat(this.context.containsBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME)).isTrue(); |
| 484 | + |
479 | 485 | AnnotationConfigApplicationContext parent;
|
480 | 486 | parent = new AnnotationConfigApplicationContext();
|
481 | 487 | parent.register(ChildConfiguration.class);
|
482 | 488 | parent.setParent(this.context);
|
483 | 489 | parent.refresh();
|
484 | 490 |
|
| 491 | + assertThat(parent.containsBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME)).isFalse(); |
| 492 | + |
485 | 493 | AnnotationConfigApplicationContext child;
|
486 | 494 | child = new AnnotationConfigApplicationContext();
|
487 | 495 | child.register(ChildConfiguration.class);
|
488 | 496 | child.setParent(parent);
|
489 | 497 | child.refresh();
|
490 | 498 |
|
| 499 | + assertThat(child.containsBeanDefinition(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME)).isFalse(); |
| 500 | + |
491 | 501 | parent.close();
|
492 | 502 | child.close();
|
493 | 503 | }
|
494 |
| - |
| 504 | + |
495 | 505 | @Test
|
496 | 506 | public void testParentChildAnnotationConfiguration() {
|
497 | 507 | AnnotationConfigApplicationContext child = new AnnotationConfigApplicationContext();
|
|
0 commit comments