DATAJPA-716 - Strengthened tests for updatability detection in JpaPersistentProperty.

Added negative check, too, and tweaked implementation to actually correctly detect the updatability.
This commit is contained in:
Oliver Gierke
2015-05-19 13:47:17 +02:00
parent 886120ebe8
commit f092c4edf8
2 changed files with 5 additions and 3 deletions

View File

@@ -188,6 +188,7 @@ public class JpaPersistentPropertyImplUnitTests {
@Test
public void considersNonUpdateablePropertyNotWriteable() {
assertThat(getProperty(WithReadOnly.class, "name").isWritable(), is(false));
assertThat(getProperty(WithReadOnly.class, "updatable").isWritable(), is(true));
}
private JpaPersistentProperty getProperty(Class<?> ownerType, String propertyName) {
@@ -311,5 +312,6 @@ public class JpaPersistentPropertyImplUnitTests {
static class WithReadOnly {
@Column(updatable = false) String name;
String updatable;
}
}