Skip to content

Commit 0bb6f46

Browse files
committed
Added missing stub for getInventory(int) method
1 parent 8ccb810 commit 0bb6f46

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

item/bukkit/src/test/java/it/angrybear/yagl/listeners/PersistentListenerTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ private static InventoryView getInventoryView(Player player, Inventory inventory
244244
when(player.getOpenInventory()).thenReturn(view);
245245
when(view.getPlayer()).thenReturn(player);
246246
when(view.getItem(any(int.class))).thenCallRealMethod();
247+
when(view.getInventory(any(int.class))).thenAnswer(a -> {
248+
int slot = a.getArgument(0);
249+
if (slot > inventory.getSize()) return inventory;
250+
return playerInventory;
251+
});
247252
return view;
248253
}
249254
}

0 commit comments

Comments
 (0)