You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2023/06/02 13:06:08 UTC

[GitHub] [curator] tisonkun commented on a diff in pull request #256: CURATOR-457. Extension point for discovering paths.

tisonkun commented on code in PR #256:
URL: https://github.com/apache/curator/pull/256#discussion_r1214350823


##########
curator-x-discovery/src/test/java/org/apache/curator/x/discovery/details/DiscoveryPathConstructorImplTest.java:
##########
@@ -0,0 +1,59 @@
+package org.apache.curator.x.discovery.details;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class DiscoveryPathConstructorImplTest
+{
+
+    @Test
+    public void testCanonicalDiscoveryPathConstructor()
+    {
+        Assert.expectThrows(IllegalArgumentException.class, new Assert.ThrowingRunnable()
+            {
+                @Override
+                public void run() throws Throwable {
+                    new DiscoveryPathConstructorImpl(null);
+                }
+            }
+        );
+    }
+
+    @Test
+    public void testGetBasePath() throws Exception
+    {
+        Assert.assertEquals(new DiscoveryPathConstructorImpl("/foo/bar").getBasePath(), "/foo/bar");
+        Assert.assertEquals(new DiscoveryPathConstructorImpl("foo/bar").getBasePath(), "/foo/bar");

Review Comment:
   I worried if we should forbid this pattern, said the base dir passed without a leading slash, instead of tolerate it.
   
   It seems somehow informal especially for `foo/bar/` patterns.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@curator.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org