From 4e4f9880d8f8c0a6996c48fb5b4101310f77c067 Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 30 Dec 2024 16:28:17 -0800 Subject: [PATCH] Fix for test class --- .../flags/protection/BlockInteractionListenerTest.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/java/world/bentobox/bentobox/listeners/flags/protection/BlockInteractionListenerTest.java b/src/test/java/world/bentobox/bentobox/listeners/flags/protection/BlockInteractionListenerTest.java index 8b8199d8f..9df46bade 100644 --- a/src/test/java/world/bentobox/bentobox/listeners/flags/protection/BlockInteractionListenerTest.java +++ b/src/test/java/world/bentobox/bentobox/listeners/flags/protection/BlockInteractionListenerTest.java @@ -46,7 +46,6 @@ import world.bentobox.bentobox.util.Util; * @author tastybento * */ -@Ignore("Paper API update required") @RunWith(PowerMockRunner.class) @PrepareForTest({Bukkit.class, BentoBox.class, Util.class, ServerBuildInfo.class}) public class BlockInteractionListenerTest extends AbstractCommonSetup { @@ -130,8 +129,6 @@ public class BlockInteractionListenerTest extends AbstractCommonSetup { } - /** - */ @Override @Before public void setUp() throws Exception { @@ -147,7 +144,9 @@ public class BlockInteractionListenerTest extends AbstractCommonSetup { when(item.getType()).thenReturn(Material.AIR); when(mockPlayer.getInventory()).thenReturn(inv); when(inv.getItemInMainHand()).thenReturn(item); - when(inv.getItemInOffHand()).thenReturn(new ItemStack(Material.BUCKET)); + ItemStack mockBucket = mock(ItemStack.class); + when(mockBucket.getType()).thenReturn(Material.BUCKET); + when(inv.getItemInOffHand()).thenReturn(mockBucket); // FlagsManager setFlags();