eolivelli commented on code in PR #16152:
URL: https://github.com/apache/pulsar/pull/16152#discussion_r902218791
##########
pulsar-client/src/test/java/org/apache/pulsar/client/impl/AutoClusterFailoverTest.java:
##########
@@ -283,4 +291,46 @@ public void testAutoClusterFailoverSwitchTlsTrustStore()
throws IOException {
.updateTlsTrustStorePathAndPassword(primaryTlsTrustStorePath,
primaryTlsTrustStorePassword);
}
+
+ @Test
+ public void testUrl() throws Exception {
+ Random random = new Random(42);
+ String serviceUrl = "pulsar://localhost:" + random.nextInt(65535);
+
+
+ PulsarServiceNameResolver resolver = new PulsarServiceNameResolver();
+
+ try {
+ resolver.updateServiceUrl(serviceUrl);
+ InetSocketAddress inetSocketAddress = new
InetSocketAddress(resolver.resolveHost().getHostName(),
resolver.resolveHost().getPort());
+ Socket socket = new Socket();
+ socket.connect(inetSocketAddress, 30);
+ socket.close();
+ fail();
Review Comment:
it is better to use a ephemeral port
btw I am not convinced if it is worth to add such test.
I believe that we can drop the test at all
--
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]