kirktrue commented on code in PR #20347:
URL: https://github.com/apache/kafka/pull/20347#discussion_r2273992582


##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/RestoreIntegrationTest.java:
##########
@@ -120,14 +124,23 @@ public class RestoreIntegrationTest {
     private static final int NUM_BROKERS = 2;
 
     public static final EmbeddedKafkaCluster CLUSTER = new 
EmbeddedKafkaCluster(NUM_BROKERS);
+    
+    private static Admin admin;
 
     @BeforeAll
     public static void startCluster() throws IOException {
         CLUSTER.start();
+        
+        final Properties adminConfig = new Properties();
+        adminConfig.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, 
CLUSTER.bootstrapServers());
+        admin = Admin.create(adminConfig);
     }
 
     @AfterAll
     public static void closeCluster() {
+        if (admin != null) {
+            admin.close();
+        }

Review Comment:
   FYI: there's a utility method in Kafka called `Utils.closeQuietly()` which 
can make closing resources a one-liner.



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