Commit a615693f authored by Dave Syer's avatar Dave Syer

Add test for gh-645

parent 708d5ade
...@@ -318,6 +318,17 @@ public class ConfigFileApplicationListenerTests { ...@@ -318,6 +318,17 @@ public class ConfigFileApplicationListenerTests {
assertThat(property, equalTo("notempty")); 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 @Test
public void yamlSetsProfiles() throws Exception { public void yamlSetsProfiles() throws Exception {
this.initializer.setSearchNames("testsetprofiles"); this.initializer.setSearchNames("testsetprofiles");
......
...@@ -6,4 +6,9 @@ my: ...@@ -6,4 +6,9 @@ my:
spring: spring:
profiles: dev profiles: dev
my: my:
property: fromdevprofile property: fromdevprofile
\ No newline at end of file ---
spring:
profiles: other
my:
property: fromotherprofile
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment