Commit 39140945 authored by Phillip Webb's avatar Phillip Webb

Polish

parent 1043239d
...@@ -77,23 +77,25 @@ public class IntegrationAutoConfigurationTests { ...@@ -77,23 +77,25 @@ public class IntegrationAutoConfigurationTests {
"org.springframework.integration.monitor"); "org.springframework.integration.monitor");
} }
@Test @Test
public void parentContext() { public void parentContext() {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
this.context.register(JmxAutoConfiguration.class, IntegrationAutoConfiguration.class); this.context.register(JmxAutoConfiguration.class,
IntegrationAutoConfiguration.class);
this.context.refresh(); this.context.refresh();
AnnotationConfigApplicationContext parent = this.context; AnnotationConfigApplicationContext parent = this.context;
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
this.context.setParent(parent); this.context.setParent(parent);
this.context.register(JmxAutoConfiguration.class, IntegrationAutoConfiguration.class); this.context.register(JmxAutoConfiguration.class,
IntegrationAutoConfiguration.class);
this.context.refresh(); this.context.refresh();
assertNotNull(this.context.getBean(HeaderChannelRegistry.class)); assertNotNull(this.context.getBean(HeaderChannelRegistry.class));
((ConfigurableApplicationContext) this.context.getParent()).close(); ((ConfigurableApplicationContext) this.context.getParent()).close();
this.context.close(); this.context.close();
} }
private static void assertDomains(MBeanServer mBeanServer, boolean expected, String... domains) { private static void assertDomains(MBeanServer mBeanServer, boolean expected,
String... domains) {
List<String> actual = Arrays.asList(mBeanServer.getDomains()); List<String> actual = Arrays.asList(mBeanServer.getDomains());
for (String domain : domains) { for (String domain : domains) {
assertEquals(expected, actual.contains(domain)); assertEquals(expected, actual.contains(domain));
......
...@@ -136,4 +136,5 @@ public class FindMainClassTask extends DefaultTask { ...@@ -136,4 +136,5 @@ public class FindMainClassTask extends DefaultTask {
} }
return null; return null;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment