From: Kai Moritz Date: Fri, 5 Jul 2024 21:10:02 +0000 (+0200) Subject: Fixed some misconceptions in the stream/stream-demo X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=0df91ea72369123c6d10e3084304fc48ea981583;p=demos%2Fkafka%2Fwordcount Fixed some misconceptions in the stream/stream-demo --- diff --git a/src/test/java/de/juplo/kafka/wordcount/counter/StreamStreamJoinTopologyTest.java b/src/test/java/de/juplo/kafka/wordcount/counter/StreamStreamJoinTopologyTest.java index 8d178d5..c930c9e 100644 --- a/src/test/java/de/juplo/kafka/wordcount/counter/StreamStreamJoinTopologyTest.java +++ b/src/test/java/de/juplo/kafka/wordcount/counter/StreamStreamJoinTopologyTest.java @@ -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 recordOf(String value, int second) { - return new TestRecord<>("foo", value, T.minusSeconds(second)); + return new TestRecord<>("foo", value, T.plusSeconds(second)); } Stream outcome()