kezhuw commented on code in PR #473:
URL: https://github.com/apache/curator/pull/473#discussion_r1286042942
##########
curator-x-discovery/src/test/java/org/apache/curator/x/discovery/details/TestServiceDiscovery.java:
##########
@@ -261,6 +262,49 @@ public void testBasic() throws Exception {
}
}
+ private static class CustomPathConstructor implements
DiscoveryPathConstructor {
+ @Override
+ public String getBasePath() {
+ return "/test";
+ }
+
+ @Override
+ public String getPathForInstances(String serviceName) {
+ return String.format("/test/%s/instances", serviceName);
+ }
Review Comment:
In case of old version, there is one more method `getPathForInstance`(with
no trailing `s` character). In this concrete test case, `getPathForInstance`
can't return anything other than `String.format("/test/%s/instances/%s",
serviceName, instanceId)`, otherwise it breaks `queryForInstances`.
`queryForInstances` relies on `getPathForInstances` which states "Return the
(parent) path where all instances of the service registered".
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]