assertEquals(2, matchingUsers.size());
}
@Test
public void searchById() {
SyncopeUserCond idLeafCond = new SyncopeUserCond(SyncopeUserCond.Type.LT);
idLeafCond.setSchema("id");
idLeafCond.setExpression("2");
NodeCond searchCondition = NodeCond.getLeafCond(idLeafCond);
assertTrue(searchCondition.checkValidity());
List<SyncopeUser> matchingUsers =
searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), searchCondition);
assertNotNull(matchingUsers);
assertEquals(1, matchingUsers.size());
assertEquals(1L, matchingUsers.iterator().next().getId().longValue());
idLeafCond = new SyncopeUserCond(SyncopeUserCond.Type.LT);
idLeafCond.setSchema("id");
idLeafCond.setExpression("4");
searchCondition = NodeCond.getNotLeafCond(idLeafCond);
assertTrue(searchCondition.checkValidity());
matchingUsers = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()), searchCondition);