diff --git a/build.gradle b/build.gradle index 86ac1ace..ceb01f7e 100644 --- a/build.gradle +++ b/build.gradle @@ -136,6 +136,7 @@ configurations.all { force "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}" force "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.11.4" force "org.yaml:snakeyaml:2.0" + force "org.slf4j:slf4j-api:2.0.7" } } @@ -198,7 +199,7 @@ dependencies { testImplementation "org.mockito:mockito-junit-jupiter:${versions.mockito}" testImplementation 'com.google.code.gson:gson:2.8.9' - ktlint "com.pinterest:ktlint:0.45.1" + ktlint "com.pinterest:ktlint:0.47.1" } javadoc.enabled = false // turn off javadoc as it barfs on Kotlin code diff --git a/src/main/kotlin/org/opensearch/reportsscheduler/resthandler/OnDemandReportRestHandler.kt b/src/main/kotlin/org/opensearch/reportsscheduler/resthandler/OnDemandReportRestHandler.kt index 483ff762..3c803d32 100644 --- a/src/main/kotlin/org/opensearch/reportsscheduler/resthandler/OnDemandReportRestHandler.kt +++ b/src/main/kotlin/org/opensearch/reportsscheduler/resthandler/OnDemandReportRestHandler.kt @@ -109,7 +109,8 @@ internal class OnDemandReportRestHandler : PluginBaseHandler() { client.execute( OnDemandReportCreateAction.ACTION_TYPE, OnDemandReportCreateRequest.parse( - request.contentParserNextToken(), request.param(REPORT_DEFINITION_ID_FIELD) + request.contentParserNextToken(), + request.param(REPORT_DEFINITION_ID_FIELD) ), RestResponseToXContentListener(it) ) diff --git a/src/main/kotlin/org/opensearch/reportsscheduler/settings/PluginSettings.kt b/src/main/kotlin/org/opensearch/reportsscheduler/settings/PluginSettings.kt index bb54852c..24ba1a62 100644 --- a/src/main/kotlin/org/opensearch/reportsscheduler/settings/PluginSettings.kt +++ b/src/main/kotlin/org/opensearch/reportsscheduler/settings/PluginSettings.kt @@ -117,26 +117,31 @@ internal object PluginSettings { OPERATION_TIMEOUT_MS_KEY, defaultSettings[OPERATION_TIMEOUT_MS_KEY]!!.toLong(), MINIMUM_OPERATION_TIMEOUT_MS, - NodeScope, Dynamic + NodeScope, + Dynamic ) private val DEFAULT_ITEMS_QUERY_COUNT: Setting = Setting.intSetting( DEFAULT_ITEMS_QUERY_COUNT_KEY, defaultSettings[DEFAULT_ITEMS_QUERY_COUNT_KEY]!!.toInt(), MINIMUM_ITEMS_QUERY_COUNT, - NodeScope, Dynamic + NodeScope, + Dynamic ) private val LEGACY_FILTER_BY_BACKEND_ROLES: Setting = Setting.boolSetting( LEGACY_FILTER_BY_BACKEND_ROLES_KEY, false, - NodeScope, Dynamic, Setting.Property.Deprecated + NodeScope, + Dynamic, + Setting.Property.Deprecated ) private val FILTER_BY_BACKEND_ROLES: Setting = Setting.boolSetting( FILTER_BY_BACKEND_ROLES_KEY, LEGACY_FILTER_BY_BACKEND_ROLES, - NodeScope, Dynamic + NodeScope, + Dynamic ) /** diff --git a/src/test/kotlin/org/opensearch/integTest/PluginRestTestCase.kt b/src/test/kotlin/org/opensearch/integTest/PluginRestTestCase.kt index 5e319f1b..b7e6c2eb 100644 --- a/src/test/kotlin/org/opensearch/integTest/PluginRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/integTest/PluginRestTestCase.kt @@ -63,7 +63,8 @@ abstract class PluginRestTestCase : OpenSearchRestTestCase() { val response = client().performRequest(Request("GET", "/_cat/indices?format=json&expand_wildcards=all")) val xContentType = MediaType.fromMediaType(response.entity.contentType) xContentType.xContent().createParser( - NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, + NamedXContentRegistry.EMPTY, + DeprecationHandler.THROW_UNSUPPORTED_OPERATION, response.entity.content ).use { parser -> for (index in parser.list()) { diff --git a/src/test/kotlin/org/opensearch/integTest/rest/ReportInstanceIT.kt b/src/test/kotlin/org/opensearch/integTest/rest/ReportInstanceIT.kt index 8ec9bfa0..4f6bc4f1 100644 --- a/src/test/kotlin/org/opensearch/integTest/rest/ReportInstanceIT.kt +++ b/src/test/kotlin/org/opensearch/integTest/rest/ReportInstanceIT.kt @@ -261,10 +261,12 @@ class ReportInstanceIT : PluginRestTestCase() { Assert.assertEquals(totalHits, 2) val reportInstanceList = listReportInstancesResponse.get("reportInstanceList").asJsonArray Assert.assertEquals( - reportInstanceId, reportInstanceList[0].asJsonObject.get("id").asString + reportInstanceId, + reportInstanceList[0].asJsonObject.get("id").asString ) Assert.assertEquals( - newReportInstanceId, reportInstanceList[1].asJsonObject.get("id").asString + newReportInstanceId, + reportInstanceList[1].asJsonObject.get("id").asString ) } @@ -514,10 +516,12 @@ class ReportInstanceIT : PluginRestTestCase() { Assert.assertEquals(totalHits, 2) val reportInstanceList = listReportInstancesResponse.get("reportInstanceList").asJsonArray Assert.assertEquals( - reportInstanceId, reportInstanceList[0].asJsonObject.get("id").asString + reportInstanceId, + reportInstanceList[0].asJsonObject.get("id").asString ) Assert.assertEquals( - newReportInstanceId, reportInstanceList[1].asJsonObject.get("id").asString + newReportInstanceId, + reportInstanceList[1].asJsonObject.get("id").asString ) } } diff --git a/src/test/kotlin/org/opensearch/reportsscheduler/model/GetAllReportInstancesResponseTests.kt b/src/test/kotlin/org/opensearch/reportsscheduler/model/GetAllReportInstancesResponseTests.kt index 747b7d56..c7fae73b 100644 --- a/src/test/kotlin/org/opensearch/reportsscheduler/model/GetAllReportInstancesResponseTests.kt +++ b/src/test/kotlin/org/opensearch/reportsscheduler/model/GetAllReportInstancesResponseTests.kt @@ -16,7 +16,6 @@ import org.opensearch.reportsscheduler.getJsonString internal class GetAllReportInstancesResponseTests { private fun createReportInstanceSearchResults(): ReportInstanceSearchResults { - return ReportInstanceSearchResults( startIndex = 0, totalHits = 100,