joerghoh commented on code in PR #189:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/189#discussion_r2273568820


##########
src/test/java/org/apache/sling/resourceresolver/impl/mapping/AliasMapEntriesTest.java:
##########
@@ -511,16 +512,20 @@ public void 
test_doRemoveAttributesWithDisableAliasOptimization() throws Excepti
         Resource parent = createMockedResource("/parent");
         Resource result = createMockedResource("/parent/child");
 
-        // TODO: using attachChildResource causes the test to fail
-        // attachChildResource(parent, result);
+        attachChildResource(parent, result);
 
-        when(result.getParent()).thenReturn(parent);
         
when(result.getValueMap()).thenReturn(buildValueMap(ResourceResolverImpl.PROP_ALIAS,
 "alias"));
 
+        Map<String, Collection<String>> aliasMapBefore = 
mapEntries.getAliasMap("/parent");
+        assertEquals(1, aliasMapBefore.size());
+
+        // this simulates a remove event, but that is immaterial here as there 
is no cache anyway
         removeAlias(mapEntries, resourceResolver, "/parent", "/parent/child", 
NOOP);
 
-        Map<String, Collection<String>> aliasMap = 
mapEntries.getAliasMap("/parent");
-        assertEquals(Collections.emptyMap(), aliasMap);
+        Map<String, Collection<String>> aliasMapAfter = 
mapEntries.getAliasMap("/parent");
+        assertEquals(1, aliasMapAfter.size());

Review Comment:
   same as above



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to