This is an automated email from the ASF dual-hosted git repository.

reschke pushed a commit to branch SLING-12884
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourceresolver.git


The following commit(s) were added to refs/heads/SLING-12884 by this push:
     new 4122b344 SLING-12884: refactor mocking in AliasMapEntriesTest - 
improve support for multiple children
4122b344 is described below

commit 4122b3447eebf95380f8aaffa79949c15caf9df1
Author: Julian Reschke <[email protected]>
AuthorDate: Wed Aug 13 13:41:59 2025 +0100

    SLING-12884: refactor mocking in AliasMapEntriesTest - improve support for 
multiple children
---
 .../sling/resourceresolver/impl/mapping/AliasMapEntriesTest.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/src/test/java/org/apache/sling/resourceresolver/impl/mapping/AliasMapEntriesTest.java
 
b/src/test/java/org/apache/sling/resourceresolver/impl/mapping/AliasMapEntriesTest.java
index 685d8562..cfb399a5 100644
--- 
a/src/test/java/org/apache/sling/resourceresolver/impl/mapping/AliasMapEntriesTest.java
+++ 
b/src/test/java/org/apache/sling/resourceresolver/impl/mapping/AliasMapEntriesTest.java
@@ -1249,8 +1249,11 @@ public class AliasMapEntriesTest extends 
AbstractMappingMapEntriesTest {
 
     private void attachChildResource(Resource parent, Resource child) {
 
-        // TODO: support adding multiple children
-        when(parent.getChildren()).thenReturn(Set.of(child));
+        Set<Resource> newChildren = new HashSet<>();
+        parent.getChildren().forEach(newChildren::add);
+        newChildren.add(child);
+
+        when(parent.getChildren()).thenReturn(newChildren);
         when(parent.getChild(child.getName())).thenReturn(child);
 
         when(child.getParent()).thenReturn(parent);

Reply via email to