Merge branch '1.1.x'

This commit is contained in:
Dave Syer 2014-07-17 09:04:44 +01:00
commit fc9b160a72
3 changed files with 18 additions and 2 deletions

View File

@ -1 +0,0 @@
/target

View File

@ -100,7 +100,7 @@ public class PropertySourcesPropertyValues implements PropertyValues {
// that's better than nothing...
for (String propertyName : exacts) {
Object value;
value = source.getProperty(propertyName);
value = resolver.getProperty(propertyName);
if (value != null && !this.propertyValues.containsKey(propertyName)) {
this.propertyValues.put(propertyName, new PropertyValue(
propertyName, value));

View File

@ -73,6 +73,23 @@ public class PropertySourcesPropertyValuesTests {
assertEquals("bar", propertyValues.getPropertyValue("name").getValue());
}
@Test
public void testNonEnumeratedPlaceholder() {
this.propertySources.addFirst(new PropertySource<String>("another", "baz") {
@Override
public Object getProperty(String name) {
if (name.equals(getSource())) {
return "${foo}";
}
return null;
}
});
PropertySourcesPropertyValues propertyValues = new PropertySourcesPropertyValues(
this.propertySources, null, Collections.singleton("baz"));
assertEquals("bar", propertyValues.getPropertyValue("baz").getValue());
}
@Test
public void testOverriddenValue() {
this.propertySources.addFirst(new MapPropertySource("new", Collections