diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadWriteStepTests.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadWriteStepTests.kt index cde5845e5..d9f6b41de 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadWriteStepTests.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/SetReadWriteStepTests.kt @@ -11,8 +11,6 @@ import com.nhaarman.mockitokotlin2.doReturn import com.nhaarman.mockitokotlin2.mock import com.nhaarman.mockitokotlin2.whenever import kotlinx.coroutines.runBlocking -import org.junit.Before -import org.mockito.ArgumentMatchers.anyString import org.opensearch.action.support.master.AcknowledgedResponse import org.opensearch.client.AdminClient import org.opensearch.client.Client @@ -20,16 +18,12 @@ import org.opensearch.client.IndicesAdminClient import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.Settings import org.opensearch.core.action.ActionListener -import org.opensearch.indexmanagement.indexstatemanagement.ManagedIndexRunner import org.opensearch.indexmanagement.indexstatemanagement.step.readwrite.SetReadWriteStep import org.opensearch.indexmanagement.spi.indexstatemanagement.Step -import org.opensearch.indexmanagement.spi.indexstatemanagement.metrics.IndexManagementActionsMetrics import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ManagedIndexMetaData import org.opensearch.indexmanagement.spi.indexstatemanagement.model.StepContext import org.opensearch.jobscheduler.spi.utils.LockService import org.opensearch.script.ScriptService -import org.opensearch.telemetry.metrics.Counter -import org.opensearch.telemetry.metrics.MetricsRegistry import org.opensearch.test.OpenSearchTestCase import org.opensearch.transport.RemoteTransportException @@ -38,17 +32,6 @@ class SetReadWriteStepTests : OpenSearchTestCase() { private val scriptService: ScriptService = mock() private val settings: Settings = Settings.EMPTY private val lockService: LockService = LockService(mock(), clusterService) - private lateinit var metricsRegistry: MetricsRegistry - - @Before - fun setup() { - metricsRegistry = mock() - whenever(metricsRegistry.createCounter(anyString(), anyString(), anyString())).thenAnswer { - mock() - } - IndexManagementActionsMetrics.instance.initialize(metricsRegistry) - ManagedIndexRunner.registerIndexManagementActionMetrics(IndexManagementActionsMetrics.instance) - } fun `test read write step sets step status to failed when not acknowledged`() { val setReadWriteResponse = AcknowledgedResponse(false) @@ -110,4 +93,4 @@ class SetReadWriteStepTests : OpenSearchTestCase() { }.whenever(this.mock).updateSettings(any(), any()) } } -} +} \ No newline at end of file