A developer is creating a unit test for a service that relies on querying nodes within the JCR.
What is the correct method for unit testing the service?
ResourceResolverType.JCR_OAK provides SlingContext with an in-memory Apache Jackrabbit Oak JCR implementation, enabling JCR-backed node creation and query execution in the test. The Apache Sling Mocks documentation identifies JCR_OAK as using a real JCR Oak implementation with full JCR/Sling features.
ResourceResolverType.JCR_OAK
JCR_OAK
Community Discussion