From f69e0efe62ae9d0614452095c6d8ea2316e906e6 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Fri, 30 Sep 2022 17:29:30 +0000 Subject: [PATCH] Fix jacoco Signed-off-by: Joshua Li --- opensearch-observability/build.gradle | 3 ++- .../org/opensearch/observability/settings/PluginSettings.kt | 4 ++-- .../kotlin/org/opensearch/observability/PluginRestTestCase.kt | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opensearch-observability/build.gradle b/opensearch-observability/build.gradle index 50f629e55..b70b2f950 100644 --- a/opensearch-observability/build.gradle +++ b/opensearch-observability/build.gradle @@ -28,7 +28,7 @@ buildscript { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}" classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}" classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.12.0" - classpath "org.jacoco:org.jacoco.agent:0.8.5" + classpath "org.jacoco:org.jacoco.agent:0.8.7" } } @@ -117,6 +117,7 @@ allprojects { plugins.withId('java') { sourceCompatibility = targetCompatibility = "1.8" } + jacoco.toolVersion = "0.8.7" } dependencies { diff --git a/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt b/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt index 0f5d31504..ae1eead9b 100644 --- a/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt +++ b/opensearch-observability/src/main/kotlin/org/opensearch/observability/settings/PluginSettings.kt @@ -8,6 +8,7 @@ package org.opensearch.observability.settings import org.apache.logging.log4j.LogManager import org.opensearch.bootstrap.BootstrapInfo import org.opensearch.cluster.service.ClusterService +import org.opensearch.common.io.PathUtils import org.opensearch.common.settings.Setting import org.opensearch.common.settings.Setting.Property.Dynamic import org.opensearch.common.settings.Setting.Property.NodeScope @@ -15,7 +16,6 @@ import org.opensearch.common.settings.Settings import org.opensearch.observability.ObservabilityPlugin.Companion.LOG_PREFIX import org.opensearch.observability.ObservabilityPlugin.Companion.PLUGIN_NAME import java.io.IOException -import java.nio.file.Paths /** * settings specific to observability Plugin. @@ -246,7 +246,7 @@ internal object PluginSettings { var settings: Settings? = null val configDirName = BootstrapInfo.getSystemProperties()?.get("opensearch.path.conf")?.toString() if (configDirName != null) { - val defaultSettingYmlFile = Paths.get(configDirName, PLUGIN_NAME, "observability.yml") + val defaultSettingYmlFile = PathUtils.get(configDirName, PLUGIN_NAME, "observability.yml") try { settings = Settings.builder().loadFromPath(defaultSettingYmlFile).build() } catch (exception: IOException) { diff --git a/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt b/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt index d2ee8ce18..c19166a27 100644 --- a/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt +++ b/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt @@ -39,7 +39,6 @@ import java.io.IOException import java.io.InputStreamReader import java.nio.charset.StandardCharsets import java.nio.file.Files -import java.nio.file.Paths import java.security.cert.X509Certificate import javax.management.MBeanServerInvocationHandler import javax.management.ObjectName