diff --git a/spring-context/src/test/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurerTests.java b/spring-context/src/test/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurerTests.java index f8f13285c80..9da942c3ed4 100644 --- a/spring-context/src/test/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurerTests.java +++ b/spring-context/src/test/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurerTests.java @@ -265,4 +265,23 @@ public class PropertySourcesPlaceholderConfigurerTests { thrown.expect(IllegalStateException.class); ppc.getAppliedPropertySources(); } + + @Test + public void multipleLocationsWithDefaultResolvedValue() throws Exception { + // SPR-10619 + PropertySourcesPlaceholderConfigurer ppc = new PropertySourcesPlaceholderConfigurer(); + ClassPathResource doesNotHave = new ClassPathResource("test.properties", getClass()); + ClassPathResource setToTrue = new ClassPathResource("placeholder.properties", getClass()); + ppc.setLocations(new Resource[] { doesNotHave, setToTrue }); + ppc.setIgnoreResourceNotFound(true); + ppc.setIgnoreUnresolvablePlaceholders(true); + DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); + bf.registerBeanDefinition("testBean", + genericBeanDefinition(TestBean.class) + .addPropertyValue("jedi", "${jedi:false}") + .getBeanDefinition()); + ppc.postProcessBeanFactory(bf); + assertThat(bf.getBean(TestBean.class).isJedi(), equalTo(true)); + } + } diff --git a/spring-context/src/test/java/org/springframework/context/support/placeholder.properties b/spring-context/src/test/java/org/springframework/context/support/placeholder.properties index 6c9d0976218..11f0d7f0306 100644 --- a/spring-context/src/test/java/org/springframework/context/support/placeholder.properties +++ b/spring-context/src/test/java/org/springframework/context/support/placeholder.properties @@ -1,3 +1,4 @@ targetName=wrappedAssemblerOne logicName=logicTwo realLogicName=realLogic +jedi=true