From aff6fcec22a801aa89403e09452ba3b02b6e5db3 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 16 Apr 2022 14:49:17 -0700 Subject: [PATCH] Fix failing test. Make player default to being on island. --- .../bentobox/challenges/commands/ChallengesPlayerCommand.java | 1 - .../bentobox/challenges/commands/ChallengesCommandTest.java | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/challenges/commands/ChallengesPlayerCommand.java b/src/main/java/world/bentobox/challenges/commands/ChallengesPlayerCommand.java index 882d164..fe2fd6e 100644 --- a/src/main/java/world/bentobox/challenges/commands/ChallengesPlayerCommand.java +++ b/src/main/java/world/bentobox/challenges/commands/ChallengesPlayerCommand.java @@ -50,7 +50,6 @@ public class ChallengesPlayerCommand extends CompositeCommand Utils.sendMessage(user, user.getTranslation("challenges.errors.no-challenges-admin", "[command]", topLabel + " " + this.getAddon().getChallengesSettings().getAdminMainCommand().split(" ")[0])); - } else { diff --git a/src/test/java/world/bentobox/challenges/commands/ChallengesCommandTest.java b/src/test/java/world/bentobox/challenges/commands/ChallengesCommandTest.java index 9c1b9c1..11182ea 100644 --- a/src/test/java/world/bentobox/challenges/commands/ChallengesCommandTest.java +++ b/src/test/java/world/bentobox/challenges/commands/ChallengesCommandTest.java @@ -159,6 +159,8 @@ public class ChallengesCommandTest { // Island when(plugin.getIslands()).thenReturn(im); when(im.getIsland(any(), any(User.class))).thenReturn(island); + // Default to player being on the island + when(im.locationIsOnIsland(any(Player.class), any())).thenReturn(true); // Util PowerMockito.mockStatic(Util.class, Mockito.RETURNS_MOCKS);