java.lang.NullPointerException while decrypting due to value is null and still looking for cipher string. #1103
This commit is contained in:
@@ -90,5 +90,18 @@ public class CipherEnvironmentEncryptorTests {
|
||||
assertEquals(secret, this.encryptor.decrypt(environment).getPropertySources()
|
||||
.get(0).getSource().get(environment.getName()));
|
||||
}
|
||||
@Test
|
||||
public void shouldBeAbleToUseNullAsPropertyValue() {
|
||||
|
||||
// when
|
||||
Environment environment = new Environment("name", "profile", "label");
|
||||
environment.add(new PropertySource("a",
|
||||
Collections.<Object, Object>singletonMap(environment.getName(),
|
||||
null)));
|
||||
|
||||
// then
|
||||
assertEquals(null, this.encryptor.decrypt(environment).getPropertySources()
|
||||
.get(0).getSource().get(environment.getName()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user