From: Kai Moritz Date: Mon, 27 May 2024 20:23:58 +0000 (+0200) Subject: counter: 1.2.15 - Made in/out messages in `TestData` immutable X-Git-Tag: counter-1.2.15~14 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=7474f0e1fc7028e60ef9526fec86bfb8824c6517;p=demos%2Fkafka%2Fwordcount counter: 1.2.15 - Made in/out messages in `TestData` immutable --- 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 ab265a9..6110f80 100644 --- a/src/test/java/de/juplo/kafka/wordcount/counter/TestData.java +++ b/src/test/java/de/juplo/kafka/wordcount/counter/TestData.java @@ -20,11 +20,11 @@ class TestData static void injectInputMessages(BiConsumer consumer) { Stream - .of(inputMessagesArray) + .of(INPUT_MESSAGES) .forEach(word -> consumer.accept(word.getUser(), word)); } - static Word[] inputMessagesArray = new Word[] + static final Word[] INPUT_MESSAGES = new Word[] { Word.of("peter","Hallo"), Word.of("klaus","Müsch"), @@ -47,7 +47,7 @@ class TestData .containsExactlyElementsOf(counter)); } - static KeyValue[] expectedMessagesArray = new KeyValue[] + static final KeyValue[] EXPECTED_MESSAGES = new KeyValue[] { KeyValue.pair( Word.of("peter","Hallo"), @@ -89,7 +89,7 @@ class TestData { expectedMessages = new LinkedMultiValueMap<>(); Stream - .of(expectedMessagesArray) + .of(EXPECTED_MESSAGES) .forEach(keyValue -> expectedMessages.add(keyValue.key, keyValue.value)); }