[
https://issues.apache.org/jira/browse/SLING-10356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Roy Teeuwen updated SLING-10356:
--------------------------------
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?
was:
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
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?
> MockResourceResolver does not correctly resolve resources
> ---------------------------------------------------------
>
> Key: SLING-10356
> URL: https://issues.apache.org/jira/browse/SLING-10356
> Project: Sling
> Issue Type: Bug
> Components: Testing
> Reporter: Roy Teeuwen
> Priority: Major
>
> 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?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)