You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2022/09/09 13:09:20 UTC

[sling-org-apache-sling-testing-sling-mock-oak] branch feature/SLING-11572-isresourcetype-serviceresolver created (now b1eff20)

This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a change to branch feature/SLING-11572-isresourcetype-serviceresolver
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock-oak.git


      at b1eff20  SLING-11572 workaround if a service resource resolver calls isResourceType()

This branch includes the following new commits:

     new b1eff20  SLING-11572 workaround if a service resource resolver calls isResourceType()

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-testing-sling-mock-oak] 01/01: SLING-11572 workaround if a service resource resolver calls isResourceType()

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch feature/SLING-11572-isresourcetype-serviceresolver
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock-oak.git

commit b1eff202043dc1383fa4eded92ba0e778bb68dd8
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Fri Sep 9 15:07:29 2022 +0200

    SLING-11572 workaround if a service resource resolver calls isResourceType()
---
 .../apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java
index a078deb..c30dfe4 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/oak/OakMockSlingRepository.java
@@ -139,6 +139,10 @@ public final class OakMockSlingRepository implements SlingRepository {
 
     public Session login(Credentials credentials, String workspaceName)
             throws LoginException, NoSuchWorkspaceException, RepositoryException {
+        if (credentials == null) {
+            // SLING-11572 workaround if a service resource resolver calls isResourceType()
+            return this.loginAdministrative(workspaceName);
+        }
         return repository.login(credentials, (workspaceName == null ? getDefaultWorkspace() : workspaceName));
     }