Fix tests, and caught NPE
This commit is contained in:
parent
939a2e8b1f
commit
156e7ce373
|
@ -64,6 +64,9 @@ public class ImportCommand extends MultiverseCommand {
|
|||
|
||||
private String getPotentialWorlds() {
|
||||
File worldFolder = this.plugin.getServer().getWorldContainer();
|
||||
if (worldFolder == null) {
|
||||
return "";
|
||||
}
|
||||
File[] files = worldFolder.listFiles();
|
||||
String worldList = "";
|
||||
Collection<MultiverseWorld> worlds = this.worldManager.getMVWorlds();
|
||||
|
|
|
@ -84,7 +84,7 @@ public class TestWorldStuff {
|
|||
// Import the first world. The world folder does not exist.
|
||||
plugin.onCommand(mockCommandSender, mockCommand, "", normalArgs);
|
||||
verify(mockCommandSender).sendMessage(ChatColor.RED + "FAILED.");
|
||||
verify(mockCommandSender).sendMessage("That world folder does not exist...");
|
||||
verify(mockCommandSender).sendMessage("That world folder does not exist. These look like worlds to me:");
|
||||
|
||||
// We should still have no worlds.
|
||||
assertEquals(0, creator.getCore().getMVWorldManager().getMVWorlds().size());
|
||||
|
|
Loading…
Reference in New Issue