@Test public void shouldWriteEntireEventOnCancel() { // given testClient.deploy(WORKFLOW); final long workflowInstanceKey = testClient.createWorkflowInstance(PROCESS_ID); final io.zeebe.exporter.record.Record<WorkflowInstanceRecordValue> activatedEvent = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_ACTIVATED) .withElementId(PROCESS_ID) .getFirst(); // when final ExecuteCommandResponse response = cancelWorkflowInstance(workflowInstanceKey); // then MsgPackUtil.assertEqualityExcluding( response.getRawValue(), activatedEvent.getValue().toJson(), "payload"); final io.zeebe.exporter.record.Record<WorkflowInstanceRecordValue> cancelingEvent = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_TERMINATING) .withElementId(PROCESS_ID) .getFirst(); assertThat(cancelingEvent.getValue()).isEqualTo(activatedEvent.getValue()); }
@Test public void shouldWriteEntireEventOnCancel() { // given testClient.deploy(WORKFLOW); final long workflowInstanceKey = testClient.createWorkflowInstance(PROCESS_ID); final io.zeebe.exporter.record.Record<WorkflowInstanceRecordValue> activatedEvent = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_ACTIVATED) .withElementId(PROCESS_ID) .getFirst(); // when final ExecuteCommandResponse response = cancelWorkflowInstance(workflowInstanceKey); // then MsgPackUtil.assertEqualityExcluding( response.getRawValue(), activatedEvent.getValue().toJson(), "payload"); final io.zeebe.exporter.record.Record<WorkflowInstanceRecordValue> cancelingEvent = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_TERMINATING) .withElementId(PROCESS_ID) .getFirst(); assertThat(cancelingEvent.getValue()).isEqualTo(activatedEvent.getValue()); }