-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: verify that subscription consumer is not signalled after removing
(cherry picked from commit 4315676)
- Loading branch information
1 parent
79204a5
commit 2cc693f
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
dispatcher/src/test/java/io/camunda/zeebe/dispatcher/SubscriptionConsumerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.dispatcher; | ||
|
||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.verifyNoInteractions; | ||
|
||
import io.camunda.zeebe.dispatcher.impl.log.LogBuffer; | ||
import io.camunda.zeebe.util.sched.ActorCondition; | ||
import org.junit.jupiter.api.Test; | ||
|
||
final class SubscriptionConsumerTest { | ||
@Test | ||
void consumersAreNotSignaledAfterRemoving() { | ||
// given | ||
final var consumer = mock(ActorCondition.class); | ||
final var subscription = | ||
new Subscription( | ||
mock(AtomicPosition.class), | ||
mock(AtomicPosition.class), | ||
0, | ||
"", | ||
consumer, | ||
mock(LogBuffer.class)); | ||
|
||
// when | ||
subscription.removeConsumer(consumer); | ||
|
||
// then | ||
subscription.getActorConditions().signalConsumers(); | ||
verifyNoInteractions(consumer); | ||
} | ||
} |