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-unsubscr...@curator.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org