DATACMNS-1199 - Added PropertyPath.nested(…).
This allows to obtain a nested property path based on a currently available one.
This commit is contained in:
@@ -355,6 +355,20 @@ public class PropertyPathUnitTests {
|
||||
assertThat(from("user.name", Bar.class).getLeafType()).isEqualTo(String.class);
|
||||
}
|
||||
|
||||
@Test // DATACMNS-1199
|
||||
public void createsNestedPropertyPath() {
|
||||
assertThat(from("user", Bar.class).nested("name")).isEqualTo(from("user.name", Bar.class));
|
||||
}
|
||||
|
||||
@Test // DATACMNS-1199
|
||||
public void rejectsNonExistantNestedPath() {
|
||||
|
||||
assertThatExceptionOfType(PropertyReferenceException.class) //
|
||||
.isThrownBy(() -> from("user", Bar.class).nested("nonexistant")) //
|
||||
.withMessageContaining("nonexistant") //
|
||||
.withMessageContaining("Bar.user");
|
||||
}
|
||||
|
||||
private class Foo {
|
||||
|
||||
String userName;
|
||||
|
||||
Reference in New Issue
Block a user