Skip to content

Commit

Permalink
quarkusio#2691 Removing call to deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarmorling committed Jun 3, 2019
1 parent 1f5a422 commit 22084a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.it.kafka;

import java.time.Duration;
import java.util.Collections;
import java.util.Properties;

Expand Down Expand Up @@ -28,7 +29,6 @@ public static KafkaConsumer<Integer, String> createConsumer() {
return consumer;
}

private int count;
private Consumer<Integer, String> consumer;

@PostConstruct
Expand All @@ -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();
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.it.main;

import java.time.Duration;
import java.util.Collections;
import java.util.Properties;

Expand Down Expand Up @@ -34,7 +35,7 @@ public static KafkaConsumer<Integer, String> createConsumer() {
public void test() throws Exception {
KafkaConsumer<Integer, String> consumer = createConsumer();
RestAssured.with().body("hello").post("/kafka");
ConsumerRecord<Integer, String> records = consumer.poll(10000).iterator().next();
ConsumerRecord<Integer, String> records = consumer.poll(Duration.ofMillis(10000)).iterator().next();
Assertions.assertEquals(records.key(), (Integer) 0);
Assertions.assertEquals(records.value(), "hello");
}
Expand Down

0 comments on commit 22084a2

Please sign in to comment.