mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-01 00:10:40 +01:00
Fix tests
This commit is contained in:
parent
1c5a52de4c
commit
b4ecb1dadd
@ -76,7 +76,6 @@ public class PhysicalInteractionListener extends FlagListener
|
||||
boolean result = TAG_TO_FLAG.entrySet().stream().filter(entry -> entry.getKey().isTagged(block.getType()))
|
||||
.findFirst().map(entry -> this.checkIsland(e, player, block.getLocation(), entry.getValue()))
|
||||
.orElse(true);
|
||||
|
||||
if (result && MAT_TO_FLAG.containsKey(block.getType())) {
|
||||
result = this.checkIsland(e, player, block.getLocation(), MAT_TO_FLAG.get(block.getType()));
|
||||
}
|
||||
|
@ -282,13 +282,11 @@ public class PhysicalInteractionListenerTest extends AbstractCommonSetup {
|
||||
// Test with wooden button
|
||||
when(block1.getType()).thenReturn(Material.OAK_BUTTON);
|
||||
when(Tag.WOODEN_BUTTONS.isTagged(Material.OAK_BUTTON)).thenReturn(true);
|
||||
i.onProjectileExplode(e);
|
||||
verify(notifier).notify(any(), eq("protection.protected"));
|
||||
|
||||
// Test with pressure plate
|
||||
when(block2.getType()).thenReturn(Material.STONE_PRESSURE_PLATE);
|
||||
when(Tag.PRESSURE_PLATES.isTagged(Material.STONE_PRESSURE_PLATE)).thenReturn(true);
|
||||
|
||||
i.onProjectileExplode(e);
|
||||
verify(notifier, times(3)).notify(any(), eq("protection.protected"));
|
||||
verify(notifier, times(2)).notify(any(), eq("protection.protected"));
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class FlagsManagerTest {
|
||||
/**
|
||||
* Update this value if the number of registered listeners changes
|
||||
*/
|
||||
private static final int NUMBER_OF_LISTENERS = 54;
|
||||
private static final int NUMBER_OF_LISTENERS = 55;
|
||||
@Mock
|
||||
private BentoBox plugin;
|
||||
@Mock
|
||||
|
Loading…
Reference in New Issue
Block a user