diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java index 359135067a..91da040f17 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java @@ -421,7 +421,8 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests { @Test void runWhenCustomDefaultProfileSameAsActiveFromFileActivatesProfile() { - ConfigurableApplicationContext context = this.application.run("--spring.profiles.default=customdefault", + ConfigurableApplicationContext context = this.application.run( + "--spring.config.location=classpath:configdata/profiles/", "--spring.profiles.default=customdefault", "--spring.config.name=customprofile"); ConfigurableEnvironment environment = context.getEnvironment(); assertThat(environment.containsProperty("customprofile")).isTrue(); diff --git a/spring-boot-project/spring-boot/src/test/resources/configdata/profiles/customprofile-customdefault.properties b/spring-boot-project/spring-boot/src/test/resources/configdata/profiles/customprofile-customdefault.properties new file mode 100644 index 0000000000..0888bcc459 --- /dev/null +++ b/spring-boot-project/spring-boot/src/test/resources/configdata/profiles/customprofile-customdefault.properties @@ -0,0 +1 @@ +customprofile-customdefault=true diff --git a/spring-boot-project/spring-boot/src/test/resources/configdata/profiles/customprofile.properties b/spring-boot-project/spring-boot/src/test/resources/configdata/profiles/customprofile.properties new file mode 100644 index 0000000000..4e26520999 --- /dev/null +++ b/spring-boot-project/spring-boot/src/test/resources/configdata/profiles/customprofile.properties @@ -0,0 +1,2 @@ +spring.profiles.active=customdefault +customprofile=true