assertRankingEqualsRankingFromLastMessage(KLAUS, store.get(KLAUS));
}
+ static void assertExpectedLastMessagesForUsers(MultiValueMap<User, Ranking> receivedMessages)
+ {
+ assertRankingEqualsRankingFromLastMessage(PETER, getLastMessageFor(PETER, receivedMessages));
+ assertRankingEqualsRankingFromLastMessage(KLAUS, getLastMessageFor(KLAUS, receivedMessages));
+ }
+
static void assertRankingEqualsRankingFromLastMessage(User user, Ranking ranking)
{
assertThat(ranking).isEqualTo(getLastMessageFor(user));
.untilAsserted(() -> TestData.assertExpectedMessages(consumer.getReceivedMessages()));
}
+ @DisplayName("Await the expected final output messages")
+ @Test
+ public void testAwaitExpectedLastMessagesForUsers()
+ {
+ await("Expected final output messages")
+ .atMost(Duration.ofSeconds(5))
+ .untilAsserted(() -> TestData.assertExpectedLastMessagesForUsers(consumer.getReceivedMessages()));
+ }
+
static class Consumer
{