From 6203b92f2e9f067fc13f86d7073d90623ef91e96 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 9 May 2020 12:51:13 -0700 Subject: [PATCH] Fixed tests. --- .../java/world/bentobox/challenges/ChallengesManagerTest.java | 1 + .../java/world/bentobox/challenges/tasks/TryToCompleteTest.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/world/bentobox/challenges/ChallengesManagerTest.java b/src/test/java/world/bentobox/challenges/ChallengesManagerTest.java index bbe3b8e..d9aa352 100644 --- a/src/test/java/world/bentobox/challenges/ChallengesManagerTest.java +++ b/src/test/java/world/bentobox/challenges/ChallengesManagerTest.java @@ -118,6 +118,7 @@ public class ChallengesManagerTest { BentoBox plugin = mock(BentoBox.class); Whitebox.setInternalState(BentoBox.class, "instance", plugin); when(addon.getPlugin()).thenReturn(plugin); + User.setPlugin(plugin); // IWM when(plugin.getIWM()).thenReturn(iwm); diff --git a/src/test/java/world/bentobox/challenges/tasks/TryToCompleteTest.java b/src/test/java/world/bentobox/challenges/tasks/TryToCompleteTest.java index 9f72b31..2bbbe26 100644 --- a/src/test/java/world/bentobox/challenges/tasks/TryToCompleteTest.java +++ b/src/test/java/world/bentobox/challenges/tasks/TryToCompleteTest.java @@ -167,6 +167,7 @@ public class TryToCompleteTest { PowerMockito.mockStatic(Util.class); when(Util.getWorld(any())).thenReturn(world); when(Util.prettifyText(anyString())).thenCallRealMethod(); + when(Util.stripSpaceAfterColorCodes(anyString())).thenCallRealMethod(); // Island World Manager IslandWorldManager iwm = mock(IslandWorldManager.class); @@ -252,7 +253,6 @@ public class TryToCompleteTest { // ItemFactory ItemFactory itemFactory = mock(ItemFactory.class); when(Bukkit.getItemFactory()).thenReturn(itemFactory); - } /**