Skip to content

Commit a5ccb7b

Browse files
committed
Fixed test
1 parent 6a2abbe commit a5ccb7b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/java/world/bentobox/level/LevelTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
import java.nio.file.Files;
1717
import java.nio.file.Path;
1818
import java.nio.file.Paths;
19+
import java.nio.file.StandardCopyOption;
1920
import java.util.Collections;
2021
import java.util.Optional;
2122
import java.util.UUID;
2223
import java.util.jar.JarEntry;
2324
import java.util.jar.JarOutputStream;
2425
import java.util.logging.Logger;
2526

27+
import org.bukkit.Bukkit;
2628
import org.eclipse.jdt.annotation.NonNull;
2729
import org.junit.jupiter.api.AfterAll;
2830
import org.junit.jupiter.api.AfterEach;
@@ -95,11 +97,11 @@ public static void beforeClass() throws IOException {
9597
// Copy over config file from src folder
9698
Path fromPath = Paths.get("src/main/resources/config.yml");
9799
Path path = Paths.get("config.yml");
98-
Files.copy(fromPath, path);
100+
Files.copy(fromPath, path, StandardCopyOption.REPLACE_EXISTING);
99101
// Copy over block config file from src folder
100102
fromPath = Paths.get("src/main/resources/blockconfig.yml");
101103
path = Paths.get("blockconfig.yml");
102-
Files.copy(fromPath, path);
104+
Files.copy(fromPath, path, StandardCopyOption.REPLACE_EXISTING);
103105
try (JarOutputStream tempJarOutputStream = new JarOutputStream(new FileOutputStream(jFile))) {
104106
// Added the new files to the jar.
105107
try (FileInputStream fis = new FileInputStream(path.toFile())) {
@@ -214,6 +216,7 @@ public static void cleanUp() throws Exception {
214216
*/
215217
@Test
216218
public void testAllLoaded() {
219+
mockedBukkit.when(() -> Bukkit.getWorld("acidisland_world")).thenReturn(null);
217220
addon.allLoaded();
218221
verify(plugin).log("[Level] Level hooking into BSkyBlock");
219222
verify(cmd, times(4)).getAddon(); // 4 commands

0 commit comments

Comments
 (0)