Skip to content

Commit

Permalink
switch to use new TestUpdateCallback utility
Browse files Browse the repository at this point in the history
  • Loading branch information
yuandrew committed Nov 26, 2024
1 parent 8d66fb2 commit 6a82166
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions internal/workflow_testsuite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))
Expand Down

0 comments on commit 6a82166

Please sign in to comment.