mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-29 12:37:37 +01:00
Fix test cases for ban commands.
This commit is contained in:
parent
d8eab7e397
commit
8a1b487a58
@ -19,10 +19,11 @@ import java.util.UUID;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Server;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
@ -48,8 +49,6 @@ import world.bentobox.bentobox.managers.RanksManager;
|
|||||||
* @author tastybento
|
* @author tastybento
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//FIXME
|
|
||||||
@Ignore
|
|
||||||
@RunWith(PowerMockRunner.class)
|
@RunWith(PowerMockRunner.class)
|
||||||
@PrepareForTest({Bukkit.class, BentoBox.class, User.class })
|
@PrepareForTest({Bukkit.class, BentoBox.class, User.class })
|
||||||
public class IslandBanCommandTest {
|
public class IslandBanCommandTest {
|
||||||
@ -118,6 +117,12 @@ public class IslandBanCommandTest {
|
|||||||
IslandWorldManager iwm = mock(IslandWorldManager.class);
|
IslandWorldManager iwm = mock(IslandWorldManager.class);
|
||||||
when(iwm.getFriendlyName(Mockito.any())).thenReturn("BSkyBlock");
|
when(iwm.getFriendlyName(Mockito.any())).thenReturn("BSkyBlock");
|
||||||
when(plugin.getIWM()).thenReturn(iwm);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,10 +17,11 @@ import java.util.Set;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Server;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
@ -45,8 +46,6 @@ import world.bentobox.bentobox.managers.RanksManager;
|
|||||||
* @author tastybento
|
* @author tastybento
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//FIXME
|
|
||||||
@Ignore
|
|
||||||
@RunWith(PowerMockRunner.class)
|
@RunWith(PowerMockRunner.class)
|
||||||
@PrepareForTest({Bukkit.class, BentoBox.class, User.class })
|
@PrepareForTest({Bukkit.class, BentoBox.class, User.class })
|
||||||
public class IslandUnbanCommandTest {
|
public class IslandUnbanCommandTest {
|
||||||
@ -119,6 +118,13 @@ public class IslandUnbanCommandTest {
|
|||||||
IslandWorldManager iwm = mock(IslandWorldManager.class);
|
IslandWorldManager iwm = mock(IslandWorldManager.class);
|
||||||
when(iwm.getFriendlyName(Mockito.any())).thenReturn("BSkyBlock");
|
when(iwm.getFriendlyName(Mockito.any())).thenReturn("BSkyBlock");
|
||||||
when(plugin.getIWM()).thenReturn(iwm);
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user