mattisonchao commented on code in PR #21379: URL: https://github.com/apache/pulsar/pull/21379#discussion_r1362003162
########## pulsar-websocket/src/test/java/org/apache/pulsar/websocket/AbstractWebSocketHandlerTest.java: ########## @@ -139,6 +142,27 @@ public void topicNameUrlEncodingTest() throws Exception { assertEquals(topicName.toString(), "persistent://my-property/my-ns/" + readerV2Topic); } + public String extractSubscription(HttpServletRequest request) { + String uri = request.getRequestURI(); + List<String> parts = Splitter.on("/").splitToList(uri); + + // v1 Format must be like : + // /ws/consumer/persistent/my-property/my-cluster/my-ns/my-topic/my-subscription + + // v2 Format must be like : + // /ws/v2/consumer/persistent/my-property/my-ns/my-topic/my-subscription + checkArgument(parts.size() == 9, "Invalid topic name format"); Review Comment: `>= 9`? -- 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...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org