diff --git a/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java b/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java index ac49a2b2..2d6092f9 100644 --- a/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java +++ b/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java @@ -360,6 +360,15 @@ public class BootstrapConfigurationTests { assertTrue(this.context.getEnvironment().acceptsProfiles("bar")); } + @Test + public void includeProfileFromBootstrapProperties() { + this.context = new SpringApplicationBuilder().web(false) + .sources(BareConfiguration.class) + .properties("spring.cloud.bootstrap.name=local").run(); + assertTrue(this.context.getEnvironment().acceptsProfiles("local")); + assertEquals("Hello added!", this.context.getEnvironment().getProperty("added")); + } + @Configuration @EnableConfigurationProperties protected static class BareConfiguration { diff --git a/spring-cloud-context/src/test/resources/local.properties b/spring-cloud-context/src/test/resources/local.properties new file mode 100644 index 00000000..745d475e --- /dev/null +++ b/spring-cloud-context/src/test/resources/local.properties @@ -0,0 +1 @@ +spring.profiles.active: local \ No newline at end of file