TSK-1758: fixed state and domain filter in Reporting REST API.

This commit is contained in:
Holger Hagen 2021-10-26 11:43:01 +02:00 committed by holgerhagen
parent e3edb45d67
commit fc3202f201
2 changed files with 26 additions and 2 deletions

View File

@ -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",

View File

@ -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<ReportRepresentationModel> 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 =