Add test for gh-645
This commit is contained in:
parent
708d5ade9f
commit
a615693f39
|
|
@ -318,6 +318,17 @@ public class ConfigFileApplicationListenerTests {
|
|||
assertThat(property, equalTo("notempty"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void yamlTwoProfiles() throws Exception {
|
||||
this.initializer.setSearchNames("testprofiles");
|
||||
this.environment.setActiveProfiles("other", "dev");
|
||||
this.initializer.onApplicationEvent(this.event);
|
||||
String property = this.environment.getProperty("my.property");
|
||||
assertThat(property, equalTo("fromotherprofile"));
|
||||
property = this.environment.getProperty("my.other");
|
||||
assertThat(property, equalTo("notempty"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void yamlSetsProfiles() throws Exception {
|
||||
this.initializer.setSearchNames("testsetprofiles");
|
||||
|
|
|
|||
|
|
@ -6,4 +6,9 @@ my:
|
|||
spring:
|
||||
profiles: dev
|
||||
my:
|
||||
property: fromdevprofile
|
||||
property: fromdevprofile
|
||||
---
|
||||
spring:
|
||||
profiles: other
|
||||
my:
|
||||
property: fromotherprofile
|
||||
Loading…
Reference in New Issue