In tests, use specific assertion implementation

These generate more helpful error messages when assertions fail and
help to show intent.
This commit is contained in:
Guus der Kinderen 2020-10-03 16:34:18 +02:00
parent 5782fff2a4
commit a809f181f5
1 changed files with 8 additions and 6 deletions

View File

@ -16,7 +16,9 @@
*/ */
package org.jivesoftware.smackx.muc; 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.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.List; import java.util.List;
@ -144,9 +146,9 @@ public class MultiUserChatIntegrationTest extends AbstractSmackIntegrationTest {
muc.addUserStatusListener(userStatusListener); muc.addUserStatusListener(userStatusListener);
assertTrue(mucManagerOne.getJoinedRooms().size() == 1); assertEquals(1, mucManagerOne.getJoinedRooms().size());
assertTrue(muc.getOccupantsCount() == 1); assertEquals(1, muc.getOccupantsCount());
assertTrue(muc.getNickname() != null); assertNotNull(muc.getNickname());
try { try {
muc.destroy("Dummy reason", null); muc.destroy("Dummy reason", null);
@ -155,8 +157,8 @@ public class MultiUserChatIntegrationTest extends AbstractSmackIntegrationTest {
muc.removeUserStatusListener(userStatusListener); muc.removeUserStatusListener(userStatusListener);
} }
assertTrue(mucManagerOne.getJoinedRooms().size() == 0); assertEquals(0, mucManagerOne.getJoinedRooms().size());
assertTrue(muc.getOccupantsCount() == 0); assertEquals(0, muc.getOccupantsCount());
assertTrue(muc.getNickname() == null); assertNull(muc.getNickname());
} }
} }