createTestExecution function
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,
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,
);
}