Browse Source

Polish

pull/6891/merge
Stephane Nicoll 10 years ago
parent
commit
8470ecb4d0
  1. 13
      spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java

13
spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java

@ -712,11 +712,12 @@ public class ConfigFileApplicationListenerTests { @@ -712,11 +712,12 @@ public class ConfigFileApplicationListenerTests {
SpringApplication application = new SpringApplication(Config.class);
application.setWebEnvironment(false);
this.context = application.run("--spring.profiles.active=includeprofile");
assertThat(this.context.getEnvironment()).has(matchingProfile("includeprofile"));
assertThat(this.context.getEnvironment()).has(matchingProfile("specific"));
assertThat(this.context.getEnvironment()).has(matchingProfile("morespecific"));
assertThat(this.context.getEnvironment()).has(matchingProfile("yetmorespecific"));
assertThat(this.context.getEnvironment()).doesNotHave(matchingProfile("missing"));
ConfigurableEnvironment environment = this.context.getEnvironment();
assertThat(environment).has(matchingProfile("includeprofile"));
assertThat(environment).has(matchingProfile("specific"));
assertThat(environment).has(matchingProfile("morespecific"));
assertThat(environment).has(matchingProfile("yetmorespecific"));
assertThat(environment).doesNotHave(matchingProfile("missing"));
}
@Test
@ -825,7 +826,7 @@ public class ConfigFileApplicationListenerTests { @@ -825,7 +826,7 @@ public class ConfigFileApplicationListenerTests {
assertThat(environment.containsProperty("customprofile")).isTrue();
assertThat(environment.containsProperty("customprofile-specific")).isTrue();
assertThat(environment.containsProperty("customprofile-customdefault")).isTrue();
assertThat(this.context.getEnvironment().acceptsProfiles("customdefault"))
assertThat(environment.acceptsProfiles("customdefault"))
.isTrue();
}

Loading…
Cancel
Save