@Test public void shouldCreateTimer() { // when testClient.deploy(SIMPLE_MODEL); // then assertThat(RecordingExporter.deploymentRecords(DeploymentIntent.CREATED).exists()).isTrue(); final TimerRecordValue timerRecord = RecordingExporter.timerRecords(TimerIntent.CREATED).getFirst().getValue(); Assertions.assertThat(timerRecord) .hasDueDate(brokerRule.getClock().getCurrentTimeInMillis() + 1000) .hasHandlerFlowNodeId("start_1") .hasElementInstanceKey(NO_ELEMENT_INSTANCE); }
@Test public void shouldCreateTimer() { // when testClient.deploy(SIMPLE_MODEL); // then assertThat(RecordingExporter.deploymentRecords(DeploymentIntent.CREATED).exists()).isTrue(); final TimerRecordValue timerRecord = RecordingExporter.timerRecords(TimerIntent.CREATED).getFirst().getValue(); Assertions.assertThat(timerRecord) .hasDueDate(brokerRule.getClock().getCurrentTimeInMillis() + 1000) .hasHandlerFlowNodeId("start_1") .hasElementInstanceKey(NO_ELEMENT_INSTANCE); }
@Test public void shouldStartWorkflowInstanceAtNoneStartEvent() { // given apiRule .partitionClient() .deploy(Bpmn.createExecutableProcess("process").startEvent("foo").endEvent().done()); // when TestUtil.waitUntil(() -> RecordingExporter.deploymentRecords().withPartitionId(2).exists()); final ExecuteCommandResponse workflowInstanceWithResponse = apiRule.partitionClient(2).createWorkflowInstanceWithResponse("process"); // then partition id is encoded in the returned getKey final long key = workflowInstanceWithResponse.getKey(); final int partitionId = Protocol.decodePartitionId(key); assertThat(partitionId).isEqualTo(2); } }
@Test public void shouldStartWorkflowInstanceAtNoneStartEvent() { // given apiRule .partitionClient() .deploy(Bpmn.createExecutableProcess("process").startEvent("foo").endEvent().done()); // when TestUtil.waitUntil(() -> RecordingExporter.deploymentRecords().withPartitionId(2).exists()); final ExecuteCommandResponse workflowInstanceWithResponse = apiRule.partitionClient(2).createWorkflowInstanceWithResponse("process"); // then partition id is encoded in the returned getKey final long key = workflowInstanceWithResponse.getKey(); final int partitionId = Protocol.decodePartitionId(key); assertThat(partitionId).isEqualTo(2); } }