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

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

Julian Reschke created SLING-11096:
--------------------------------------

             Summary: 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


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)