diff --git a/integration-tests/kafka/src/main/java/io/quarkus/it/kafka/KafkaConsumerManager.java b/integration-tests/kafka/src/main/java/io/quarkus/it/kafka/KafkaConsumerManager.java index 6261a509d98a65..8bf529c80c0945 100644 --- a/integration-tests/kafka/src/main/java/io/quarkus/it/kafka/KafkaConsumerManager.java +++ b/integration-tests/kafka/src/main/java/io/quarkus/it/kafka/KafkaConsumerManager.java @@ -1,5 +1,6 @@ package io.quarkus.it.kafka; +import java.time.Duration; import java.util.Collections; import java.util.Properties; @@ -28,7 +29,6 @@ public static KafkaConsumer createConsumer() { return consumer; } - private int count; private Consumer consumer; @PostConstruct @@ -37,7 +37,7 @@ public void create() { } public String receive() { - return consumer.poll(10000).iterator().next().value(); + return consumer.poll(Duration.ofMillis(10000)).iterator().next().value(); } } diff --git a/integration-tests/kafka/src/test/java/io/quarkus/it/main/KafkaProducerTest.java b/integration-tests/kafka/src/test/java/io/quarkus/it/main/KafkaProducerTest.java index 76423e1ea0e279..1b14c552b95b0b 100644 --- a/integration-tests/kafka/src/test/java/io/quarkus/it/main/KafkaProducerTest.java +++ b/integration-tests/kafka/src/test/java/io/quarkus/it/main/KafkaProducerTest.java @@ -1,5 +1,6 @@ package io.quarkus.it.main; +import java.time.Duration; import java.util.Collections; import java.util.Properties; @@ -34,7 +35,7 @@ public static KafkaConsumer createConsumer() { public void test() throws Exception { KafkaConsumer consumer = createConsumer(); RestAssured.with().body("hello").post("/kafka"); - ConsumerRecord records = consumer.poll(10000).iterator().next(); + ConsumerRecord records = consumer.poll(Duration.ofMillis(10000)).iterator().next(); Assertions.assertEquals(records.key(), (Integer) 0); Assertions.assertEquals(records.value(), "hello"); }