query: 2.0.1 - (GREEN) Adjusted implementation to corrected expectations query-2.0.1
authorKai Moritz <kai@juplo.de>
Sun, 16 Jun 2024 19:38:51 +0000 (21:38 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 16 Jun 2024 19:39:35 +0000 (21:39 +0200)
src/main/java/de/juplo/kafka/wordcount/query/Entry.java
src/main/java/de/juplo/kafka/wordcount/query/Key.java
src/main/java/de/juplo/kafka/wordcount/query/QueryStreamProcessor.java
src/test/java/de/juplo/kafka/wordcount/query/TestData.java

index 80b4daf..4be314c 100644 (file)
@@ -7,5 +7,5 @@ import lombok.Data;
 public class Entry
 {
   private String word;
-  private Long count;
+  private Long counter;
 }
index afeac4a..57d095a 100644 (file)
@@ -6,6 +6,5 @@ import lombok.Data;
 @Data
 public class Key
 {
-  private String username;
-  private String word;
+  private String user;
 }
index 3a1665f..e075eb7 100644 (file)
@@ -65,7 +65,7 @@ public class QueryStreamProcessor
                                                                .withValueSerde(new JsonSerde().copyWithType(User.class)));
                KStream<String, Ranking> rankings = builder
                                .<Key, Ranking>stream(rankingInputTopic)
-                               .map((key, value) -> new KeyValue<>(key.getUsername(), value));
+                               .map((key, value) -> new KeyValue<>(key.getUser(), value));
 
                rankings
                                .join(users, (ranking, user) -> UserRanking.of(
index cf58173..f5b8a00 100644 (file)
@@ -70,7 +70,7 @@ class TestData
        {
                Entry entry = new Entry();
                entry.setWord(testEntry.getWord());
-               entry.setCount(testEntry.getCounter());
+               entry.setCounter(testEntry.getCounter());
                return entry;
        }
        private static KeyValue<TestUser, TestRanking>[] TOP10_MESSAGES = new KeyValue[]