#1103 java.lang.NullPointerException (#1104)

java.lang.NullPointerException while decrypting due to value is null and still looking for cipher string. #1103
This commit is contained in:
ramaiahkk
2018-08-06 12:51:43 -04:00
committed by Ryan Baxter
parent f0ea304a87
commit e380b83026
2 changed files with 15 additions and 2 deletions

View File

@@ -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()));
}
}