You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Robert Munteanu (Jira)" <ji...@apache.org> on 2022/01/27 14:47:00 UTC

[jira] [Commented] (SLING-11096) resource resolver: enable sling mock testing

    [ https://issues.apache.org/jira/browse/SLING-11096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17483190#comment-17483190 ] 

Robert Munteanu commented on SLING-11096:
-----------------------------------------

I think importing the Sling Mock in this module is problematic since (IIRC) it also depends on the resource resolves. In the end, this might not be possible. Maybe [~sseifert] can help if you have specific questions around the Sling Mock usage.

> resource resolver: enable sling mock testing
> --------------------------------------------
>
>                 Key: SLING-11096
>                 URL: https://issues.apache.org/jira/browse/SLING-11096
>             Project: Sling
>          Issue Type: Task
>          Components: ResourceResolver
>            Reporter: Julian Reschke
>            Priority: Minor
>
> I'd like to add test coverage using sling-mock.
> However, just adding the dependency:
> {noformat}
> +        <dependency>
> +            <groupId>org.apache.sling</groupId>
> +            <artifactId>org.apache.sling.testing.sling-mock.junit4</artifactId>
> +            <version>3.2.2</version>
> +            <scope>test</scope>
> +        </dependency>
> +        <dependency>
> +            <groupId>org.apache.sling</groupId>
> +            <artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
> +            <version>3.1.2-1.40.0</version>
> +            <scope>test</scope>
> +        </dependency>
> {noformat}
> causes test failures...:
> {noformat}
> [ERROR] Failures:
> [ERROR]   ResourceMapperImplTest.mapResourceWithAliasAndEtcMap:246 All mappings without request
> Expected: is <[http://localhost:8080/everywhere, /alias-value-2, /somewhere]>
>      but: was <[/alias-value-2, /somewhere]>
> [ERROR]   ResourceMapperImplTest.mapResourceWithAliasAndEtcMap:246 All mappings without request
> Expected: is <[http://localhost:8080/everywhere, /alias-value-2, /somewhere]>
>      but: was <[/alias-value-2, /somewhere]>
> [ERROR]   ResourceMapperImplTest.mapResourceWithVanityPaths:328 All mappings without request
> Expected: is <[/vain, /vanity-a, /vanity-b]>
>      but: was <[/vain]>
> [ERROR]   ResourceMapperImplTest.mapResourceWithVanityPaths:328 All mappings without request
> Expected: is <[/vain, /vanity-a, /vanity-b]>
>      but: was <[/vain]>
> [ERROR]   ResourceMapperImplTest.priorityForVHostMappings:280 Single mapping without request
> Expected: is "http://virtual.host.com/foo"
>      but: was "/content/virtual/foo"
> [ERROR]   ResourceMapperImplTest.priorityForVHostMappings:280 Single mapping without request
> Expected: is "http://virtual.host.com/foo"
>      but: was "/content/virtual/foo"
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)