systemPropertiesOverride -> overrideSystemProperties

This commit is contained in:
Dave Syer
2015-01-17 15:11:47 +00:00
parent a0c9ae3ff0
commit 048bc6a9a7
3 changed files with 8 additions and 8 deletions

View File

@@ -101,7 +101,7 @@ public class PropertySourceBootstrapConfiguration implements
new RelaxedDataBinder(remoteProperties, "spring.cloud.config").bind(new PropertySourcesPropertyValues(
incoming));
if (!remoteProperties.isAllowOverride()
|| remoteProperties.isSystemPropertiesOverride()) {
|| remoteProperties.isOverrideSystemProperties()) {
propertySources.addFirst(composite);
return;
}

View File

@@ -9,7 +9,7 @@ public class PropertySourceBootstrapProperties {
* Flag to indicate that the external properties should override system properties.
* Default true.
*/
private boolean systemPropertiesOverride = true;
private boolean overrideSystemProperties = true;
/**
* Flag to indicate that {@link #isSystemPropertiesOverride()
@@ -18,12 +18,12 @@ public class PropertySourceBootstrapProperties {
*/
private boolean allowOverride = true;
public boolean isSystemPropertiesOverride() {
return systemPropertiesOverride;
public boolean isOverrideSystemProperties() {
return overrideSystemProperties;
}
public void setSystemPropertiesOverride(boolean systemPropertiesOverride) {
this.systemPropertiesOverride = systemPropertiesOverride;
public void setOverrideSystemProperties(boolean overrideSystemProperties) {
this.overrideSystemProperties = overrideSystemProperties;
}
public boolean isAllowOverride() {

View File

@@ -122,7 +122,7 @@ public class BootstrapConfigurationTests {
public void systemPropertyOverrideFalse() {
PropertySourceConfiguration.MAP.put("bootstrap.foo", "bar");
PropertySourceConfiguration.MAP.put(
"spring.cloud.config.systemPropertiesOverride", "false");
"spring.cloud.config.overrideSystemProperties", "false");
System.setProperty("bootstrap.foo", "system");
context = new SpringApplicationBuilder().web(false)
.sources(BareConfiguration.class).run();
@@ -133,7 +133,7 @@ public class BootstrapConfigurationTests {
public void systemPropertyOverrideWhenOverrideDisallowed() {
PropertySourceConfiguration.MAP.put("bootstrap.foo", "bar");
PropertySourceConfiguration.MAP.put(
"spring.cloud.config.systemPropertiesOverride", "false");
"spring.cloud.config.overrideSystemProperties", "false");
// If spring.cloud.config.allowOverride=false is in the remote property sources
// with sufficiently high priority it always wins. Admins can enforce it by adding
// their own remote property source.