From 6a82166e8dddd3af355c8e8828b9ad919972abde Mon Sep 17 00:00:00 2001 From: Andrew Yuan Date: Mon, 25 Nov 2024 19:45:40 -0500 Subject: [PATCH] switch to use new TestUpdateCallback utility --- internal/workflow_testsuite_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/workflow_testsuite_test.go b/internal/workflow_testsuite_test.go index 4e7ee628d..9d0684266 100644 --- a/internal/workflow_testsuite_test.go +++ b/internal/workflow_testsuite_test.go @@ -508,12 +508,12 @@ func duplicateIDDedup(t *testing.T, delay_second bool, with_sleep bool, addition // Test dev server dedups UpdateWorkflow with same ID env := suite.NewTestWorkflowEnvironment() env.RegisterDelayedCallback(func() { - env.UpdateWorkflow("update", "id", &updateCallback{ - reject: func(err error) { + env.UpdateWorkflow("update", "id", &TestUpdateCallback{ + OnReject: func(err error) { require.Fail(t, fmt.Sprintf("update should not be rejected, err: %v", err)) }, - accept: func() {}, - complete: func(result interface{}, err error) { + OnAccept: func() {}, + OnComplete: func(result interface{}, err error) { intResult, ok := result.(int) if !ok { require.Fail(t, fmt.Sprintf("result should be int: %v\nerr: %v", result, err)) @@ -526,12 +526,12 @@ func duplicateIDDedup(t *testing.T, delay_second bool, with_sleep bool, addition for i := 0; i < additional; i++ { env.RegisterDelayedCallback(func() { - env.UpdateWorkflow("update", "id", &updateCallback{ - reject: func(err error) { + env.UpdateWorkflow("update", "id", &TestUpdateCallback{ + OnReject: func(err error) { require.Fail(t, fmt.Sprintf("update should not be rejected, err: %v", err)) }, - accept: func() {}, - complete: func(result interface{}, err error) { + OnAccept: func() {}, + OnComplete: func(result interface{}, err error) { intResult, ok := result.(int) if !ok { require.Fail(t, fmt.Sprintf("result should be int: %v\nerr: %v", result, err))