mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-23 00:31:25 +01:00
clean up test files
This commit is contained in:
parent
be6e0b67be
commit
9821f1d9c8
6
pom.xml
6
pom.xml
@ -351,12 +351,6 @@
|
|||||||
<version>3.11.2</version>
|
<version>3.11.2</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.easymock</groupId>
|
|
||||||
<artifactId>easymock</artifactId>
|
|
||||||
<version>4.0.2</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
|
@ -14,12 +14,9 @@ import org.bukkit.Server;
|
|||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
|
||||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
@ -7,28 +7,28 @@ import com.onarandombox.MultiverseCore.utils.MockWorldFactory;
|
|||||||
import com.onarandombox.MultiverseCore.utils.TestInstanceCreator;
|
import com.onarandombox.MultiverseCore.utils.TestInstanceCreator;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.WorldType;
|
import org.bukkit.WorldType;
|
||||||
import org.bukkit.entity.Entity;
|
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Sheep;
|
import org.bukkit.entity.Sheep;
|
||||||
import org.bukkit.entity.Zombie;
|
import org.bukkit.entity.Zombie;
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
|
||||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static junit.framework.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.anyBoolean;
|
||||||
|
import static org.mockito.Mockito.anyString;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.never;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
public class TestEntitySpawnRules {
|
public class TestEntitySpawnRules {
|
||||||
TestInstanceCreator creator;
|
TestInstanceCreator creator;
|
||||||
@ -151,6 +151,6 @@ public class TestEntitySpawnRules {
|
|||||||
when(zombie.getType()).thenReturn(EntityType.ZOMBIE);
|
when(zombie.getType()).thenReturn(EntityType.ZOMBIE);
|
||||||
when(zombie.getWorld()).thenReturn(this.cbworld);
|
when(zombie.getWorld()).thenReturn(this.cbworld);
|
||||||
|
|
||||||
when(cbworld.getEntities()).thenReturn(Arrays.asList((Entity) sheep, (Entity) zombie));
|
when(cbworld.getEntities()).thenReturn(Arrays.asList(sheep, zombie));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,17 +2,16 @@ package com.onarandombox.MultiverseCore;
|
|||||||
|
|
||||||
import com.onarandombox.MultiverseCore.utils.TestInstanceCreator;
|
import com.onarandombox.MultiverseCore.utils.TestInstanceCreator;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
|
||||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
public class TestEntryFeeConversion {
|
public class TestEntryFeeConversion {
|
||||||
|
|
||||||
|
@ -6,14 +6,13 @@ import org.bukkit.Server;
|
|||||||
import org.bukkit.World.Environment;
|
import org.bukkit.World.Environment;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
|
||||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
@ -13,8 +13,6 @@ import com.onarandombox.MultiverseCore.configuration.SpawnLocation;
|
|||||||
import com.onarandombox.MultiverseCore.listeners.MVAsyncPlayerChatListener;
|
import com.onarandombox.MultiverseCore.listeners.MVAsyncPlayerChatListener;
|
||||||
import com.onarandombox.MultiverseCore.utils.MockWorldFactory;
|
import com.onarandombox.MultiverseCore.utils.MockWorldFactory;
|
||||||
import com.onarandombox.MultiverseCore.utils.TestInstanceCreator;
|
import com.onarandombox.MultiverseCore.utils.TestInstanceCreator;
|
||||||
import com.onarandombox.MultiverseCore.utils.WorldManager;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Difficulty;
|
import org.bukkit.Difficulty;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@ -36,22 +34,25 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||||
import org.bukkit.event.weather.ThunderChangeEvent;
|
import org.bukkit.event.weather.ThunderChangeEvent;
|
||||||
import org.bukkit.event.weather.WeatherChangeEvent;
|
import org.bukkit.event.weather.WeatherChangeEvent;
|
||||||
import org.bukkit.permissions.Permission;
|
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
|
||||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.mockito.internal.verification.VerificationModeFactory;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.mockito.Matchers.any;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.mockito.Matchers.anyString;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.junit.Assert.assertNull;
|
||||||
|
import static org.junit.Assert.assertSame;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.mockito.Mockito.any;
|
||||||
|
import static org.mockito.Mockito.anyString;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.never;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
public class TestWorldProperties {
|
public class TestWorldProperties {
|
||||||
private TestInstanceCreator creator;
|
private TestInstanceCreator creator;
|
||||||
@ -112,7 +113,7 @@ public class TestWorldProperties {
|
|||||||
String[] netherArgs = new String[] { "import", "world_nether", "nether" };
|
String[] netherArgs = new String[] { "import", "world_nether", "nether" };
|
||||||
core.onCommand(mockCommandSender, mockCommand, "", netherArgs);
|
core.onCommand(mockCommandSender, mockCommand, "", netherArgs);
|
||||||
verify(mockCommandSender).sendMessage("Starting import of world 'world_nether'...");
|
verify(mockCommandSender).sendMessage("Starting import of world 'world_nether'...");
|
||||||
verify(mockCommandSender, VerificationModeFactory.times(2)).sendMessage(
|
verify(mockCommandSender, times(2)).sendMessage(
|
||||||
ChatColor.GREEN + "Complete!");
|
ChatColor.GREEN + "Complete!");
|
||||||
|
|
||||||
assertEquals(core.getServer().getWorlds().size(), 2);
|
assertEquals(core.getServer().getWorlds().size(), 2);
|
||||||
@ -212,7 +213,7 @@ public class TestWorldProperties {
|
|||||||
assertTrue(mvWorld.setColor("BLACK"));
|
assertTrue(mvWorld.setColor("BLACK"));
|
||||||
assertFalse(mvWorld.setColor("INVALID COLOR"));
|
assertFalse(mvWorld.setColor("INVALID COLOR"));
|
||||||
assertEquals(ChatColor.BLACK, mvWorld.getColor());
|
assertEquals(ChatColor.BLACK, mvWorld.getColor());
|
||||||
assertEquals(ChatColor.BLACK.toString() + "alias" + ChatColor.WHITE.toString(), mvWorld.getColoredWorldString());
|
assertEquals(ChatColor.BLACK + "alias" + ChatColor.WHITE, mvWorld.getColoredWorldString());
|
||||||
mvWorld.setPVPMode(false);
|
mvWorld.setPVPMode(false);
|
||||||
assertEquals(false, mvWorld.isPVPEnabled());
|
assertEquals(false, mvWorld.isPVPEnabled());
|
||||||
assertTrue(mvWorld.setScaling(2D));
|
assertTrue(mvWorld.setScaling(2D));
|
||||||
@ -319,7 +320,7 @@ public class TestWorldProperties {
|
|||||||
assertEquals(true, mvWorld.isHidden());
|
assertEquals(true, mvWorld.isHidden());
|
||||||
assertEquals("alias", mvWorld.getAlias());
|
assertEquals("alias", mvWorld.getAlias());
|
||||||
assertEquals(ChatColor.GREEN, mvWorld.getColor());
|
assertEquals(ChatColor.GREEN, mvWorld.getColor());
|
||||||
assertEquals(ChatColor.GREEN.toString() + "alias" + ChatColor.WHITE.toString(), mvWorld.getColoredWorldString());
|
assertEquals(ChatColor.GREEN + "alias" + ChatColor.WHITE, mvWorld.getColoredWorldString());
|
||||||
assertEquals(false, mvWorld.isPVPEnabled());
|
assertEquals(false, mvWorld.isPVPEnabled());
|
||||||
assertEquals(2D, mvWorld.getScaling(), 0);
|
assertEquals(2D, mvWorld.getScaling(), 0);
|
||||||
assertSame(worldManager.getMVWorld("world_nether").getCBWorld(),
|
assertSame(worldManager.getMVWorld("world_nether").getCBWorld(),
|
||||||
|
@ -4,21 +4,20 @@ import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
|||||||
import com.onarandombox.MultiverseCore.api.WorldPurger;
|
import com.onarandombox.MultiverseCore.api.WorldPurger;
|
||||||
import com.onarandombox.MultiverseCore.utils.TestInstanceCreator;
|
import com.onarandombox.MultiverseCore.utils.TestInstanceCreator;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Entity;
|
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Sheep;
|
import org.bukkit.entity.Sheep;
|
||||||
import org.bukkit.entity.Zombie;
|
import org.bukkit.entity.Zombie;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
|
||||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.never;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
public class TestWorldPurger {
|
public class TestWorldPurger {
|
||||||
TestInstanceCreator creator;
|
TestInstanceCreator creator;
|
||||||
@ -115,6 +114,6 @@ public class TestWorldPurger {
|
|||||||
zombie = mock(Zombie.class);
|
zombie = mock(Zombie.class);
|
||||||
when(zombie.getType()).thenReturn(EntityType.ZOMBIE);
|
when(zombie.getType()).thenReturn(EntityType.ZOMBIE);
|
||||||
when(zombie.getWorld()).thenReturn(world);
|
when(zombie.getWorld()).thenReturn(world);
|
||||||
when(cbworld.getEntities()).thenReturn(Arrays.asList((Entity) sheep, (Entity) zombie));
|
when(cbworld.getEntities()).thenReturn(Arrays.asList(sheep, zombie));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,31 +12,29 @@ import com.onarandombox.MultiverseCore.exceptions.PropertyDoesNotExistException;
|
|||||||
import com.onarandombox.MultiverseCore.utils.MockWorldFactory;
|
import com.onarandombox.MultiverseCore.utils.MockWorldFactory;
|
||||||
import com.onarandombox.MultiverseCore.utils.TestInstanceCreator;
|
import com.onarandombox.MultiverseCore.utils.TestInstanceCreator;
|
||||||
import com.onarandombox.MultiverseCore.utils.WorldCreatorMatcher;
|
import com.onarandombox.MultiverseCore.utils.WorldCreatorMatcher;
|
||||||
import com.onarandombox.MultiverseCore.utils.WorldManager;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.WorldCreator;
|
import org.bukkit.WorldCreator;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.permissions.Permission;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
|
||||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.mockito.ArgumentMatchers;
|
import org.mockito.ArgumentMatchers;
|
||||||
import org.mockito.Matchers;
|
|
||||||
import org.mockito.internal.verification.VerificationModeFactory;
|
import org.mockito.internal.verification.VerificationModeFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import static junit.framework.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
public class TestWorldStuff {
|
public class TestWorldStuff {
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
package com.onarandombox.MultiverseCore.utils;
|
package com.onarandombox.MultiverseCore.utils;
|
||||||
|
|
||||||
import static org.junit.Assert.assertFalse;
|
import org.junit.After;
|
||||||
import static org.junit.Assert.assertTrue;
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
@ -10,10 +11,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.dumptruckman.minecraft.util.Logging;
|
import static org.junit.Assert.assertFalse;
|
||||||
import org.junit.After;
|
import static org.junit.Assert.assertTrue;
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
public class FileUtilsTest {
|
public class FileUtilsTest {
|
||||||
|
|
||||||
@ -137,7 +136,7 @@ public class FileUtilsTest {
|
|||||||
assertTrue(Files.isRegularFile(targetChildDirFile));
|
assertTrue(Files.isRegularFile(targetChildDirFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test()
|
@Test
|
||||||
public void copyFolder_intoExistingFolder_whereFileExists() throws Exception {
|
public void copyFolder_intoExistingFolder_whereFileExists() throws Exception {
|
||||||
Path targetDir = Files.createDirectory(tempDir.resolve("target"));
|
Path targetDir = Files.createDirectory(tempDir.resolve("target"));
|
||||||
Path targetFile = Files.createFile(targetDir.resolve("parentDirFile.txt"));
|
Path targetFile = Files.createFile(targetDir.resolve("parentDirFile.txt"));
|
||||||
|
@ -21,13 +21,17 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
|
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.any;
|
||||||
|
import static org.mockito.Mockito.anyBoolean;
|
||||||
|
import static org.mockito.Mockito.doAnswer;
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
public class MockWorldFactory {
|
public class MockWorldFactory {
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ import org.bukkit.plugin.PluginManager;
|
|||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
import org.bukkit.plugin.java.JavaPluginLoader;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
import org.mockito.ArgumentMatchers;
|
|
||||||
import org.mockito.internal.util.reflection.ReflectionMemberAccessor;
|
import org.mockito.internal.util.reflection.ReflectionMemberAccessor;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
import org.mockito.invocation.InvocationOnMock;
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
@ -41,16 +40,16 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.ArgumentMatchers.anyString;
|
import static org.mockito.Mockito.any;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.Mockito.anyBoolean;
|
||||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
import static org.mockito.Mockito.anyLong;
|
||||||
import static org.mockito.ArgumentMatchers.anyLong;
|
import static org.mockito.Mockito.anyString;
|
||||||
import static org.mockito.ArgumentMatchers.isNull;
|
import static org.mockito.Mockito.doAnswer;
|
||||||
import static org.mockito.Mockito.when;
|
|
||||||
import static org.mockito.Mockito.doReturn;
|
import static org.mockito.Mockito.doReturn;
|
||||||
|
import static org.mockito.Mockito.isA;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.spy;
|
import static org.mockito.Mockito.spy;
|
||||||
import static org.mockito.Mockito.doAnswer;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
public class TestInstanceCreator {
|
public class TestInstanceCreator {
|
||||||
private MultiverseCore core;
|
private MultiverseCore core;
|
||||||
@ -147,7 +146,7 @@ public class TestInstanceCreator {
|
|||||||
|
|
||||||
when(mockServer.getPluginManager()).thenReturn(mockPluginManager);
|
when(mockServer.getPluginManager()).thenReturn(mockPluginManager);
|
||||||
|
|
||||||
when(mockServer.createWorld(ArgumentMatchers.isA(WorldCreator.class))).thenAnswer(
|
when(mockServer.createWorld(isA(WorldCreator.class))).thenAnswer(
|
||||||
new Answer<World>() {
|
new Answer<World>() {
|
||||||
@Override
|
@Override
|
||||||
public World answer(InvocationOnMock invocation) throws Throwable {
|
public World answer(InvocationOnMock invocation) throws Throwable {
|
||||||
@ -254,9 +253,9 @@ public class TestInstanceCreator {
|
|||||||
when(commandSender.getServer()).thenReturn(mockServer);
|
when(commandSender.getServer()).thenReturn(mockServer);
|
||||||
when(commandSender.getName()).thenReturn("MockCommandSender");
|
when(commandSender.getName()).thenReturn("MockCommandSender");
|
||||||
when(commandSender.isPermissionSet(anyString())).thenReturn(true);
|
when(commandSender.isPermissionSet(anyString())).thenReturn(true);
|
||||||
when(commandSender.isPermissionSet(ArgumentMatchers.isA(Permission.class))).thenReturn(true);
|
when(commandSender.isPermissionSet(isA(Permission.class))).thenReturn(true);
|
||||||
when(commandSender.hasPermission(anyString())).thenReturn(true);
|
when(commandSender.hasPermission(anyString())).thenReturn(true);
|
||||||
when(commandSender.hasPermission(ArgumentMatchers.isA(Permission.class))).thenReturn(true);
|
when(commandSender.hasPermission(isA(Permission.class))).thenReturn(true);
|
||||||
when(commandSender.addAttachment(core)).thenReturn(null);
|
when(commandSender.addAttachment(core)).thenReturn(null);
|
||||||
when(commandSender.isOp()).thenReturn(true);
|
when(commandSender.isOp()).thenReturn(true);
|
||||||
|
|
||||||
|
@ -10,8 +10,8 @@ package com.onarandombox.MultiverseCore.utils;
|
|||||||
import java.util.logging.ConsoleHandler;
|
import java.util.logging.ConsoleHandler;
|
||||||
import java.util.logging.Handler;
|
import java.util.logging.Handler;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.LogRecord;
|
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
import java.util.logging.LogRecord;
|
||||||
|
|
||||||
public class Util {
|
public class Util {
|
||||||
private Util() {}
|
private Util() {}
|
||||||
|
@ -11,7 +11,7 @@ import org.bukkit.WorldCreator;
|
|||||||
import org.mockito.ArgumentMatcher;
|
import org.mockito.ArgumentMatcher;
|
||||||
|
|
||||||
public class WorldCreatorMatcher implements ArgumentMatcher<WorldCreator> {
|
public class WorldCreatorMatcher implements ArgumentMatcher<WorldCreator> {
|
||||||
private WorldCreator worldCreator;
|
private final WorldCreator worldCreator;
|
||||||
private boolean careAboutSeeds = false;
|
private boolean careAboutSeeds = false;
|
||||||
private boolean careAboutGenerators = false;
|
private boolean careAboutGenerators = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user