You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by gh...@apache.org on 2020/10/08 21:33:31 UTC

[sling-org-apache-sling-api] branch master updated: SLING-9777 unit test for well-known URI

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

ghenzler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-api.git


The following commit(s) were added to refs/heads/master by this push:
     new 3e9cf18  SLING-9777 unit test for well-known URI
3e9cf18 is described below

commit 3e9cf187eff999235ee161e0543f1d8a68c4285c
Author: georg.henzler <ge...@netcentric.biz>
AuthorDate: Thu Oct 8 23:32:23 2020 +0200

    SLING-9777 unit test for well-known URI
---
 src/test/java/org/apache/sling/api/uri/SlingUriTest.java | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/test/java/org/apache/sling/api/uri/SlingUriTest.java b/src/test/java/org/apache/sling/api/uri/SlingUriTest.java
index 6284fb9..f350aec 100644
--- a/src/test/java/org/apache/sling/api/uri/SlingUriTest.java
+++ b/src/test/java/org/apache/sling/api/uri/SlingUriTest.java
@@ -668,6 +668,22 @@ public class SlingUriTest {
     }
 
     @Test
+    public void testWellKnownUri() {
+
+        // well-known URIs as specified in https://tools.ietf.org/html/rfc8615
+        String dataUrl = "/.well-known/change-password";
+
+        testUri(dataUrl, true, true, false, false, false, slingUri -> {
+            assertEquals("/", slingUri.getResourcePath());
+            assertEquals(null, slingUri.getSelectorString());
+            assertEquals("well-known", slingUri.getExtension());
+            assertEquals("/change-password", slingUri.getSuffix());
+            assertEquals(null, slingUri.getQuery());
+            assertEquals(null, slingUri.getFragment());
+        }, asList(resolver, null));
+    }
+
+    @Test
     public void testGetSuffixResource() {
         Resource expectedSuffixResource = mock(Resource.class);
         when(resolver.getResource("/suffix/path")).thenReturn(expectedSuffixResource);