From fa1325bf148d0579cb5aa6da1f9dd0b97cc340c9 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Wed, 20 Feb 2019 11:20:14 +0100 Subject: [PATCH] Fixed IslandSethomeCommandTest --- .../api/commands/island/IslandSethomeCommandTest.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/test/java/world/bentobox/bentobox/api/commands/island/IslandSethomeCommandTest.java b/src/test/java/world/bentobox/bentobox/api/commands/island/IslandSethomeCommandTest.java index a49b597c6..678b454b5 100644 --- a/src/test/java/world/bentobox/bentobox/api/commands/island/IslandSethomeCommandTest.java +++ b/src/test/java/world/bentobox/bentobox/api/commands/island/IslandSethomeCommandTest.java @@ -1,6 +1,3 @@ -/** - * - */ package world.bentobox.bentobox.api.commands.island; import static org.junit.Assert.assertEquals; @@ -49,6 +46,7 @@ public class IslandSethomeCommandTest { private CompositeCommand ic; private User user; + private UUID uuid; private IslandsManager im; private Island island; private IslandWorldManager iwm; @@ -75,7 +73,7 @@ public class IslandSethomeCommandTest { // Sometimes use Mockito.withSettings().verboseLogging() user = mock(User.class); when(user.isOp()).thenReturn(false); - UUID uuid = UUID.randomUUID(); + uuid = UUID.randomUUID(); when(user.getUniqueId()).thenReturn(uuid); when(user.getPlayer()).thenReturn(player); when(user.getName()).thenReturn("tastybento"); @@ -125,8 +123,6 @@ public class IslandSethomeCommandTest { PowerMockito.mockStatic(Util.class); // 1 home for now when(user.getPermissionValue(Mockito.anyString(), Mockito.anyInt())).thenReturn(1); - - } /** @@ -153,6 +149,9 @@ public class IslandSethomeCommandTest { */ @Test public void testCanExecuteNoIsland() { + // Player doesn't have an island and doesn't have a team. + when(im.inTeam(Mockito.any(), Mockito.eq(uuid))).thenReturn(false); + IslandSethomeCommand isc = new IslandSethomeCommand(ic); assertFalse(isc.canExecute(user, "island", Collections.emptyList())); Mockito.verify(user).sendMessage("general.errors.no-island");