Fixes tests that broke by #158 bug fix.

b45a3160c7
This commit is contained in:
tastybento 2018-06-17 17:09:52 -07:00
parent a71eee537d
commit c03c1e3ecc
3 changed files with 4 additions and 1 deletions

View File

@ -166,6 +166,7 @@ public class TestBSkyBlock {
Bukkit.getLogger().info("SETUP: member UUID = " + MEMBER_UUID);
Bukkit.getLogger().info("SETUP: visitor UUID = " + VISITOR_UUID);
Mockito.when(im.getIslandAt(Matchers.any())).thenReturn(Optional.of(island));
when(im.getProtectedIslandAt(Mockito.any())).thenReturn(Optional.of(island));
Settings settings = mock(Settings.class);
Mockito.when(plugin.getSettings()).thenReturn(settings);

View File

@ -412,6 +412,7 @@ public class FireListenerTest {
when(plugin.getIslands()).thenReturn(im);
Island island = mock(Island.class);
when(im.getIslandAt(Matchers.any())).thenReturn(Optional.of(island));
when(im.getProtectedIslandAt(Mockito.any())).thenReturn(Optional.of(island));
// Block on fire
Block block = mock(Block.class);
@ -482,7 +483,7 @@ public class FireListenerTest {
assertFalse(listener.onTNTDamage(e));
// Check with no island
when(im.getIslandAt(Matchers.any())).thenReturn(Optional.empty());
when(im.getProtectedIslandAt(Matchers.any())).thenReturn(Optional.empty());
// BREAK_BLOCKS spread is not allowed, so should be cancelled
Flags.BREAK_BLOCKS.setDefaultSetting(false);
assertTrue(listener.onTNTDamage(e));

View File

@ -155,6 +155,7 @@ public class PVPListenerTest {
when(im.userIsOnIsland(Mockito.any(), Mockito.any())).thenReturn(true);
island = mock(Island.class);
when(im.getIslandAt(Mockito.any())).thenReturn(Optional.of(island));
when(im.getProtectedIslandAt(Mockito.any())).thenReturn(Optional.of(island));
// All flags are disallowed by default.
when(island.isAllowed(Mockito.any())).thenReturn(false);
when(plugin.getIslands()).thenReturn(im);