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