using a newer Sling API than that sling-mocks was compiled against is usually 
no problem, because the API is backwards-compatible.
the problems start if other dependencies esp. org.apache.sling.resourceresolver 
or org.apache.sling.jcr.resource are updated withouth the other.

this is a sort of dependency hell we cannot solve automatically, because it 
highly depends on the dependencies already declared in the project poms. some 
hints are included in this talk
https://adapt.to/2016/en/schedule/unit-testing-with-sling-aem-mocks.html

if you have a proposal for some information added to the sling mocks 
documentation to make it easier for people to solve these issues i would be 
glad to add them to the sling site.

stefan


>-----Original Message-----
>From: Santiago Garcia Pimentel [mailto:[email protected]]
>Sent: Tuesday, May 2, 2017 3:44 PM
>To: [email protected]
>Subject: Re: sling mocks "Creating resource resolver failed"
>
>Hi again,
>
>Coming back a bit on this.
>
>It seems the the point is that the version of the sling api and the
>resourceResolver you use need to match, and this needs to be done
>explicitly in your pom.
>
>This is more clear in the sling-mock source code. It has a profiles that
>uses different versions of the api and the resourceResolver:
>
>for api 2.11 -> RR 1.4.8
>for api 2.16 -> RR 1.5.x
>
>I could not find this information in the documentation. I think it would be
>worth it to explicitly mention it in the documentation since it is not so
>common to depend directly on the resourceResolver api.
>
>WDYT?
>
>Greetings.
>
>
>Santiago García Pimentel| Sr Software Engineer
>Netcentric Ibérica SLU
>M: +34687915463
>[email protected] <mailto:[email protected]>
>| www.netcentric.biz <http://www.netcentric.biz/>
>> On Apr 30, 2017, at 11:03 AM, Santiago Garcia Pimentel
><[email protected]> wrote:
>>
>> thanks Stefan!
>>
>> latest SNAPSHOT seems to work fine.
>>
>> Greetings.
>>
>> Santiago García Pimentel| Sr Software Engineer
>> Netcentric Ibérica SLU
>> M: +34687915463
>> [email protected]
><mailto:[email protected]>  | www.netcentric.biz
><http://www.netcentric.biz/>
>>> On Apr 28, 2017, at 5:44 PM, Stefan Seifert <[email protected]
><mailto:[email protected]>> wrote:
>>>
>>>
>>>> I tried updating the resourceresolver version to 1.5.22 but got a
>different
>>>> error:
>>>
>>> just hit this as well - also try osgi-mock 2.2.5-SNAPSHOT with the fix
>from SLING-6811
>>>
>>> stefan
>>>
>>

Reply via email to