+ .containsExactly(words);
+ }
+
+ @Test
+ void order()
+ {
+ kafkaTemplate.send(TOPIC_IN, "beate", LORE_IPSUM);
+ kafkaTemplate.send(TOPIC_IN, "peter", LORE_IPSUM);
+ kafkaTemplate.send(TOPIC_IN, "klaus", LORE_IPSUM);
+
+ String[] words = messagSplitter.split(LORE_IPSUM);
+
+ Awaitility
+ .await("Receive all words")
+ .atMost(Duration.ofSeconds(5))
+ .untilAsserted(() -> {
+ assertThat(listener.total)
+ .describedAs("Received all words for beate")
+ .isEqualTo(words.length * 3);
+ });
+
+ assertThat(listener.words.keySet())
+ .describedAs("Received unexpected key(s)")
+ .containsExactlyInAnyOrder("beate", "peter", "klaus");
+ assertThat(listener.words.get("beate"))
+ .describedAs("Received unexpected words for beate")
+ .containsExactly(words);
+ assertThat(listener.words.get("peter"))
+ .describedAs("Received unexpected words for beate")
+ .containsExactly(words);
+ assertThat(listener.words.get("klaus"))
+ .describedAs("Received unexpected words for beate")
+ .containsExactly(words);