From 7e9a5713e96812dc64ba2555fdf79646bb15f707 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Thu, 13 Jun 2024 15:32:23 +0200 Subject: [PATCH] [sinttest] Improve test assertion message Making use of the new assertion handling for MultiResultSyncPoint, the integration test that uses that implementation can now get improved assertion messages. This will allow users to more quickly determine why a test is failing. --- .../smackx/muc/MultiUserChatOccupantIntegrationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java index 4caad88d9..3be33ae6d 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java @@ -293,10 +293,10 @@ public class MultiUserChatOccupantIntegrationTest extends AbstractMultiUserChatI try { mucAsSeenByThree.join(nicknameThree); - List results = syncPoint.waitForResults(timeout); + List results = assertResult(syncPoint, "Expected all occupants of room '" + mucAddress + "' to be notified of '" + conThree.getUser() + "' using nickname '" + nicknameThree + "' joining the room (but one or more did not get notified)."); assertTrue(results.stream().allMatch( result -> JidCreate.fullFrom(mucAddress, nicknameThree).equals(result.getFrom())), - "Expected all occupants of room '" + mucAddress + "' to be notified of '" + conThree.getUser() + "' using nickname '" + nicknameThree + "' joining the room (but one or more got notified )."); + "Expected all occupants of room '" + mucAddress + "' to be notified of '" + conThree.getUser() + "' using nickname '" + nicknameThree + "' joining the room (but one or more got notified for a different user)."); assertTrue(results.stream().anyMatch( result -> result.getTo().equals(conOne.getUser().asEntityFullJidIfPossible())), "Expected '" + conOne.getUser().asEntityFullJidIfPossible() + "' to be notified of '" + conThree.getUser() + "' joining room '" + mucAddress + "' (but did not)");