From 06c7b899c5e4b7c289b2c806637a18d56f5af316 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 10:53:49 +0000 Subject: [PATCH 1/4] chore(deps): bump org.hisp.dhis:json-tree in /dhis-2/dhis-test-e2e Bumps [org.hisp.dhis:json-tree](https://github.com/dhis2/json-tree) from 1.8.1 to 1.9.4. - [Release notes](https://github.com/dhis2/json-tree/releases) - [Changelog](https://github.com/dhis2/json-tree/blob/main/CHANGELOG.md) - [Commits](https://github.com/dhis2/json-tree/compare/v1.8.1...v1.9.4) --- updated-dependencies: - dependency-name: org.hisp.dhis:json-tree dependency-version: 1.9.4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dhis-2/dhis-test-e2e/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhis-2/dhis-test-e2e/pom.xml b/dhis-2/dhis-test-e2e/pom.xml index 7e48d08178c0..9a233710b370 100644 --- a/dhis-2/dhis-test-e2e/pom.xml +++ b/dhis-2/dhis-test-e2e/pom.xml @@ -20,7 +20,7 @@ 2.21.3 2.21 33.6.0-jre - 1.8.1 + 1.9.4 1.0.2 5.12.0 1.0.12 From 7a648cd83c3b92661967db240dd6901707a20d6f Mon Sep 17 00:00:00 2001 From: Stian Sandvold Date: Sun, 31 May 2026 07:31:33 +0200 Subject: [PATCH 2/4] fix: adapt JsonValueSerializer usage to json-tree 1.9.x API json-tree 1.9.x removed JsonTypedAccess; the default global accessors are now applied by the single-arg JsonMixed.of(content). Drop the obsolete JsonTypedAccess.GLOBAL argument and import so dhis-test-e2e compiles at 1.9.4. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/main/java/org/hisp/dhis/dto/ApiResponse.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/dto/ApiResponse.java b/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/dto/ApiResponse.java index 0a19c1bef0b8..c992619c9651 100644 --- a/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/dto/ApiResponse.java +++ b/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/dto/ApiResponse.java @@ -40,7 +40,6 @@ import org.hisp.dhis.helpers.JsonObjectBuilder; import org.hisp.dhis.jsontree.JsonMixed; import org.hisp.dhis.jsontree.JsonNode; -import org.hisp.dhis.jsontree.JsonTypedAccess; /** * @author Gintare Vilkelyte @@ -116,7 +115,7 @@ public JsonObjectBuilder getBodyAsJsonBuilder() { } public JsonMixed getBodyAsJsonValue() { - return JsonMixed.of(raw.asString(), JsonTypedAccess.GLOBAL); + return JsonMixed.of(raw.asString()); } public JsonNode getBodyAsJsonNode() { From 023c7fba034d5509a6bbc54c3896a47d96bf703d Mon Sep 17 00:00:00 2001 From: Stian Sandvold Date: Sun, 31 May 2026 09:06:17 +0200 Subject: [PATCH 3/4] fix: adapt e2e to json-tree 1.9.x runtime behaviour changes (2.41) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two 1.9.x behaviour changes broke api-test after the compile-only fix: 1. RelationshipsTests: JsonNode.getDeclaration() now returns Text (a CharSequence), not String. postAndGetJobReport(Object,..) hands it to REST-assured .body(), which sends a String raw but JSON-serializes any other object — so the Text became a malformed body and the expected E4015 'already exists' warning never returned. Call .toString(). 2. UserActions.addRoleToUser: json-tree 1.9.x rejects a property segment applied to an array node, so getArray("userRoles.id") now throws (ARRAY node .userRoles does not support #get(.id)). Map the ids across the userRoles array instead. Surfaced via UserAssignmentFilterTests, which exists only on 2.41. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/main/java/org/hisp/dhis/actions/UserActions.java | 6 ++++-- .../tracker/imports/relationships/RelationshipsTests.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/actions/UserActions.java b/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/actions/UserActions.java index cc9e786f32c3..de4c71595f4e 100644 --- a/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/actions/UserActions.java +++ b/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/actions/UserActions.java @@ -83,8 +83,10 @@ public void addRoleToUser(String userId, String userRoleId) { ApiResponse response = this.get(userId); if (response .getBodyAsJsonValue() - .getArray("userRoles.id") - .stringValues() + .getArray("userRoles") + .stream() + .map(role -> role.getString("id").string()) + .toList() .contains(userRoleId)) { return; } diff --git a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/tracker/imports/relationships/RelationshipsTests.java b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/tracker/imports/relationships/RelationshipsTests.java index 0afcd503b9e6..07f4b2a9606f 100644 --- a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/tracker/imports/relationships/RelationshipsTests.java +++ b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/tracker/imports/relationships/RelationshipsTests.java @@ -228,7 +228,7 @@ public void shouldNotUpdateRelationship() { // act trackerImportExportActions .postAndGetJobReport( - updatedRelationship.getDeclaration(), + updatedRelationship.getDeclaration().toString(), new QueryParamsBuilder().addAll("importStrategy=UPDATE")) .validateWarningReport() .body("warningCode", hasItems("E4015")) From 64b0d8fd5ac39aa8bec8c84e070f244a13f8e1dd Mon Sep 17 00:00:00 2001 From: Stian Sandvold Date: Sun, 31 May 2026 11:22:36 +0200 Subject: [PATCH 4/4] style: apply spotless formatting to UserActions Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/main/java/org/hisp/dhis/actions/UserActions.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/actions/UserActions.java b/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/actions/UserActions.java index de4c71595f4e..96687a56d4d9 100644 --- a/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/actions/UserActions.java +++ b/dhis-2/dhis-test-e2e/src/main/java/org/hisp/dhis/actions/UserActions.java @@ -81,10 +81,7 @@ public String addUserFull( public void addRoleToUser(String userId, String userRoleId) { ApiResponse response = this.get(userId); - if (response - .getBodyAsJsonValue() - .getArray("userRoles") - .stream() + if (response.getBodyAsJsonValue().getArray("userRoles").stream() .map(role -> role.getString("id").string()) .toList() .contains(userRoleId)) {