use of io.zeebe.test.util.MsgPackUtil.asMsgPack in project zeebe by zeebe-io.
the class WorkflowInstanceFunctionalTest method testWorkflowInstanceStatesWithExclusiveGateway.
@Test
public void testWorkflowInstanceStatesWithExclusiveGateway() {
// given
final WorkflowDefinition workflowDefinition = Bpmn.createExecutableWorkflow("workflow").startEvent().exclusiveGateway("xor").sequenceFlow("s1", s -> s.condition("$.foo < 5")).endEvent("a").sequenceFlow("s2", s -> s.defaultFlow()).endEvent("b").done();
testClient.deploy(workflowDefinition);
// when
testClient.createWorkflowInstance("workflow", MsgPackUtil.asMsgPack("foo", 4));
// then
final List<SubscribedEvent> workflowEvents = testClient.receiveEvents(workflowInstanceEvents()).limit(8).collect(Collectors.toList());
assertThat(workflowEvents).extracting(e -> e.event().get(PROP_STATE)).containsExactly("CREATE_WORKFLOW_INSTANCE", "WORKFLOW_INSTANCE_CREATED", "START_EVENT_OCCURRED", "SEQUENCE_FLOW_TAKEN", "GATEWAY_ACTIVATED", "SEQUENCE_FLOW_TAKEN", "END_EVENT_OCCURRED", "WORKFLOW_INSTANCE_COMPLETED");
}
Aggregations