use of com.yahoo.elide.core.filter.predicates.IsNullPredicate in project elide by yahoo.
the class InMemoryFilterExecutorTest method isnullAndNotnullPredicateTest.
@Test
public void isnullAndNotnullPredicateTest() throws Exception {
author = new Author();
author.setId(1L);
author.setName("AuthorForTest");
// When name is not null
expression = new IsNullPredicate(authorNameElement);
fn = expression.accept(visitor);
assertFalse(fn.test(author));
expression = new NotNullPredicate(authorNameElement);
fn = expression.accept(visitor);
assertTrue(fn.test(author));
// When name is null
author.setName(null);
expression = new IsNullPredicate(authorNameElement);
fn = expression.accept(visitor);
assertTrue(fn.test(author));
expression = new NotNullPredicate(authorNameElement);
fn = expression.accept(visitor);
assertFalse(fn.test(author));
}
Aggregations