From a809f181f56e14a08b44fdfb1c039a956aff3097 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Sat, 3 Oct 2020 16:34:18 +0200 Subject: [PATCH] In tests, use specific assertion implementation These generate more helpful error messages when assertions fail and help to show intent. --- .../smackx/muc/MultiUserChatIntegrationTest.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java index 8943e9023..afd34e36e 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java @@ -16,7 +16,9 @@ */ package org.jivesoftware.smackx.muc; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.List; @@ -144,9 +146,9 @@ public class MultiUserChatIntegrationTest extends AbstractSmackIntegrationTest { muc.addUserStatusListener(userStatusListener); - assertTrue(mucManagerOne.getJoinedRooms().size() == 1); - assertTrue(muc.getOccupantsCount() == 1); - assertTrue(muc.getNickname() != null); + assertEquals(1, mucManagerOne.getJoinedRooms().size()); + assertEquals(1, muc.getOccupantsCount()); + assertNotNull(muc.getNickname()); try { muc.destroy("Dummy reason", null); @@ -155,8 +157,8 @@ public class MultiUserChatIntegrationTest extends AbstractSmackIntegrationTest { muc.removeUserStatusListener(userStatusListener); } - assertTrue(mucManagerOne.getJoinedRooms().size() == 0); - assertTrue(muc.getOccupantsCount() == 0); - assertTrue(muc.getNickname() == null); + assertEquals(0, mucManagerOne.getJoinedRooms().size()); + assertEquals(0, muc.getOccupantsCount()); + assertNull(muc.getNickname()); } }