DATACMNS-1129 - A PartTree is now an empty iterable if no predicate is given.

This commit is contained in:
Oliver Gierke
2017-07-25 13:40:05 +02:00
parent 6c55d7e03b
commit 7960786083
2 changed files with 26 additions and 2 deletions

View File

@@ -589,6 +589,20 @@ public class PartTreeUnitTests {
assertType(asList("emptyIs"), SIMPLE_PROPERTY, "empty", 1, true);
}
@Test // DATACMNS-1129
public void emptyTreeDoesNotContainParts() {
PartTree tree = partTree("");
assertThat(tree).isEmpty();
assertThat(tree.hasPredicate()).isFalse();
tree = partTree("findByOrderByFirstname");
assertThat(tree).isEmpty();
assertThat(tree.hasPredicate()).isFalse();
}
private static void assertLimiting(String methodName, Class<?> entityType, boolean limiting, Integer maxResults) {
assertLimiting(methodName, entityType, limiting, maxResults, false);
}