You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2021/05/28 13:40:10 UTC

[sling-org-apache-sling-resourceresolver] 01/01: SLING-10432 - regression: incorrect mapping result for aliased pages

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

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

commit cbfac0aeeb66aa4f3d1442976d7177e02bc141a3
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri May 28 15:39:31 2021 +0200

    SLING-10432 - regression: incorrect mapping result for aliased pages
    
    Add a failing test(ignored for now)
---
 .../impl/mapping/ResourceMapperImplTest.java             | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/test/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImplTest.java b/src/test/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImplTest.java
index a990eb2..9ae3c4f 100644
--- a/src/test/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImplTest.java
+++ b/src/test/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImplTest.java
@@ -47,6 +47,7 @@ import org.apache.sling.spi.resource.provider.ResourceProvider;
 import org.apache.sling.testing.mock.osgi.junit.OsgiContext;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -327,6 +328,21 @@ public class ResourceMapperImplTest {
             .verify(resolver, req);
     }
 
+    /**
+     * Validates that the mapping for a non-existing resource that is the target of an alias
+     * is the alias itself
+     */
+    @Test
+    @Ignore("SLING-10432")
+    public void mapAliasTarget() {
+        ExpectedMappings.nonExistingResource("/alias-value")
+            .singleMapping("/alias-value")
+            .singleMappingWithRequest("/app/alias-value")
+            .allMappings("/alias-value")
+            .allMappingsWithRequest("/app/alias-value")
+            .verify(resolver, req);
+    }
+
     static class ExpectedMappings {
 
         public static ExpectedMappings existingResource(String path) {