Fix tests

This commit is contained in:
tastybento 2019-05-04 23:07:05 -07:00
parent 1a0933bdb7
commit faaff04bd5
4 changed files with 10 additions and 23 deletions

10
pom.xml
View File

@ -6,7 +6,7 @@
<groupId>world.bentobox</groupId>
<artifactId>bskyblock</artifactId>
<version>1.4.2</version>
<version>1.5.0</version>
<name>BSkyBlock</name>
<description>BSkyBlock is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland.</description>
@ -186,14 +186,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<minimizeJar>false</minimizeJar>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>

View File

@ -23,7 +23,10 @@ permissions:
default: true
bskyblock.island.lock:
description: Allows island locking
default: false
default: true
bskyblock.island.near:
description: Players can see nearby island names
default: true
bskyblock.island.expel:
description: Allows expelling of visitors
default: true

View File

@ -24,6 +24,7 @@ import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.entity.Player;
import org.eclipse.jdt.annotation.Nullable;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@ -37,6 +38,7 @@ import org.powermock.reflect.Whitebox;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.addons.AddonDescription;
import world.bentobox.bentobox.api.configuration.Config;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.bentobox.managers.CommandsManager;
@ -49,7 +51,7 @@ import world.bentobox.bskyblock.generators.ChunkGeneratorWorld;
*
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({Bukkit.class, BentoBox.class, User.class })
@PrepareForTest({Bukkit.class, BentoBox.class, User.class, Config.class })
public class BSkyBlockTest {
private User user;
@ -216,15 +218,4 @@ public class BSkyBlockTest {
assertTrue(addon.getDefaultWorldGenerator("", "") instanceof ChunkGeneratorWorld);
}
/**
* Test method for {@link world.bentobox.bskyblock.BSkyBlock#getDefaultWorldGenerator(java.lang.String, java.lang.String)}.
*/
@Test
public void testGetDefaultWorldGeneratorStringStringUseOwnGenerator() {
addon.onLoad();
addon.getSettings().setUseOwnGenerator(true);
addon.createWorlds();
assertNull(addon.getDefaultWorldGenerator("", ""));
}
}

View File

@ -41,6 +41,7 @@ import world.bentobox.bskyblock.Settings;
@PrepareForTest({Bukkit.class, BentoBox.class, User.class })
public class IslandCommandTest {
private static final int NUMBER_OF_COMMANDS = 18;
private User user;
private IslandsManager im;
private Island island;
@ -114,7 +115,7 @@ public class IslandCommandTest {
assertEquals("commands.island.parameters", cmd.getParameters());
assertEquals("commands.island.help.description", cmd.getDescription());
// Number of commands = sub commands + help
assertEquals("Number of sub commands registered", 17, cmd.getSubCommands().values().size());
assertEquals("Number of sub commands registered", NUMBER_OF_COMMANDS, cmd.getSubCommands().values().size());
}