reschke commented on code in PR #243:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/243#discussion_r4665545788


##########
src/test/java/org/apache/sling/resourceresolver/impl/mapping/VanityPathMapEntriesTest.java:
##########
@@ -335,6 +336,36 @@ private void prepareMapEntriesForSingleVanityPath(String 
node, String vanityPath
                 });
     }
 
+    @Test
+    public void test_simple_dubious_vanity_path() {
+        // a dubious vanity path
+        String vanityPath = "empty//path//segment";
+
+        String containerName = "foo";
+        String childName = "child";
+        String oneMore = "one-more";
+        prepareMapEntriesForVanityPath(false, false, containerName, childName, 
oneMore, vanityPath);
+
+        try (TestLogger logger = TestLogger.create(VanityPathHandler.class)
+                .contains("dubious vanity paths")
+                .start()) {
+            initializeVanityPaths();
+            List<String> logs = logger.stopAndGetLogs();
+            // 1 because both resources share the same broken vanity path
+            assertEquals(1, logs.size());
+            // dubious vanity path results in resource name in root with "-" 
stripped??
+            assertTrue(logs.get(0).contains("onemore"));

Review Comment:
   old code



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to