use of io.zeebe.client.event.DeploymentEvent in project zeebe by zeebe-io.
the class BrokerRestartTest method shouldDeployNewWorkflowVersionAfterRestart.
@Test
// FIXME: https://github.com/zeebe-io/zeebe/issues/567
@Category(io.zeebe.UnstableTest.class)
public void shouldDeployNewWorkflowVersionAfterRestart() {
// given
clientRule.workflows().deploy(clientRule.getDefaultTopic()).addWorkflowModel(WORKFLOW, "workflow.bpmn").execute();
// when
restartBroker();
final DeploymentEvent deploymentResult = clientRule.workflows().deploy(clientRule.getDefaultTopic()).addWorkflowModel(WORKFLOW, "workflow.bpmn").execute();
// then
assertThat(deploymentResult.getDeployedWorkflows().get(0).getVersion()).isEqualTo(2);
final WorkflowInstanceEvent workflowInstanceV1 = clientRule.workflows().create(clientRule.getDefaultTopic()).bpmnProcessId("process").version(1).execute();
final WorkflowInstanceEvent workflowInstanceV2 = clientRule.workflows().create(clientRule.getDefaultTopic()).bpmnProcessId("process").latestVersion().execute();
// then
assertThat(workflowInstanceV1.getVersion()).isEqualTo(1);
assertThat(workflowInstanceV2.getVersion()).isEqualTo(2);
}
use of io.zeebe.client.event.DeploymentEvent in project zeebe by zeebe-io.
the class BrokerRecoveryTest method shouldDeployNewWorkflowVersionAfterRestart.
@Test
public void shouldDeployNewWorkflowVersionAfterRestart() {
// given
clientRule.workflows().deploy(clientRule.getDefaultTopic()).addWorkflowModel(WORKFLOW, "workflow.bpmn").execute();
// when
restartBroker();
final DeploymentEvent deploymentResult = clientRule.workflows().deploy(clientRule.getDefaultTopic()).addWorkflowModel(WORKFLOW, "workflow.bpmn").execute();
// then
assertThat(deploymentResult.getDeployedWorkflows().get(0).getVersion()).isEqualTo(2);
final WorkflowInstanceEvent workflowInstanceV1 = clientRule.workflows().create(clientRule.getDefaultTopic()).bpmnProcessId("process").version(1).execute();
final WorkflowInstanceEvent workflowInstanceV2 = clientRule.workflows().create(clientRule.getDefaultTopic()).bpmnProcessId("process").latestVersion().execute();
// then
assertThat(workflowInstanceV1.getVersion()).isEqualTo(1);
assertThat(workflowInstanceV2.getVersion()).isEqualTo(2);
}
use of io.zeebe.client.event.DeploymentEvent in project zeebe by zeebe-io.
the class DeploymentClusteredTest method shouldDeployInCluster.
@Test
public void shouldDeployInCluster() {
// given
clusteringRule.createTopic("test", PARTITION_COUNT);
// when
final DeploymentEvent deploymentEvent = client.workflows().deploy("test").addWorkflowModel(WORKFLOW, "workflow.bpmn").execute();
// then
assertThat(deploymentEvent.getDeployedWorkflows().size()).isEqualTo(1);
assertThat(deploymentEvent.getErrorMessage()).isEmpty();
}
use of io.zeebe.client.event.DeploymentEvent in project zeebe by zeebe-io.
the class DeploymentClusteredTest method shouldDeployOnDifferentTopics.
@Test
public void shouldDeployOnDifferentTopics() {
// given
clusteringRule.createTopic("test-1", PARTITION_COUNT);
clusteringRule.createTopic("test-2", PARTITION_COUNT);
// when
final DeploymentEvent deploymentEventOnTest1 = client.workflows().deploy("test-2").addWorkflowModel(WORKFLOW, "workflow.bpmn").execute();
final DeploymentEvent deploymentEventOnTest2 = client.workflows().deploy("test-2").addWorkflowModel(WORKFLOW, "workflow.bpmn").execute();
// then
assertThat(deploymentEventOnTest1.getDeployedWorkflows().size()).isEqualTo(1);
assertThat(deploymentEventOnTest1.getErrorMessage()).isEmpty();
assertThat(deploymentEventOnTest2.getDeployedWorkflows().size()).isEqualTo(1);
assertThat(deploymentEventOnTest2.getErrorMessage()).isEmpty();
}
use of io.zeebe.client.event.DeploymentEvent in project zeebe by zeebe-io.
the class DeploymentClusteredTest method shouldDeployMultipleResources.
@Test
public void shouldDeployMultipleResources() {
// given
clusteringRule.createTopic("test", PARTITION_COUNT);
// when
final DeploymentEvent deploymentEvent = client.workflows().deploy("test").addWorkflowModel(WORKFLOW, "workflow.bpmn").addWorkflowModel(WORKFLOW_WITH_TASK, "workflowWithTask.bpmn").addWorkflowModel(WORKFLOW_WITH_OTHER_TASK, "workflowWithOtherTask.bpmn").execute();
// then
assertThat(deploymentEvent.getDeployedWorkflows().size()).isEqualTo(3);
assertThat(deploymentEvent.getErrorMessage()).isEmpty();
}
Aggregations