Browse Source

Updates for new context id generation in boot 2

pull/313/head
Spencer Gibb 7 years ago
parent
commit
4aa2050b4b
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 6
      spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java
  2. 2
      spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeSerializationTests.java

6
spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java

@ -216,7 +216,8 @@ public class BootstrapConfigurationTests { @@ -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 { @@ -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

2
spring-cloud-context/src/test/java/org/springframework/cloud/context/scope/refresh/RefreshScopeSerializationTests.java

@ -40,7 +40,7 @@ public class RefreshScopeSerializationTests { @@ -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

Loading…
Cancel
Save