Merge branch 'master' into 2.0.x

This commit is contained in:
Dave Syer
2017-11-14 12:48:54 +00:00
2 changed files with 10 additions and 0 deletions

View File

@@ -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 {