[ https://issues.apache.org/jira/browse/SLING-10003?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Konrad Windszus updated SLING-10003: ------------------------------------ Affects Version/s: (was: Testing ResourceResolver Mock 1.1.28) > Allow to mock findResources in MockResourceResolver > --------------------------------------------------- > > Key: SLING-10003 > URL: https://issues.apache.org/jira/browse/SLING-10003 > Project: Sling > Issue Type: Improvement > Components: Testing > Reporter: Konrad Windszus > Priority: Major > Fix For: Testing ResourceResolver Mock 1.1.28 > > Time Spent: 10m > Remaining Estimate: 0h > > Currently there is no easy way to override the method > [MockResourceResolver.findResources().|https://github.com/apache/sling-org-apache-sling-testing-resourceresolver-mock/blob/6ef6bd69ce1679b06d6b4d52b1b170dce51d102c/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolver.java#L455] > 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. -- This message was sent by Atlassian Jira (v8.3.4#803005)