}
@Test
public void paginatedSearch() {
// LIKE
AttributeCond fullnameLeafCond1 = new AttributeCond(AttributeCond.Type.LIKE);
fullnameLeafCond1.setSchema("fullname");
fullnameLeafCond1.setExpression("%o%");
AttributeCond fullnameLeafCond2 = new AttributeCond(AttributeCond.Type.LIKE);
fullnameLeafCond2.setSchema("fullname");
fullnameLeafCond2.setExpression("%i%");
NodeCond searchCondition = NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond1), NodeCond.getLeafCond(
fullnameLeafCond2));
assertTrue(searchCondition.checkValidity());
List<UserTO> matchedUsers = Arrays.asList(restTemplate.postForObject(BASE_URL + "user/search/{page}/{size}",
searchCondition, UserTO[].class, 1, 2));
assertNotNull(matchedUsers);
assertFalse(matchedUsers.isEmpty());
for (UserTO user : matchedUsers) {
assertNotNull(user);
}
// ISNULL
AttributeCond isNullCond = new AttributeCond(AttributeCond.Type.ISNULL);
isNullCond.setSchema("loginDate");
searchCondition = NodeCond.getLeafCond(isNullCond);
matchedUsers = Arrays.asList(restTemplate.postForObject(BASE_URL + "user/search/{page}/{size}",
searchCondition, UserTO[].class, 1, 2));