popular: 1.1.0 - Formulated expectations for suppressed results
authorKai Moritz <kai@juplo.de>
Mon, 17 Jun 2024 19:53:34 +0000 (21:53 +0200)
committerKai Moritz <kai@juplo.de>
Thu, 20 Jun 2024 19:29:03 +0000 (21:29 +0200)
* Removed result-messages, that will be supressed
* Added additionally messages, that are necessary, to advance the
  stream-time and close the window.

pom.xml
src/test/java/de/juplo/kafka/wordcount/popular/TestData.java

diff --git a/pom.xml b/pom.xml
index a9aae74..a9ba9e1 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
        </parent>
        <groupId>de.juplo.kafka.wordcount</groupId>
        <artifactId>popular</artifactId>
-       <version>1.0.0</version>
+       <version>1.1.0</version>
        <name>Wordcount-Popular-Words</name>
        <description>Query stream-processor that gives access to the most popular words</description>
        <properties>
index 372e0c0..fa6a258 100644 (file)
@@ -102,6 +102,26 @@ class TestData
                                        instantOfSecond(20),
                                        InputUser.of(KLAUS),
                                        InputWord.of(KLAUS, WORD_S)),
+                       TestMessage.of(
+                                       instantOfSecond((int)WINDOW_SIZE.toSeconds()),
+                                       InputUser.of(PETER),
+                                       InputWord.of(PETER, WORD_HALLO)),
+                       TestMessage.of(
+                                       instantOfSecond((int)WINDOW_SIZE.toSeconds()),
+                                       InputUser.of(KLAUS),
+                                       InputWord.of(KLAUS, WORD_MÜSCH)),
+                       TestMessage.of(
+                                       instantOfSecond((int)WINDOW_SIZE.toSeconds()),
+                                       InputUser.of(PETER),
+                                       InputWord.of(PETER, WORD_WELT)),
+                       TestMessage.of(
+                                       instantOfSecond((int)WINDOW_SIZE.toSeconds()),
+                                       InputUser.of(KLAUS),
+                                       InputWord.of(KLAUS, WORD_S)),
+                       TestMessage.of(
+                                       instantOfSecond((int)WINDOW_SIZE.toSeconds()),
+                                       InputUser.of(PETER),
+                                       InputWord.of(PETER, WORD_BOÄH)),
        };
 
        private static Instant instantOfSecond(int second)
@@ -223,30 +243,12 @@ class TestData
                        KeyValue.pair(
                                        WINDOWED_WORD_HALLO,
                                        OutputWordCounter.of(WORD_HALLO,1)),
-                       KeyValue.pair(
-                                       WINDOWED_WORD_MÜSCH,
-                                       OutputWordCounter.of(WORD_MÜSCH,1)),
-                       KeyValue.pair(
-                                       WINDOWED_WORD_WELT,
-                                       OutputWordCounter.of(WORD_WELT,1)),
                        KeyValue.pair(
                                        WINDOWED_WORD_MÜSCH,
                                        OutputWordCounter.of(WORD_MÜSCH,2)),
-                       KeyValue.pair(
-                                       WINDOWED_WORD_S,
-                                       OutputWordCounter.of(WORD_S,1)),
-                       KeyValue.pair(
-                                       WINDOWED_WORD_BOÄH,
-                                       OutputWordCounter.of(WORD_BOÄH,1)),
                        KeyValue.pair(
                                        WINDOWED_WORD_WELT,
                                        OutputWordCounter.of(WORD_WELT,2)),
-                       KeyValue.pair(
-                                       WINDOWED_WORD_BOÄH,
-                                       OutputWordCounter.of(WORD_BOÄH,2)),
-                       KeyValue.pair(
-                                       WINDOWED_WORD_S,
-                                       OutputWordCounter.of(WORD_S,2)),
                        KeyValue.pair(
                                        WINDOWED_WORD_BOÄH,
                                        OutputWordCounter.of(WORD_BOÄH,3)),