You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/06/21 15:39:06 UTC

[GitHub] [sling-org-apache-sling-servlets-resolver] enapps-enorman commented on a change in pull request #17: SLING-10507 Refactor tests to replace usage of deprecated apis

enapps-enorman commented on a change in pull request #17:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/17#discussion_r655495030



##########
File path: src/test/java/org/apache/sling/servlets/resolver/internal/helper/LocationIteratorTest.java
##########
@@ -62,62 +66,88 @@ public void testSearchPathEmpty() {
     }
 
     public void testSearchPath1Element() {
-        String root0 = "/apps";
-        resourceResolver.setSearchPath(root0);
+        String root0 = "/apps/";
+        resourceResolverOptions.setSearchPaths(new String[] {
+                root0
+        });
 
         final Resource r = request.getResource();
         LocationIterator li = getLocationIterator(r.getResourceType(),
                 r.getResourceSuperType());
 
         // 1. /apps/foo/bar
         assertTrue(li.hasNext());
-        assertEquals(root0 + "/" + resourceTypePath, li.next());
+        assertEquals(root0 + resourceTypePath, li.next());

Review comment:
       This was compensating for the search root paths (root0/root1) already having a trailing slash so adding another slash doubles up the slashes and makes the test fail.
   
   
   




-- 
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.

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