Clean up test

This commit is contained in:
tastybento 2024-11-08 20:42:43 -08:00
parent d9b24cff7c
commit 622026248a

View File

@ -49,6 +49,7 @@ public class ChunkGeneratorWorldTest {
@Mock @Mock
private World world; private World world;
private final Random random = new Random(); private final Random random = new Random();
@SuppressWarnings("deprecation")
@Mock @Mock
private BiomeGrid biomeGrid; private BiomeGrid biomeGrid;
private Settings settings; private Settings settings;
@ -58,6 +59,7 @@ public class ChunkGeneratorWorldTest {
/** /**
* @throws java.lang.Exception * @throws java.lang.Exception
*/ */
@SuppressWarnings("deprecation")
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
ServerMocks.newServer(); ServerMocks.newServer();
@ -67,7 +69,6 @@ public class ChunkGeneratorWorldTest {
Server server = mock(Server.class); Server server = mock(Server.class);
when(server.createChunkData(any())).thenReturn(data); when(server.createChunkData(any())).thenReturn(data);
when(Bukkit.getServer()).thenReturn(server); when(Bukkit.getServer()).thenReturn(server);
@SuppressWarnings("deprecation")
UnsafeValues unsafe = mock(UnsafeValues.class); UnsafeValues unsafe = mock(UnsafeValues.class);
when(Bukkit.getUnsafe()).thenReturn(unsafe); when(Bukkit.getUnsafe()).thenReturn(unsafe);
@ -85,13 +86,14 @@ public class ChunkGeneratorWorldTest {
* @throws java.lang.Exception * @throws java.lang.Exception
*/ */
@After @After
public void tearDown() throws Exception { public void tearDown() {
ServerMocks.unsetBukkitServer(); ServerMocks.unsetBukkitServer();
} }
/** /**
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}. * Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}.
*/ */
@SuppressWarnings("deprecation")
@Test @Test
public void testGenerateChunkDataWorldRandomIntIntBiomeGridOverworldVoid() { public void testGenerateChunkDataWorldRandomIntIntBiomeGridOverworldVoid() {
ChunkData cd = cg.generateChunkData(world, random, 0 , 0 , biomeGrid); ChunkData cd = cg.generateChunkData(world, random, 0 , 0 , biomeGrid);
@ -105,6 +107,7 @@ public class ChunkGeneratorWorldTest {
/** /**
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}. * Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}.
*/ */
@SuppressWarnings("deprecation")
@Test @Test
public void testGenerateChunkDataWorldRandomIntIntBiomeGridOverworldSea() { public void testGenerateChunkDataWorldRandomIntIntBiomeGridOverworldSea() {
// Set sea height // Set sea height
@ -120,6 +123,7 @@ public class ChunkGeneratorWorldTest {
/** /**
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}. * Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}.
*/ */
@SuppressWarnings("deprecation")
@Test @Test
public void testGenerateChunkDataWorldRandomIntIntBiomeGridEnd() { public void testGenerateChunkDataWorldRandomIntIntBiomeGridEnd() {
when(world.getEnvironment()).thenReturn(World.Environment.THE_END); when(world.getEnvironment()).thenReturn(World.Environment.THE_END);
@ -135,6 +139,7 @@ public class ChunkGeneratorWorldTest {
/** /**
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}. * Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}.
*/ */
@SuppressWarnings("deprecation")
@Test @Test
public void testGenerateChunkDataWorldRandomIntIntBiomeGridNetherWithRoof() { public void testGenerateChunkDataWorldRandomIntIntBiomeGridNetherWithRoof() {
when(world.getEnvironment()).thenReturn(World.Environment.NETHER); when(world.getEnvironment()).thenReturn(World.Environment.NETHER);
@ -150,6 +155,7 @@ public class ChunkGeneratorWorldTest {
/** /**
* Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}. * Test method for {@link world.bentobox.bskyblock.generators.ChunkGeneratorWorld#generateChunkData(org.bukkit.World, java.util.Random, int, int, org.bukkit.generator.ChunkGenerator.BiomeGrid)}.
*/ */
@SuppressWarnings("deprecation")
@Test @Test
public void testGenerateChunkDataWorldRandomIntIntBiomeGridNetherNoRoof() { public void testGenerateChunkDataWorldRandomIntIntBiomeGridNetherNoRoof() {
settings.setNetherRoof(false); settings.setNetherRoof(false);