counter: 1.2.15 - Refined method-naming in `TestData`
authorKai Moritz <kai@juplo.de>
Mon, 27 May 2024 19:39:22 +0000 (21:39 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 8 Jun 2024 11:33:30 +0000 (13:33 +0200)
src/test/java/de/juplo/kafka/wordcount/counter/CounterApplicationIT.java
src/test/java/de/juplo/kafka/wordcount/counter/CounterStreamProcessorTopologyTest.java
src/test/java/de/juplo/kafka/wordcount/counter/TestData.java

index 57ac365..3889cea 100644 (file)
@@ -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()));
        }
 
 
index 5b9f365..16cf5d2 100644 (file)
@@ -59,7 +59,7 @@ public class CounterStreamProcessorTopologyTest
         (JsonDeserializer<Word>)keySerde.deserializer(),
         (JsonDeserializer<WordCounter>)valueSerde.deserializer());
 
-    TestData.writeInputData((key, value) -> in.pipeInput(key, value));
+    TestData.injectInputMessages((key, value) -> in.pipeInput(key, value));
 
     MultiValueMap<Word, WordCounter> receivedMessages = new LinkedMultiValueMap<>();
     out
@@ -75,6 +75,6 @@ public class CounterStreamProcessorTopologyTest
           receivedMessages.add(record.key(), record.value());
         });
 
-    TestData.assertExpectedResult(receivedMessages);
+    TestData.assertExpectedMessages(receivedMessages);
   }
 }
index ea33cb0..ab265a9 100644 (file)
@@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 class TestData
 {
-       static void writeInputData(BiConsumer<String, Word> consumer)
+       static void injectInputMessages(BiConsumer<String, Word> consumer)
        {
                Stream
                                .of(inputMessagesArray)
@@ -39,7 +39,7 @@ class TestData
                        Word.of("klaus","s"),
        };
 
-       static void assertExpectedResult(MultiValueMap<Word, WordCounter> receivedMessages)
+       static void assertExpectedMessages(MultiValueMap<Word, WordCounter> receivedMessages)
        {
                expectedMessages.forEach(
                                (word, counter) ->