apupier commented on code in PR #8226:
URL: https://github.com/apache/camel-quarkus/pull/8226#discussion_r2745099351


##########
integration-tests-support/kafka/src/main/java/org/apache/camel/quarkus/test/support/kafka/KafkaTestResource.java:
##########
@@ -16,33 +16,39 @@
  */
 package org.apache.camel.quarkus.test.support.kafka;
 
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Map;
 import java.util.function.Function;
 
 import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
-import io.strimzi.test.container.StrimziKafkaContainer;
+import io.strimzi.test.container.StrimziKafkaCluster;
 import org.eclipse.microprofile.config.ConfigProvider;
+import org.testcontainers.containers.GenericContainer;
 
 public class KafkaTestResource implements QuarkusTestResourceLifecycleManager {
     protected static final String KAFKA_IMAGE_NAME = 
ConfigProvider.getConfig().getValue("kafka.container.image", String.class);
-    private StrimziKafkaContainer container;
+    private StrimziKafkaCluster container;
 
     @Override
     public Map<String, String> start() {
         try {
-            start(name -> new StrimziKafkaContainer(name));
+            start(name -> new StrimziKafkaCluster.StrimziKafkaClusterBuilder()
+                    .withNumberOfBrokers(1)
+                    .build());
             return Collections.singletonMap("camel.component.kafka.brokers", 
container.getBootstrapServers());
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
     }
 
-    public String start(Function<String, StrimziKafkaContainer> 
containerSupplier) {
+    public String start(Function<String, StrimziKafkaCluster> 
containerSupplier) {
         container = containerSupplier.apply(KAFKA_IMAGE_NAME);
-        container.withLogConsumer(frame -> 
System.out.print(frame.getUtf8String()))
-                .waitForRunning()
-                .start();
+        Collection<GenericContainer<?>> nodes = container.getNodes();
+        for (GenericContainer<?> genericContainer : nodes) {
+            genericContainer.withLogConsumer(frame -> 
System.out.print(frame.getUtf8String()));
+        }
+        container.start();

Review Comment:
   I'm not completed sure that it is bullet-proof here because we lost the 
waitForRunning() but in other hand, the tests were passing locally and the 
start is called on another object now.



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