Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Currently there is no easy way to override the method MockResourceResolver.findResources().
There should be a way to override that without relying on other mock frameworks like Mockito.
One way could be to add a static method MockResourceResolver.registerFindResourcesFunction(ResourceResolver resolver, BiFunction<String, String, Iterator<Resource> findResourcesFunction) which allows to easily override the default implementation (which always throws an UnsupportedOperationException) for the given resolver (in case this is a MockResourceResolver). The registration should only affect the given resource resolver as usually there is different functions necessary per test method.
Attachments
Issue Links
- relates to
-
SLING-11252 RRMockResourceResolverWrapper supports no way of mocking searches
- Closed
- links to