From e526b41b3fcefe57f78bf04dcc40ff0eb56b82f0 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 20 Apr 2024 21:36:30 +0200 Subject: [PATCH] Fixed? --- app/build.gradle.kts | 27 ++++++++++++++++++----- app/src/test/java/krusty/KrustyTests.java | 16 ++++++-------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6748f86..4d27de6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -16,17 +16,19 @@ repositories { } dependencies { - // Use JUnit Jupiter for testing. - testImplementation("org.junit.jupiter:junit-jupiter:5.9.3") + testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") + testImplementation("org.skyscreamer:jsonassert:1.5.0") + testImplementation("com.mashape.unirest:unirest-java:1.4.9") + testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.10.2") - testRuntimeOnly("org.junit.platform:junit-platform-launcher") - - // This dependency is used by the application. implementation("com.google.guava:guava:32.1.1-jre") implementation("com.sparkjava:spark-core:2.9.4") implementation("com.fasterxml.jackson.core:jackson-core:2.17.0") implementation("com.fasterxml.jackson.core:jackson-databind:2.17.0") + implementation("org.slf4j:slf4j-simple:1.7.30") + implementation("mysql:mysql-connector-java:8.0.19") + implementation("org.xerial:sqlite-jdbc:3.30.1") } // Apply a specific Java toolchain to ease working on different environments. @@ -45,3 +47,18 @@ tasks.named("test") { // Use JUnit Platform for unit tests. useJUnitPlatform() } + +group = "com.krusty" +version = "1.0" +description = "Krusty" + +tasks.named("jar") { + // Make the JAR executable. + manifest { + attributes( + "Main-Class" to "krusty.ServerMain", + "Implementation-Title" to "KrustyCookiesAPI", + "Implementation-Version" to version + ) + } +} diff --git a/app/src/test/java/krusty/KrustyTests.java b/app/src/test/java/krusty/KrustyTests.java index 45d41a7..fd1184b 100644 --- a/app/src/test/java/krusty/KrustyTests.java +++ b/app/src/test/java/krusty/KrustyTests.java @@ -1,6 +1,6 @@ package krusty; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.nio.file.Files; @@ -10,18 +10,16 @@ import java.util.Calendar; import java.util.Date; import org.json.JSONException; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.FixMethodOrder; -import org.junit.Test; -import org.junit.runners.MethodSorters; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + import org.skyscreamer.jsonassert.JSONAssert; import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; import com.mashape.unirest.http.exceptions.UnirestException; -@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class KrustyTests { public static final String BASE_URL = "http://localhost:" + ServerMain.PORT + ServerMain.API_ENTRYPOINT + "/"; @@ -166,7 +164,7 @@ public class KrustyTests { */ private static ServerMain server; - @BeforeClass + @BeforeAll public static void startServer() throws InterruptedException { try { // Check if rest server is running @@ -186,7 +184,7 @@ public class KrustyTests { } } - @AfterClass + @AfterAll public static void stopServer() { if (server != null) { server.stopServer();