mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-01 21:11:37 +01:00
Made Test class cleaner.
This commit is contained in:
parent
a198c1a44a
commit
2effa48c8f
@ -20,7 +20,7 @@ import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
@ -32,13 +32,13 @@ import us.tastybento.bskyblock.api.events.team.TeamEvent.TeamReason;
|
||||
import us.tastybento.bskyblock.config.Settings;
|
||||
import us.tastybento.bskyblock.util.Util;
|
||||
|
||||
public class TestIslandCommand {
|
||||
public class TestBSkyBlock {
|
||||
private final UUID playerUUID = UUID.randomUUID();
|
||||
private CommandSender sender;
|
||||
private Player player;
|
||||
private static CommandSender sender;
|
||||
private static Player player;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
@BeforeClass
|
||||
public static void setUp() {
|
||||
|
||||
//Plugin plugin = mock(Plugin.class);
|
||||
//Mockito.doReturn(plugin).when(BSkyBlock.getPlugin());
|
||||
@ -63,7 +63,7 @@ public class TestIslandCommand {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
public void testIslandEvent() {
|
||||
|
||||
// Test island events
|
||||
IslandBaseEvent event = TeamEvent.builder()
|
||||
@ -72,7 +72,10 @@ public class TestIslandCommand {
|
||||
.involvedPlayer(playerUUID)
|
||||
.build();
|
||||
assertEquals(playerUUID, event.getPlayerUUID());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCommandAPI() {
|
||||
// Test command
|
||||
User user = User.getInstance(playerUUID);
|
||||
CompositeCommand testCommand = new TestCommand();
|
||||
@ -115,7 +118,7 @@ public class TestIslandCommand {
|
||||
// Test for partial word
|
||||
assertEquals(Arrays.asList(new String[] {"Ben", "Bill"}),
|
||||
testCommand.tabComplete(player, "test", new String[] {"sub2", "subsub", "subsubsub", "b"}));
|
||||
|
||||
|
||||
// Test command arguments
|
||||
CompositeCommand argCmd = new Test3ArgsCommand();
|
||||
argCmd.setOnlyPlayer(true);
|
@ -1,40 +0,0 @@
|
||||
package bskyblock;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.Before;
|
||||
|
||||
public class TestTest {
|
||||
private final UUID playerUUID = UUID.randomUUID();
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
/*
|
||||
World world = mock(World.class);
|
||||
|
||||
|
||||
//Mockito.when(world.getWorldFolder()).thenReturn(worldFile);
|
||||
|
||||
Server server = mock(Server.class);
|
||||
Mockito.when(server.getLogger()).thenReturn(Logger.getAnonymousLogger());
|
||||
Mockito.when(server.getWorld("world")).thenReturn(world);
|
||||
Mockito.when(server.getVersion()).thenReturn("TestTestMocking");
|
||||
Mockito.when(server.getVersion()).thenReturn("TestTestMocking");
|
||||
Bukkit.setServer(server);
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
@Test
|
||||
public void createAndSave() {
|
||||
|
||||
|
||||
IslandBaseEvent event = TeamEvent.builder()
|
||||
//.island(getIslands().getIsland(playerUUID))
|
||||
.reason(TeamReason.INFO)
|
||||
.involvedPlayer(playerUUID)
|
||||
.build();
|
||||
assertEquals(playerUUID, event.getPlayerUUID());
|
||||
|
||||
}*/
|
||||
}
|
Loading…
Reference in New Issue
Block a user