mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Merge branch '1.1.x'
This commit is contained in:
commit
fc9b160a72
@ -1 +0,0 @@
|
||||
/target
|
@ -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));
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user