Fixed some misconceptions in the stream/stream-demo
authorKai Moritz <kai@juplo.de>
Fri, 5 Jul 2024 21:10:02 +0000 (23:10 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 5 Jul 2024 21:24:10 +0000 (23:24 +0200)
src/test/java/de/juplo/kafka/wordcount/counter/StreamStreamJoinTopologyTest.java

index 8d178d5..c930c9e 100644 (file)
@@ -76,13 +76,13 @@ public class StreamStreamJoinTopologyTest
 
 
     inLeft.pipeInput(A);
-    assertThat(outJoined.isEmpty()).isTrue();
+    assertThat(outcome()).containsExactlyInAnyOrder();
 
     inRight.pipeInput(a);
-    assertThat(outcome()).containsExactly("A-a");
+    assertThat(outcome()).containsExactlyInAnyOrder("A-a");
 
     inLeft.pipeInput(B);
-    assertThat(outcome()).containsExactly("B-a");
+    assertThat(outcome()).containsExactlyInAnyOrder("B-a");
 
     inRight.pipeInput(b);
     assertThat(outcome()).containsExactlyInAnyOrder("A-b", "B-b");
@@ -100,25 +100,20 @@ public class StreamStreamJoinTopologyTest
     assertThat(outcome()).containsExactlyInAnyOrder("D-b", "D-c", "D-d");
 
     inLeft.pipeInput(E);
-    assertThat(noResult());
+    assertThat(outcome()).containsExactlyInAnyOrder();
 
     inLeft.pipeInput(F);
-    assertThat(noResult());
+    assertThat(outcome()).containsExactlyInAnyOrder();
 
     inLeft.pipeInput(G);
-    assertThat(noResult());
+    assertThat(outcome()).containsExactlyInAnyOrder();
   }
 
 
 
-  boolean noResult()
-  {
-    return outJoined.isEmpty();
-  }
-
   TestRecord<String, String> recordOf(String value, int second)
   {
-    return new TestRecord<>("foo", value, T.minusSeconds(second));
+    return new TestRecord<>("foo", value, T.plusSeconds(second));
   }
 
   Stream<String> outcome()