Test that NoDuplicatesProperties throws for null value
This commit adds a test that NoDuplicatesProperties throws a NullPointerException if an attempt is made to put a key that corresponds to a null value. This behavior ultimately comes from the super class Properties but the test ensures that we retain this behavior.
This commit is contained in:
parent
cf92151513
commit
ca5e48d39a
|
@ -49,4 +49,9 @@ public class PropertiesSettingsLoaderTests extends ESTestCase {
|
|||
assertEquals(e.getMessage(), "duplicate settings key [foo] found, previous value [bar], current value [baz]");
|
||||
}
|
||||
|
||||
public void testThatNoDuplicatesPropertiesDoesNotAcceptNullValues() {
|
||||
PropertiesSettingsLoader.NoDuplicatesProperties properties = loader.new NoDuplicatesProperties();
|
||||
expectThrows(NullPointerException.class, () -> properties.put("key", null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue