From e5450fa2d22412735494cf2a01f65a51781552ba Mon Sep 17 00:00:00 2001 From: Arnau Mora Date: Fri, 5 Jul 2024 11:10:11 +0200 Subject: [PATCH] Got rid of commons dependency (#49) * Got rid of commons dependency Signed-off-by: Arnau Mora * Fixed import Signed-off-by: Arnau Mora --------- Signed-off-by: Arnau Mora --- build.gradle.kts | 3 +-- gradle/libs.versions.toml | 2 -- src/test/kotlin/at/bitfire/dav4jvm/HttpUtilsTest.kt | 11 +++++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index eb3dd5f..84dd8f4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ -import org.jetbrains.dokka.gradle.DokkaTask import java.net.URL +import org.jetbrains.dokka.gradle.DokkaTask repositories { mavenCentral() @@ -45,7 +45,6 @@ tasks.withType().configureEach { dependencies { api(libs.okhttp) - implementation(libs.commons.lang3) api(libs.xpp3) testImplementation(libs.junit4) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4bc18b2..ed411ab 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,4 @@ [versions] -commons-lang3 = "3.14.0" dokka = "1.9.20" junit4 = "4.13.2" kotlin = "2.0.0" @@ -7,7 +6,6 @@ okhttpVersion = "4.12.0" xpp3Version = "1.1.6" [libraries] -commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "commons-lang3" } junit4 = { module = "junit:junit", version.ref = "junit4" } okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttpVersion" } okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttpVersion" } diff --git a/src/test/kotlin/at/bitfire/dav4jvm/HttpUtilsTest.kt b/src/test/kotlin/at/bitfire/dav4jvm/HttpUtilsTest.kt index cb05717..71a17c0 100644 --- a/src/test/kotlin/at/bitfire/dav4jvm/HttpUtilsTest.kt +++ b/src/test/kotlin/at/bitfire/dav4jvm/HttpUtilsTest.kt @@ -6,11 +6,6 @@ package at.bitfire.dav4jvm -import okhttp3.HttpUrl.Companion.toHttpUrl -import org.apache.commons.lang3.time.TimeZones -import org.junit.Assert.assertEquals -import org.junit.Assert.assertNull -import org.junit.Test import java.time.Instant import java.time.LocalDate import java.time.LocalTime @@ -20,6 +15,10 @@ import java.time.format.DateTimeFormatter import java.util.Calendar import java.util.Locale import java.util.TimeZone +import okhttp3.HttpUrl.Companion.toHttpUrl +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Test class HttpUtilsTest { @@ -35,7 +34,7 @@ class HttpUtilsTest { @Test fun formatDate() { - val cal = Calendar.getInstance(TimeZone.getTimeZone(TimeZones.GMT_ID)) + val cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")) cal.set(2023, 4, 11, 17, 26, 35) cal.timeZone = TimeZone.getTimeZone("UTC") assertEquals("Sun, 06 Nov 1994 08:49:37 GMT", HttpUtils.formatDate(