showuon commented on code in PR #16319:
URL: https://github.com/apache/kafka/pull/16319#discussion_r1637590625


##########
clients/src/test/java/org/apache/kafka/common/utils/UtilsTest.java:
##########
@@ -113,16 +113,26 @@ public void testGetHost() {
         assertEquals("mydomain.com", getHost("PLAINTEXT://mydomain.com:8080"));
         assertEquals("MyDomain.com", getHost("PLAINTEXT://MyDomain.com:8080"));
         assertEquals("My_Domain.com", 
getHost("PLAINTEXT://My_Domain.com:8080"));
+        assertEquals("mydomain.com", 
getHost("SASL_PLAINTEXT://mydomain.com:8080"));
+        assertEquals("MyDomain.com", 
getHost("SASL_PLAINTEXT://MyDomain.com:8080"));
+        assertEquals("My_Domain.com", 
getHost("SASL_PLAINTEXT://My_Domain.com:8080"));
         assertEquals("::1", getHost("[::1]:1234"));
         assertEquals("2001:db8:85a3:8d3:1319:8a2e:370:7348", 
getHost("PLAINTEXT://[2001:db8:85a3:8d3:1319:8a2e:370:7348]:5678"));
         assertEquals("2001:DB8:85A3:8D3:1319:8A2E:370:7348", 
getHost("PLAINTEXT://[2001:DB8:85A3:8D3:1319:8A2E:370:7348]:5678"));
         assertEquals("fe80::b1da:69ca:57f7:63d8%3", 
getHost("PLAINTEXT://[fe80::b1da:69ca:57f7:63d8%3]:5678"));
+        assertEquals("2001:db8:85a3:8d3:1319:8a2e:370:7348", 
getHost("SASL_PLAINTEXT://[2001:db8:85a3:8d3:1319:8a2e:370:7348]:5678"));

Review Comment:
   @frankvicky , we have 4 kinds of security protocol, let's test all of them 
to make sure we don't break anything. I think we can use `ParameterizedTest` 
here:
   
   ```
       @ParameterizedTest
       @CsvSource(value = {"PLANTEXT", "SASL_PLAINTEXT", ...)
   ```
   
   ref: 
https://kafka.apache.org/documentation/#brokerconfigs_security.inter.broker.protocol



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to