Fixes failing UnitTests for Challenges Addon.

This commit is contained in:
BONNe 2020-11-05 09:24:06 +02:00
parent 27d10f2d16
commit 3e542036a0
2 changed files with 4 additions and 2 deletions

View File

@ -291,7 +291,7 @@ public class ChallengesAddonTest {
addon.setState(State.LOADED);
addon.onEnable();
verify(plugin).logWarning("[challenges] Level add-on not found so level challenges will not work!");
verify(plugin).logWarning("[challenges] Economy plugin not found so money options will not work!");
verify(plugin).logWarning("[challenges] Vault plugin not found. Economy will not work!");
verify(plugin).log("[challenges] Loading challenges...");
verify(plugin, never()).logError("Challenges could not hook into AcidIsland or BSkyBlock so will not do anything!");

View File

@ -60,6 +60,7 @@ import world.bentobox.challenges.config.Settings;
import world.bentobox.challenges.database.object.Challenge;
import world.bentobox.challenges.database.object.Challenge.ChallengeType;
import world.bentobox.challenges.database.object.ChallengeLevel;
import world.bentobox.challenges.database.object.requirements.IslandRequirements;
import world.bentobox.challenges.events.ChallengeCompletedEvent;
import world.bentobox.challenges.events.ChallengeResetAllEvent;
import world.bentobox.challenges.events.ChallengeResetEvent;
@ -162,6 +163,7 @@ public class ChallengesManagerTest {
challenge.setFriendlyName("name");
challenge.setLevel(GAME_MODE_NAME + "_novice");
challenge.setDescription(Collections.singletonList("A description"));
challenge.setRequirements(new IslandRequirements());
// Challenge Level
level = new ChallengeLevel();
@ -737,7 +739,7 @@ public class ChallengesManagerTest {
@Test
public void testCreateChallenge() {
@Nullable
Challenge ch = cm.createChallenge("newChal", ChallengeType.ISLAND, null);
Challenge ch = cm.createChallenge("newChal", ChallengeType.ISLAND, new IslandRequirements());
assertEquals(ChallengeType.ISLAND, ch.getChallengeType());
assertEquals("newChal", ch.getUniqueId());
}