lucasbru commented on code in PR #21642:
URL: https://github.com/apache/kafka/pull/21642#discussion_r2907787196


##########
core/src/test/scala/integration/kafka/api/GroupCoordinatorIntegrationTest.scala:
##########
@@ -366,6 +452,32 @@ class GroupCoordinatorIntegrationTest(cluster: 
ClusterInstance) {
     }
   }
 
+  private def withStreamsApp(
+    applicationId: String,
+    inputTopic: String
+  )(f: KafkaStreams => Unit): Unit = {
+    val builder = new StreamsBuilder()
+    builder.stream(inputTopic)
+
+    val props = new Properties()
+    props.put(StreamsConfig.APPLICATION_ID_CONFIG, applicationId)
+    props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, 
cluster.bootstrapServers())
+    props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, 
classOf[Serdes.StringSerde].getName)
+    props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, 
classOf[Serdes.StringSerde].getName)
+    props.put(StreamsConfig.GROUP_PROTOCOL_CONFIG, 
StreamsGroupProtocol.STREAMS.name())
+    props.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "500")
+    props.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, "100")
+
+    val streams = new KafkaStreams(builder.build(), props)
+    try {
+      streams.start()
+      f(streams)

Review Comment:
   Good point, removed the lambda entirely — the wait-for-RUNNING logic is now 
inlined in `withStreamsApp`.



##########
core/src/test/scala/integration/kafka/api/GroupCoordinatorIntegrationTest.scala:
##########
@@ -366,6 +452,32 @@ class GroupCoordinatorIntegrationTest(cluster: 
ClusterInstance) {
     }
   }
 
+  private def withStreamsApp(
+    applicationId: String,
+    inputTopic: String
+  )(f: KafkaStreams => Unit): Unit = {
+    val builder = new StreamsBuilder()
+    builder.stream(inputTopic)
+
+    val props = new Properties()
+    props.put(StreamsConfig.APPLICATION_ID_CONFIG, applicationId)
+    props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, 
cluster.bootstrapServers())
+    props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, 
classOf[Serdes.StringSerde].getName)
+    props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, 
classOf[Serdes.StringSerde].getName)
+    props.put(StreamsConfig.GROUP_PROTOCOL_CONFIG, 
StreamsGroupProtocol.STREAMS.name())
+    props.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "500")
+    props.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, "100")
+
+    val streams = new KafkaStreams(builder.build(), props)
+    try {
+      streams.start()
+      f(streams)

Review Comment:
   Agreed, inlined the wait-for-RUNNING logic into `withStreamsApp` and removed 
the lambda parameter.



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