use of org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder in project syncope by apache.
the class SearchCondConverterTest method and.
@Test
public void and() {
String fiql = new UserFiqlSearchConditionBuilder().is("fullname").equalTo("*o*").and("fullname").equalTo("*i*").query();
assertEquals("fullname==*o*;fullname==*i*", fiql);
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%");
SearchCond andCond = SearchCond.getAndCond(SearchCond.getLeafCond(fullnameLeafCond1), SearchCond.getLeafCond(fullnameLeafCond2));
assertEquals(andCond, SearchCondConverter.convert(fiql));
}
use of org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder in project syncope by apache.
the class SearchCondConverterTest method privileges.
@Test
public void privileges() {
String fiql = new UserFiqlSearchConditionBuilder().withPrivileges("postMighty").query();
assertEquals(SpecialAttr.PRIVILEGES + "==postMighty", fiql);
PrivilegeCond privilegeCond = new PrivilegeCond();
privilegeCond.setPrivilege("postMighty");
SearchCond simpleCond = SearchCond.getLeafCond(privilegeCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
use of org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder in project syncope by apache.
the class SearchCondConverterTest method dynRealms.
@Test
public void dynRealms() {
String dynRealm = UUID.randomUUID().toString();
String fiql = new UserFiqlSearchConditionBuilder().inDynRealms(dynRealm).query();
assertEquals(SpecialAttr.DYNREALMS + "==" + dynRealm, fiql);
DynRealmCond dynRealmCond = new DynRealmCond();
dynRealmCond.setDynRealm(dynRealm);
SearchCond simpleCond = SearchCond.getLeafCond(dynRealmCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
use of org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder in project syncope by apache.
the class SearchCondConverterTest method issueSYNCOPE1223.
@Test
public void issueSYNCOPE1223() {
String fiql = new UserFiqlSearchConditionBuilder().is("ctype").equalTo("ou=sample%252Co=isp").query();
AttributeCond cond = new AttributeCond(AttributeCond.Type.EQ);
cond.setSchema("ctype");
cond.setExpression("ou=sample,o=isp");
assertEquals(SearchCond.getLeafCond(cond), SearchCondConverter.convert(fiql));
}
Aggregations