From c5175395f72b0a9fbed2fb992c7d8a230eefd968 Mon Sep 17 00:00:00 2001 From: Hao Wang Date: Fri, 16 Jul 2021 11:48:55 -0700 Subject: [PATCH] fix a flaky test --- .../java/fr/xephi/authme/listener/PlayerListenerTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/fr/xephi/authme/listener/PlayerListenerTest.java b/src/test/java/fr/xephi/authme/listener/PlayerListenerTest.java index c2459a652..6ea299732 100644 --- a/src/test/java/fr/xephi/authme/listener/PlayerListenerTest.java +++ b/src/test/java/fr/xephi/authme/listener/PlayerListenerTest.java @@ -65,7 +65,7 @@ import java.util.UUID; import static com.google.common.collect.Sets.newHashSet; import static fr.xephi.authme.listener.EventCancelVerifier.withServiceMock; import static fr.xephi.authme.service.BukkitServiceTestHelper.setBukkitServiceToScheduleSyncDelayedTaskWithDelay; -import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; @@ -345,7 +345,7 @@ public class PlayerListenerTest { // message sender + 3 recipients = 4 verify(listenerService, times(4)).shouldCancelEvent(any(Player.class)); verify(event, never()).setCancelled(anyBoolean()); - assertThat(event.getRecipients(), contains(recipients.get(1), recipients.get(2))); + assertThat(event.getRecipients(), containsInAnyOrder(recipients.get(1), recipients.get(2))); } @Test