counter: 1.2.15 - Made in/out messages in `TestData` immutable
authorKai Moritz <kai@juplo.de>
Mon, 27 May 2024 20:23:58 +0000 (22:23 +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/TestData.java

index ab265a9..6110f80 100644 (file)
@@ -20,11 +20,11 @@ class TestData
        static void injectInputMessages(BiConsumer<String, Word> 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<Word, WordCounter>[] expectedMessagesArray = new KeyValue[]
+       static final KeyValue<Word, WordCounter>[] 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));
        }