Limit when SystemEnvironment mapping is used
Update `SpringConfigurationPropertySource` so that the `SystemEnvironmentPropertyMapper` is only used for the "actual" system environment property source. This allows SystemEnvironmentProperySource class to be used for other purposes (for example, Spring Cloud uses it to as an override source providing decryption). Only property sources named `systemEnvironment` or ending with `-systemEnvironment` now have the `SystemEnvironmentPropertyMapper` applied. The `TestPropertyValues` has been retrofitted to name the source it adds appropriately. Fixes gh-10840
This commit is contained in:
@@ -57,7 +57,7 @@ public class EnvironmentInfoContributorTests {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void propertiesFromEnvironmentShouldBindCorrectly() throws Exception {
|
||||
TestPropertyValues.of("INFO_ENVIRONMENT_FOO=green").applyTo(this.environment,
|
||||
Type.SYSTEM);
|
||||
Type.SYSTEM_ENVIRONMENT);
|
||||
Info actual = contributeFrom(this.environment);
|
||||
assertThat(actual.get("environment", Map.class)).containsEntry("foo", "green");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user