Search in sources :

Example 1 with GroupFiqlSearchConditionBuilder

use of org.apache.syncope.common.lib.search.GroupFiqlSearchConditionBuilder in project syncope by apache.

the class SearchCondConverterTest method assignable.

@Test
public void assignable() {
    String fiql = new GroupFiqlSearchConditionBuilder().isAssignable().query();
    assertEquals(SpecialAttr.ASSIGNABLE + "==" + SpecialAttr.NULL, fiql);
    AssignableCond assignableCond = new AssignableCond();
    assignableCond.setRealmFullPath("/even/two");
    SearchCond simpleCond = SearchCond.getLeafCond(assignableCond);
    assertEquals(simpleCond, SearchCondConverter.convert(fiql, "/even/two"));
}
Also used : AssignableCond(org.apache.syncope.core.persistence.api.dao.search.AssignableCond) GroupFiqlSearchConditionBuilder(org.apache.syncope.common.lib.search.GroupFiqlSearchConditionBuilder) SearchCond(org.apache.syncope.core.persistence.api.dao.search.SearchCond) Test(org.junit.jupiter.api.Test)

Example 2 with GroupFiqlSearchConditionBuilder

use of org.apache.syncope.common.lib.search.GroupFiqlSearchConditionBuilder 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));
}
Also used : GroupFiqlSearchConditionBuilder(org.apache.syncope.common.lib.search.GroupFiqlSearchConditionBuilder) MemberCond(org.apache.syncope.core.persistence.api.dao.search.MemberCond) SearchCond(org.apache.syncope.core.persistence.api.dao.search.SearchCond) Test(org.junit.jupiter.api.Test)

Aggregations

GroupFiqlSearchConditionBuilder (org.apache.syncope.common.lib.search.GroupFiqlSearchConditionBuilder)2 SearchCond (org.apache.syncope.core.persistence.api.dao.search.SearchCond)2 Test (org.junit.jupiter.api.Test)2 AssignableCond (org.apache.syncope.core.persistence.api.dao.search.AssignableCond)1 MemberCond (org.apache.syncope.core.persistence.api.dao.search.MemberCond)1