From b33fd1ee9c03cac4c3a5f919babc9728f2a38c2b Mon Sep 17 00:00:00 2001 From: Gerardo Roza Date: Mon, 18 Jan 2021 15:50:55 -0300 Subject: [PATCH] Added additional scenario to reflect scenario mentioned in spring-feature-flags (even though the article does not point to any module in the codebase) --- .../src/main/resources/application.properties | 4 ++++ .../src/main/resources/application.yml | 3 +++ .../IntegrationMultidocumentFilesIntegrationTest.java | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.properties b/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.properties index c2bb5deb45..a079837942 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.properties +++ b/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.properties @@ -11,6 +11,7 @@ app.name=MyApp app.description=${app.name} is a Spring Boot application logging.file.name=myapplication.log bael.property=defaultValue +bael.otherProperty=defaultOtherValue #--- spring.config.activate.on-profile=multidocument-dev spring.datasource.password=password @@ -18,6 +19,9 @@ spring.datasource.url=jdbc:h2:dev spring.datasource.username=SA bael.property=devValue #--- +spring.config.activate.on-profile=multidocument-integration-extension +bael.otherProperty=integrationExtensionOtherValue +#--- spring.config.activate.on-profile=multidocument-prod spring.datasource.password=password spring.datasource.url=jdbc:h2:prod diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml b/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml index 33aabb2459..da398f5beb 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml +++ b/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml @@ -2,6 +2,9 @@ bael: root-level-property: defaultRootLevelValue --- spring: + profiles: + group: + multidocument-integration: multidocument-integration-extension config: activate: on-profile: multidocument-staging diff --git a/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/multidocument/IntegrationMultidocumentFilesIntegrationTest.java b/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/multidocument/IntegrationMultidocumentFilesIntegrationTest.java index f7968f51ad..e0727154d0 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/multidocument/IntegrationMultidocumentFilesIntegrationTest.java +++ b/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/multidocument/IntegrationMultidocumentFilesIntegrationTest.java @@ -17,12 +17,16 @@ public class IntegrationMultidocumentFilesIntegrationTest { @Value("${bael.property}") private String baelCustomProperty; + @Value("${bael.otherProperty}") + private String baelCustomOtherProperty; + @Value("${bael.root-level-property}") private String baelRootProperty; @Test public void givenProductionProfileActive_whenApplicationStarts_thenDefaultPropertiesUser() { assertThat(baelCustomProperty).isEqualTo("integrationValue"); + assertThat(baelCustomOtherProperty).isEqualTo("integrationExtensionOtherValue"); assertThat(baelRootProperty).isEqualTo("defaultRootLevelValue"); } }