Skip to content

Commit

Permalink
Test spring.profiles.include in profile file
Browse files Browse the repository at this point in the history
Add a test to ensure that `spring.profiles.include` is not silently
ignored when used in a profile-specific file.

See gh-24733
  • Loading branch information
philwebb committed Jan 11, 2021
1 parent 26a68ca commit 039df1d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
Expand Up @@ -630,8 +630,14 @@ void runWhenHasIncludedProfilesWithPlaceholderActivatesProfiles() {

@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
Expand Down
@@ -0,0 +1 @@
spring.profiles.include=p2
@@ -0,0 +1 @@
spring.profiles.active=test

0 comments on commit 039df1d

Please sign in to comment.