diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt index cf44441fe..81411165c 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/filter/NotificationActionListener.kt @@ -235,9 +235,12 @@ class NotificationActionListener>> + )["hits"]!!["total"]!!["value"] + ) + + try { + client.makeRequest("GET", "_plugins/_im/lron/LRON:$taskId") + } catch (e: ResponseException) { + // runtime policy been removed + Assert.assertTrue(e.response.restStatus() == RestStatus.NOT_FOUND) + } + } + } + + private fun performReindex(): Response { + insertSampleData("source-index", 10) + createIndex("reindex-dest", Settings.EMPTY) + + val response = client.makeRequest( + "POST", "_reindex?wait_for_completion=false", + StringEntity( + """ + { + "source": { + "index": "source-index" + }, + "dest": { + "index": "reindex-dest" + } + } + """.trimIndent(), + ContentType.APPLICATION_JSON + ) + ) + return response + } }