mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-10 09:21:31 +01:00
Fix tests
This commit is contained in:
parent
7882a77b14
commit
f5338bfaac
@ -67,6 +67,7 @@ public class PlayersTest {
|
||||
Location l = mock(Location.class);
|
||||
World w = mock(World.class);
|
||||
when(w.getName()).thenReturn("world");
|
||||
when(w.getEnvironment()).thenReturn(World.Environment.NORMAL);
|
||||
when(l.getWorld()).thenReturn(w);
|
||||
p.setHomeLocation(l, 5);
|
||||
assertEquals(l, p.getHomeLocation(w, 5));
|
||||
|
@ -3,6 +3,7 @@ package world.bentobox.bentobox.managers;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSet.Builder;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -149,6 +150,8 @@ public class IslandsManagerTest {
|
||||
when(location.getWorld()).thenReturn(world);
|
||||
when(location.getBlock()).thenReturn(space1);
|
||||
when(location.getWorld()).thenReturn(world);
|
||||
Chunk chunk = mock(Chunk.class);
|
||||
when(location.getChunk()).thenReturn(chunk);
|
||||
when(space1.getRelative(BlockFace.DOWN)).thenReturn(ground);
|
||||
when(space1.getRelative(BlockFace.UP)).thenReturn(space2);
|
||||
// A safe spot
|
||||
|
@ -80,10 +80,13 @@ public class PlayersManagerTest {
|
||||
IslandWorldManager iwm = mock(IslandWorldManager.class);
|
||||
world = mock(World.class);
|
||||
when(world.getName()).thenReturn("world");
|
||||
when(world.getEnvironment()).thenReturn(World.Environment.NORMAL);
|
||||
nether = mock(World.class);
|
||||
when(nether.getName()).thenReturn("world_nether");
|
||||
when(nether.getEnvironment()).thenReturn(World.Environment.NETHER);
|
||||
end = mock(World.class);
|
||||
when(end.getName()).thenReturn("world_the_end");
|
||||
when(end.getEnvironment()).thenReturn(World.Environment.THE_END);
|
||||
when(iwm.inWorld(any(World.class))).thenReturn(true);
|
||||
when(iwm.inWorld(any(Location.class))).thenReturn(true);
|
||||
when(plugin.getIWM()).thenReturn(iwm);
|
||||
|
Loading…
Reference in New Issue
Block a user