diff --git a/internal/internal_workflow_testsuite.go b/internal/internal_workflow_testsuite.go index 88ecf1b02..c1be8b4d7 100644 --- a/internal/internal_workflow_testsuite.go +++ b/internal/internal_workflow_testsuite.go @@ -353,6 +353,10 @@ func (env *testWorkflowEnvironmentImpl) setContinueAsNewSuggested(suggest bool) env.workflowInfo.continueAsNewSuggested = suggest } +func (env *testWorkflowEnvironmentImpl) setContinuedExecutionRunID(rid string) { + env.workflowInfo.ContinuedExecutionRunID = rid +} + func (env *testWorkflowEnvironmentImpl) newTestWorkflowEnvironmentForChild(params *ExecuteWorkflowParams, callback ResultHandler, startedHandler func(r WorkflowExecution, e error)) (*testWorkflowEnvironmentImpl, error) { // create a new test env childEnv := newTestWorkflowEnvironmentImpl(env.testSuite, env.registry) diff --git a/internal/internal_workflow_testsuite_test.go b/internal/internal_workflow_testsuite_test.go index 916372d91..fbd618cc6 100644 --- a/internal/internal_workflow_testsuite_test.go +++ b/internal/internal_workflow_testsuite_test.go @@ -3747,6 +3747,12 @@ func (s *WorkflowTestSuiteUnitTest) Test_SetWorkerStopChannel() { s.NotNil(env.workerStopChannel) } +func (s *WorkflowTestSuiteUnitTest) Test_SetContinuedExecutionRunID() { + env := newTestWorkflowEnvironmentImpl(&s.WorkflowTestSuite, nil) + env.setContinuedExecutionRunID("some-run-id") + s.NotNil(env.workflowInfo.ContinuedExecutionRunID) +} + func (s *WorkflowTestSuiteUnitTest) Test_ActivityTimeoutWithDetails() { count := 0 timeoutFn := func() error { diff --git a/internal/workflow_testsuite.go b/internal/workflow_testsuite.go index 5b0c6fd02..7df65e353 100644 --- a/internal/workflow_testsuite.go +++ b/internal/workflow_testsuite.go @@ -318,6 +318,12 @@ func (e *TestWorkflowEnvironment) SetContinueAsNewSuggested(suggest bool) { e.impl.setContinueAsNewSuggested(suggest) } +// SetContinuedExecutionRunID sets the value that is returned from +// GetInfo(ctx).ContinuedExecutionRunID +func (e *TestWorkflowEnvironment) SetContinuedExecutionRunID(rid string) { + e.impl.setContinuedExecutionRunID(rid) +} + // OnActivity setup a mock call for activity. Parameter activity must be activity function (func) or activity name (string). // You must call Return() with appropriate parameters on the returned *MockCallWrapper instance. The supplied parameters to // the Return() call should either be a function that has exact same signature as the mocked activity, or it should be