Skip to content

Commit

Permalink
test: verify that subscription consumer is not signalled after removing
Browse files Browse the repository at this point in the history
(cherry picked from commit 4315676)
  • Loading branch information
lenaschoenburg authored and github-actions[bot] committed Apr 14, 2022
1 parent 79204a5 commit 2cc693f
Showing 1 changed file with 38 additions and 0 deletions.
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);
}
}

0 comments on commit 2cc693f

Please sign in to comment.