diff --git a/pom.xml b/pom.xml index a4ff247..415bda0 100644 --- a/pom.xml +++ b/pom.xml @@ -54,12 +54,12 @@ UTF-8 UTF-8 - 16 + 17 2.0.9 - 1.17-R0.1-SNAPSHOT - 1.18.0-SNAPSHOT + 1.19.4-R0.1-SNAPSHOT + 1.23.0-SNAPSHOT 2.7.0-SNAPSHOT ${build.version}-SNAPSHOT diff --git a/src/main/java/world/bentobox/warps/managers/WarpSignsManager.java b/src/main/java/world/bentobox/warps/managers/WarpSignsManager.java index 52e95bd..3d32b95 100644 --- a/src/main/java/world/bentobox/warps/managers/WarpSignsManager.java +++ b/src/main/java/world/bentobox/warps/managers/WarpSignsManager.java @@ -373,7 +373,6 @@ public class WarpSignsManager { .getInstance() .getIWM() .getFriendlyName(actualWarp.getWorld()); - warpOwner.sendMessage("warps.player-warped", "[name]", user.getName(), "[gamemode]", gameMode); } }); diff --git a/src/test/java/world/bentobox/warps/WarpSignsManagerTest.java b/src/test/java/world/bentobox/warps/WarpSignsManagerTest.java index 946dc5b..8a53f70 100644 --- a/src/test/java/world/bentobox/warps/WarpSignsManagerTest.java +++ b/src/test/java/world/bentobox/warps/WarpSignsManagerTest.java @@ -21,7 +21,6 @@ import java.util.concurrent.CompletableFuture; import java.util.logging.Logger; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.OfflinePlayer; @@ -71,7 +70,7 @@ import world.bentobox.warps.objects.WarpsData; * */ @RunWith(PowerMockRunner.class) -@PrepareForTest({Bukkit.class, Util.class, DatabaseSetup.class, ChatColor.class}) +@PrepareForTest({Bukkit.class, Util.class, DatabaseSetup.class}) public class WarpSignsManagerTest { @Mock @@ -139,12 +138,15 @@ public class WarpSignsManagerTest { // Player when(player.getUniqueId()).thenReturn(uuid); + when(player.isOnline()).thenReturn(true); + when(player.canSee(any(Player.class))).thenReturn(true); User.setPlugin(plugin); User.getInstance(player); // Locales LocalesManager lm = mock(LocalesManager.class); - when(lm.get(Mockito.any(), Mockito.any())).thenReturn(null); + when(lm.getAvailablePrefixes(any())).thenReturn(Collections.emptySet()); + when(lm.get(Mockito.any(), Mockito.any())).thenAnswer((Answer) invocation -> invocation.getArgument(1, String.class)); when(plugin.getLocalesManager()).thenReturn(lm); // Return the same string PlaceholdersManager phm = mock(PlaceholdersManager.class); @@ -212,6 +214,7 @@ public class WarpSignsManagerTest { // IWM when(plugin.getIWM()).thenReturn(iwm); when(iwm.getPermissionPrefix(any())).thenReturn("bskyblock."); + when(iwm.getFriendlyName(any())).thenReturn("BSkyBlock"); // Island Manager when(addon.getIslands()).thenReturn(im); @@ -425,13 +428,15 @@ public class WarpSignsManagerTest { when(p.getWorld()).thenReturn(world); when(p.getName()).thenReturn("tastybento"); when(p.getLocation()).thenReturn(location); + when(p.isOnline()).thenReturn(true); + when(p.canSee(any(Player.class))).thenReturn(true); @Nullable User u = User.getInstance(p); PowerMockito.when(Util.teleportAsync(any(), any(), any())).thenReturn(CompletableFuture.completedFuture(true)); wsm.warpPlayer(world, u, uuid); PowerMockito.verifyStatic(Util.class); Util.teleportAsync(eq(p), any(), eq(TeleportCause.COMMAND)); - verify(player).sendMessage("warps.player-warped"); + verify(player).sendMessage(anyString()); } /**