use of org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder in project syncope by apache.
the class SearchCondConverterTest method ilike.
@Test
public void ilike() {
String fiql = new UserFiqlSearchConditionBuilder().is("username").equalToIgnoreCase("ros*").query();
assertEquals("username=~ros*", fiql);
AttributeCond attrCond = new AnyCond(AttributeCond.Type.ILIKE);
attrCond.setSchema("username");
attrCond.setExpression("ros%");
SearchCond simpleCond = SearchCond.getLeafCond(attrCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
use of org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder in project syncope by apache.
the class SearchCondConverterTest method ieq.
@Test
public void ieq() {
String fiql = new UserFiqlSearchConditionBuilder().is("username").equalToIgnoreCase("rossini").query();
assertEquals("username=~rossini", fiql);
AnyCond attrCond = new AnyCond(AttributeCond.Type.IEQ);
attrCond.setSchema("username");
attrCond.setExpression("rossini");
SearchCond simpleCond = SearchCond.getLeafCond(attrCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
use of org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder in project syncope by apache.
the class SearchCondConverterTest method eq.
@Test
public void eq() {
String fiql = new UserFiqlSearchConditionBuilder().is("username").equalTo("rossini").query();
assertEquals("username==rossini", fiql);
AnyCond attrCond = new AnyCond(AttributeCond.Type.EQ);
attrCond.setSchema("username");
attrCond.setExpression("rossini");
SearchCond simpleCond = SearchCond.getLeafCond(attrCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
use of org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder in project syncope by apache.
the class SearchCondConverterTest method relationships.
@Test
public void relationships() {
String fiql = new UserFiqlSearchConditionBuilder().inRelationships("ca20ffca-1305-442f-be9a-3723a0cd88ca").query();
assertEquals(SpecialAttr.RELATIONSHIPS + "==ca20ffca-1305-442f-be9a-3723a0cd88ca", fiql);
RelationshipCond relationshipCond = new RelationshipCond();
relationshipCond.setAnyObject("ca20ffca-1305-442f-be9a-3723a0cd88ca");
SearchCond simpleCond = SearchCond.getLeafCond(relationshipCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
use of org.apache.syncope.common.lib.search.UserFiqlSearchConditionBuilder in project syncope by apache.
the class SearchCondConverterTest method like.
@Test
public void like() {
String fiql = new UserFiqlSearchConditionBuilder().is("username").equalTo("ros*").query();
assertEquals("username==ros*", fiql);
AttributeCond attrCond = new AnyCond(AttributeCond.Type.LIKE);
attrCond.setSchema("username");
attrCond.setExpression("ros%");
SearchCond simpleCond = SearchCond.getLeafCond(attrCond);
assertEquals(simpleCond, SearchCondConverter.convert(fiql));
}
Aggregations