From 5f386e456b6c99603d21613fdc58b50ba0fa5fb4 Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Wed, 5 Aug 2020 14:59:27 -0700 Subject: [PATCH] Fix test --- .../ConfigDataEnvironmentPostProcessorIntegrationTests.java | 3 ++- .../configdata/profiles/customprofile-customdefault.properties | 1 + .../resources/configdata/profiles/customprofile.properties | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 spring-boot-project/spring-boot/src/test/resources/configdata/profiles/customprofile-customdefault.properties create mode 100644 spring-boot-project/spring-boot/src/test/resources/configdata/profiles/customprofile.properties 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