|
|
@ -78,17 +78,6 @@ public class EnvironmentDecryptApplicationInitializerTests { |
|
|
|
assertEquals("spam", context.getEnvironment().getProperty("foo")); |
|
|
|
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) |
|
|
|
@Test(expected = IllegalStateException.class) |
|
|
|
public void errorOnDecrypt() { |
|
|
|
public void errorOnDecrypt() { |
|
|
|
this.listener = new EnvironmentDecryptApplicationInitializer( |
|
|
|
this.listener = new EnvironmentDecryptApplicationInitializer( |
|
|
|