From 4d967caf203fbd22c7f5f6e9a2258a57039ed4e4 Mon Sep 17 00:00:00 2001 From: j-sandy <30489233+j-sandy@users.noreply.github.com> Date: Fri, 22 Dec 2023 18:53:45 +0530 Subject: [PATCH] refactor(test): replace deprecated mockito api verifyZeroInteractions() with verifyNoMoreInteractions() during upgrade to spring boot 2.6.x While upgrading spring boot 2.6.15, encounter similar errors as given below in multiple module of orca (keiko-core, keiko-tck, orca-clouddriver, orca-queue) during test compilation: ``` com.netflix.spinnaker.q.sql.SqlQueueTest > describe polling the queue > given there are no messages > com.netflix.spinnaker.q.sql.SqlQueueTest.it does not invoke the callback FAILED java.lang.NoSuchMethodError: 'void org.mockito.Mockito.verifyZeroInteractions(java.lang.Object[])' at com.nhaarman.mockito_kotlin.MockitoKt.verifyZeroInteractions(Mockito.kt:259) at com.netflix.spinnaker.q.QueueTest$1$1$1$5.invoke(QueueTest.kt:75) at com.netflix.spinnaker.q.QueueTest$1$1$1$5.invoke(QueueTest.kt:74) ``` Spring boot [2.6.15](https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies/2.6.15/spring-boot-dependencies-2.6.15.pom) brings mockito 4.0.0 as transitive dependency. The `verifyZeroInteractions()` was deprecated in 3.x as mentioned here: https://github.com/mockito/mockito-kotlin/issues/383 And now it is removed from mockito [4.0.0](https://github.com/mockito/mockito/releases/tag/v4.0.0). To fix these issues, replacing `verifyZeroInteractions()` with `verifyNoMoreInteractions()`. --- .../com/netflix/spinnaker/q/MessageHandlerTest.kt | 4 ++-- .../com/netflix/spinnaker/q/QueueProcessorTest.kt | 6 +++--- .../kotlin/com/netflix/spinnaker/q/QueueTest.kt | 15 +++++++-------- .../strategies/CFRollingRedBlackStrategyTest.java | 8 ++++---- .../netflix/spinnaker/orca/q/QueueShovelTest.kt | 10 +++++----- .../orca/q/admin/HydrateQueueCommandTest.kt | 9 ++++----- .../orca/q/handler/AbortStageHandlerTest.kt | 6 +++--- .../orca/q/handler/CancelExecutionHandlerTest.kt | 4 ++-- .../orca/q/handler/CancelStageHandlerTest.kt | 6 +++--- .../q/handler/CompleteExecutionHandlerTest.kt | 11 +++++------ .../orca/q/handler/CompleteStageHandlerTest.kt | 6 +++--- .../orca/q/handler/CompleteTaskHandlerTest.kt | 4 ++-- .../q/handler/ConfigurationErrorHandlerTest.kt | 8 ++++---- .../q/handler/ContinueParentStageHandlerTest.kt | 6 +++--- .../orca/q/handler/DeadMessageHandlerTest.kt | 4 ++-- .../orca/q/handler/PauseStageHandlerTest.kt | 3 +-- .../orca/q/handler/SkipStageHandlerTest.kt | 6 +++--- .../orca/q/handler/StartStageHandlerTest.kt | 11 +++++------ .../handler/StartWaitingExecutionsHandlerTest.kt | 3 +-- .../q/metrics/ZombieExecutionCheckingAgentTest.kt | 8 ++++---- 20 files changed, 66 insertions(+), 72 deletions(-) diff --git a/keiko-core/src/test/kotlin/com/netflix/spinnaker/q/MessageHandlerTest.kt b/keiko-core/src/test/kotlin/com/netflix/spinnaker/q/MessageHandlerTest.kt index 835a0e4335..1a19797793 100644 --- a/keiko-core/src/test/kotlin/com/netflix/spinnaker/q/MessageHandlerTest.kt +++ b/keiko-core/src/test/kotlin/com/netflix/spinnaker/q/MessageHandlerTest.kt @@ -20,7 +20,7 @@ import com.netflix.spinnaker.assertj.isA import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import org.assertj.core.api.Assertions.assertThatThrownBy import org.jetbrains.spek.api.dsl.describe import org.jetbrains.spek.api.dsl.it @@ -58,7 +58,7 @@ object MessageHandlerTest : SubjectSpek>({ } it("does not invoke the handler") { - verifyZeroInteractions(handleCallback) + verifyNoMoreInteractions(handleCallback) } } diff --git a/keiko-core/src/test/kotlin/com/netflix/spinnaker/q/QueueProcessorTest.kt b/keiko-core/src/test/kotlin/com/netflix/spinnaker/q/QueueProcessorTest.kt index db69005088..88fd5ed9cf 100644 --- a/keiko-core/src/test/kotlin/com/netflix/spinnaker/q/QueueProcessorTest.kt +++ b/keiko-core/src/test/kotlin/com/netflix/spinnaker/q/QueueProcessorTest.kt @@ -31,7 +31,7 @@ import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.never import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import com.nhaarman.mockito_kotlin.whenever import java.util.concurrent.CountDownLatch import java.util.concurrent.Executor @@ -77,7 +77,7 @@ object QueueProcessorTest : Spek({ } it("does not poll the queue") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } @@ -112,7 +112,7 @@ object QueueProcessorTest : Spek({ } it("does not poll the queue") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } it("fires an event") { diff --git a/keiko-tck/src/main/kotlin/com/netflix/spinnaker/q/QueueTest.kt b/keiko-tck/src/main/kotlin/com/netflix/spinnaker/q/QueueTest.kt index 02cc9eb21b..b67fbab54c 100644 --- a/keiko-tck/src/main/kotlin/com/netflix/spinnaker/q/QueueTest.kt +++ b/keiko-tck/src/main/kotlin/com/netflix/spinnaker/q/QueueTest.kt @@ -25,7 +25,6 @@ import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions -import com.nhaarman.mockito_kotlin.verifyZeroInteractions import java.io.Closeable import java.time.Clock import java.time.Duration @@ -72,7 +71,7 @@ abstract class QueueTest( } it("does not invoke the callback") { - verifyZeroInteractions(callback) + verifyNoMoreInteractions(callback) } } @@ -143,7 +142,7 @@ abstract class QueueTest( } it("does not invoke the callback") { - verifyZeroInteractions(callback) + verifyNoMoreInteractions(callback) } } @@ -196,7 +195,7 @@ abstract class QueueTest( } it("does not retry the message") { - verifyZeroInteractions(callback) + verifyNoMoreInteractions(callback) } } @@ -252,7 +251,7 @@ abstract class QueueTest( } it("does not retry the message") { - verifyZeroInteractions(callback) + verifyNoMoreInteractions(callback) } on("polling the queue after the message acknowledgment override has timed out") { @@ -325,7 +324,7 @@ abstract class QueueTest( } it("stops retrying the message") { - verifyZeroInteractions(callback) + verifyNoMoreInteractions(callback) } it("passes the failed message to the dead letter handler") { @@ -341,7 +340,7 @@ abstract class QueueTest( } it("it does not get redelivered again") { - verifyZeroInteractions(callback) + verifyNoMoreInteractions(callback) } it("no longer gets sent to the dead letter handler") { @@ -473,7 +472,7 @@ abstract class QueueTest( } it("did not enqueue the duplicate message") { - verifyZeroInteractions(callback) + verifyNoMoreInteractions(callback) } } diff --git a/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/pipeline/servergroup/strategies/CFRollingRedBlackStrategyTest.java b/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/pipeline/servergroup/strategies/CFRollingRedBlackStrategyTest.java index 93fcd7a5ea..5c04ece0b2 100644 --- a/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/pipeline/servergroup/strategies/CFRollingRedBlackStrategyTest.java +++ b/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/pipeline/servergroup/strategies/CFRollingRedBlackStrategyTest.java @@ -213,8 +213,8 @@ void composeFlowWithNoSourceAndManifestDirect() { assertThat(deployServerGroupStage.getContext().get("useSourceCapacity")).isNull(); assertThat(deployServerGroupStage.getContext().get("capacity")).isEqualTo(zeroCapacity); assertThat(deployServerGroupStage.getContext().get("manifest")).isEqualTo(expectedManifest); - verifyZeroInteractions(artifactUtils); - verifyZeroInteractions(oortService); + verifyNoMoreInteractions(artifactUtils); + verifyNoMoreInteractions(oortService); } @Test @@ -281,8 +281,8 @@ void composeFlowWithSourceAndManifestDirect() { assertThat(deployServerGroupStage.getContext().get("useSourceCapacity")).isNull(); assertThat(deployServerGroupStage.getContext().get("capacity")).isEqualTo(zeroCapacity); assertThat(deployServerGroupStage.getContext().get("manifest")).isEqualTo(expectedManifest); - verifyZeroInteractions(artifactUtils); - verifyZeroInteractions(oortService); + verifyNoMoreInteractions(artifactUtils); + verifyNoMoreInteractions(oortService); } @Test diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/QueueShovelTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/QueueShovelTest.kt index 478faa4130..4cb0074db8 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/QueueShovelTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/QueueShovelTest.kt @@ -31,7 +31,7 @@ import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.never import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import com.nhaarman.mockito_kotlin.whenever import org.jetbrains.spek.api.dsl.describe import org.jetbrains.spek.api.dsl.it @@ -113,10 +113,10 @@ class QueueShovelTest : SubjectSpek({ it("leaves the message on the old queue") { // not pushed - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) // not acked - verifyZeroInteractions(ackCallback) + verifyNoMoreInteractions(ackCallback) // execution not updated verify(executionRepository, never()).handlesPartition(anyString()) @@ -142,10 +142,10 @@ class QueueShovelTest : SubjectSpek({ verify(executionRepository).store(execution) // not pushed - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) // not acked - verifyZeroInteractions(ackCallback) + verifyNoMoreInteractions(ackCallback) } } } diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/admin/HydrateQueueCommandTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/admin/HydrateQueueCommandTest.kt index 5f835707f4..63d286a4e0 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/admin/HydrateQueueCommandTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/admin/HydrateQueueCommandTest.kt @@ -50,7 +50,6 @@ import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.times import com.nhaarman.mockito_kotlin.verify import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions -import com.nhaarman.mockito_kotlin.verifyZeroInteractions import com.nhaarman.mockito_kotlin.whenever import java.time.Instant import org.assertj.core.api.Assertions.assertThat @@ -85,7 +84,7 @@ object HydrateQueueCommandTest : SubjectSpek({ subject.invoke(HydrateQueueInput(dryRun = false)) it("does nothing") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } } @@ -128,7 +127,7 @@ object HydrateQueueCommandTest : SubjectSpek({ ) it("does nothing") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } } @@ -155,7 +154,7 @@ object HydrateQueueCommandTest : SubjectSpek({ subject.invoke(HydrateQueueInput(executionId = "2", dryRun = false)) it("does nothing") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } } @@ -465,7 +464,7 @@ object HydrateQueueCommandTest : SubjectSpek({ val output = subject.invoke(HydrateQueueInput(dryRun = true)) it("does not interact with queue") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } it("emits dry run output") { diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/AbortStageHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/AbortStageHandlerTest.kt index ba395ccdf7..05e35e8290 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/AbortStageHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/AbortStageHandlerTest.kt @@ -38,7 +38,7 @@ import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.never import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import com.nhaarman.mockito_kotlin.whenever import org.assertj.core.api.Assertions.assertThat import org.jetbrains.spek.api.dsl.describe @@ -88,8 +88,8 @@ object AbortStageHandlerTest : SubjectSpek({ } it("does nothing at all") { - verifyZeroInteractions(queue) - verifyZeroInteractions(publisher) + verifyNoMoreInteractions(queue) + verifyNoMoreInteractions(publisher) verify(repository, never()).storeStage(any()) } } diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CancelExecutionHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CancelExecutionHandlerTest.kt index 8072a137f6..2ed126a297 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CancelExecutionHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CancelExecutionHandlerTest.kt @@ -33,7 +33,7 @@ import com.nhaarman.mockito_kotlin.doReturn import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import com.nhaarman.mockito_kotlin.whenever import org.assertj.core.api.Assertions.assertThat import org.jetbrains.spek.api.dsl.describe @@ -97,7 +97,7 @@ object CancelExecutionHandlerTest : SubjectSpek({ } it("does not send any further messages") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CancelStageHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CancelStageHandlerTest.kt index 47f5050c54..f772aab459 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CancelStageHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CancelStageHandlerTest.kt @@ -42,7 +42,7 @@ import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.never import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import com.nhaarman.mockito_kotlin.whenever import org.jetbrains.spek.api.dsl.context import org.jetbrains.spek.api.dsl.describe @@ -131,7 +131,7 @@ object CancelStageHandlerTest : SubjectSpek({ } it("should not push any messages to the queue") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } } @@ -160,7 +160,7 @@ object CancelStageHandlerTest : SubjectSpek({ } it("should not push any messages to the queue") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } } diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteExecutionHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteExecutionHandlerTest.kt index 72360b064c..dedd05574a 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteExecutionHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteExecutionHandlerTest.kt @@ -43,7 +43,6 @@ import com.nhaarman.mockito_kotlin.never import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions -import com.nhaarman.mockito_kotlin.verifyZeroInteractions import com.nhaarman.mockito_kotlin.whenever import java.time.Duration import java.util.UUID @@ -110,7 +109,7 @@ object CompleteExecutionHandlerTest : SubjectSpek({ } it("does not queue any other commands") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } @@ -175,7 +174,7 @@ object CompleteExecutionHandlerTest : SubjectSpek({ } it("does not publish any events") { - verifyZeroInteractions(publisher) + verifyNoMoreInteractions(publisher) } it("re-queues the message for later evaluation") { @@ -281,7 +280,7 @@ object CompleteExecutionHandlerTest : SubjectSpek({ } it("does not queue any other commands") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } @@ -330,7 +329,7 @@ object CompleteExecutionHandlerTest : SubjectSpek({ } it("does not queue any other commands") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } @@ -375,7 +374,7 @@ object CompleteExecutionHandlerTest : SubjectSpek({ } it("publishes no events") { - verifyZeroInteractions(publisher) + verifyNoMoreInteractions(publisher) } it("re-queues the message") { diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteStageHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteStageHandlerTest.kt index 0e5f654e5a..58e38e52e1 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteStageHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteStageHandlerTest.kt @@ -82,7 +82,7 @@ import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.spy import com.nhaarman.mockito_kotlin.times import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import com.nhaarman.mockito_kotlin.whenever import java.time.Duration.ZERO import org.assertj.core.api.Assertions.assertThat @@ -214,8 +214,8 @@ object CompleteStageHandlerTest : SubjectSpek({ it("ignores the message") { verify(repository, never()).storeStage(any()) - verifyZeroInteractions(queue) - verifyZeroInteractions(publisher) + verifyNoMoreInteractions(queue) + verifyNoMoreInteractions(publisher) } } diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteTaskHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteTaskHandlerTest.kt index 612682338f..d43048445c 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteTaskHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/CompleteTaskHandlerTest.kt @@ -57,7 +57,7 @@ import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.never import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import com.nhaarman.mockito_kotlin.whenever import org.assertj.core.api.Assertions.assertThat import org.jetbrains.spek.api.dsl.describe @@ -251,7 +251,7 @@ object CompleteTaskHandlerTest : SubjectSpek({ } it("does not publish an event") { - verifyZeroInteractions(publisher) + verifyNoMoreInteractions(publisher) } } } diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/ConfigurationErrorHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/ConfigurationErrorHandlerTest.kt index 40529040b9..cb479e0c47 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/ConfigurationErrorHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/ConfigurationErrorHandlerTest.kt @@ -30,7 +30,7 @@ import com.netflix.spinnaker.q.Queue import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import org.jetbrains.spek.api.dsl.describe import org.jetbrains.spek.api.dsl.it import org.jetbrains.spek.api.dsl.on @@ -57,11 +57,11 @@ object ConfigurationErrorHandlerTest : SubjectSpek({ } it("does not try to update the execution status") { - verifyZeroInteractions(repository) + verifyNoMoreInteractions(repository) } it("does not push any messages to the queue") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } } @@ -84,7 +84,7 @@ object ConfigurationErrorHandlerTest : SubjectSpek({ } it("does not push any messages to the queue") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } } diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/ContinueParentStageHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/ContinueParentStageHandlerTest.kt index 36d3006e1f..538149b296 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/ContinueParentStageHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/ContinueParentStageHandlerTest.kt @@ -43,7 +43,7 @@ import com.nhaarman.mockito_kotlin.doReturn import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import com.nhaarman.mockito_kotlin.whenever import java.time.Duration import org.jetbrains.spek.api.dsl.describe @@ -121,7 +121,7 @@ object ContinueParentStageHandlerTest : SubjectSpek( } it("does not re-queue the message") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } @@ -170,7 +170,7 @@ object ContinueParentStageHandlerTest : SubjectSpek( } it("ignores the message") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } } diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/DeadMessageHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/DeadMessageHandlerTest.kt index c3faa28a90..9eadde4cf4 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/DeadMessageHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/DeadMessageHandlerTest.kt @@ -29,7 +29,7 @@ import com.netflix.spinnaker.q.Queue import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import org.jetbrains.spek.api.dsl.describe import org.jetbrains.spek.api.dsl.it import org.jetbrains.spek.api.dsl.on @@ -100,7 +100,7 @@ object DeadMessageHandlerTest : SubjectSpek({ } it("does nothing") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } }) diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/PauseStageHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/PauseStageHandlerTest.kt index c1ba2db49d..fc09e8fc28 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/PauseStageHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/PauseStageHandlerTest.kt @@ -32,7 +32,6 @@ import com.nhaarman.mockito_kotlin.mock import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.verify import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions -import com.nhaarman.mockito_kotlin.verifyZeroInteractions import com.nhaarman.mockito_kotlin.whenever import org.assertj.core.api.Assertions.assertThat import org.jetbrains.spek.api.dsl.context @@ -87,7 +86,7 @@ object PauseStageHandlerTest : SubjectSpek({ } it("does not take any further action") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } } diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/SkipStageHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/SkipStageHandlerTest.kt index a6ed879694..07bf74f824 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/SkipStageHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/SkipStageHandlerTest.kt @@ -42,7 +42,7 @@ import com.nhaarman.mockito_kotlin.never import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.times import com.nhaarman.mockito_kotlin.verify -import com.nhaarman.mockito_kotlin.verifyZeroInteractions +import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions import com.nhaarman.mockito_kotlin.whenever import org.assertj.core.api.Assertions.assertThat import org.jetbrains.spek.api.dsl.describe @@ -91,8 +91,8 @@ object SkipStageHandlerTest : SubjectSpek({ it("ignores the message") { verify(repository, never()).storeStage(any()) - verifyZeroInteractions(queue) - verifyZeroInteractions(publisher) + verifyNoMoreInteractions(queue) + verifyNoMoreInteractions(publisher) } } diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/StartStageHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/StartStageHandlerTest.kt index ccf7b8615d..ae5ded7972 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/StartStageHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/StartStageHandlerTest.kt @@ -80,7 +80,6 @@ import com.nhaarman.mockito_kotlin.times import com.nhaarman.mockito_kotlin.spy import com.nhaarman.mockito_kotlin.verify import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions -import com.nhaarman.mockito_kotlin.verifyZeroInteractions import com.nhaarman.mockito_kotlin.whenever import java.time.Duration import org.assertj.core.api.Assertions.assertThat @@ -473,7 +472,7 @@ object StartStageHandlerTest : SubjectSpek({ } it("does not publish an event") { - verifyZeroInteractions(publisher) + verifyNoMoreInteractions(publisher) } it("re-queues the message with a delay") { @@ -517,7 +516,7 @@ object StartStageHandlerTest : SubjectSpek({ } it("publishes no events") { - verifyZeroInteractions(publisher) + verifyNoMoreInteractions(publisher) } it("completes the execution") { @@ -541,11 +540,11 @@ object StartStageHandlerTest : SubjectSpek({ } it("does not queue any messages") { - verifyZeroInteractions(queue) + verifyNoMoreInteractions(queue) } it("does not publish any events") { - verifyZeroInteractions(publisher) + verifyNoMoreInteractions(publisher) } } } @@ -631,7 +630,7 @@ object StartStageHandlerTest : SubjectSpek({ } } } - + and("parallel stages") { val pipeline = pipeline { application = "foo" diff --git a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/StartWaitingExecutionsHandlerTest.kt b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/StartWaitingExecutionsHandlerTest.kt index 0711024bf6..d79930cccb 100644 --- a/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/StartWaitingExecutionsHandlerTest.kt +++ b/orca-queue/src/test/kotlin/com/netflix/spinnaker/orca/q/handler/StartWaitingExecutionsHandlerTest.kt @@ -34,7 +34,6 @@ import com.nhaarman.mockito_kotlin.reset import com.nhaarman.mockito_kotlin.times import com.nhaarman.mockito_kotlin.verify import com.nhaarman.mockito_kotlin.verifyNoMoreInteractions -import com.nhaarman.mockito_kotlin.verifyZeroInteractions import com.nhaarman.mockito_kotlin.whenever import java.time.Instant.now import java.util.Random @@ -76,7 +75,7 @@ object StartWaitingExecutionsHandlerTest : SubjectSpek