Add test for gh-645

This commit is contained in:
Dave Syer 2014-04-09 06:59:05 +01:00
parent 708d5ade9f
commit a615693f39
2 changed files with 17 additions and 1 deletions

View File

@ -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");

View File

@ -6,4 +6,9 @@ my:
spring:
profiles: dev
my:
property: fromdevprofile
property: fromdevprofile
---
spring:
profiles: other
my:
property: fromotherprofile