use of io.zeebe.broker.it.clustering.ClusteringRule.BROKER_1_CLIENT_ADDRESS in project zeebe by zeebe-io.
the class TopologyRequestTest method shouldUpdateClientTopologyOnAsyncTopologyRequest.
@Test
public void shouldUpdateClientTopologyOnAsyncTopologyRequest() {
// given
final SocketAddress oldLeader = BROKER_1_CLIENT_ADDRESS;
// when
final List<Integer> partitions = clusteringRule.getBrokersLeadingPartitions(oldLeader);
clusteringRule.brokers.remove(oldLeader).close();
doRepeatedly(this::requestTopologyAsync).until(topologyBrokers -> topologyBrokers != null && topologyBrokers.stream().filter(broker -> !broker.getSocketAddress().equals(oldLeader)).flatMap(broker -> broker.getPartitions().stream()).filter(BrokerPartitionState::isLeader).map(BrokerPartitionState::getPartitionId).collect(Collectors.toSet()).containsAll(partitions));
// then
zeebeClient.topics().create("foo", 1).execute();
}
Aggregations