From f0c4f03c39fd77a51ffb0df122f504bbf5d5b457 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Sat, 27 Feb 2021 14:55:36 -0800 Subject: [PATCH] chore: migrate RegionEntitiesTest in IsolatedMTEExtension --- src/test/java/regions/RegionEntitiesTest.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/test/java/regions/RegionEntitiesTest.java b/src/test/java/regions/RegionEntitiesTest.java index 546d475..8a0164e 100644 --- a/src/test/java/regions/RegionEntitiesTest.java +++ b/src/test/java/regions/RegionEntitiesTest.java @@ -16,39 +16,39 @@ package regions; -import com.google.common.collect.Sets; import org.joml.RoundingMode; import org.joml.Vector2i; import org.joml.Vector3f; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mockito; import org.terasology.dynamicCities.region.RegionEntityManager; import org.terasology.entitySystem.entity.EntityRef; import org.terasology.logic.location.LocationComponent; -import org.terasology.moduletestingenvironment.ModuleTestingEnvironment; +import org.terasology.moduletestingenvironment.IsolatedMTEExtension; +import org.terasology.moduletestingenvironment.extension.Dependencies; +import org.terasology.registry.In; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Set; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public class RegionEntitiesTest extends ModuleTestingEnvironment { - private RegionEntityManager regionEntityManager; + +@ExtendWith(IsolatedMTEExtension.class) +@Dependencies({"engine", "ModuleTestingEnvironment", "DynamicCities"}) +public class RegionEntitiesTest { + @In + protected RegionEntityManager regionEntityManager; private EntityRef[] test; private Vector3f[] pos = new Vector3f[10]; - @Override - public Set getDependencies() { - return Sets.newHashSet("engine", "DynamicCities", "ModuleTestingEnvironment"); - } - @BeforeEach public void setupEntityRefs() { pos[0] = new Vector3f(16, 0, 16); @@ -62,8 +62,6 @@ public void setupEntityRefs() { pos[8] = new Vector3f(-32, 0, -32); pos[9] = new Vector3f(97, 0, -97); - regionEntityManager = getHostContext().get(RegionEntityManager.class); - test = new EntityRef[10]; LocationComponent[] loc = new LocationComponent[test.length]; for (int i = 0; i < test.length; i++) {