From 93721a3ee511e105f3972ccca0d0c37d7b3c6c5e Mon Sep 17 00:00:00 2001 From: panos-kakos Date: Mon, 23 Dec 2024 13:31:01 +0200 Subject: [PATCH 1/5] [JAVA-42811] Upgraded kotlin to latest version 2.1.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c0cd702c8..04d2fb4c8 100644 --- a/pom.xml +++ b/pom.xml @@ -793,7 +793,7 @@ - 2.0.21 + 2.1.0 1.7.1 1.0.1 From b73a54fce78ee60dac83393e0eaa5fc3f09ae111 Mon Sep 17 00:00:00 2001 From: panos-kakos Date: Mon, 23 Dec 2024 13:48:16 +0200 Subject: [PATCH 2/5] [JAVA-42811] --- .../src/test/kotlin/com/baeldung/elapsed/ElapsedTimeUnitTest.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/core-kotlin-modules/core-kotlin-6/src/test/kotlin/com/baeldung/elapsed/ElapsedTimeUnitTest.kt b/core-kotlin-modules/core-kotlin-6/src/test/kotlin/com/baeldung/elapsed/ElapsedTimeUnitTest.kt index 05d6749ce..c6a20a383 100644 --- a/core-kotlin-modules/core-kotlin-6/src/test/kotlin/com/baeldung/elapsed/ElapsedTimeUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-6/src/test/kotlin/com/baeldung/elapsed/ElapsedTimeUnitTest.kt @@ -10,7 +10,6 @@ import kotlin.time.ExperimentalTime import kotlin.time.TimedValue import kotlin.time.measureTime import kotlin.time.measureTimedValue -import kotlin.time.milliseconds import kotlin.time.toDuration class ElapsedTimeUnitTest { From 2d9f4120db1b612ade930c99382656bd3bdb685a Mon Sep 17 00:00:00 2001 From: panos-kakos Date: Mon, 23 Dec 2024 14:10:03 +0200 Subject: [PATCH 3/5] [JAVA-42811] --- .../BooleanValueOfKotlinEquivalentUnitTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-kotlin-modules/core-kotlin-strings-4/src/test/kotlin/com/baeldung/booleanValueOfKotlinEquivalent/BooleanValueOfKotlinEquivalentUnitTest.kt b/core-kotlin-modules/core-kotlin-strings-4/src/test/kotlin/com/baeldung/booleanValueOfKotlinEquivalent/BooleanValueOfKotlinEquivalentUnitTest.kt index 7808f238b..d8c0f1cc5 100644 --- a/core-kotlin-modules/core-kotlin-strings-4/src/test/kotlin/com/baeldung/booleanValueOfKotlinEquivalent/BooleanValueOfKotlinEquivalentUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-strings-4/src/test/kotlin/com/baeldung/booleanValueOfKotlinEquivalent/BooleanValueOfKotlinEquivalentUnitTest.kt @@ -75,7 +75,7 @@ fun convertStringToBooleanUsingRegex(input: String): Boolean { } fun String.toBooleanValue(): Boolean = - when (this.toLowerCase()) { + when (this.lowercase()) { "true" -> true else -> false } \ No newline at end of file From 6fde134fd43d98c305d150418cefdf73283a23fb Mon Sep 17 00:00:00 2001 From: panos-kakos Date: Thu, 26 Dec 2024 10:49:07 +0200 Subject: [PATCH 4/5] [JAVA-42811] --- core-kotlin-modules/core-kotlin-advanced-4/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/core-kotlin-modules/core-kotlin-advanced-4/pom.xml b/core-kotlin-modules/core-kotlin-advanced-4/pom.xml index c23938ee2..fe49a923d 100644 --- a/core-kotlin-modules/core-kotlin-advanced-4/pom.xml +++ b/core-kotlin-modules/core-kotlin-advanced-4/pom.xml @@ -55,6 +55,7 @@ 1.8.0 + 2.0.21 \ No newline at end of file From a47cbb092e2065f31ec7cc986898d0287eabff30 Mon Sep 17 00:00:00 2001 From: panos-kakos Date: Sat, 28 Dec 2024 17:32:21 +0200 Subject: [PATCH 5/5] [JAVA-42811] Use dynamic port --- .../kotlin/com/baeldung/fileupload/FileUploadUnitTest.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/fileupload/FileUploadUnitTest.kt b/core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/fileupload/FileUploadUnitTest.kt index 24645e8de..fa679bcad 100644 --- a/core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/fileupload/FileUploadUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/fileupload/FileUploadUnitTest.kt @@ -8,6 +8,7 @@ import com.github.tomakehurst.wiremock.client.WireMock.matching import com.github.tomakehurst.wiremock.client.WireMock.post import com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor import com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo +import com.github.tomakehurst.wiremock.core.WireMockConfiguration import com.github.tomakehurst.wiremock.junit.WireMockRule import io.ktor.client.HttpClient import io.ktor.client.engine.cio.CIO @@ -18,16 +19,12 @@ import io.ktor.client.statement.readText import io.ktor.http.Headers import io.ktor.http.HttpHeaders import kotlinx.coroutines.runBlocking -import okhttp3.Call -import okhttp3.Callback import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.MultipartBody import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.Response import okhttp3.ResponseBody -import okhttp3.internal.wait import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.Rule @@ -38,7 +35,6 @@ import retrofit2.http.Multipart import retrofit2.http.POST import retrofit2.http.Part import java.io.File -import java.io.IOException fun uploadFileFuel(filePath: String, uploadUrl: String) { val file = File(filePath) @@ -112,7 +108,7 @@ fun uploadFileRetrofit(filePath: String, uploadUrl: String) { class FileUploadUnitTest { @Rule @JvmField - val wireMockRule = WireMockRule(8080) + val wireMockRule = WireMockRule(WireMockConfiguration.wireMockConfig().dynamicPort()) @BeforeEach fun startWireMock() {