diff --git a/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapConfiguration.java b/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapConfiguration.java index 51e934b1..b79a2023 100644 --- a/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapConfiguration.java +++ b/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapConfiguration.java @@ -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; } diff --git a/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapProperties.java b/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapProperties.java index eaf9cfd0..cfe2692b 100644 --- a/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapProperties.java +++ b/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapProperties.java @@ -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() { diff --git a/spring-cloud-config-client/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java b/spring-cloud-config-client/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java index 1fbbb435..796e9cd3 100644 --- a/spring-cloud-config-client/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java +++ b/spring-cloud-config-client/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java @@ -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.