diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SnapshotManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SnapshotManagementRestTestCase.kt index d425e9e83..d4078288e 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SnapshotManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/SnapshotManagementRestTestCase.kt @@ -171,7 +171,7 @@ abstract class SnapshotManagementRestTestCase : IndexManagementRestTestCase() { val startTimeMillis = desiredStartTimeMillis ?: (now().toEpochMilli() - millis) val waitForActiveShards = if (isMultiNode) "all" else "1" val response = - client().makeRequest( + adminClient().makeRequest( "POST", "$INDEX_MANAGEMENT_INDEX/_update/${update.metadataID}?wait_for_active_shards=$waitForActiveShards", StringEntity( """ diff --git a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStartSnapshotManagementIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStartSnapshotManagementIT.kt index 4ec67011a..8f8d0c67c 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStartSnapshotManagementIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/snapshotmanagement/resthandler/RestStartSnapshotManagementIT.kt @@ -5,9 +5,11 @@ package org.opensearch.indexmanagement.snapshotmanagement.resthandler +import org.opensearch.client.Request import org.opensearch.client.ResponseException import org.opensearch.core.rest.RestStatus import org.opensearch.indexmanagement.IndexManagementPlugin +import org.opensearch.indexmanagement.IndexManagementPlugin.Companion.INDEX_MANAGEMENT_INDEX import org.opensearch.indexmanagement.makeRequest import org.opensearch.indexmanagement.snapshotmanagement.SnapshotManagementRestTestCase import org.opensearch.indexmanagement.snapshotmanagement.randomSMPolicy @@ -59,7 +61,8 @@ class RestStartSnapshotManagementIT : SnapshotManagementRestTestCase() { fun `test starting a snapshot management policy with no config index fails`() { try { - deleteIndex(IndexManagementPlugin.INDEX_MANAGEMENT_INDEX) + val request = Request("DELETE", "/$INDEX_MANAGEMENT_INDEX") + adminClient().performRequest(request) client().makeRequest("POST", "${IndexManagementPlugin.SM_POLICIES_URI}/nonexistent_foo/_start") fail("expected response exception") } catch (e: ResponseException) {