From 07496aa1e43f92de6f50381f9558bdb432571154 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Thu, 11 Jun 2026 11:50:27 +0000
Subject: [PATCH] Fix `BasicRequestsTest.testReadSelectPartial` for nesting-preserving field projection (#650)
---
opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/BasicRequestsTest.java | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/BasicRequestsTest.java b/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/BasicRequestsTest.java
index cb1bab0..fa93ea4 100644
--- a/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/BasicRequestsTest.java
+++ b/opendj-rest2ldap/src/test/java/org/forgerock/opendj/rest2ldap/BasicRequestsTest.java
@@ -13,6 +13,7 @@
*
* Copyright 2013-2016 ForgeRock AS.
* Portions Copyright 2017 Rosie Applications, Inc.
+ * Portions Copyright 2026 3A Systems, LLC
*/
package org.forgerock.opendj.rest2ldap;
@@ -805,8 +806,12 @@
assertThat(resource.getId()).isEqualTo("test1");
assertThat(resource.getRevision()).isEqualTo("12345");
assertThat(resource.getContent().get("_id").asString()).isNull();
- assertThat(resource.getContent().get("name").asMap()).isNull();
- assertThat(resource.getContent().get("surname").asString()).isEqualTo("user 1");
+ // The nested structure of the requested field is now preserved: the
+ // projected "/name/surname" is returned as { "name": { "surname": ... } }
+ // instead of being collapsed to a top-level "surname" field.
+ assertThat(resource.getContent().get("name").asMap()).isNotNull();
+ assertThat(resource.getContent().get("name").get("surname").asString()).isEqualTo("user 1");
+ assertThat(resource.getContent().get("surname").asString()).isNull();
assertThat(resource.getContent().get("_rev").asString()).isNull();
}
--
Gitblit v1.10.0