From 2a42626c695b86f76ef5bd3fb4cca98da35d7065 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 20 Apr 2024 00:45:04 -0300 Subject: [PATCH] Fix for the latest paper version --- pom.xml | 17 ++++++- .../java/io/servertap/api/v1/ServerApi.java | 2 +- .../java/io/servertap/api/v1/WorldApi.java | 2 + .../java/io/servertap/TestPluginClass.java | 47 ------------------- 4 files changed, 18 insertions(+), 50 deletions(-) delete mode 100644 src/test/java/io/servertap/TestPluginClass.java diff --git a/pom.xml b/pom.xml index 7df8a5cd..40848022 100644 --- a/pom.xml +++ b/pom.xml @@ -50,11 +50,18 @@ + + + org.apache.isis.core + commons + 0.2.0-incubating + + io.papermc.paper paper-api - 1.18.2-R0.1-SNAPSHOT + 1.20.4-R0.1-SNAPSHOT provided @@ -91,10 +98,16 @@ 2.15.2 + + org.apache.commons + commons-lang3 + 3.1 + + org.apache.commons commons-compress - 1.24.0 + 1.26.1 diff --git a/src/main/java/io/servertap/api/v1/ServerApi.java b/src/main/java/io/servertap/api/v1/ServerApi.java index 9aefe557..c0c48173 100644 --- a/src/main/java/io/servertap/api/v1/ServerApi.java +++ b/src/main/java/io/servertap/api/v1/ServerApi.java @@ -13,7 +13,7 @@ import io.servertap.mojang.api.MojangApiService; import io.servertap.utils.pluginwrappers.EconomyWrapper; import io.servertap.utils.GsonSingleton; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.bukkit.BanList; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; diff --git a/src/main/java/io/servertap/api/v1/WorldApi.java b/src/main/java/io/servertap/api/v1/WorldApi.java index 44f0e805..a1e8fab7 100644 --- a/src/main/java/io/servertap/api/v1/WorldApi.java +++ b/src/main/java/io/servertap/api/v1/WorldApi.java @@ -8,9 +8,11 @@ import io.servertap.Constants; import io.servertap.ServerTapMain; import io.servertap.api.v1.models.World; + import org.apache.commons.compress.archivers.tar.TarArchiveEntry; import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream; + import org.apache.commons.io.IOUtils; import org.bukkit.Bukkit; diff --git a/src/test/java/io/servertap/TestPluginClass.java b/src/test/java/io/servertap/TestPluginClass.java deleted file mode 100644 index e15cf277..00000000 --- a/src/test/java/io/servertap/TestPluginClass.java +++ /dev/null @@ -1,47 +0,0 @@ -package io.servertap; - -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import kong.unirest.HttpResponse; -import kong.unirest.JsonNode; -import kong.unirest.Unirest; -import org.junit.jupiter.api.*; - -public class TestPluginClass { - private static ServerMock server; - private static ServerTapMain plugin; - - private static final String TEST_URL_BASE = "http://localhost:4567"; - - @BeforeAll - public static void setUp() { - server = MockBukkit.mock(); - plugin = MockBukkit.load(ServerTapMain.class); - } - - @AfterAll - public static void tearDown() { - MockBukkit.unmock(); - } - - @Test - @DisplayName("Verify that auth is on") - void verifyTestEnvironment() { - HttpResponse response = Unirest.get(TEST_URL_BASE + "/v1/players/all").asJson(); - Assertions.assertEquals(401, response.getStatus()); - } - - @Test - @DisplayName("swagger endpoint loads") - void verifySwaggerUI() { - HttpResponse response = Unirest.get(TEST_URL_BASE + "/swagger").asJson(); - Assertions.assertEquals(200, response.getStatus()); - } - - @Test - @DisplayName("swagger-docs endpoint loads") - void verifySwaggerDocs() { - HttpResponse response = Unirest.get(TEST_URL_BASE + "/swagger-docs").asJson(); - Assertions.assertEquals(200, response.getStatus()); - } -}