use of com.hazelcast.query.impl.Indexes in project hazelcast by hazelcast.
the class NotPredicateTest method accept_whenNullPredicate_thenReturnItself.
@Test
public void accept_whenNullPredicate_thenReturnItself() {
Visitor mockVisitor = createPassthroughVisitor();
Indexes mockIndexes = mock(Indexes.class);
NotPredicate notPredicate = new NotPredicate(null);
NotPredicate result = (NotPredicate) notPredicate.accept(mockVisitor, mockIndexes);
assertThat(result, sameInstance(notPredicate));
}
use of com.hazelcast.query.impl.Indexes in project hazelcast by hazelcast.
the class NotPredicateTest method accept_whenPredicateChangedOnAccept_thenReturnAndNewNotPredicate.
@Test
public void accept_whenPredicateChangedOnAccept_thenReturnAndNewNotPredicate() {
Visitor mockVisitor = createPassthroughVisitor();
Indexes mockIndexes = mock(Indexes.class);
Predicate transformed = mock(Predicate.class);
Predicate predicate = createMockVisitablePredicate(transformed);
NotPredicate notPredicate = new NotPredicate(predicate);
NotPredicate result = (NotPredicate) notPredicate.accept(mockVisitor, mockIndexes);
assertThat(result, not(sameInstance(notPredicate)));
assertThat(result.predicate, equalTo(transformed));
}
Aggregations