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

David Gonzalez updated SLING-9131:
----------------------------------
    Description: 
This is in regard to dependency:  
{code:java}
<dependency>
    <groupId>org.apache.sling</groupId>
    <artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
    <!-- Bumping this to 2.4.14 changes behavior in how mock context resolves 
ranked service, which breaks ComputedPropertiesTest -->
    <version>2.4.10</version>
    <scope>test</scope>
</dependency>{code}
In v2.4.14 of OSGi mock, in Junit4 tests, ctx.getService(...) does not return 
the service w/ the highest service ranking if multiple are registered.

This used to work in v2.4.10.

A working test that broke when moving to 2.4.14 is available at: 
[https://github.com/davidjgonzalez/asset-share-commons/blob/497/unit-tests-not-executing/core/src/test/java/com/adobe/aem/commons/assetshare/content/properties/impl/ComputedPropertiesImplTest.java#L38-L56]
 

  was:
This is in regard to dependency:  
{code:java}
<dependency>
    <groupId>org.apache.sling</groupId>
    <artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
    <!-- Bumping this to 2.4.14 changes behavior in how mock context resolves 
ranked service, which breaks ComputedPropertiesTest -->
    <version>2.4.10</version>
    <scope>test</scope>
</dependency>{code}
In v2.4.14 of OSGi mock, in Junit4 tests, ctx.getService(...) does not return 
the service w/ the highest service ranking if multiple are registered.

This used to work in v2.4.10.

A working test that broke when moving to 2.4.14 is available at: 
[https://github.com/davidjgonzalez/asset-share-commons/blob/497/unit-tests-not-executing/core/src/test/java/com/adobe/aem/commons/assetshare/content/properties/impl/ComputedPropertiesImplTest.java#L38-L56]

/cc @se

 


> OSGi Mock 2.4.14 breaks getting services by highest rank
> --------------------------------------------------------
>
>                 Key: SLING-9131
>                 URL: https://issues.apache.org/jira/browse/SLING-9131
>             Project: Sling
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: Testing OSGi Mock 2.4.14
>            Reporter: David Gonzalez
>            Priority: Major
>
> This is in regard to dependency:  
> {code:java}
> <dependency>
>     <groupId>org.apache.sling</groupId>
>     <artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
>     <!-- Bumping this to 2.4.14 changes behavior in how mock context resolves 
> ranked service, which breaks ComputedPropertiesTest -->
>     <version>2.4.10</version>
>     <scope>test</scope>
> </dependency>{code}
> In v2.4.14 of OSGi mock, in Junit4 tests, ctx.getService(...) does not return 
> the service w/ the highest service ranking if multiple are registered.
> This used to work in v2.4.10.
> A working test that broke when moving to 2.4.14 is available at: 
> [https://github.com/davidjgonzalez/asset-share-commons/blob/497/unit-tests-not-executing/core/src/test/java/com/adobe/aem/commons/assetshare/content/properties/impl/ComputedPropertiesImplTest.java#L38-L56]
>  



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

Reply via email to