DATACMNS-867 - ReflectionEntityInformation getId(Object) considers potential null values.
This commit is contained in:
committed by
Oliver Gierke
parent
6e0596694d
commit
bab5ddade9
@@ -57,6 +57,11 @@ public class ReflectionEntityInformationUnitTests {
|
||||
assertThat(information.isNew(primitiveId)).isFalse();
|
||||
}
|
||||
|
||||
@Test // DATACMNS-867
|
||||
public void detectsNewStateForEntityWithNullId() {
|
||||
assertThat(new ReflectionEntityInformation<>(Sample.class).isNew(new Sample())).isTrue();
|
||||
}
|
||||
|
||||
private static <T> EntityInformation<T, Serializable> getEntityInformation(Class<T> type) {
|
||||
return new ReflectionEntityInformation<T, Serializable>(type, Id.class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user