assertEquals(someKey2, someKey1.getKey());
assertEquals(1, someKey1.getKeys().size());
-
- assertThatThrownBy(() -> new PfTimestampKey((PfTimestampKey) null)).isInstanceOf(NullPointerException.class)
- .hasMessageMatching(CONCEPT_IS_NULL);
- assertThatThrownBy(() -> new PfTimestampKey(null, null, null)).isInstanceOf(NullPointerException.class)
- .hasMessageMatching(NAME_IS_NULL);
- assertThatThrownBy(() -> new PfTimestampKey("my-name", null, null)).isInstanceOf(NullPointerException.class)
- .hasMessageMatching(VERSION_IS_NULL);
- assertThatThrownBy(() -> new PfTimestampKey("my-name", VERSION001, null))
- .isInstanceOf(NullPointerException.class)
- .hasMessageMatching("^instant is marked .*on.*ull but is null$");
-
assertThatThrownBy(() -> someKey0.setName(null)).isInstanceOf(NullPointerException.class)
.hasMessageMatching(NAME_IS_NULL);
assertThatThrownBy(() -> someKey0.setVersion(null)).isInstanceOf(NullPointerException.class)
assertFalse(someKey4.isNullKey());
assertFalse(someKey1.isNullKey());
}
+
+ @Test
+ public void testTimestampKeyErrors() {
+ assertThatThrownBy(() -> new PfTimestampKey((PfTimestampKey) null)).isInstanceOf(NullPointerException.class)
+ .hasMessageMatching(CONCEPT_IS_NULL);
+ assertThatThrownBy(() -> new PfTimestampKey(null, null, null)).isInstanceOf(NullPointerException.class)
+ .hasMessageMatching(NAME_IS_NULL);
+ assertThatThrownBy(() -> new PfTimestampKey("my-name", null, null)).isInstanceOf(NullPointerException.class)
+ .hasMessageMatching(VERSION_IS_NULL);
+ assertThatThrownBy(() -> new PfTimestampKey("my-name", VERSION001, null))
+ .isInstanceOf(NullPointerException.class)
+ .hasMessageMatching("^instant is marked .*on.*ull but is null$");
+ }
}