You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Seifert (Jira)" <ji...@apache.org> on 2021/09/12 07:53:00 UTC

[jira] [Resolved] (SLING-10265) JUNIT5 Test cases are failing when I use code "new AemContext(ResourceResolverType.JCR_OAK)"

     [ https://issues.apache.org/jira/browse/SLING-10265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Seifert resolved SLING-10265.
------------------------------------
    Resolution: Done

first, update to latest version of sling-mock and sling-mock-oak (or, if you are using AEM Mocks, update to latest version of aem-mock and do not declare an explicit version for sling-mock). we fixed an issue with dependency management in latest sling-mock-oak release.

secondly it is recommended to put the aem-mock/sling-mock test dependency at top in your pom, before the AEM SDK dependency.

if you need more help for AEM Mocks, please come to https://wcm.io/mailing-lists.html

> JUNIT5 Test cases are failing when I use code "new AemContext(ResourceResolverType.JCR_OAK)"
> --------------------------------------------------------------------------------------------
>
>                 Key: SLING-10265
>                 URL: https://issues.apache.org/jira/browse/SLING-10265
>             Project: Sling
>          Issue Type: Bug
>          Components: Apache Sling Testing Clients
>    Affects Versions: Testing Sling Mock 2.6.0
>            Reporter: subramanya
>            Priority: Blocker
>
> I am unable to run test cases using JUNIT5 with JCR_OAK repository implementation in the test case code .
> Repository using JCR_MOCK works, the snippet below works
> private final AemContext aemContext = new AemContext(ResourceResolverType.JCR_MOCK);   
> Where as this one throws exception:
> private final AemContext aemContext = new AemContext(ResourceResolverType.JCR_OAK);   
> This is the error I am getting 
> 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;  summary JUNIT5 Test cases are failing when I use new AemContext(ResourceResolverType.JCR_OAK)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)