From b90a7f0878b21af62a455114f1dfaebb8c3f68f3 Mon Sep 17 00:00:00 2001 From: Giuseppe Nespolino Date: Thu, 28 Dec 2023 10:39:20 +0100 Subject: [PATCH] test: added e2e test [DHIS2-16191] --- .../analytics/tei/TrackedEntityQueryTest.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/tei/TrackedEntityQueryTest.java b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/tei/TrackedEntityQueryTest.java index 8141515f9e98..360763720bbe 100644 --- a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/tei/TrackedEntityQueryTest.java +++ b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/tei/TrackedEntityQueryTest.java @@ -2889,4 +2889,33 @@ public void headerParamIncidentDate() { validateRow(response, 0, List.of("2022-01-01 12:05:00.0")); } + + @Test + public void headerParamOunameIsPresent() { + // Given + QueryParamsBuilder params = new QueryParamsBuilder().add("headers=IpHINAT79UW.ouname"); + + // When + ApiResponse response = analyticsTeiActions.query().get("nEenWmSyUEp", JSON, JSON, params); + + // Then + response + .validate() + .statusCode(200) + .body("rows", hasSize(equalTo(50))) + .body("height", equalTo(50)) + .body("width", equalTo(1)) + .body("headerWidth", equalTo(1)) + .body("headers", hasSize(equalTo(1))); + + validateHeader( + response, + 0, + "IpHINAT79UW.ouname", + "Enrollment Organisation unit name", + "TEXT", + "java.lang.String", + false, + true); + } }