Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Junit5 throwing error when I use ResourceResolverType.JCR_OAK
Description
I am using the AEM maven archetype 25. I found that below code in JUNIT5 works private final AemContext aemContext = new AemContext(ResourceResolverType.JCR_MOCK); where as this code throws exception private final AemContext aemContext = new AemContext(ResourceResolverType.JCR_OAK); I using JCR_OAK as the test class is testing the functionalities of AccessControlManager class . I get below error: java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to invoke method 'activate' for class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository Caused by: java.lang.NoSuchMethodError: org.apache.jackrabbit.oak.plugins.nodetype.constraint.Constraints.asPredicate(ILjava/lang/String;)Ljava/util/function/Predicate;
I am using the AEM maven archetype 25.
I found that below code in JUNIT5 works
private final AemContext aemContext = new AemContext(ResourceResolverType.JCR_MOCK);
where as this code throws exception
private final AemContext aemContext = new AemContext(ResourceResolverType.JCR_OAK);
I using JCR_OAK as the test class is testing the functionalities of AccessControlManager class .
I get below error:
java.lang.RuntimeException: Unable to initialize JCR_OAK resource resolver factory: Unable to invoke method 'activate' for class org.apache.sling.testing.mock.sling.oak.OakMockSlingRepository
Caused by: java.lang.NoSuchMethodError: org.apache.jackrabbit.oak.plugins.nodetype.constraint.Constraints.asPredicate(ILjava/lang/String;)Ljava/util/function/Predicate;