use of org.opengis.filter.temporal.Before in project ddf by codice.
the class TestCswRecordMapperFilterVisitor method testVisitPropertyIsLessThanTemporal.
@Test
public void testVisitPropertyIsLessThanTemporal() {
Expression val = factory.literal(new Date());
PropertyIsLessThan filter = factory.less(created, val);
Object obj = visitor.visit(filter, null);
assertThat(obj, instanceOf(Before.class));
Before duplicate = (Before) obj;
assertThat(duplicate.getExpression1(), is(created));
assertThat(duplicate.getExpression2(), is(val));
}
use of org.opengis.filter.temporal.Before in project ddf by codice.
the class FilterBuilderTest method before.
@Test
public void before() {
FilterVisitor visitor = spy(new DefaultFilterVisitor() {
});
FilterBuilder builder = new GeotoolsFilterBuilder();
Filter filter = builder.attribute(FOO_ATTRIBUTE).before().date(new Date());
filter.accept(visitor, null);
filter = builder.attribute(FOO_ATTRIBUTE).is().before().date(new Date());
filter.accept(visitor, null);
InOrder inOrder = inOrder(visitor);
inOrder.verify(visitor, times(2)).visit(isA(Before.class), anyObject());
}
Aggregations