diff --git a/spring-boot-properties/extra.properties b/spring-boot-properties/extra.properties index 8e28a6f889..51874a0415 100644 --- a/spring-boot-properties/extra.properties +++ b/spring-boot-properties/extra.properties @@ -1 +1 @@ -application.theme.color=blue \ No newline at end of file +application.theme.color=red \ No newline at end of file diff --git a/spring-boot-properties/src/main/java/org/baeldung/properties/core/ComponentInXmlUsingProperties.java b/spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentInXmlUsingProperties.java similarity index 95% rename from spring-boot-properties/src/main/java/org/baeldung/properties/core/ComponentInXmlUsingProperties.java rename to spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentInXmlUsingProperties.java index dbdcebcb36..675c72e642 100644 --- a/spring-boot-properties/src/main/java/org/baeldung/properties/core/ComponentInXmlUsingProperties.java +++ b/spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentInXmlUsingProperties.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.core; +package com.baeldung.properties.core; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring-boot-properties/src/main/java/org/baeldung/properties/core/ComponentUsingProperties.java b/spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentUsingProperties.java similarity index 95% rename from spring-boot-properties/src/main/java/org/baeldung/properties/core/ComponentUsingProperties.java rename to spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentUsingProperties.java index 7e082702fe..ff6e11d453 100644 --- a/spring-boot-properties/src/main/java/org/baeldung/properties/core/ComponentUsingProperties.java +++ b/spring-boot-properties/src/main/java/com/baeldung/properties/core/ComponentUsingProperties.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.core; +package com.baeldung.properties.core; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithJavaConfig.java b/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithJavaConfig.java similarity index 94% rename from spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithJavaConfig.java rename to spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithJavaConfig.java index 216f905437..d43f18f6a7 100644 --- a/spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithJavaConfig.java +++ b/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithJavaConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.external; +package com.baeldung.properties.external; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; diff --git a/spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithXmlConfig.java b/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfig.java similarity index 90% rename from spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithXmlConfig.java rename to spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfig.java index ea5bbf1c4d..6d105428d9 100644 --- a/spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithXmlConfig.java +++ b/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.external; +package com.baeldung.properties.external; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithXmlConfigOne.java b/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigOne.java similarity index 90% rename from spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithXmlConfigOne.java rename to spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigOne.java index 2698937e1e..6f1e4c8490 100644 --- a/spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithXmlConfigOne.java +++ b/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigOne.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.external; +package com.baeldung.properties.external; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithXmlConfigTwo.java b/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigTwo.java similarity index 88% rename from spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithXmlConfigTwo.java rename to spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigTwo.java index efbb995b73..38ecdd2aae 100644 --- a/spring-boot-properties/src/main/java/org/baeldung/properties/external/ExternalPropertiesWithXmlConfigTwo.java +++ b/spring-boot-properties/src/main/java/com/baeldung/properties/external/ExternalPropertiesWithXmlConfigTwo.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.external; +package com.baeldung.properties.external; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; diff --git a/spring-boot-properties/src/main/java/org/baeldung/properties/spring/BasicPropertiesWithJavaConfig.java b/spring-boot-properties/src/main/java/com/baeldung/properties/spring/BasicPropertiesWithJavaConfig.java similarity index 88% rename from spring-boot-properties/src/main/java/org/baeldung/properties/spring/BasicPropertiesWithJavaConfig.java rename to spring-boot-properties/src/main/java/com/baeldung/properties/spring/BasicPropertiesWithJavaConfig.java index 25bfaa20a9..1c7886b34b 100644 --- a/spring-boot-properties/src/main/java/org/baeldung/properties/spring/BasicPropertiesWithJavaConfig.java +++ b/spring-boot-properties/src/main/java/com/baeldung/properties/spring/BasicPropertiesWithJavaConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.spring; +package com.baeldung.properties.spring; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; diff --git a/spring-boot-properties/src/main/java/org/baeldung/properties/spring/PropertiesWithJavaConfig.java b/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfig.java similarity index 94% rename from spring-boot-properties/src/main/java/org/baeldung/properties/spring/PropertiesWithJavaConfig.java rename to spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfig.java index 6589143a94..4a29e5e3ea 100644 --- a/spring-boot-properties/src/main/java/org/baeldung/properties/spring/PropertiesWithJavaConfig.java +++ b/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfig.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.spring; +package com.baeldung.properties.spring; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-properties/src/main/java/org/baeldung/properties/spring/PropertiesWithJavaConfigOther.java b/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfigOther.java similarity index 88% rename from spring-boot-properties/src/main/java/org/baeldung/properties/spring/PropertiesWithJavaConfigOther.java rename to spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfigOther.java index 594ba0a09d..54d7814045 100644 --- a/spring-boot-properties/src/main/java/org/baeldung/properties/spring/PropertiesWithJavaConfigOther.java +++ b/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithJavaConfigOther.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.spring; +package com.baeldung.properties.spring; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; diff --git a/spring-boot-properties/src/main/java/org/baeldung/properties/spring/PropertiesWithPlaceHolderConfigurer.java b/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithPlaceHolderConfigurer.java similarity index 94% rename from spring-boot-properties/src/main/java/org/baeldung/properties/spring/PropertiesWithPlaceHolderConfigurer.java rename to spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithPlaceHolderConfigurer.java index 97d7fe0ffa..512ecda266 100644 --- a/spring-boot-properties/src/main/java/org/baeldung/properties/spring/PropertiesWithPlaceHolderConfigurer.java +++ b/spring-boot-properties/src/main/java/com/baeldung/properties/spring/PropertiesWithPlaceHolderConfigurer.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.spring; +package com.baeldung.properties.spring; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-properties/src/main/resources/application.properties b/spring-boot-properties/src/main/resources/application.properties index f976004a04..2e06fad574 100644 --- a/spring-boot-properties/src/main/resources/application.properties +++ b/spring-boot-properties/src/main/resources/application.properties @@ -1,3 +1,4 @@ management.endpoints.web.exposure.include=refresh spring.properties.refreshDelay=1000 spring.config.location=file:extra.properties +spring.main.allow-bean-definition-overriding=true \ No newline at end of file diff --git a/spring-boot-properties/src/main/resources/configForProperties.xml b/spring-boot-properties/src/main/resources/configForProperties.xml index 459aea3ec6..d796f791cb 100644 --- a/spring-boot-properties/src/main/resources/configForProperties.xml +++ b/spring-boot-properties/src/main/resources/configForProperties.xml @@ -9,7 +9,7 @@ - + diff --git a/spring-boot-properties/src/main/resources/configForPropertiesOne.xml b/spring-boot-properties/src/main/resources/configForPropertiesOne.xml index 068c86a840..53072d89bb 100644 --- a/spring-boot-properties/src/main/resources/configForPropertiesOne.xml +++ b/spring-boot-properties/src/main/resources/configForPropertiesOne.xml @@ -9,7 +9,7 @@ - + diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/basic/BasicPropertiesWithJavaIntegrationTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/basic/BasicPropertiesWithJavaIntegrationTest.java similarity index 90% rename from spring-boot-properties/src/test/java/org/baeldung/properties/basic/BasicPropertiesWithJavaIntegrationTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/basic/BasicPropertiesWithJavaIntegrationTest.java index 049b0d546a..f12808a16b 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/basic/BasicPropertiesWithJavaIntegrationTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/basic/BasicPropertiesWithJavaIntegrationTest.java @@ -1,6 +1,5 @@ -package org.baeldung.properties.basic; +package com.baeldung.properties.basic; -import org.baeldung.properties.spring.BasicPropertiesWithJavaConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -10,6 +9,8 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.properties.spring.BasicPropertiesWithJavaConfig; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { BasicPropertiesWithJavaConfig.class }, loader = AnnotationConfigContextLoader.class) public class BasicPropertiesWithJavaIntegrationTest { diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/basic/ExtendedPropertiesWithJavaIntegrationTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/basic/ExtendedPropertiesWithJavaIntegrationTest.java similarity index 86% rename from spring-boot-properties/src/test/java/org/baeldung/properties/basic/ExtendedPropertiesWithJavaIntegrationTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/basic/ExtendedPropertiesWithJavaIntegrationTest.java index 28ef76e249..a622029653 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/basic/ExtendedPropertiesWithJavaIntegrationTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/basic/ExtendedPropertiesWithJavaIntegrationTest.java @@ -1,7 +1,5 @@ -package org.baeldung.properties.basic; +package com.baeldung.properties.basic; -import org.baeldung.properties.spring.BasicPropertiesWithJavaConfig; -import org.baeldung.properties.spring.PropertiesWithJavaConfigOther; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -11,6 +9,9 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.properties.spring.BasicPropertiesWithJavaConfig; +import com.baeldung.properties.spring.PropertiesWithJavaConfigOther; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { BasicPropertiesWithJavaConfig.class, PropertiesWithJavaConfigOther.class }, loader = AnnotationConfigContextLoader.class) public class ExtendedPropertiesWithJavaIntegrationTest { diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/basic/PropertiesWithJavaIntegrationTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithJavaIntegrationTest.java similarity index 90% rename from spring-boot-properties/src/test/java/org/baeldung/properties/basic/PropertiesWithJavaIntegrationTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithJavaIntegrationTest.java index c55c1ee783..e43007ea2c 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/basic/PropertiesWithJavaIntegrationTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithJavaIntegrationTest.java @@ -1,6 +1,5 @@ -package org.baeldung.properties.basic; +package com.baeldung.properties.basic; -import org.baeldung.properties.spring.PropertiesWithJavaConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -10,6 +9,8 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.properties.spring.PropertiesWithJavaConfig; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { PropertiesWithJavaConfig.class }, loader = AnnotationConfigContextLoader.class) public class PropertiesWithJavaIntegrationTest { diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/basic/PropertiesWithMultipleXmlsIntegrationTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithMultipleXmlsIntegrationTest.java similarity index 96% rename from spring-boot-properties/src/test/java/org/baeldung/properties/basic/PropertiesWithMultipleXmlsIntegrationTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithMultipleXmlsIntegrationTest.java index 461f86f559..c3af2dc1d8 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/basic/PropertiesWithMultipleXmlsIntegrationTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithMultipleXmlsIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.basic; +package com.baeldung.properties.basic; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/basic/PropertiesWithXmlIntegrationTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithXmlIntegrationTest.java similarity index 95% rename from spring-boot-properties/src/test/java/org/baeldung/properties/basic/PropertiesWithXmlIntegrationTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithXmlIntegrationTest.java index 5e7689a2d9..85c4ac34e2 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/basic/PropertiesWithXmlIntegrationTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/basic/PropertiesWithXmlIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.basic; +package com.baeldung.properties.basic; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/external/ExternalPropertiesWithJavaIntegrationTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithJavaIntegrationTest.java similarity index 88% rename from spring-boot-properties/src/test/java/org/baeldung/properties/external/ExternalPropertiesWithJavaIntegrationTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithJavaIntegrationTest.java index c38a4b5465..2d6b3a74c5 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/external/ExternalPropertiesWithJavaIntegrationTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithJavaIntegrationTest.java @@ -1,6 +1,5 @@ -package org.baeldung.properties.external; +package com.baeldung.properties.external; -import org.baeldung.properties.spring.PropertiesWithJavaConfigOther; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -11,6 +10,9 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.properties.external.ExternalPropertiesWithJavaConfig; +import com.baeldung.properties.spring.PropertiesWithJavaConfigOther; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { ExternalPropertiesWithJavaConfig.class, PropertiesWithJavaConfigOther.class }, loader = AnnotationConfigContextLoader.class) @Ignore("manual only") diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/external/ExternalPropertiesWithMultipleXmlsIntegrationTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithMultipleXmlsIntegrationTest.java similarity index 87% rename from spring-boot-properties/src/test/java/org/baeldung/properties/external/ExternalPropertiesWithMultipleXmlsIntegrationTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithMultipleXmlsIntegrationTest.java index fe96ea8f7f..018c655ec2 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/external/ExternalPropertiesWithMultipleXmlsIntegrationTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithMultipleXmlsIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.external; +package com.baeldung.properties.external; import org.junit.Ignore; import org.junit.Test; @@ -10,6 +10,9 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.properties.external.ExternalPropertiesWithXmlConfigOne; +import com.baeldung.properties.external.ExternalPropertiesWithXmlConfigTwo; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { ExternalPropertiesWithXmlConfigOne.class, ExternalPropertiesWithXmlConfigTwo.class }, loader = AnnotationConfigContextLoader.class) @Ignore("manual only") diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/external/ExternalPropertiesWithXmlManualTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithXmlManualTest.java similarity index 92% rename from spring-boot-properties/src/test/java/org/baeldung/properties/external/ExternalPropertiesWithXmlManualTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithXmlManualTest.java index a8a7bda91c..4f0abbc12c 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/external/ExternalPropertiesWithXmlManualTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/external/ExternalPropertiesWithXmlManualTest.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.external; +package com.baeldung.properties.external; import org.junit.Ignore; import org.junit.Test; @@ -10,6 +10,8 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import com.baeldung.properties.external.ExternalPropertiesWithXmlConfig; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { ExternalPropertiesWithXmlConfig.class }, loader = AnnotationConfigContextLoader.class) @Ignore("manual only") diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/multiple/MultiplePropertiesJavaConfigIntegrationTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesJavaConfigIntegrationTest.java similarity index 85% rename from spring-boot-properties/src/test/java/org/baeldung/properties/multiple/MultiplePropertiesJavaConfigIntegrationTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesJavaConfigIntegrationTest.java index 9cb41c20f7..c7b9d33803 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/multiple/MultiplePropertiesJavaConfigIntegrationTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesJavaConfigIntegrationTest.java @@ -1,10 +1,11 @@ -package org.baeldung.properties.multiple; +package com.baeldung.properties.multiple; -import org.baeldung.properties.spring.PropertiesWithJavaConfig; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; +import com.baeldung.properties.spring.PropertiesWithJavaConfig; + import static org.assertj.core.api.Assertions.assertThat; @SpringJUnitConfig(PropertiesWithJavaConfig.class) diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/multiple/MultiplePropertiesXmlConfigIntegrationTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesXmlConfigIntegrationTest.java similarity index 93% rename from spring-boot-properties/src/test/java/org/baeldung/properties/multiple/MultiplePropertiesXmlConfigIntegrationTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesXmlConfigIntegrationTest.java index b4f81f3541..db71e816dd 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/multiple/MultiplePropertiesXmlConfigIntegrationTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/multiple/MultiplePropertiesXmlConfigIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.multiple; +package com.baeldung.properties.multiple; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ChildValueHolder.java b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ChildValueHolder.java similarity index 90% rename from spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ChildValueHolder.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ChildValueHolder.java index 0ed66d3c68..d97e7efb9e 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ChildValueHolder.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ChildValueHolder.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.parentchild; +package com.baeldung.properties.parentchild; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ParentChildPropertyPlaceHolderPropertiesIntegrationTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertyPlaceHolderPropertiesIntegrationTest.java similarity index 91% rename from spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ParentChildPropertyPlaceHolderPropertiesIntegrationTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertyPlaceHolderPropertiesIntegrationTest.java index e0eccc978a..374a502e5c 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ParentChildPropertyPlaceHolderPropertiesIntegrationTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertyPlaceHolderPropertiesIntegrationTest.java @@ -1,10 +1,8 @@ -package org.baeldung.properties.parentchild; +package com.baeldung.properties.parentchild; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; -import org.baeldung.properties.parentchild.config.ChildConfig2; -import org.baeldung.properties.parentchild.config.ParentConfig2; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -15,6 +13,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.web.context.WebApplicationContext; +import com.baeldung.properties.parentchild.config.ChildConfig2; +import com.baeldung.properties.parentchild.config.ParentConfig2; + @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextHierarchy({ @ContextConfiguration(classes = ParentConfig2.class), @ContextConfiguration(classes = ChildConfig2.class) }) diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ParentChildPropertySourcePropertiesIntegrationTest.java b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertySourcePropertiesIntegrationTest.java similarity index 91% rename from spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ParentChildPropertySourcePropertiesIntegrationTest.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertySourcePropertiesIntegrationTest.java index e9990523a7..c8d3413a04 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ParentChildPropertySourcePropertiesIntegrationTest.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentChildPropertySourcePropertiesIntegrationTest.java @@ -1,10 +1,8 @@ -package org.baeldung.properties.parentchild; +package com.baeldung.properties.parentchild; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; -import org.baeldung.properties.parentchild.config.ChildConfig; -import org.baeldung.properties.parentchild.config.ParentConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -15,6 +13,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.web.context.WebApplicationContext; +import com.baeldung.properties.parentchild.config.ChildConfig; +import com.baeldung.properties.parentchild.config.ParentConfig; + @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextHierarchy({ @ContextConfiguration(classes = ParentConfig.class), @ContextConfiguration(classes = ChildConfig.class) }) diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ParentValueHolder.java b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentValueHolder.java similarity index 90% rename from spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ParentValueHolder.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentValueHolder.java index abfafa8a7d..0330239f16 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/ParentValueHolder.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/ParentValueHolder.java @@ -1,4 +1,4 @@ -package org.baeldung.properties.parentchild; +package com.baeldung.properties.parentchild; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ChildConfig.java b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig.java similarity index 84% rename from spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ChildConfig.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig.java index 23c8db7864..41bc4704c3 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ChildConfig.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig.java @@ -1,11 +1,12 @@ -package org.baeldung.properties.parentchild.config; +package com.baeldung.properties.parentchild.config; -import org.baeldung.properties.parentchild.ChildValueHolder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; +import com.baeldung.properties.parentchild.ChildValueHolder; + @Configuration @PropertySource("classpath:child.properties") public class ChildConfig { diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ChildConfig2.java b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig2.java similarity index 85% rename from spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ChildConfig2.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig2.java index 2ed14d7701..c15fcbd352 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ChildConfig2.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ChildConfig2.java @@ -1,11 +1,12 @@ -package org.baeldung.properties.parentchild.config; +package com.baeldung.properties.parentchild.config; -import org.baeldung.properties.parentchild.ChildValueHolder; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; +import com.baeldung.properties.parentchild.ChildValueHolder; + @Configuration public class ChildConfig2 { diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ParentConfig.java b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig.java similarity index 84% rename from spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ParentConfig.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig.java index ed407e0b52..5cb8cc1639 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ParentConfig.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig.java @@ -1,11 +1,12 @@ -package org.baeldung.properties.parentchild.config; +package com.baeldung.properties.parentchild.config; -import org.baeldung.properties.parentchild.ParentValueHolder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; +import com.baeldung.properties.parentchild.ParentValueHolder; + @Configuration @PropertySource("classpath:parent.properties") public class ParentConfig { diff --git a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ParentConfig2.java b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig2.java similarity index 85% rename from spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ParentConfig2.java rename to spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig2.java index c38ba8e483..ddb59a5309 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/properties/parentchild/config/ParentConfig2.java +++ b/spring-boot-properties/src/test/java/com/baeldung/properties/parentchild/config/ParentConfig2.java @@ -1,11 +1,12 @@ -package org.baeldung.properties.parentchild.config; +package com.baeldung.properties.parentchild.config; -import org.baeldung.properties.parentchild.ParentValueHolder; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; +import com.baeldung.properties.parentchild.ParentValueHolder; + @Configuration public class ParentConfig2 { diff --git a/spring-boot-properties/src/test/java/org/baeldung/test/IntegrationTestSuite.java b/spring-boot-properties/src/test/java/com/baeldung/test/IntegrationTestSuite.java similarity index 59% rename from spring-boot-properties/src/test/java/org/baeldung/test/IntegrationTestSuite.java rename to spring-boot-properties/src/test/java/com/baeldung/test/IntegrationTestSuite.java index 470ae9e538..722c4fd1c4 100644 --- a/spring-boot-properties/src/test/java/org/baeldung/test/IntegrationTestSuite.java +++ b/spring-boot-properties/src/test/java/com/baeldung/test/IntegrationTestSuite.java @@ -1,15 +1,16 @@ -package org.baeldung.test; +package com.baeldung.test; -import org.baeldung.properties.basic.ExtendedPropertiesWithJavaIntegrationTest; -import org.baeldung.properties.basic.PropertiesWithMultipleXmlsIntegrationTest; -import org.baeldung.properties.basic.PropertiesWithXmlIntegrationTest; -import org.baeldung.properties.external.ExternalPropertiesWithJavaIntegrationTest; -import org.baeldung.properties.external.ExternalPropertiesWithMultipleXmlsIntegrationTest; -import org.baeldung.properties.external.ExternalPropertiesWithXmlManualTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; +import com.baeldung.properties.basic.ExtendedPropertiesWithJavaIntegrationTest; +import com.baeldung.properties.basic.PropertiesWithMultipleXmlsIntegrationTest; +import com.baeldung.properties.basic.PropertiesWithXmlIntegrationTest; +import com.baeldung.properties.external.ExternalPropertiesWithJavaIntegrationTest; +import com.baeldung.properties.external.ExternalPropertiesWithMultipleXmlsIntegrationTest; +import com.baeldung.properties.external.ExternalPropertiesWithXmlManualTest; + @RunWith(Suite.class) @SuiteClasses({ //@formatter:off PropertiesWithXmlIntegrationTest.class, diff --git a/spring-boot-properties/src/test/resources/application.properties b/spring-boot-properties/src/test/resources/application.properties index 6fc241a106..2e06fad574 100644 --- a/spring-boot-properties/src/test/resources/application.properties +++ b/spring-boot-properties/src/test/resources/application.properties @@ -1,3 +1,4 @@ management.endpoints.web.exposure.include=refresh spring.properties.refreshDelay=1000 -spring.config.location=file:extra.properties \ No newline at end of file +spring.config.location=file:extra.properties +spring.main.allow-bean-definition-overriding=true \ No newline at end of file