use of io.camunda.zeebe.client.api.response.Topology in project zeebe-test-container by camunda-community-hub.
the class ZeebeClusterTest method shouldStartClusterWithStandaloneGateway.
@Test
void shouldStartClusterWithStandaloneGateway() {
// given
cluster = ZeebeCluster.builder().withEmbeddedGateway(false).withReplicationFactor(1).withPartitionsCount(1).withBrokersCount(1).withGatewaysCount(1).build();
// when
cluster.start();
// then
try (final ZeebeClient client = cluster.newClientBuilder().build()) {
final Topology topology = client.newTopologyRequest().send().join();
assertThat(topology.getPartitionsCount()).as("there is exactly one partition as configured").isEqualTo(1);
assertThat(topology.getReplicationFactor()).as("there is a replication factor of 1 as configured").isEqualTo(1);
TopologyAssert.assertThat(topology).as("the topology is complete for a one broker, one partition cluster").hasBrokersCount(1).isComplete(1, 1, 1);
}
}
use of io.camunda.zeebe.client.api.response.Topology in project zeebe-test-container by camunda-community-hub.
the class ZeebeGatewayContainerTest method shouldConnectToBroker.
@Test
void shouldConnectToBroker() {
// given
final Topology topology;
// when
try (final ZeebeClient client = ZeebeClientFactory.newZeebeClient(gatewayContainer)) {
topology = client.newTopologyRequest().send().join(5, TimeUnit.SECONDS);
}
// then
final List<BrokerInfo> brokers = topology.getBrokers();
Assertions.assertThat(brokers).as("the gateway should report one broker").hasSize(1);
Assertions.assertThat(brokers.get(0).getAddress()).as("the gateway should report the correct contact point").isEqualTo(brokerContainer.getInternalCommandAddress());
}
Aggregations