use of de.metas.handlingunits.trace.HUTraceEventQuery in project metasfresh-webui-api by metasfresh.
the class DocumentFilterToHuTraceQueryTest method createTraceQueryFromDocumentFilter_eventdate.
@Test
public void createTraceQueryFromDocumentFilter_eventdate() {
final Date date = TimeUtil.parseTimestamp("2017-10-13");
final Date dateTo = TimeUtil.parseTimestamp("2017-10-15");
final DocumentFilter filter = DocumentFilter.builder().setFilterId("filter").addParameter(createEventTimeBetweenParameter(date, dateTo)).build();
final HUTraceEventQuery huTraceQuery = HuTraceQueryCreator.createTraceQueryFromDocumentFilter(filter);
assertThat(huTraceQuery.getRecursionMode()).isEqualTo(RecursionMode.BOTH);
assertThat(huTraceQuery.getEventTime()).isEqualTo(date.toInstant());
assertThat(huTraceQuery.getEventTimeOperator()).isEqualTo(EventTimeOperator.BETWEEN);
assertThat(huTraceQuery.getEventTimeTo()).isEqualTo(dateTo.toInstant());
}
Aggregations