Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Testing Sling Mock 3.1.2
-
None
Description
The resources returned from org.apache.sling.testing.mock.sling.RRMockResourceResolverWrapper are of type ResourceResolverResourceWrapper (in case the resource providers are empty).
When these resources are adapted to a Sling Model, the injected resource is the unwrapped resource which is not equal to the wrapped resource from outside.
This is due to the fact that ResourceResolverResourceWrapper.adaptTo(...) is not overwritten but just delegated to the underlying Resource. That makes the Adapter only acting on the unwrapped resource which is not equal to the wrapped one.
This leads to unexpected behaviour when verifying interactions with mocks taking the resource as argument, as the wrapped resource is never equal to the resource used in the Sling Model given to the mock.
Attachments
Issue Links
- is broken by
-
SLING-5922 allow sling mock to load content from jcrvlt's xml
- Closed
- is related to
-
SLING-11297 The org.apache.sling.testing.mock.sling.RRMockResourceResolverWrapper should first query its providers
- Closed
-
SLING-11455 ResourceResolver Mock: ResourceProvider implementation
- Closed
-
SLING-11548 sling-mock: Introduce RESOURCEPROVIDER_MOCK resource resolver type
- Closed