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