Fix tests

This commit is contained in:
tastybento 2020-06-04 07:59:24 -07:00
parent ad186958cc
commit 2329e2c61e
1 changed files with 7 additions and 3 deletions

View File

@ -22,6 +22,7 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.PluginManager;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -68,6 +69,8 @@ public class JoinListenerTest {
private OfflinePlayer owner;
@Mock
private Island island;
@Mock
private PluginManager pim;
@Before
public void setUp() {
@ -102,6 +105,7 @@ public class JoinListenerTest {
when(owner.isOnline()).thenReturn(true);
when(owner.getPlayer()).thenReturn(player);
when(Bukkit.getOfflinePlayer(any(UUID.class))).thenReturn(owner);
when(Bukkit.getPluginManager()).thenReturn(pim);
// Island
when(island.getOwner()).thenReturn(UUID.randomUUID());