@@ -269,7 +269,7 @@ func TestCancelResume(t *testing.T) {
269269 }
270270
271271 // Cancel the workflow
272- err = clientCtx . CancelWorkflow (workflowID )
272+ err = CancelWorkflow (clientCtx , workflowID )
273273 if err != nil {
274274 t .Fatalf ("failed to cancel workflow: %v" , err )
275275 }
@@ -368,7 +368,7 @@ func TestCancelResume(t *testing.T) {
368368 time .Sleep (500 * time .Millisecond )
369369
370370 // Cancel the workflow before timeout expires
371- err = clientCtx . CancelWorkflow (workflowID )
371+ err = CancelWorkflow (clientCtx , workflowID )
372372 if err != nil {
373373 t .Fatalf ("failed to cancel workflow: %v" , err )
374374 }
@@ -447,7 +447,7 @@ func TestCancelResume(t *testing.T) {
447447 nonExistentWorkflowID := "non-existent-workflow-id"
448448
449449 // Try to cancel a non-existent workflow
450- err := clientCtx . CancelWorkflow (nonExistentWorkflowID )
450+ err := CancelWorkflow (clientCtx , nonExistentWorkflowID )
451451 if err == nil {
452452 t .Fatal ("expected error when canceling non-existent workflow, but got none" )
453453 }
@@ -848,7 +848,7 @@ func TestListWorkflows(t *testing.T) {
848848 }
849849
850850 // Test 1: List all workflows (no filters)
851- allWorkflows , err := clientCtx . ListWorkflows ()
851+ allWorkflows , err := ListWorkflows (clientCtx )
852852 if err != nil {
853853 t .Fatalf ("failed to list all workflows: %v" , err )
854854 }
@@ -858,7 +858,7 @@ func TestListWorkflows(t *testing.T) {
858858
859859 // Test 2: Filter by workflow IDs
860860 expectedIDs := workflowIDs [:3 ]
861- specificWorkflows , err := clientCtx . ListWorkflows (WithWorkflowIDs (expectedIDs ))
861+ specificWorkflows , err := ListWorkflows (clientCtx , WithWorkflowIDs (expectedIDs ))
862862 if err != nil {
863863 t .Fatalf ("failed to list workflows by IDs: %v" , err )
864864 }
@@ -877,7 +877,7 @@ func TestListWorkflows(t *testing.T) {
877877 }
878878
879879 // Test 3: Filter by workflow ID prefix
880- batchWorkflows , err := clientCtx . ListWorkflows (WithWorkflowIDPrefix ("test-batch-" ))
880+ batchWorkflows , err := ListWorkflows (clientCtx , WithWorkflowIDPrefix ("test-batch-" ))
881881 if err != nil {
882882 t .Fatalf ("failed to list workflows by prefix: %v" , err )
883883 }
@@ -892,7 +892,7 @@ func TestListWorkflows(t *testing.T) {
892892 }
893893
894894 // Test 4: Filter by status - SUCCESS
895- successWorkflows , err := clientCtx . ListWorkflows (
895+ successWorkflows , err := ListWorkflows (clientCtx ,
896896 WithWorkflowIDPrefix ("test-" ), // Only our test workflows
897897 WithStatus ([]WorkflowStatusType {WorkflowStatusSuccess }))
898898 if err != nil {
@@ -909,7 +909,7 @@ func TestListWorkflows(t *testing.T) {
909909 }
910910
911911 // Test 5: Filter by status - ERROR
912- errorWorkflows , err := clientCtx . ListWorkflows (
912+ errorWorkflows , err := ListWorkflows (clientCtx ,
913913 WithWorkflowIDPrefix ("test-" ),
914914 WithStatus ([]WorkflowStatusType {WorkflowStatusError }))
915915 if err != nil {
@@ -927,7 +927,7 @@ func TestListWorkflows(t *testing.T) {
927927
928928 // Test 6: Filter by time range - first 5 workflows (start to start+500ms)
929929 firstHalfTime := testStartTime .Add (500 * time .Millisecond )
930- firstHalfWorkflows , err := clientCtx . ListWorkflows (
930+ firstHalfWorkflows , err := ListWorkflows (clientCtx ,
931931 WithWorkflowIDPrefix ("test-" ),
932932 WithEndTime (firstHalfTime ))
933933 if err != nil {
@@ -938,7 +938,7 @@ func TestListWorkflows(t *testing.T) {
938938 }
939939
940940 // Test 6b: Filter by time range - last 5 workflows (start+500ms to end)
941- secondHalfWorkflows , err := clientCtx . ListWorkflows (
941+ secondHalfWorkflows , err := ListWorkflows (clientCtx ,
942942 WithWorkflowIDPrefix ("test-" ),
943943 WithStartTime (firstHalfTime ))
944944 if err != nil {
@@ -949,15 +949,15 @@ func TestListWorkflows(t *testing.T) {
949949 }
950950
951951 // Test 7: Test sorting order (ascending - default)
952- ascWorkflows , err := clientCtx . ListWorkflows (
952+ ascWorkflows , err := ListWorkflows (clientCtx ,
953953 WithWorkflowIDPrefix ("test-" ),
954954 WithSortDesc (false ))
955955 if err != nil {
956956 t .Fatalf ("failed to list workflows ascending: %v" , err )
957957 }
958958
959959 // Test 8: Test sorting order (descending)
960- descWorkflows , err := clientCtx . ListWorkflows (
960+ descWorkflows , err := ListWorkflows (clientCtx ,
961961 WithWorkflowIDPrefix ("test-" ),
962962 WithSortDesc (true ))
963963 if err != nil {
@@ -991,7 +991,7 @@ func TestListWorkflows(t *testing.T) {
991991 }
992992
993993 // Test 9: Test limit and offset
994- limitedWorkflows , err := clientCtx . ListWorkflows (
994+ limitedWorkflows , err := ListWorkflows (clientCtx ,
995995 WithWorkflowIDPrefix ("test-" ),
996996 WithLimit (5 ))
997997 if err != nil {
@@ -1008,7 +1008,7 @@ func TestListWorkflows(t *testing.T) {
10081008 }
10091009 }
10101010
1011- offsetWorkflows , err := clientCtx . ListWorkflows (
1011+ offsetWorkflows , err := ListWorkflows (clientCtx ,
10121012 WithWorkflowIDPrefix ("test-" ),
10131013 WithOffset (5 ),
10141014 WithLimit (3 ))
@@ -1027,7 +1027,7 @@ func TestListWorkflows(t *testing.T) {
10271027 }
10281028
10291029 // Test 10: Test input/output loading
1030- noDataWorkflows , err := clientCtx . ListWorkflows (
1030+ noDataWorkflows , err := ListWorkflows (clientCtx ,
10311031 WithWorkflowIDs (workflowIDs [:2 ]),
10321032 WithLoadInput (false ),
10331033 WithLoadOutput (false ))
0 commit comments