showuon commented on a change in pull request #10437:
URL: https://github.com/apache/kafka/pull/10437#discussion_r650625978



##########
File path: core/src/test/scala/unit/kafka/server/KafkaConfigTest.scala
##########
@@ -143,73 +143,6 @@ class KafkaConfigTest {
 
   }
 
-  @Test
-  def testAdvertiseDefaults(): Unit = {
-    val port = "9999"
-    val hostName = "fake-host"
-
-    val props = TestUtils.createBrokerConfig(0, TestUtils.MockZkConnect)
-    props.remove(KafkaConfig.ListenersProp)
-    props.put(KafkaConfig.HostNameProp, hostName)
-    props.put(KafkaConfig.PortProp, port)
-    val serverConfig = KafkaConfig.fromProps(props)
-    val endpoints = serverConfig.advertisedListeners
-    val endpoint = endpoints.find(_.securityProtocol == 
SecurityProtocol.PLAINTEXT).get
-    assertEquals(endpoint.host, hostName)
-    assertEquals(endpoint.port, port.toInt)
-  }
-
-  @Test
-  def testAdvertiseConfigured(): Unit = {

Review comment:
       I saw you removed all the `AdvertiseListener`'s tests here. Should we 
add or keep and update some tests for it?

##########
File path: core/src/main/scala/kafka/server/KafkaConfig.scala
##########
@@ -1804,9 +1773,7 @@ class KafkaConfig(val props: java.util.Map[_, _], doLog: 
Boolean, dynamicConfigO
   // If the user did not define listeners but did define host or port, let's 
use them in backward compatible way

Review comment:
       +1

##########
File path: core/src/main/scala/kafka/server/KafkaConfig.scala
##########
@@ -1838,8 +1805,6 @@ class KafkaConfig(val props: java.util.Map[_, _], doLog: 
Boolean, dynamicConfigO
     val advertisedListenersProp = 
getString(KafkaConfig.AdvertisedListenersProp)
     if (advertisedListenersProp != null)
       CoreUtils.listenerListToEndPoints(advertisedListenersProp, 
listenerSecurityProtocolMap, requireDistinctPorts=false)

Review comment:
       +1




-- 
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.

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


Reply via email to