use of net.glowstone.entity.FishingRewardManager in project Glowstone by GlowstoneMC.
the class GlowFishingHookTest method setUp.
@Before
@Override
public void setUp() throws Exception {
super.setUp();
PowerMockito.mockStatic(Bukkit.class);
when(Bukkit.getServer()).thenReturn(server);
eventsFired.removeAll(PlayerFishEvent.class);
when(world.getBlockAt(any(Location.class))).thenReturn(block);
when(world.getBlockAt(anyInt(), anyInt(), anyInt())).thenReturn(block);
when(block.getType()).thenReturn(Material.WATER);
fishingRewardManager = new FishingRewardManager();
when(server.getFishingRewardManager()).thenReturn(fishingRewardManager);
when(player.getLocation()).thenReturn(location);
when(eventFactory.callEvent(any(Event.class))).thenAnswer(invocation -> {
Event e = invocation.getArgument(0);
eventsFired.put(e.getClass(), e);
return e;
});
when(eventFactory.onEntityDamage(any(EntityDamageEvent.class))).thenAnswer(returnsFirstArg());
}
Aggregations