Search in sources :

Example 6 with HUTraceEventQuery

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());
}
Also used : HUTraceEventQuery(de.metas.handlingunits.trace.HUTraceEventQuery) DocumentFilter(de.metas.ui.web.document.filter.DocumentFilter) Date(java.util.Date) Test(org.junit.Test)

Aggregations

HUTraceEventQuery (de.metas.handlingunits.trace.HUTraceEventQuery)6 DocumentFilter (de.metas.ui.web.document.filter.DocumentFilter)4 Test (org.junit.Test)4 DocumentFilterParam (de.metas.ui.web.document.filter.DocumentFilterParam)1 Date (java.util.Date)1 AdempiereException (org.adempiere.exceptions.AdempiereException)1