hachikuji commented on a change in pull request #11790:
URL: https://github.com/apache/kafka/pull/11790#discussion_r812466771



##########
File path: core/src/test/scala/unit/kafka/utils/TestUtils.scala
##########
@@ -220,17 +220,10 @@ object TestUtils extends Logging {
     }
   }
 
-  def getBrokerListStrFromServers[B <: KafkaBroker](
-      brokers: Seq[B],
-      protocol: SecurityProtocol = SecurityProtocol.PLAINTEXT): String = {
-    brokers.map { s =>
-      val listener = 
s.config.effectiveAdvertisedListeners.find(_.securityProtocol == 
protocol).getOrElse(
-        sys.error(s"Could not find listener with security protocol $protocol"))
-      formatAddress(listener.host, boundPort(s, protocol))
-    }.mkString(",")
-  }
-
-  def bootstrapServers[B <: KafkaBroker](brokers: Seq[B], listenerName: 
ListenerName): String = {
+  def bootstrapServers[B <: KafkaBroker](
+    brokers: Seq[B],
+    listenerName: ListenerName = 
ListenerName.forSecurityProtocol(SecurityProtocol.PLAINTEXT)

Review comment:
       Yeah, that's a good suggestion. That makes the dependence on the 
listener clear.




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


Reply via email to