From 5c8af0c1df28c651157a76eb243813f591bf048e Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 2 Jan 2022 12:21:28 -0800 Subject: [PATCH] Fix tests --- .../bentobox/managers/PlayersManagerTest.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/test/java/world/bentobox/bentobox/managers/PlayersManagerTest.java b/src/test/java/world/bentobox/bentobox/managers/PlayersManagerTest.java index 44cd67b08..c99d1b0da 100644 --- a/src/test/java/world/bentobox/bentobox/managers/PlayersManagerTest.java +++ b/src/test/java/world/bentobox/bentobox/managers/PlayersManagerTest.java @@ -147,9 +147,17 @@ public class PlayersManagerTest { when(nether.getSpawnLocation()).thenReturn(netherSpawn); when(iwm.getNetherSpawnRadius(Mockito.any())).thenReturn(100); + // UUID + uuid = UUID.randomUUID(); + notUUID = UUID.randomUUID(); + while(notUUID.equals(uuid)) { + notUUID = UUID.randomUUID(); + } + // Player when(p.getEnderChest()).thenReturn(inv); when(p.getInventory()).thenReturn(playerInv); + when(p.getUniqueId()).thenReturn(uuid); AttributeInstance at = mock(AttributeInstance.class); when(at.getValue()).thenReturn(20D); when(p.getAttribute(Attribute.GENERIC_MAX_HEALTH)).thenReturn(at); @@ -157,11 +165,6 @@ public class PlayersManagerTest { // Sometimes use Mockito.withSettings().verboseLogging() user = mock(User.class); when(user.isOp()).thenReturn(false); - uuid = UUID.randomUUID(); - notUUID = UUID.randomUUID(); - while(notUUID.equals(uuid)) { - notUUID = UUID.randomUUID(); - } when(user.getUniqueId()).thenReturn(uuid); when(user.getPlayer()).thenReturn(p); when(user.getName()).thenReturn("tastybento");