consider spring.profiles.include values from bootstrap PropertySources (#123)
This commit is contained in:
committed by
Spencer Gibb
parent
625b906e53
commit
941275ded2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2014 the original author or authors.
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -315,6 +315,15 @@ public class BootstrapConfigurationTests {
|
||||
assertEquals("parent", this.context.getEnvironment().getProperty("info.name"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void includeProfileFromBootstrapPropertySource() {
|
||||
PropertySourceConfiguration.MAP.put("spring.profiles.include", "bar,baz");
|
||||
this.context = new SpringApplicationBuilder().web(false).profiles("foo")
|
||||
.sources(BareConfiguration.class).run();
|
||||
assertTrue(this.context.getEnvironment().acceptsProfiles("baz"));
|
||||
assertTrue(this.context.getEnvironment().acceptsProfiles("bar"));
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableConfigurationProperties
|
||||
protected static class BareConfiguration {
|
||||
|
||||
Reference in New Issue
Block a user