createTestExecution function

WorkflowExecution createTestExecution(
  1. String id, {
  2. String workflowId = 'wf-test-0',
  3. ExecutionStatus status = const Running(),
  4. int currentStep = 0,
  5. String? inputData,
  6. String? outputData,
  7. String? errorMessage,
  8. String? ttlExpiresAt,
  9. WorkflowGuarantee guarantee = WorkflowGuarantee.foregroundOnly,
})

Creates a WorkflowExecution with sensible defaults for testing.

Only id is required; all other fields use minimal defaults.

Implementation

WorkflowExecution createTestExecution(
  String id, {
  String workflowId = 'wf-test-0',
  ExecutionStatus status = const Running(),
  int currentStep = 0,
  String? inputData,
  String? outputData,
  String? errorMessage,
  String? ttlExpiresAt,
  WorkflowGuarantee guarantee = WorkflowGuarantee.foregroundOnly,
}) {
  final now = nowTimestamp();
  return WorkflowExecution(
    workflowExecutionId: id,
    workflowId: workflowId,
    status: status,
    currentStep: currentStep,
    inputData: inputData,
    outputData: outputData,
    errorMessage: errorMessage,
    ttlExpiresAt: ttlExpiresAt,
    guarantee: guarantee,
    createdAt: now,
    updatedAt: now,
  );
}