use of io.zeebe.client.event.WorkflowInstanceEvent in project zeebe by zeebe-io.
the class DeploymentClusteredTest method shouldCreateInstancesOnRestartedBroker.
@Test
public void shouldCreateInstancesOnRestartedBroker() {
// given
final int workCount = PARTITION_COUNT;
final Topic topic = clusteringRule.createTopic("test", PARTITION_COUNT);
clusteringRule.stopBroker(ClusteringRule.BROKER_3_CLIENT_ADDRESS);
client.workflows().deploy("test").addWorkflowModel(WORKFLOW, "workflow.bpmn").execute();
// when
clusteringRule.restartBroker(ClusteringRule.BROKER_3_CLIENT_ADDRESS);
// then create wf instance on each partition
final Integer[] partitionIds = topic.getPartitions().stream().mapToInt(p -> p.getId()).boxed().toArray(Integer[]::new);
for (int partition : partitionIds) {
final WorkflowInstanceEvent workflowInstanceEvent = createWorkflowInstanceOnPartition("test", partition, "process");
assertThat(workflowInstanceEvent.getState()).isEqualTo("WORKFLOW_INSTANCE_CREATED");
}
}
Aggregations