From 556ab86761d16893d343b9fb6831525ea7cb5601 Mon Sep 17 00:00:00 2001 From: Hendrik Brummermann Date: Sat, 21 Oct 2023 19:53:48 +0200 Subject: [PATCH] fixed NPCList test in order not to break tests caching NPCList --- src/games/stendhal/server/entity/npc/NPCList.java | 1 - .../stendhal/server/entity/npc/NPCListTest.java | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/src/games/stendhal/server/entity/npc/NPCList.java b/src/games/stendhal/server/entity/npc/NPCList.java index aebf4fce7a3..6ddf278a1f5 100644 --- a/src/games/stendhal/server/entity/npc/NPCList.java +++ b/src/games/stendhal/server/entity/npc/NPCList.java @@ -47,7 +47,6 @@ public static NPCList get() { } protected NPCList() { - instance = this; contents = new HashMap(); } diff --git a/tests/games/stendhal/server/entity/npc/NPCListTest.java b/tests/games/stendhal/server/entity/npc/NPCListTest.java index 647ff0139b8..061d02cfeb8 100644 --- a/tests/games/stendhal/server/entity/npc/NPCListTest.java +++ b/tests/games/stendhal/server/entity/npc/NPCListTest.java @@ -15,25 +15,13 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; import org.junit.Test; -import games.stendhal.server.core.engine.SingletonRepository; import utilities.PlayerTestHelper; public class NPCListTest { - /** - * Tests for get. - */ - @Test - public final void testGet() { - final NPCList npclist = new NPCList() { - }; - assertSame(npclist, SingletonRepository.getNPCList()); - } - /** * Tests for addHas. */