From 510b5aa022053e0fec8f19718e050e96bd085506 Mon Sep 17 00:00:00 2001 From: skiesewetter-intershop <82586807+skiesewetter-intershop@users.noreply.github.com> Date: Wed, 24 Jan 2024 11:20:00 +0100 Subject: [PATCH] fix: fix gradle task GebTest (#92129) (#91) * fixed value rendered for geb system property `geb.build.reportsDir` * fixed URL creation for browser driver download --- .../intershop/gradle/icm/docker/tasks/geb/GebDriverDownload.kt | 3 ++- .../com/intershop/gradle/icm/docker/tasks/geb/GebTest.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebDriverDownload.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebDriverDownload.kt index b620746..761cc35 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebDriverDownload.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebDriverDownload.kt @@ -31,6 +31,7 @@ import org.gradle.api.tasks.TaskAction import java.io.File import java.io.FileOutputStream import java.io.IOException +import java.net.URI import java.nio.file.Paths import javax.inject.Inject @@ -60,7 +61,7 @@ open class GebDriverDownload @Inject constructor(objectFactory: ObjectFactory, val targetFile = File(targetDir, "driver.${extension.get()}") try { - Paths.get(url.get()).toUri().toURL().openStream().use { input -> + URI.create(url.get()).toURL().openStream().use { input -> FileOutputStream(targetFile).use { output -> input.copyTo(output) } diff --git a/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebTest.kt b/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebTest.kt index 5d9cadd..d31edaa 100644 --- a/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebTest.kt +++ b/src/main/kotlin/com/intershop/gradle/icm/docker/tasks/geb/GebTest.kt @@ -62,7 +62,7 @@ abstract class GebTest : Test() { } systemProperty("geb.env", gebEnvironment.get()) - systemProperty("geb.build.reportsDir", project.layout.buildDirectory.dir("geb-reports/${gebEnvironment.get()}")) + systemProperty("geb.build.reportsDir", project.layout.buildDirectory.dir("geb-reports/${gebEnvironment.get()}").get().asFile.absolutePath) useJUnitPlatform()