use of io.camunda.zeebe.client.api.response.DeploymentEvent in project zeebe-process-test by camunda-cloud.
the class EngineClientTest method shouldCreateInstanceWithoutVariables.
@Test
void shouldCreateInstanceWithoutVariables() {
// given
final DeploymentEvent deployment = zeebeClient.newDeployCommand().addProcessModel(Bpmn.createExecutableProcess("simpleProcess").startEvent().endEvent().done(), "simpleProcess.bpmn").send().join();
// when
final ProcessInstanceEvent processInstance = zeebeClient.newCreateInstanceCommand().bpmnProcessId("simpleProcess").latestVersion().send().join();
// then
assertThat(processInstance.getProcessInstanceKey()).isPositive();
assertThat(processInstance.getBpmnProcessId()).isEqualTo("simpleProcess");
assertThat(processInstance.getProcessDefinitionKey()).isEqualTo(deployment.getProcesses().get(0).getProcessDefinitionKey());
assertThat(processInstance.getVersion()).isEqualTo(1);
}
use of io.camunda.zeebe.client.api.response.DeploymentEvent in project zeebe-process-test by camunda-cloud.
the class EngineClientTest method shouldDeployProcess.
@Test
void shouldDeployProcess() {
// given
// when
final DeploymentEvent deployment = zeebeClient.newDeployCommand().addProcessModel(Bpmn.createExecutableProcess("simpleProcess").startEvent().endEvent().done(), "simpleProcess.bpmn").send().join();
// then
assertThat(deployment.getKey()).isPositive();
assertThat(deployment.getProcesses()).isNotEmpty();
final Process process = deployment.getProcesses().get(0);
assertThat(process.getVersion()).isEqualTo(1);
assertThat(process.getResourceName()).isEqualTo("simpleProcess.bpmn");
assertThat(process.getBpmnProcessId()).isEqualTo("simpleProcess");
assertThat(process.getProcessDefinitionKey()).isPositive();
}
use of io.camunda.zeebe.client.api.response.DeploymentEvent in project zeebe-process-test by camunda-cloud.
the class EngineClientTest method shouldDeployResource.
@Test
void shouldDeployResource() {
// given
// when
final DeploymentEvent deployment = zeebeClient.newDeployResourceCommand().addProcessModel(Bpmn.createExecutableProcess("simpleProcess").startEvent().endEvent().done(), "simpleProcess.bpmn").send().join();
// then
assertThat(deployment.getKey()).isPositive();
assertThat(deployment.getProcesses()).isNotEmpty();
final Process process = deployment.getProcesses().get(0);
assertThat(process.getVersion()).isEqualTo(1);
assertThat(process.getResourceName()).isEqualTo("simpleProcess.bpmn");
assertThat(process.getBpmnProcessId()).isEqualTo("simpleProcess");
assertThat(process.getProcessDefinitionKey()).isPositive();
}
use of io.camunda.zeebe.client.api.response.DeploymentEvent in project zeebe-process-test by camunda-cloud.
the class EngineClientTest method shouldCreateProcessInstanceWithResult.
@Test
void shouldCreateProcessInstanceWithResult() {
// given
final DeploymentEvent deployment = zeebeClient.newDeployCommand().addProcessModel(Bpmn.createExecutableProcess("simpleProcess").startEvent().endEvent().done(), "simpleProcess.bpmn").send().join();
// when
final ProcessInstanceResult processInstanceResult = zeebeClient.newCreateInstanceCommand().bpmnProcessId("simpleProcess").latestVersion().variables(Map.of("test", 1)).withResult().send().join();
// then
assertThat(processInstanceResult.getProcessInstanceKey()).isPositive();
assertThat(processInstanceResult.getBpmnProcessId()).isEqualTo("simpleProcess");
assertThat(processInstanceResult.getProcessDefinitionKey()).isEqualTo(deployment.getProcesses().get(0).getProcessDefinitionKey());
assertThat(processInstanceResult.getVersion()).isEqualTo(1);
assertThat(processInstanceResult.getVariablesAsMap()).containsEntry("test", 1);
}
use of io.camunda.zeebe.client.api.response.DeploymentEvent in project zeebe-process-test by camunda-cloud.
the class AbstractProcessEventInspectionsTest method testFindLastProcessInstance.
@Test
void testFindLastProcessInstance() throws InterruptedException {
// given
final DeploymentEvent deploymentEvent = Utilities.deployResource(getClient(), ProcessPackTimerStartEvent.RESOURCE_NAME);
// when
Utilities.increaseTime(getEngine(), Duration.ofDays(1));
final Optional<InspectedProcessInstance> lastProcessInstance = InspectionUtility.findProcessEvents().triggeredByTimer(ProcessPackTimerStartEvent.TIMER_ID).withProcessDefinitionKey(deploymentEvent.getProcesses().get(0).getProcessDefinitionKey()).findLastProcessInstance();
// then
Assertions.assertThat(lastProcessInstance).isNotEmpty();
BpmnAssert.assertThat(lastProcessInstance.get()).isCompleted();
}
Aggregations