Fix test cases for ban commands.

This commit is contained in:
tastybento 2019-01-13 08:52:57 -08:00
parent d8eab7e397
commit 8a1b487a58
2 changed files with 21 additions and 10 deletions

View File

@ -19,10 +19,11 @@ import java.util.UUID;
import java.util.stream.Collectors;
import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.bukkit.scheduler.BukkitScheduler;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
@ -48,8 +49,6 @@ import world.bentobox.bentobox.managers.RanksManager;
* @author tastybento
*
*/
//FIXME
@Ignore
@RunWith(PowerMockRunner.class)
@PrepareForTest({Bukkit.class, BentoBox.class, User.class })
public class IslandBanCommandTest {
@ -118,6 +117,12 @@ public class IslandBanCommandTest {
IslandWorldManager iwm = mock(IslandWorldManager.class);
when(iwm.getFriendlyName(Mockito.any())).thenReturn("BSkyBlock");
when(plugin.getIWM()).thenReturn(iwm);
// Server and Plugin Manager for events
Server server = mock(Server.class);
when(Bukkit.getServer()).thenReturn(server);
PluginManager pim = mock(PluginManager.class);
when(server.getPluginManager()).thenReturn(pim);
}
/**

View File

@ -17,10 +17,11 @@ import java.util.Set;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.bukkit.scheduler.BukkitScheduler;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
@ -45,8 +46,6 @@ import world.bentobox.bentobox.managers.RanksManager;
* @author tastybento
*
*/
//FIXME
@Ignore
@RunWith(PowerMockRunner.class)
@PrepareForTest({Bukkit.class, BentoBox.class, User.class })
public class IslandUnbanCommandTest {
@ -119,6 +118,13 @@ public class IslandUnbanCommandTest {
IslandWorldManager iwm = mock(IslandWorldManager.class);
when(iwm.getFriendlyName(Mockito.any())).thenReturn("BSkyBlock");
when(plugin.getIWM()).thenReturn(iwm);
// Server and Plugin Manager for events
Server server = mock(Server.class);
when(Bukkit.getServer()).thenReturn(server);
PluginManager pim = mock(PluginManager.class);
when(server.getPluginManager()).thenReturn(pim);
}
/**