|
16 | 16 | import java.nio.file.Files; |
17 | 17 | import java.nio.file.Path; |
18 | 18 | import java.nio.file.Paths; |
| 19 | +import java.nio.file.StandardCopyOption; |
19 | 20 | import java.util.Collections; |
20 | 21 | import java.util.Optional; |
21 | 22 | import java.util.UUID; |
22 | 23 | import java.util.jar.JarEntry; |
23 | 24 | import java.util.jar.JarOutputStream; |
24 | 25 | import java.util.logging.Logger; |
25 | 26 |
|
| 27 | +import org.bukkit.Bukkit; |
26 | 28 | import org.eclipse.jdt.annotation.NonNull; |
27 | 29 | import org.junit.jupiter.api.AfterAll; |
28 | 30 | import org.junit.jupiter.api.AfterEach; |
@@ -95,11 +97,11 @@ public static void beforeClass() throws IOException { |
95 | 97 | // Copy over config file from src folder |
96 | 98 | Path fromPath = Paths.get("src/main/resources/config.yml"); |
97 | 99 | Path path = Paths.get("config.yml"); |
98 | | - Files.copy(fromPath, path); |
| 100 | + Files.copy(fromPath, path, StandardCopyOption.REPLACE_EXISTING); |
99 | 101 | // Copy over block config file from src folder |
100 | 102 | fromPath = Paths.get("src/main/resources/blockconfig.yml"); |
101 | 103 | path = Paths.get("blockconfig.yml"); |
102 | | - Files.copy(fromPath, path); |
| 104 | + Files.copy(fromPath, path, StandardCopyOption.REPLACE_EXISTING); |
103 | 105 | try (JarOutputStream tempJarOutputStream = new JarOutputStream(new FileOutputStream(jFile))) { |
104 | 106 | // Added the new files to the jar. |
105 | 107 | try (FileInputStream fis = new FileInputStream(path.toFile())) { |
@@ -214,6 +216,7 @@ public static void cleanUp() throws Exception { |
214 | 216 | */ |
215 | 217 | @Test |
216 | 218 | public void testAllLoaded() { |
| 219 | + mockedBukkit.when(() -> Bukkit.getWorld("acidisland_world")).thenReturn(null); |
217 | 220 | addon.allLoaded(); |
218 | 221 | verify(plugin).log("[Level] Level hooking into BSkyBlock"); |
219 | 222 | verify(cmd, times(4)).getAddon(); // 4 commands |
|
0 commit comments