Updates for new context id generation in boot 2

This commit is contained in:
Spencer Gibb
2018-01-17 12:05:36 -05:00
parent 7f0791a79a
commit 4aa2050b4b
2 changed files with 5 additions and 3 deletions

View File

@@ -216,7 +216,8 @@ public class BootstrapConfigurationTests {
assertEquals(this.context.getEnvironment().getPropertySources().get("bootstrap"),
((ConfigurableEnvironment) this.context.getParent().getEnvironment())
.getPropertySources().get("bootstrap"));
assertEquals("app", this.context.getId());
//TODO: is this correct based on the new boot 2 ContextIdApplicationContextInitializer
assertEquals("main-1", this.context.getId());
}
@Test
@@ -248,7 +249,8 @@ public class BootstrapConfigurationTests {
// other.properties (the bootstrap properties this time)
assertEquals("main", this.context.getParent().getEnvironment()
.getProperty("spring.application.name"));
assertEquals("main", this.context.getId());
//TODO: is this correct based on the new boot 2 ContextIdApplicationContextInitializer
assertEquals("main-1", this.context.getId());
}
@Test

View File

@@ -40,7 +40,7 @@ public class RefreshScopeSerializationTests {
public void defaultApplicationContextId() throws Exception {
ConfigurableApplicationContext context = new SpringApplicationBuilder(
TestConfiguration.class).web(WebApplicationType.NONE).run();
assertThat(context.getId(), is(equalTo("application")));
assertThat(context.getId(), is(equalTo("application-1")));
}
@Test