Revert "Allow overriding encrypted properties with unencrypted properties (#459)"

This reverts commit 4a66435d38.
This commit is contained in:
Ryan Baxter
2019-02-14 17:09:28 -05:00
parent 8c4fe5626e
commit 5e52806440
2 changed files with 1 additions and 15 deletions

View File

@@ -199,13 +199,10 @@ public class EnvironmentDecryptApplicationInitializer implements
}
}
else if (COLLECTION_PROPERTY.matcher(key).matches()) {
// put non-encrypted properties so merging of index properties
// put non-ecrypted properties so merging of index properties
// happens correctly
otherCollectionProperties.put(key, value);
}
else {
overrides.remove(key);
}
}
}
// copy all indexed properties even if not encrypted

View File

@@ -78,17 +78,6 @@ public class EnvironmentDecryptApplicationInitializerTests {
assertEquals("spam", context.getEnvironment().getProperty("foo"));
}
@Test
public void propertySourcesOrderedCorrectlyWithUnencryptedOverrides() {
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext();
TestPropertyValues.of("foo: {cipher}bar").applyTo(context);
context.getEnvironment().getPropertySources()
.addFirst(new MapPropertySource("test_override",
Collections.<String, Object>singletonMap("foo", "spam")));
this.listener.initialize(context);
assertEquals("spam", context.getEnvironment().getProperty("foo"));
}
@Test(expected = IllegalStateException.class)
public void errorOnDecrypt() {
this.listener = new EnvironmentDecryptApplicationInitializer(