Skip to content

Commit

Permalink
test: java client should accept dead partitions
Browse files Browse the repository at this point in the history
  • Loading branch information
lenaschoenburg committed May 20, 2022
1 parent 751140f commit dad809d
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import static io.camunda.zeebe.client.util.RecordingGatewayService.broker;
import static io.camunda.zeebe.client.util.RecordingGatewayService.partition;
import static io.camunda.zeebe.gateway.protocol.GatewayOuterClass.Partition.PartitionBrokerHealth.DEAD;
import static io.camunda.zeebe.gateway.protocol.GatewayOuterClass.Partition.PartitionBrokerHealth.HEALTHY;
import static io.camunda.zeebe.gateway.protocol.GatewayOuterClass.Partition.PartitionBrokerHealth.UNHEALTHY;
import static io.camunda.zeebe.gateway.protocol.GatewayOuterClass.Partition.PartitionBrokerRole.FOLLOWER;
Expand Down Expand Up @@ -119,6 +120,25 @@ public void shouldRequestTopology() {
tuple(1, PartitionBrokerRole.INACTIVE, PartitionBrokerHealth.UNHEALTHY));
}

@Test
public void shouldAcceptDeadPartitions() {
// given
gatewayService.onTopologyRequest(
1,
1,
1,
"1.22.3-SNAPSHOT",
broker(0, "host1", 123, "1.22.3-SNAPSHOT", partition(0, LEADER, DEAD)));

// when
final Topology topology = client.newTopologyRequest().send().join();

// then
assertThat(topology.getBrokers().get(0).getPartitions().get(0))
.extracting(PartitionInfo::getHealth)
.isEqualTo(PartitionBrokerHealth.DEAD);
}

@Test
public void shouldRaiseExceptionOnError() {
// given
Expand Down

0 comments on commit dad809d

Please sign in to comment.