diff --git a/opensearch-observability/build.gradle b/opensearch-observability/build.gradle index 276ac2880..50f629e55 100644 --- a/opensearch-observability/build.gradle +++ b/opensearch-observability/build.gradle @@ -13,7 +13,7 @@ buildscript { // 1.0.0 -> 1.0.0.0, and 1.0.0-SNAPSHOT -> 1.0.0.0-SNAPSHOT opensearch_build = opensearch_version.replaceAll(/(\.\d)([^\d]*)$/, '$1.0$2') common_utils_version = System.getProperty("common_utils.version", opensearch_build) - kotlin_version = System.getProperty("kotlin.version", "1.6.21") + kotlin_version = System.getProperty("kotlin.version", "1.6.0") } repositories { 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 c80e1bddd..d2ee8ce18 100644 --- a/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt +++ b/opensearch-observability/src/test/kotlin/org/opensearch/observability/PluginRestTestCase.kt @@ -26,6 +26,7 @@ import org.opensearch.client.Response import org.opensearch.client.ResponseException import org.opensearch.client.RestClient import org.opensearch.client.RestClientBuilder +import org.opensearch.common.io.PathUtils import org.opensearch.common.settings.Settings import org.opensearch.common.unit.TimeValue import org.opensearch.common.util.concurrent.ThreadContext @@ -263,7 +264,7 @@ abstract class PluginRestTestCase : OpenSearchRestTestCase() { false ) proxy.getExecutionData(false)?.let { - val path = Paths.get("$jacocoBuildPath/integTest.exec") + val path = PathUtils.get("$jacocoBuildPath/integTest.exec") Files.write(path, it) } } diff --git a/opensearch-observability/src/test/kotlin/org/opensearch/observability/bwc/TABackwardCompatibilityIT.kt b/opensearch-observability/src/test/kotlin/org/opensearch/observability/bwc/TABackwardCompatibilityIT.kt index cc709de4a..f23ed095f 100644 --- a/opensearch-observability/src/test/kotlin/org/opensearch/observability/bwc/TABackwardCompatibilityIT.kt +++ b/opensearch-observability/src/test/kotlin/org/opensearch/observability/bwc/TABackwardCompatibilityIT.kt @@ -13,8 +13,8 @@ import org.opensearch.observability.PluginRestTestCase import org.opensearch.observability.constructNotebookRequest import org.opensearch.rest.RestRequest import org.opensearch.rest.RestStatus -import java.util.List -import java.util.Map +// import kotlin.Collections.List +// import kotlin.Collections.Map class TABackwardCompatibilityIT : PluginRestTestCase() { @@ -61,14 +61,14 @@ class TABackwardCompatibilityIT : PluginRestTestCase() { } @Throws(Exception::class) - @SuppressWarnings("unchecked") + @SuppressWarnings("UNCHECKED_CAST") fun `test backwards compatibility`() { val uri = getUri() val responseMap = getAsMap(uri)["nodes"] as Map> - for (response in responseMap.values()) { + for (response in responseMap.values) { val plugins = response["plugins"] as List> val pluginNames = plugins.map { plugin -> plugin["name"] }.toSet() - return when (CLUSTER_TYPE) { + when (CLUSTER_TYPE) { ClusterType.OLD -> { assertTrue(pluginNames.contains("opensearch-notebooks")) createNotebook()