From fc3202f201a0ea4ea2a2e0dbf3dd4705e079a4a2 Mon Sep 17 00:00:00 2001 From: Holger Hagen <19706592+holgerhagen@users.noreply.github.com> Date: Tue, 26 Oct 2021 11:43:01 +0200 Subject: [PATCH] TSK-1758: fixed state and domain filter in Reporting REST API. --- .../TimeIntervalReportFilterParameter.java | 4 ++-- .../rest/MonitorControllerIntTest.java | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/TimeIntervalReportFilterParameter.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/TimeIntervalReportFilterParameter.java index 8a06c7e59..7e98643b6 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/TimeIntervalReportFilterParameter.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/monitor/rest/TimeIntervalReportFilterParameter.java @@ -308,9 +308,9 @@ public class TimeIntervalReportFilterParameter @ConstructorProperties({ "in-working-days", "workbasket-id", - "states", + "state", "classification-category", - "domains", + "domain", "classification-id", "excluded-classification-id", "custom-1", diff --git a/rest/taskana-rest-spring/src/test/java/pro/taskana/monitor/rest/MonitorControllerIntTest.java b/rest/taskana-rest-spring/src/test/java/pro/taskana/monitor/rest/MonitorControllerIntTest.java index 8c88f940a..287150098 100644 --- a/rest/taskana-rest-spring/src/test/java/pro/taskana/monitor/rest/MonitorControllerIntTest.java +++ b/rest/taskana-rest-spring/src/test/java/pro/taskana/monitor/rest/MonitorControllerIntTest.java @@ -111,6 +111,30 @@ class MonitorControllerIntTest { .containsExactly(new int[] {0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0}); } + @Test + void should_ApplyStateFilterAndComputeReport_When_QueryingForAWorkbasketReport() { + String url = + restHelper.toUrl(RestEndpoints.URL_MONITOR_WORKBASKET_REPORT) + + "?workbasket-id=WBI:100000000000000000000000000000000008" + + "&state=READY" + + "&state=CLAIMED"; + HttpEntity auth = new HttpEntity<>(RestHelper.generateHeadersForUser("monitor")); + + ResponseEntity response = + TEMPLATE.exchange( + url, + HttpMethod.GET, + auth, + ParameterizedTypeReference.forType(ReportRepresentationModel.class)); + + ReportRepresentationModel report = response.getBody(); + assertThat(report).isNotNull(); + assertThat(report.getSumRow()) + .extracting(RowRepresentationModel::getCells) + // expecting 4 tasks due tomorrow (RELATIVE_DATE(1)) + .containsExactly(new int[] {0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0}); + } + @Test void should_ComputeWorkbasketPriorityReport_When_QueryingForAWorkbasketPriorityReport() { String url =