Fix failing test. Make player default to being on island.

This commit is contained in:
tastybento 2022-04-16 14:49:17 -07:00
parent 80f748070e
commit aff6fcec22
2 changed files with 2 additions and 1 deletions

View File

@ -50,7 +50,6 @@ public class ChallengesPlayerCommand extends CompositeCommand
Utils.sendMessage(user, user.getTranslation("challenges.errors.no-challenges-admin", Utils.sendMessage(user, user.getTranslation("challenges.errors.no-challenges-admin",
"[command]", "[command]",
topLabel + " " + this.<ChallengesAddon>getAddon().getChallengesSettings().getAdminMainCommand().split(" ")[0])); topLabel + " " + this.<ChallengesAddon>getAddon().getChallengesSettings().getAdminMainCommand().split(" ")[0]));
} }
else else
{ {

View File

@ -159,6 +159,8 @@ public class ChallengesCommandTest {
// Island // Island
when(plugin.getIslands()).thenReturn(im); when(plugin.getIslands()).thenReturn(im);
when(im.getIsland(any(), any(User.class))).thenReturn(island); 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 // Util
PowerMockito.mockStatic(Util.class, Mockito.RETURNS_MOCKS); PowerMockito.mockStatic(Util.class, Mockito.RETURNS_MOCKS);