use of com.yahoo.elide.core.filter.expression.FilterExpression in project elide by yahoo.
the class RSQLFilterDialectTest method testGlobalExpressionParsingWithComplexAttribute.
@Test
public void testGlobalExpressionParsingWithComplexAttribute() throws Exception {
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<>();
queryParams.add("filter", "homeAddress.street1==*State*");
FilterExpression expression = dialect.parseGlobalExpression("/author", queryParams, NO_VERSION);
assertEquals("author.homeAddress.street1 INFIX [State]", expression.toString());
}
use of com.yahoo.elide.core.filter.expression.FilterExpression in project elide by yahoo.
the class RSQLFilterDialectTest method testNotEqualOperator.
@Test
public void testNotEqualOperator() throws Exception {
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<>();
queryParams.add("filter", "title!=Hemingway");
FilterExpression expression = dialect.parseGlobalExpression("/book", queryParams, NO_VERSION);
assertEquals("NOT (book.title IN [Hemingway])", expression.toString());
}
use of com.yahoo.elide.core.filter.expression.FilterExpression in project elide by yahoo.
the class RSQLFilterDialectTest method testBetweenOperator.
@Test
public void testBetweenOperator() throws Exception {
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<>();
queryParams.add("filter", "(publishDate=notbetween=(5,10))");
FilterExpression expression = dialect.parseGlobalExpression("/book", queryParams, NO_VERSION);
assertEquals("book.publishDate NOTBETWEEN [5, 10]", expression.toString());
}
use of com.yahoo.elide.core.filter.expression.FilterExpression in project elide by yahoo.
the class RSQLFilterDialectTest method testInfixFilterOnPrimitiveIdField.
@Test
public void testInfixFilterOnPrimitiveIdField() throws ParseException {
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<>();
queryParams.add("filter", "id==*1*");
FilterExpression expression = dialect.parseGlobalExpression("/primitiveTypeId", queryParams, NO_VERSION);
assertEquals(expression.toString(), "primitiveId.primitiveId INFIX [1]");
}
use of com.yahoo.elide.core.filter.expression.FilterExpression in project elide by yahoo.
the class RSQLFilterDialectTest method testMemberOfToManyRelationship.
@Test
public void testMemberOfToManyRelationship() throws Exception {
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<>();
queryParams.add("filter", "authors.name=hasmember='0'");
FilterExpression expression = dialect.parseGlobalExpression("/book", queryParams, NO_VERSION);
assertEquals("book.authors.name HASMEMBER [0]", expression.toString());
}
Aggregations