use of org.apache.cxf.jaxrs.ext.search.SearchCondition in project cxf by apache.
the class FiqlParserTest method testParseLocalDateTimeWithDefaultFormat.
@Test
public void testParseLocalDateTimeWithDefaultFormat() throws SearchParseException, ParseException {
SearchCondition<Condition> filter = parser.parse("localDateTime=le=2010-03-11T18:00:00");
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
assertTrue(filter.isMet(new Condition("whatever", 15, null, LocalDateTime.parse("2010-03-11T18:00:00", df))));
assertTrue(filter.isMet(new Condition(null, null, null, LocalDateTime.parse("2010-03-10T22:22:00", df))));
assertFalse(filter.isMet(new Condition("blah", null, null, LocalDateTime.parse("2010-03-12T00:00:00", df))));
assertFalse(filter.isMet(new Condition(null, 123, null, LocalDateTime.parse("2010-03-12T00:00:00", df))));
}
Aggregations