You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by re...@apache.org on 2025/08/14 14:23:54 UTC

(sling-org-apache-sling-resourceresolver) branch SLING-12888 updated: SLING-12888: Parametrize AliasMapEntriesTest for optimized/non-optimized testing - fix test conditions for the two tests specific to the non-optimized case - more cleanup

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

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


The following commit(s) were added to refs/heads/SLING-12888 by this push:
     new 44a3b960 SLING-12888: Parametrize AliasMapEntriesTest for optimized/non-optimized testing - fix test conditions for the two tests specific to the non-optimized case - more cleanup
44a3b960 is described below

commit 44a3b960362fc2f5b1d6dad978e8ad0f01a5dac3
Author: Julian Reschke <re...@apache.org>
AuthorDate: Thu Aug 14 15:23:40 2025 +0100

    SLING-12888: Parametrize AliasMapEntriesTest for optimized/non-optimized testing - fix test conditions for the two tests specific to the non-optimized case - more cleanup
---
 .../impl/mapping/AliasMapEntriesTest.java             | 19 -------------------
 1 file changed, 19 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 9aff9f43..08597bd1 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
@@ -687,7 +687,6 @@ public class AliasMapEntriesTest extends AbstractMappingMapEntriesTest {
 
         when(jcrContentResult.getValueMap())
                 .thenReturn(buildValueMap(ResourceResolverImpl.PROP_ALIAS, "aliasJcrContent"));
-        when(result.getChild("jcr:content")).thenReturn(jcrContentResult);
 
         updateResource(mapEntries, "/parent/child/jcr:content", new AtomicBoolean());
 
@@ -1111,19 +1110,11 @@ public class AliasMapEntriesTest extends AbstractMappingMapEntriesTest {
         assertEquals(0, aliasMap.size());
 
         Resource parent = createMockedResource("/parent");
-
-        when(parent.getValueMap()).thenReturn(buildValueMap());
-
         Resource child1 = createMockedResource(parent, "child1");
-
-        when(child1.getValueMap()).thenReturn(buildValueMap());
-
         Resource child1JcrContent = createMockedResource(child1, "jcr:content");
 
         when(child1JcrContent.getValueMap()).thenReturn(buildValueMap(ResourceResolverImpl.PROP_ALIAS, "test1"));
 
-        when(parent.getChild("child1")).thenReturn(child1);
-
         addResource(mapEntries, child1JcrContent.getPath(), new AtomicBoolean());
 
         Map<String, Collection<String>> aliasMapEntry = mapEntries.getAliasMap("/parent");
@@ -1134,15 +1125,9 @@ public class AliasMapEntriesTest extends AbstractMappingMapEntriesTest {
         assertEquals(1, aliasMap.size());
 
         Resource child2 = createMockedResource(parent, "child2");
-
-        when(child2.getValueMap()).thenReturn(buildValueMap());
-
         Resource child2JcrContent = createMockedResource(child2, "jcr:content");
 
         when(child2JcrContent.getValueMap()).thenReturn(buildValueMap(ResourceResolverImpl.PROP_ALIAS, "test2"));
-        when(child2.getChild("jcr:content")).thenReturn(child2JcrContent);
-
-        when(parent.getChild("child2")).thenReturn(child2);
 
         addResource(mapEntries, child2JcrContent.getPath(), new AtomicBoolean());
 
@@ -1158,8 +1143,6 @@ public class AliasMapEntriesTest extends AbstractMappingMapEntriesTest {
 
         Resource child2JcrContentChild = createMockedResource(child2, "test");
 
-        when(child2JcrContent.getChild("test")).thenReturn(child2JcrContentChild);
-
         removeResource(mapEntries, child2JcrContentChild.getPath(), new AtomicBoolean());
 
         aliasMapEntry = mapEntries.getAliasMap("/parent");
@@ -1191,9 +1174,7 @@ public class AliasMapEntriesTest extends AbstractMappingMapEntriesTest {
         aliasMapEntry = mapEntries.getAliasMap("/parent");
         assertEquals(Collections.emptyMap(), aliasMapEntry);
 
-        when(child1.getChild("jcr:content")).thenReturn(child1JcrContent);
         addResource(mapEntries, child1JcrContent.getPath(), new AtomicBoolean());
-        when(child2.getChild("jcr:content")).thenReturn(child2JcrContent);
         addResource(mapEntries, child2JcrContent.getPath(), new AtomicBoolean());
 
         aliasMapEntry = mapEntries.getAliasMap("/parent");