use of org.apache.syncope.core.persistence.api.dao.search.SearchCond in project syncope by apache.
the class SearchCondConverterTest method resources.
@Test
public void resources() {
String fiql = new UserFiqlSearchConditionBuilder().hasResources("resource-ldap").query();
assertEquals(SpecialAttr.RESOURCES + "==resource-ldap", fiql);
ResourceCond resCond = new ResourceCond();
resCond.setResourceKey("resource-ldap");
SearchCond simpleCond = SearchCond.getLeafCond(resCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
use of org.apache.syncope.core.persistence.api.dao.search.SearchCond 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.core.persistence.api.dao.search.SearchCond 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.core.persistence.api.dao.search.SearchCond 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.core.persistence.api.dao.search.SearchCond in project syncope by apache.
the class SearchCondConverterTest method member.
@Test
public void member() {
String fiql = new GroupFiqlSearchConditionBuilder().withMembers("rossini").query();
assertEquals(SpecialAttr.MEMBER + "==rossini", fiql);
MemberCond mcond = new MemberCond();
mcond.setMember("rossini");
SearchCond simpleCond = SearchCond.getLeafCond(mcond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
Aggregations