From 15f5d4a36e9df8d54f859688a2129bfa93389d83 Mon Sep 17 00:00:00 2001 From: Gary Tierney Date: Sun, 13 Sep 2015 01:46:59 +0100 Subject: [PATCH] Change @BeforeClass to @Before to prevent tests failing --- .../message/handler/ItemOnItemVerificationHandlerTest.java | 5 +++-- .../message/handler/ObjectActionVerificationHandlerTest.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/game/src/test/org/apollo/game/message/handler/ItemOnItemVerificationHandlerTest.java b/game/src/test/org/apollo/game/message/handler/ItemOnItemVerificationHandlerTest.java index 3542c858..31389266 100644 --- a/game/src/test/org/apollo/game/message/handler/ItemOnItemVerificationHandlerTest.java +++ b/game/src/test/org/apollo/game/message/handler/ItemOnItemVerificationHandlerTest.java @@ -7,6 +7,7 @@ import org.apollo.game.model.World; import org.apollo.game.model.entity.Player; import org.apollo.game.model.inter.bank.BankConstants; import org.apollo.game.model.inv.Inventory; +import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -25,8 +26,8 @@ public class ItemOnItemVerificationHandlerTest { private ItemOnItemVerificationHandler itemOnItemVerificationHandler = new ItemOnItemVerificationHandler(world); private ItemVerificationHandler itemVerificationHandler = new ItemVerificationHandler(world); - @BeforeClass - public static void setupTestItemDefinitions() { + @Before + public void setupTestItemDefinitions() { mockStatic(ItemDefinition.class); when(ItemDefinition.lookup(4151)).thenReturn(new ItemDefinition(4151)); } diff --git a/game/src/test/org/apollo/game/message/handler/ObjectActionVerificationHandlerTest.java b/game/src/test/org/apollo/game/message/handler/ObjectActionVerificationHandlerTest.java index 21344672..40cf72db 100644 --- a/game/src/test/org/apollo/game/message/handler/ObjectActionVerificationHandlerTest.java +++ b/game/src/test/org/apollo/game/message/handler/ObjectActionVerificationHandlerTest.java @@ -11,6 +11,7 @@ import org.apollo.game.model.entity.Entity; import org.apollo.game.model.entity.EntityType; import org.apollo.game.model.entity.Player; import org.apollo.game.model.entity.obj.StaticGameObject; +import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -29,8 +30,8 @@ import static org.powermock.api.mockito.PowerMockito.when; @PrepareForTest({World.class, Player.class, ObjectDefinition.class, RegionRepository.class, Region.class}) public class ObjectActionVerificationHandlerTest { - @BeforeClass - public static void setupTestObjectDefinitions() { + @Before + public void setupTestObjectDefinitions() { mockStatic(ObjectDefinition.class); when(ObjectDefinition.count()).thenReturn(4152); }