mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-03-12 06:42:49 +01:00
Fix tests
This commit is contained in:
parent
5c8af0c1df
commit
bfbeb7964b
@ -22,6 +22,7 @@ import java.util.zip.ZipOutputStream;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.junit.After;
|
||||
@ -98,6 +99,8 @@ public class BlueprintClipboardManagerTest {
|
||||
" \"ySize\": 10,\n" +
|
||||
" \"zSize\": 10\n" +
|
||||
"}";
|
||||
@Mock
|
||||
private Server server;
|
||||
|
||||
private void zip(File targetFile) throws IOException {
|
||||
try (ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(targetFile.getAbsolutePath() + BlueprintsManager.BLUEPRINT_SUFFIX))) {
|
||||
@ -129,6 +132,9 @@ public class BlueprintClipboardManagerTest {
|
||||
BlockData blockData = mock(BlockData.class);
|
||||
when(Bukkit.createBlockData(any(Material.class))).thenReturn(blockData);
|
||||
when(blockData.getAsString()).thenReturn("test123");
|
||||
when(server.getBukkitVersion()).thenReturn("version");
|
||||
when(Bukkit.getServer()).thenReturn(server);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@ import java.util.jar.Manifest;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
@ -93,6 +94,8 @@ public class BlueprintsManagerTest {
|
||||
private BukkitTask task;
|
||||
|
||||
private int times;
|
||||
@Mock
|
||||
private Server server;
|
||||
/**
|
||||
* @throws java.lang.Exception
|
||||
*/
|
||||
@ -116,6 +119,8 @@ public class BlueprintsManagerTest {
|
||||
// Scheduler
|
||||
PowerMockito.mockStatic(Bukkit.class);
|
||||
when(Bukkit.getScheduler()).thenReturn(scheduler);
|
||||
when(server.getBukkitVersion()).thenReturn("version");
|
||||
when(Bukkit.getServer()).thenReturn(server);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user