Compacted & clearified code: records are created "in place"
authorKai Moritz <kai@juplo.de>
Fri, 5 Jul 2024 21:27:11 +0000 (23:27 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 5 Jul 2024 21:27:11 +0000 (23:27 +0200)
src/test/java/de/juplo/kafka/wordcount/counter/StreamStreamJoinTopologyTest.java

index c930c9e..de45d53 100644 (file)
@@ -22,20 +22,6 @@ import static org.assertj.core.api.Assertions.assertThat;
 @Slf4j
 public class StreamStreamJoinTopologyTest
 {
-  TestRecord<String, String> A = recordOf("A", 3);
-  TestRecord<String, String> a = recordOf("a", 4);
-  TestRecord<String, String> B = recordOf("B", 5);
-  TestRecord<String, String> b = recordOf("b", 6);
-  TestRecord<String, String> C = recordOf("C", 9);
-  TestRecord<String, String> c = recordOf("c", 10);
-  TestRecord<String, String> D = recordOf("D", 15);
-  TestRecord<String, String> d = recordOf("d", 14);
-  TestRecord<String, String> E = recordOf("E", 40);
-  TestRecord<String, String> F = recordOf("F", 60);
-  TestRecord<String, String> f = recordOf("f", 80);
-  TestRecord<String, String> G = recordOf("G", 100);
-
-
   @Test
   public void test()
   {
@@ -75,37 +61,37 @@ public class StreamStreamJoinTopologyTest
         Serdes.String().deserializer());
 
 
-    inLeft.pipeInput(A);
+    inLeft.pipeInput(recordOf("A", 3));
     assertThat(outcome()).containsExactlyInAnyOrder();
 
-    inRight.pipeInput(a);
+    inRight.pipeInput(recordOf("a", 4));
     assertThat(outcome()).containsExactlyInAnyOrder("A-a");
 
-    inLeft.pipeInput(B);
+    inLeft.pipeInput(recordOf("B", 5));
     assertThat(outcome()).containsExactlyInAnyOrder("B-a");
 
-    inRight.pipeInput(b);
+    inRight.pipeInput(recordOf("b", 6));
     assertThat(outcome()).containsExactlyInAnyOrder("A-b", "B-b");
 
-    inLeft.pipeInput(C);
+    inLeft.pipeInput(recordOf("C", 9));
     assertThat(outcome()).containsExactlyInAnyOrder("C-a", "C-b");
 
-    inRight.pipeInput(c);
+    inRight.pipeInput(recordOf("c", 10));
     assertThat(outcome()).containsExactlyInAnyOrder("A-c", "B-c", "C-c");
 
-    inRight.pipeInput(d);
+    inRight.pipeInput(recordOf("d", 14));
     assertThat(outcome()).containsExactlyInAnyOrder("B-d", "C-d"); // !
 
-    inLeft.pipeInput(D);
+    inLeft.pipeInput(recordOf("D", 15));
     assertThat(outcome()).containsExactlyInAnyOrder("D-b", "D-c", "D-d");
 
-    inLeft.pipeInput(E);
+    inLeft.pipeInput(recordOf("E", 40));
     assertThat(outcome()).containsExactlyInAnyOrder();
 
-    inLeft.pipeInput(F);
+    inLeft.pipeInput(recordOf("F", 60));
     assertThat(outcome()).containsExactlyInAnyOrder();
 
-    inLeft.pipeInput(G);
+    inLeft.pipeInput(recordOf("G", 100));
     assertThat(outcome()).containsExactlyInAnyOrder();
   }