</parent>
<groupId>de.juplo.kafka.wordcount</groupId>
<artifactId>counter</artifactId>
- <version>1.1.7</version>
+ <version>1.1.8</version>
<name>Wordcount-Counter</name>
<description>Word-counting stream-processor of the multi-user wordcount-example</description>
<properties>
await("Expexted converted data")
.atMost(Duration.ofSeconds(10))
- .untilAsserted(() -> TestData.assertExpectedResult(consumer.received));
+ .untilAsserted(() -> TestData.assertExpectedResult(consumer.getReceivedMessages()));
}
private final List<Message> received = new LinkedList<>();
@KafkaListener(groupId = "TEST", topics = TOPIC_OUT)
- public void receive(ConsumerRecord<String, String> record)
+ public synchronized void receive(ConsumerRecord<String, String> record)
{
log.debug("Received message: {}", record);
received.add(Message.of(record.key(),record.value()));
}
+
+ synchronized List<Message> getReceivedMessages()
+ {
+ return received;
+ }
}
@TestConfiguration