Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10356

MockResourceResolver does not correctly resolve resources

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Testing
    • None

    Description

      The mock resource resolver does not do the complete cycle of the resolving. For example I could have a file:
      /content/dam/my-file.jpg

      If I would now do resourceResolver.resolve("/content/dam/my-file.jpg.selector/my-suffix") I would expect to get /content/dam/my-file.jpg but it returns a non existing resource for path /content/dam/my-file.jpg.selector/my-suffix

      I see that this logic is done by the ResourcePathIterator in the ResourceResolverImpl:

      https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/a19b2c2474ae0165e35bce94ecad5e3d23873549/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java#L704

      What would be the recommended approach? Copy the internal ResourcePathIterator class to the mock testing library and implement the same logic?

      Attachments

        Activity

          People

            Unassigned Unassigned
            royteeuwen Roy Teeuwen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: