Skip to content

Commit

Permalink
Upgrade kotlin and fix issues related to that
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Agrawal <[email protected]>
  • Loading branch information
lezzago committed Mar 15, 2022
1 parent 3150380 commit 6fcf29f
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions alerting/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ configurations.all {
}
}

configurations.testCompile {
configurations.testImplementation {
exclude module: "securemock"
}

Expand All @@ -67,7 +67,7 @@ dependencies {
implementation "com.github.seancfoley:ipaddress:5.3.3"

testImplementation "org.jetbrains.kotlin:kotlin-test:${kotlin_version}"
testCompile "org.mockito:mockito-core:4.3.1"
testImplementation "org.mockito:mockito-core:4.3.1"
}

javadoc.enabled = false // turn off javadoc as it barfs on Kotlin code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import org.opensearch.action.ActionType
class AcknowledgeAlertAction private constructor() : ActionType<AcknowledgeAlertResponse>(NAME, ::AcknowledgeAlertResponse) {
companion object {
val INSTANCE = AcknowledgeAlertAction()
val NAME = "cluster:admin/opendistro/alerting/alerts/ack"
const val NAME = "cluster:admin/opendistro/alerting/alerts/ack"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import org.opensearch.action.delete.DeleteResponse
class DeleteDestinationAction private constructor() : ActionType<DeleteResponse>(NAME, ::DeleteResponse) {
companion object {
val INSTANCE = DeleteDestinationAction()
val NAME = "cluster:admin/opendistro/alerting/destination/delete"
const val NAME = "cluster:admin/opendistro/alerting/destination/delete"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import org.opensearch.action.delete.DeleteResponse
class DeleteMonitorAction private constructor() : ActionType<DeleteResponse>(NAME, ::DeleteResponse) {
companion object {
val INSTANCE = DeleteMonitorAction()
val NAME = "cluster:admin/opendistro/alerting/monitor/delete"
const val NAME = "cluster:admin/opendistro/alerting/monitor/delete"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import org.opensearch.action.ActionType
class ExecuteMonitorAction private constructor() : ActionType<ExecuteMonitorResponse>(NAME, ::ExecuteMonitorResponse) {
companion object {
val INSTANCE = ExecuteMonitorAction()
val NAME = "cluster:admin/opendistro/alerting/monitor/execute"
const val NAME = "cluster:admin/opendistro/alerting/monitor/execute"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import org.opensearch.action.ActionType
class GetAlertsAction private constructor() : ActionType<GetAlertsResponse>(NAME, ::GetAlertsResponse) {
companion object {
val INSTANCE = GetAlertsAction()
val NAME = "cluster:admin/opendistro/alerting/alerts/get"
const val NAME = "cluster:admin/opendistro/alerting/alerts/get"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import org.opensearch.action.ActionType
class GetDestinationsAction private constructor() : ActionType<GetDestinationsResponse>(NAME, ::GetDestinationsResponse) {
companion object {
val INSTANCE = GetDestinationsAction()
val NAME = "cluster:admin/opendistro/alerting/destination/get"
const val NAME = "cluster:admin/opendistro/alerting/destination/get"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import org.opensearch.action.ActionType
class GetEmailAccountAction private constructor() : ActionType<GetEmailAccountResponse>(NAME, ::GetEmailAccountResponse) {
companion object {
val INSTANCE = GetEmailAccountAction()
val NAME = "cluster:admin/opendistro/alerting/destination/email_account/get"
const val NAME = "cluster:admin/opendistro/alerting/destination/email_account/get"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import org.opensearch.action.ActionType
class GetEmailGroupAction private constructor() : ActionType<GetEmailGroupResponse>(NAME, ::GetEmailGroupResponse) {
companion object {
val INSTANCE = GetEmailGroupAction()
val NAME = "cluster:admin/opendistro/alerting/destination/email_group/get"
const val NAME = "cluster:admin/opendistro/alerting/destination/email_group/get"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import org.opensearch.action.ActionType
class GetMonitorAction private constructor() : ActionType<GetMonitorResponse>(NAME, ::GetMonitorResponse) {
companion object {
val INSTANCE = GetMonitorAction()
val NAME = "cluster:admin/opendistro/alerting/monitor/get"
const val NAME = "cluster:admin/opendistro/alerting/monitor/get"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import org.opensearch.action.ActionType
class IndexDestinationAction private constructor() : ActionType<IndexDestinationResponse>(NAME, ::IndexDestinationResponse) {
companion object {
val INSTANCE = IndexDestinationAction()
val NAME = "cluster:admin/opendistro/alerting/destination/write"
const val NAME = "cluster:admin/opendistro/alerting/destination/write"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import org.opensearch.action.ActionType
class IndexEmailAccountAction private constructor() : ActionType<IndexEmailAccountResponse>(NAME, ::IndexEmailAccountResponse) {
companion object {
val INSTANCE = IndexEmailAccountAction()
val NAME = "cluster:admin/opendistro/alerting/destination/email_account/write"
const val NAME = "cluster:admin/opendistro/alerting/destination/email_account/write"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import org.opensearch.action.ActionType
class IndexEmailGroupAction private constructor() : ActionType<IndexEmailGroupResponse>(NAME, ::IndexEmailGroupResponse) {
companion object {
val INSTANCE = IndexEmailGroupAction()
val NAME = "cluster:admin/opendistro/alerting/destination/email_group/write"
const val NAME = "cluster:admin/opendistro/alerting/destination/email_group/write"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import org.opensearch.action.ActionType
class IndexMonitorAction private constructor() : ActionType<IndexMonitorResponse>(NAME, ::IndexMonitorResponse) {
companion object {
val INSTANCE = IndexMonitorAction()
val NAME = "cluster:admin/opendistro/alerting/monitor/write"
const val NAME = "cluster:admin/opendistro/alerting/monitor/write"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import org.opensearch.action.search.SearchResponse
class SearchEmailAccountAction private constructor() : ActionType<SearchResponse>(NAME, ::SearchResponse) {
companion object {
val INSTANCE = SearchEmailAccountAction()
val NAME = "cluster:admin/opendistro/alerting/destination/email_account/search"
const val NAME = "cluster:admin/opendistro/alerting/destination/email_account/search"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import org.opensearch.action.search.SearchResponse
class SearchEmailGroupAction private constructor() : ActionType<SearchResponse>(NAME, ::SearchResponse) {
companion object {
val INSTANCE = SearchEmailGroupAction()
val NAME = "cluster:admin/opendistro/alerting/destination/email_group/search"
const val NAME = "cluster:admin/opendistro/alerting/destination/email_group/search"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import org.opensearch.action.search.SearchResponse
class SearchMonitorAction private constructor() : ActionType<SearchResponse>(NAME, ::SearchResponse) {
companion object {
val INSTANCE = SearchMonitorAction()
val NAME = "cluster:admin/opendistro/alerting/monitor/search"
const val NAME = "cluster:admin/opendistro/alerting/monitor/search"
}
}
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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 = '1.3.72'
kotlin_version = '1.6.10'
}

repositories {
Expand Down Expand Up @@ -77,10 +77,10 @@ allprojects {
apply from: "$rootDir/build-tools/repositories.gradle"

plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
}
plugins.withId('org.jetbrains.kotlin.jvm') {
compileKotlin.kotlinOptions.jvmTarget = compileTestKotlin.kotlinOptions.jvmTarget = "1.8"
compileKotlin.kotlinOptions.jvmTarget = compileTestKotlin.kotlinOptions.jvmTarget = JavaVersion.VERSION_11
compileKotlin.dependsOn ktlint
}
}
Expand Down

0 comments on commit 6fcf29f

Please sign in to comment.