#1256: Update tests to JUnit 5

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2023-09-23 18:10:23 +10:00
parent da860132b5
commit 07002cbfcd
62 changed files with 770 additions and 732 deletions

View File

@@ -1,14 +1,14 @@
package org.bukkit.map;
import static org.junit.jupiter.api.Assertions.*;
import java.awt.Color;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.minecraft.world.level.material.MaterialMapColor;
import org.bukkit.craftbukkit.map.CraftMapColorCache;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
public class MapTest {
@@ -59,10 +59,10 @@ public class MapTest {
}
}
}
Assert.assertFalse(fail);
assertFalse(fail);
}
@Ignore("Test takes around 25 seconds, should be run by changes to the map color conversion")
@Disabled("Test takes around 25 seconds, should be run by changes to the map color conversion")
@Test
public void testMapColorCacheBuilding() throws ExecutionException, InterruptedException {
CraftMapColorCache craftMapColorCache = new CraftMapColorCache(logger);
@@ -72,7 +72,7 @@ public class MapTest {
for (int g = 0; g < 256; g++) {
for (int b = 0; b < 256; b++) {
Color color = new Color(r, g, b);
Assert.assertEquals(String.format("Incorrect matched color c(%s, %s, %s)", color.getRed(), color.getGreen(), color.getBlue()), MapPalette.matchColor(color), craftMapColorCache.matchColor(color));
assertEquals(MapPalette.matchColor(color), craftMapColorCache.matchColor(color), String.format("Incorrect matched color c(%s, %s, %s)", color.getRed(), color.getGreen(), color.getBlue()));
}
}
}