public WorkflowInstanceAssert hasElementPayload( String elementId, String key, Object expectedValue) { final Optional<Record<WorkflowInstanceRecordValue>> record = RecordingExporter.workflowInstanceRecords() .withWorkflowInstanceKey(workflowInstanceKey) .withElementId(elementId) .filter(r -> ELEMENT_PASSED_INTENTS.contains(r.getMetadata().getIntent())) .findFirst(); if (record.isPresent()) { hasPayload(record.get(), key, expectedValue); } else { failWithMessage("Expected <%s> to contain payload but element was not passed", elementId); } return this; }
public WorkflowInstanceAssert hasPayload(String key, Object expectedValue) { final Optional<Record<WorkflowInstanceRecordValue>> record = RecordingExporter.workflowInstanceRecords() .withWorkflowInstanceKey(workflowInstanceKey) .withKey(workflowInstanceKey) .filter(intent(INSTANCE_ENDED_INTENTS)) .findFirst(); if (record.isPresent()) { hasPayload(record.get(), key, expectedValue); } else { failWithMessage("Expected workflow instance to contain payload but instance is not ended"); } return this; }
public WorkflowInstanceAssert hasPayload(String key, Object expectedValue) { final Optional<Record<WorkflowInstanceRecordValue>> record = RecordingExporter.workflowInstanceRecords() .withWorkflowInstanceKey(workflowInstanceKey) .withKey(workflowInstanceKey) .filter(intent(INSTANCE_ENDED_INTENTS)) .findFirst(); if (record.isPresent()) { hasPayload(record.get(), key, expectedValue); } else { failWithMessage("Expected workflow instance to contain payload but instance is not ended"); } return this; }
public WorkflowInstanceAssert hasElementPayload( String elementId, String key, Object expectedValue) { final Optional<Record<WorkflowInstanceRecordValue>> record = RecordingExporter.workflowInstanceRecords() .withWorkflowInstanceKey(workflowInstanceKey) .withElementId(elementId) .filter(r -> ELEMENT_PASSED_INTENTS.contains(r.getMetadata().getIntent())) .findFirst(); if (record.isPresent()) { hasPayload(record.get(), key, expectedValue); } else { failWithMessage("Expected <%s> to contain payload but element was not passed", elementId); } return this; }