Test spring.profiles.include in profile file

Add a test to ensure that `spring.profiles.include` is not silently
ignored when used in a profile-specific file.

See gh-24733
This commit is contained in:
Phillip Webb 2021-01-11 12:04:14 -08:00
parent 26a68ca2cf
commit 039df1d96d
4 changed files with 9 additions and 1 deletions

View File

@ -630,8 +630,14 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests {
@Test
void runWhenHasIncludedProfilesWithProfileSpecificDocumentThrowsException() {
assertThatExceptionOfType(InactiveConfigDataAccessException.class).isThrownBy(() -> this.application.run(
"--spring.config.location=classpath:application-include-profiles-in-profile-specific-document.properties"));
}
@Test
void runWhenHasIncludedProfilesWithProfileSpecificFileThrowsException() {
assertThatExceptionOfType(InactiveConfigDataAccessException.class).isThrownBy(() -> this.application
.run("--spring.config.location=classpath:application-include-profiles-in-profile-specific.properties"));
.run("--spring.config.name=application-include-profiles-in-profile-specific-document"));
}
@Test