diff --git a/Plan/test/main/java/com/djrapitops/plan/systems/cache/SessionCacheTest.java b/Plan/test/main/java/com/djrapitops/plan/systems/cache/SessionCacheTest.java index 4791a97d4..b760333b7 100644 --- a/Plan/test/main/java/com/djrapitops/plan/systems/cache/SessionCacheTest.java +++ b/Plan/test/main/java/com/djrapitops/plan/systems/cache/SessionCacheTest.java @@ -1,9 +1,14 @@ package main.java.com.djrapitops.plan.systems.cache; import main.java.com.djrapitops.plan.data.Session; +import org.bukkit.plugin.java.JavaPlugin; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; import test.java.utils.MockUtils; +import test.java.utils.TestInit; import java.util.Optional; import java.util.UUID; @@ -11,6 +16,8 @@ import java.util.UUID; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +@RunWith(PowerMockRunner.class) +@PrepareForTest(JavaPlugin.class) public class SessionCacheTest { private final UUID uuid = MockUtils.getPlayerUUID(); @@ -18,7 +25,8 @@ public class SessionCacheTest { private Session session; @Before - public void setUp() { + public void setUp() throws Exception { + TestInit t = TestInit.init(); sessionCache = new SessionCache(null); session = new Session(12345L, "World1", "SURVIVAL"); sessionCache.cacheSession(uuid, session);