public static void assertEqualityExcluding( DirectBuffer actualMsgPack, String expectedJson, String... excludedProperties) { assertNotNull("actual msg pack is null", actualMsgPack); final byte[] msgPackArray = new byte[actualMsgPack.capacity()]; actualMsgPack.getBytes(0, msgPackArray); assertEqualityExcluding(msgPackArray, expectedJson, excludedProperties); }
public static void assertEqualityExcluding( DirectBuffer actualMsgPack, String expectedJson, String... excludedProperties) { assertNotNull("actual msg pack is null", actualMsgPack); final byte[] msgPackArray = new byte[actualMsgPack.capacity()]; actualMsgPack.getBytes(0, msgPackArray); assertEqualityExcluding(msgPackArray, expectedJson, excludedProperties); }
@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()); }