From: Kai Moritz Date: Mon, 27 May 2024 19:39:22 +0000 (+0200) Subject: counter: 1.2.15 - Refined method-naming in `TestData` X-Git-Tag: counter-1.2.15~15 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=ac64aac16d87b469f7772463e70f38db95e9943d;p=demos%2Fkafka%2Fwordcount counter: 1.2.15 - Refined method-naming in `TestData` --- diff --git a/src/test/java/de/juplo/kafka/wordcount/counter/CounterApplicationIT.java b/src/test/java/de/juplo/kafka/wordcount/counter/CounterApplicationIT.java index 57ac365..3889cea 100644 --- a/src/test/java/de/juplo/kafka/wordcount/counter/CounterApplicationIT.java +++ b/src/test/java/de/juplo/kafka/wordcount/counter/CounterApplicationIT.java @@ -66,11 +66,11 @@ public class CounterApplicationIT @Test void testSendMessage() { - TestData.writeInputData((key, value) -> kafkaTemplate.send(TOPIC_IN, key, value)); + TestData.injectInputMessages((key, value) -> kafkaTemplate.send(TOPIC_IN, key, value)); - await("Expexted converted data") + await("Expected messages") .atMost(Duration.ofSeconds(10)) - .untilAsserted(() -> TestData.assertExpectedResult(consumer.getReceivedMessages())); + .untilAsserted(() -> TestData.assertExpectedMessages(consumer.getReceivedMessages())); } diff --git a/src/test/java/de/juplo/kafka/wordcount/counter/CounterStreamProcessorTopologyTest.java b/src/test/java/de/juplo/kafka/wordcount/counter/CounterStreamProcessorTopologyTest.java index 5b9f365..16cf5d2 100644 --- a/src/test/java/de/juplo/kafka/wordcount/counter/CounterStreamProcessorTopologyTest.java +++ b/src/test/java/de/juplo/kafka/wordcount/counter/CounterStreamProcessorTopologyTest.java @@ -59,7 +59,7 @@ public class CounterStreamProcessorTopologyTest (JsonDeserializer)keySerde.deserializer(), (JsonDeserializer)valueSerde.deserializer()); - TestData.writeInputData((key, value) -> in.pipeInput(key, value)); + TestData.injectInputMessages((key, value) -> in.pipeInput(key, value)); MultiValueMap receivedMessages = new LinkedMultiValueMap<>(); out @@ -75,6 +75,6 @@ public class CounterStreamProcessorTopologyTest receivedMessages.add(record.key(), record.value()); }); - TestData.assertExpectedResult(receivedMessages); + TestData.assertExpectedMessages(receivedMessages); } } diff --git a/src/test/java/de/juplo/kafka/wordcount/counter/TestData.java b/src/test/java/de/juplo/kafka/wordcount/counter/TestData.java index ea33cb0..ab265a9 100644 --- a/src/test/java/de/juplo/kafka/wordcount/counter/TestData.java +++ b/src/test/java/de/juplo/kafka/wordcount/counter/TestData.java @@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat; class TestData { - static void writeInputData(BiConsumer consumer) + static void injectInputMessages(BiConsumer consumer) { Stream .of(inputMessagesArray) @@ -39,7 +39,7 @@ class TestData Word.of("klaus","s"), }; - static void assertExpectedResult(MultiValueMap receivedMessages) + static void assertExpectedMessages(MultiValueMap receivedMessages) { expectedMessages.forEach( (word, counter) ->