diff --git a/spring-boot-modules/spring-boot-properties/.dockerignore b/spring-boot-modules/spring-boot-properties/.dockerignore
new file mode 100644
index 0000000000..df36044e46
--- /dev/null
+++ b/spring-boot-modules/spring-boot-properties/.dockerignore
@@ -0,0 +1,13 @@
+# Logs
+logs
+*.log
+
+# Git
+.git
+.cache
+
+# Classes
+**/*.class
+
+# Ignore md files
+*.md
diff --git a/spring-boot-modules/spring-boot-properties/Dockerfile b/spring-boot-modules/spring-boot-properties/Dockerfile
new file mode 100644
index 0000000000..d6bd2a95ae
--- /dev/null
+++ b/spring-boot-modules/spring-boot-properties/Dockerfile
@@ -0,0 +1,10 @@
+FROM maven:3.6.0-jdk-11
+WORKDIR /code/spring-boot-modules/spring-boot-properties/
+COPY ./spring-boot-modules/spring-boot-properties/pom.xml .
+COPY ./spring-boot-modules/spring-boot-properties/src ./src
+COPY ./parent-boot-2/pom.xml /code/parent-boot-2/pom.xml
+COPY ./pom.xml /code/pom.xml
+COPY ./custom-pmd-0.0.1.jar /code/custom-pmd-0.0.1.jar
+COPY ./baeldung-pmd-rules.xml /code/baeldung-pmd-rules.xml
+RUN mvn dependency:resolve
+CMD ["mvn", "spring-boot:run"]
\ No newline at end of file
diff --git a/spring-boot-modules/spring-boot-properties/pom.xml b/spring-boot-modules/spring-boot-properties/pom.xml
index ef9c084f4c..98d328bd19 100644
--- a/spring-boot-modules/spring-boot-properties/pom.xml
+++ b/spring-boot-modules/spring-boot-properties/pom.xml
@@ -128,7 +128,8 @@
4.4.11
@
2.2.4.RELEASE
- com.baeldung.buildproperties.Application
+
+ com.baeldung.yaml.MyApplication
diff --git a/spring-boot-modules/spring-boot-properties/src/main/resources/application.yml b/spring-boot-modules/spring-boot-properties/src/main/resources/application.yml
index 6fc6f67cd0..4914ff15f7 100644
--- a/spring-boot-modules/spring-boot-properties/src/main/resources/application.yml
+++ b/spring-boot-modules/spring-boot-properties/src/main/resources/application.yml
@@ -1,7 +1,14 @@
+spring:
+ profiles:
+ active:
+ - test
+
+---
+
spring:
profiles: test
name: test-YAML
-environment: test
+environment: testing
servers:
- www.abc.test.com
- www.xyz.test.com
@@ -15,3 +22,13 @@ environment: production
servers:
- www.abc.com
- www.xyz.com
+
+---
+
+spring:
+ profiles: dev
+name: ${DEV_NAME:dev-YAML}
+environment: development
+servers:
+ - www.abc.dev.com
+ - www.xyz.dev.com
diff --git a/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/yaml/YAMLDevIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/yaml/YAMLDevIntegrationTest.java
new file mode 100644
index 0000000000..8dfc4c2208
--- /dev/null
+++ b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/yaml/YAMLDevIntegrationTest.java
@@ -0,0 +1,25 @@
+package com.baeldung.yaml;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = MyApplication.class)
+@TestPropertySource(properties = {"spring.profiles.active = dev"})
+class YAMLDevIntegrationTest {
+
+ @Autowired
+ private YAMLConfig config;
+
+ @Test
+ void whenProfileTest_thenNameTesting() {
+ assertTrue("development".equalsIgnoreCase(config.getEnvironment()));
+ assertTrue("dev-YAML".equalsIgnoreCase(config.getName()));
+ }
+}
diff --git a/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/yaml/YAMLIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/yaml/YAMLIntegrationTest.java
new file mode 100644
index 0000000000..090d5c592e
--- /dev/null
+++ b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/yaml/YAMLIntegrationTest.java
@@ -0,0 +1,24 @@
+package com.baeldung.yaml;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = MyApplication.class)
+class YAMLIntegrationTest {
+
+ @Autowired
+ private YAMLConfig config;
+
+ @Test
+ void whenProfileTest_thenNameTesting() {
+ assertTrue("testing".equalsIgnoreCase(config.getEnvironment()));
+ assertTrue("test-YAML".equalsIgnoreCase(config.getName()));
+ }
+}