• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber-go / cadence-client / 018e9ff9-d8ed-403a-8c3a-5ffe0c57f644

02 Apr 2024 06:02PM UTC coverage: 64.75% (+0.08%) from 64.67%
018e9ff9-d8ed-403a-8c3a-5ffe0c57f644

push

buildkite

web-flow
Update client wrappers with new async APIs (#1327)

182 of 242 new or added lines in 2 files covered. (75.21%)

3 existing lines in 2 files now uncovered.

13389 of 20678 relevant lines covered (64.75%)

314.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

17.29
/mocks/Client.go
1
// Copyright (c) 2017-2021 Uber Technologies Inc.
2
//
3
// Permission is hereby granted, free of charge, to any person obtaining a copy
4
// of this software and associated documentation files (the "Software"), to deal
5
// in the Software without restriction, including without limitation the rights
6
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
// copies of the Software, and to permit persons to whom the Software is
8
// furnished to do so, subject to the following conditions:
9
//
10
// The above copyright notice and this permission notice shall be included in
11
// all copies or substantial portions of the Software.
12
//
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
// THE SOFTWARE.
20

21
// Code generated by mockery v2.16.0. DO NOT EDIT.
22

23
package mocks
24

25
import (
26
        context "context"
27

28
        mock "github.com/stretchr/testify/mock"
29

30
        internal "go.uber.org/cadence/internal"
31

32
        shared "go.uber.org/cadence/.gen/go/shared"
33
)
34

35
// Client is an autogenerated mock type for the Client type
36
type Client struct {
37
        mock.Mock
38
}
39

40
// CancelWorkflow provides a mock function with given fields: ctx, workflowID, runID, opts
41
func (_m *Client) CancelWorkflow(ctx context.Context, workflowID string, runID string, opts ...internal.Option) error {
×
42
        _va := make([]interface{}, len(opts))
×
43
        for _i := range opts {
×
44
                _va[_i] = opts[_i]
×
45
        }
×
46
        var _ca []interface{}
×
47
        _ca = append(_ca, ctx, workflowID, runID)
×
48
        _ca = append(_ca, _va...)
×
49
        ret := _m.Called(_ca...)
×
50

×
51
        var r0 error
×
52
        if rf, ok := ret.Get(0).(func(context.Context, string, string, ...internal.Option) error); ok {
×
53
                r0 = rf(ctx, workflowID, runID, opts...)
×
54
        } else {
×
55
                r0 = ret.Error(0)
×
56
        }
×
57

58
        return r0
×
59
}
60

61
// CompleteActivity provides a mock function with given fields: ctx, taskToken, result, err
62
func (_m *Client) CompleteActivity(ctx context.Context, taskToken []byte, result interface{}, err error) error {
×
63
        ret := _m.Called(ctx, taskToken, result, err)
×
64

×
65
        var r0 error
×
66
        if rf, ok := ret.Get(0).(func(context.Context, []byte, interface{}, error) error); ok {
×
67
                r0 = rf(ctx, taskToken, result, err)
×
68
        } else {
×
69
                r0 = ret.Error(0)
×
70
        }
×
71

72
        return r0
×
73
}
74

75
// CompleteActivityByID provides a mock function with given fields: ctx, domain, workflowID, runID, activityID, result, err
76
func (_m *Client) CompleteActivityByID(ctx context.Context, domain string, workflowID string, runID string, activityID string, result interface{}, err error) error {
×
77
        ret := _m.Called(ctx, domain, workflowID, runID, activityID, result, err)
×
78

×
79
        var r0 error
×
80
        if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, interface{}, error) error); ok {
×
81
                r0 = rf(ctx, domain, workflowID, runID, activityID, result, err)
×
82
        } else {
×
83
                r0 = ret.Error(0)
×
84
        }
×
85

86
        return r0
×
87
}
88

89
// CountWorkflow provides a mock function with given fields: ctx, request
90
func (_m *Client) CountWorkflow(ctx context.Context, request *shared.CountWorkflowExecutionsRequest) (*shared.CountWorkflowExecutionsResponse, error) {
×
91
        ret := _m.Called(ctx, request)
×
92

×
93
        var r0 *shared.CountWorkflowExecutionsResponse
×
94
        if rf, ok := ret.Get(0).(func(context.Context, *shared.CountWorkflowExecutionsRequest) *shared.CountWorkflowExecutionsResponse); ok {
×
95
                r0 = rf(ctx, request)
×
96
        } else {
×
97
                if ret.Get(0) != nil {
×
98
                        r0 = ret.Get(0).(*shared.CountWorkflowExecutionsResponse)
×
99
                }
×
100
        }
101

102
        var r1 error
×
103
        if rf, ok := ret.Get(1).(func(context.Context, *shared.CountWorkflowExecutionsRequest) error); ok {
×
104
                r1 = rf(ctx, request)
×
105
        } else {
×
106
                r1 = ret.Error(1)
×
107
        }
×
108

109
        return r0, r1
×
110
}
111

112
// DescribeTaskList provides a mock function with given fields: ctx, tasklist, tasklistType
113
func (_m *Client) DescribeTaskList(ctx context.Context, tasklist string, tasklistType shared.TaskListType) (*shared.DescribeTaskListResponse, error) {
×
114
        ret := _m.Called(ctx, tasklist, tasklistType)
×
115

×
116
        var r0 *shared.DescribeTaskListResponse
×
117
        if rf, ok := ret.Get(0).(func(context.Context, string, shared.TaskListType) *shared.DescribeTaskListResponse); ok {
×
118
                r0 = rf(ctx, tasklist, tasklistType)
×
119
        } else {
×
120
                if ret.Get(0) != nil {
×
121
                        r0 = ret.Get(0).(*shared.DescribeTaskListResponse)
×
122
                }
×
123
        }
124

125
        var r1 error
×
126
        if rf, ok := ret.Get(1).(func(context.Context, string, shared.TaskListType) error); ok {
×
127
                r1 = rf(ctx, tasklist, tasklistType)
×
128
        } else {
×
129
                r1 = ret.Error(1)
×
130
        }
×
131

132
        return r0, r1
×
133
}
134

135
// DescribeWorkflowExecution provides a mock function with given fields: ctx, workflowID, runID
136
func (_m *Client) DescribeWorkflowExecution(ctx context.Context, workflowID string, runID string) (*shared.DescribeWorkflowExecutionResponse, error) {
×
137
        ret := _m.Called(ctx, workflowID, runID)
×
138

×
139
        var r0 *shared.DescribeWorkflowExecutionResponse
×
140
        if rf, ok := ret.Get(0).(func(context.Context, string, string) *shared.DescribeWorkflowExecutionResponse); ok {
×
141
                r0 = rf(ctx, workflowID, runID)
×
142
        } else {
×
143
                if ret.Get(0) != nil {
×
144
                        r0 = ret.Get(0).(*shared.DescribeWorkflowExecutionResponse)
×
145
                }
×
146
        }
147

148
        var r1 error
×
149
        if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
×
150
                r1 = rf(ctx, workflowID, runID)
×
151
        } else {
×
152
                r1 = ret.Error(1)
×
153
        }
×
154

155
        return r0, r1
×
156
}
157

158
// ExecuteWorkflow provides a mock function with given fields: ctx, options, workflow, args
159
func (_m *Client) ExecuteWorkflow(ctx context.Context, options internal.StartWorkflowOptions, workflow interface{}, args ...interface{}) (internal.WorkflowRun, error) {
1✔
160
        var _ca []interface{}
1✔
161
        _ca = append(_ca, ctx, options, workflow)
1✔
162
        _ca = append(_ca, args...)
1✔
163
        ret := _m.Called(_ca...)
1✔
164

1✔
165
        var r0 internal.WorkflowRun
1✔
166
        if rf, ok := ret.Get(0).(func(context.Context, internal.StartWorkflowOptions, interface{}, ...interface{}) internal.WorkflowRun); ok {
1✔
167
                r0 = rf(ctx, options, workflow, args...)
×
168
        } else {
1✔
169
                if ret.Get(0) != nil {
2✔
170
                        r0 = ret.Get(0).(internal.WorkflowRun)
1✔
171
                }
1✔
172
        }
173

174
        var r1 error
1✔
175
        if rf, ok := ret.Get(1).(func(context.Context, internal.StartWorkflowOptions, interface{}, ...interface{}) error); ok {
1✔
176
                r1 = rf(ctx, options, workflow, args...)
×
177
        } else {
1✔
178
                r1 = ret.Error(1)
1✔
179
        }
1✔
180

181
        return r0, r1
1✔
182
}
183

184
// GetSearchAttributes provides a mock function with given fields: ctx
185
func (_m *Client) GetSearchAttributes(ctx context.Context) (*shared.GetSearchAttributesResponse, error) {
×
186
        ret := _m.Called(ctx)
×
187

×
188
        var r0 *shared.GetSearchAttributesResponse
×
189
        if rf, ok := ret.Get(0).(func(context.Context) *shared.GetSearchAttributesResponse); ok {
×
190
                r0 = rf(ctx)
×
191
        } else {
×
192
                if ret.Get(0) != nil {
×
193
                        r0 = ret.Get(0).(*shared.GetSearchAttributesResponse)
×
194
                }
×
195
        }
196

197
        var r1 error
×
198
        if rf, ok := ret.Get(1).(func(context.Context) error); ok {
×
199
                r1 = rf(ctx)
×
200
        } else {
×
201
                r1 = ret.Error(1)
×
202
        }
×
203

204
        return r0, r1
×
205
}
206

207
// GetWorkflow provides a mock function with given fields: ctx, workflowID, runID
208
func (_m *Client) GetWorkflow(ctx context.Context, workflowID string, runID string) internal.WorkflowRun {
1✔
209
        ret := _m.Called(ctx, workflowID, runID)
1✔
210

1✔
211
        var r0 internal.WorkflowRun
1✔
212
        if rf, ok := ret.Get(0).(func(context.Context, string, string) internal.WorkflowRun); ok {
1✔
213
                r0 = rf(ctx, workflowID, runID)
×
214
        } else {
1✔
215
                if ret.Get(0) != nil {
2✔
216
                        r0 = ret.Get(0).(internal.WorkflowRun)
1✔
217
                }
1✔
218
        }
219

220
        return r0
1✔
221
}
222

223
// GetWorkflowHistory provides a mock function with given fields: ctx, workflowID, runID, isLongPoll, filterType
224
func (_m *Client) GetWorkflowHistory(ctx context.Context, workflowID string, runID string, isLongPoll bool, filterType shared.HistoryEventFilterType) internal.HistoryEventIterator {
1✔
225
        ret := _m.Called(ctx, workflowID, runID, isLongPoll, filterType)
1✔
226

1✔
227
        var r0 internal.HistoryEventIterator
1✔
228
        if rf, ok := ret.Get(0).(func(context.Context, string, string, bool, shared.HistoryEventFilterType) internal.HistoryEventIterator); ok {
1✔
229
                r0 = rf(ctx, workflowID, runID, isLongPoll, filterType)
×
230
        } else {
1✔
231
                if ret.Get(0) != nil {
2✔
232
                        r0 = ret.Get(0).(internal.HistoryEventIterator)
1✔
233
                }
1✔
234
        }
235

236
        return r0
1✔
237
}
238

239
// ListArchivedWorkflow provides a mock function with given fields: ctx, request
240
func (_m *Client) ListArchivedWorkflow(ctx context.Context, request *shared.ListArchivedWorkflowExecutionsRequest) (*shared.ListArchivedWorkflowExecutionsResponse, error) {
×
241
        ret := _m.Called(ctx, request)
×
242

×
243
        var r0 *shared.ListArchivedWorkflowExecutionsResponse
×
244
        if rf, ok := ret.Get(0).(func(context.Context, *shared.ListArchivedWorkflowExecutionsRequest) *shared.ListArchivedWorkflowExecutionsResponse); ok {
×
245
                r0 = rf(ctx, request)
×
246
        } else {
×
247
                if ret.Get(0) != nil {
×
248
                        r0 = ret.Get(0).(*shared.ListArchivedWorkflowExecutionsResponse)
×
249
                }
×
250
        }
251

252
        var r1 error
×
253
        if rf, ok := ret.Get(1).(func(context.Context, *shared.ListArchivedWorkflowExecutionsRequest) error); ok {
×
254
                r1 = rf(ctx, request)
×
255
        } else {
×
256
                r1 = ret.Error(1)
×
257
        }
×
258

259
        return r0, r1
×
260
}
261

262
// ListClosedWorkflow provides a mock function with given fields: ctx, request
263
func (_m *Client) ListClosedWorkflow(ctx context.Context, request *shared.ListClosedWorkflowExecutionsRequest) (*shared.ListClosedWorkflowExecutionsResponse, error) {
×
264
        ret := _m.Called(ctx, request)
×
265

×
266
        var r0 *shared.ListClosedWorkflowExecutionsResponse
×
267
        if rf, ok := ret.Get(0).(func(context.Context, *shared.ListClosedWorkflowExecutionsRequest) *shared.ListClosedWorkflowExecutionsResponse); ok {
×
268
                r0 = rf(ctx, request)
×
269
        } else {
×
270
                if ret.Get(0) != nil {
×
271
                        r0 = ret.Get(0).(*shared.ListClosedWorkflowExecutionsResponse)
×
272
                }
×
273
        }
274

275
        var r1 error
×
276
        if rf, ok := ret.Get(1).(func(context.Context, *shared.ListClosedWorkflowExecutionsRequest) error); ok {
×
277
                r1 = rf(ctx, request)
×
278
        } else {
×
279
                r1 = ret.Error(1)
×
280
        }
×
281

282
        return r0, r1
×
283
}
284

285
// ListOpenWorkflow provides a mock function with given fields: ctx, request
286
func (_m *Client) ListOpenWorkflow(ctx context.Context, request *shared.ListOpenWorkflowExecutionsRequest) (*shared.ListOpenWorkflowExecutionsResponse, error) {
×
287
        ret := _m.Called(ctx, request)
×
288

×
289
        var r0 *shared.ListOpenWorkflowExecutionsResponse
×
290
        if rf, ok := ret.Get(0).(func(context.Context, *shared.ListOpenWorkflowExecutionsRequest) *shared.ListOpenWorkflowExecutionsResponse); ok {
×
291
                r0 = rf(ctx, request)
×
292
        } else {
×
293
                if ret.Get(0) != nil {
×
294
                        r0 = ret.Get(0).(*shared.ListOpenWorkflowExecutionsResponse)
×
295
                }
×
296
        }
297

298
        var r1 error
×
299
        if rf, ok := ret.Get(1).(func(context.Context, *shared.ListOpenWorkflowExecutionsRequest) error); ok {
×
300
                r1 = rf(ctx, request)
×
301
        } else {
×
302
                r1 = ret.Error(1)
×
303
        }
×
304

305
        return r0, r1
×
306
}
307

308
// ListWorkflow provides a mock function with given fields: ctx, request
309
func (_m *Client) ListWorkflow(ctx context.Context, request *shared.ListWorkflowExecutionsRequest) (*shared.ListWorkflowExecutionsResponse, error) {
×
310
        ret := _m.Called(ctx, request)
×
311

×
312
        var r0 *shared.ListWorkflowExecutionsResponse
×
313
        if rf, ok := ret.Get(0).(func(context.Context, *shared.ListWorkflowExecutionsRequest) *shared.ListWorkflowExecutionsResponse); ok {
×
314
                r0 = rf(ctx, request)
×
315
        } else {
×
316
                if ret.Get(0) != nil {
×
317
                        r0 = ret.Get(0).(*shared.ListWorkflowExecutionsResponse)
×
318
                }
×
319
        }
320

321
        var r1 error
×
322
        if rf, ok := ret.Get(1).(func(context.Context, *shared.ListWorkflowExecutionsRequest) error); ok {
×
323
                r1 = rf(ctx, request)
×
324
        } else {
×
325
                r1 = ret.Error(1)
×
326
        }
×
327

328
        return r0, r1
×
329
}
330

331
// QueryWorkflow provides a mock function with given fields: ctx, workflowID, runID, queryType, args
332
func (_m *Client) QueryWorkflow(ctx context.Context, workflowID string, runID string, queryType string, args ...interface{}) (internal.Value, error) {
×
333
        var _ca []interface{}
×
334
        _ca = append(_ca, ctx, workflowID, runID, queryType)
×
335
        _ca = append(_ca, args...)
×
336
        ret := _m.Called(_ca...)
×
337

×
338
        var r0 internal.Value
×
339
        if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...interface{}) internal.Value); ok {
×
340
                r0 = rf(ctx, workflowID, runID, queryType, args...)
×
341
        } else {
×
342
                if ret.Get(0) != nil {
×
343
                        r0 = ret.Get(0).(internal.Value)
×
344
                }
×
345
        }
346

347
        var r1 error
×
348
        if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...interface{}) error); ok {
×
349
                r1 = rf(ctx, workflowID, runID, queryType, args...)
×
350
        } else {
×
351
                r1 = ret.Error(1)
×
352
        }
×
353

354
        return r0, r1
×
355
}
356

357
// QueryWorkflowWithOptions provides a mock function with given fields: ctx, request
358
func (_m *Client) QueryWorkflowWithOptions(ctx context.Context, request *internal.QueryWorkflowWithOptionsRequest) (*internal.QueryWorkflowWithOptionsResponse, error) {
×
359
        ret := _m.Called(ctx, request)
×
360

×
361
        var r0 *internal.QueryWorkflowWithOptionsResponse
×
362
        if rf, ok := ret.Get(0).(func(context.Context, *internal.QueryWorkflowWithOptionsRequest) *internal.QueryWorkflowWithOptionsResponse); ok {
×
363
                r0 = rf(ctx, request)
×
364
        } else {
×
365
                if ret.Get(0) != nil {
×
366
                        r0 = ret.Get(0).(*internal.QueryWorkflowWithOptionsResponse)
×
367
                }
×
368
        }
369

370
        var r1 error
×
371
        if rf, ok := ret.Get(1).(func(context.Context, *internal.QueryWorkflowWithOptionsRequest) error); ok {
×
372
                r1 = rf(ctx, request)
×
373
        } else {
×
374
                r1 = ret.Error(1)
×
375
        }
×
376

377
        return r0, r1
×
378
}
379

380
// RecordActivityHeartbeat provides a mock function with given fields: ctx, taskToken, details
381
func (_m *Client) RecordActivityHeartbeat(ctx context.Context, taskToken []byte, details ...interface{}) error {
×
382
        var _ca []interface{}
×
383
        _ca = append(_ca, ctx, taskToken)
×
384
        _ca = append(_ca, details...)
×
385
        ret := _m.Called(_ca...)
×
386

×
387
        var r0 error
×
388
        if rf, ok := ret.Get(0).(func(context.Context, []byte, ...interface{}) error); ok {
×
389
                r0 = rf(ctx, taskToken, details...)
×
390
        } else {
×
391
                r0 = ret.Error(0)
×
392
        }
×
393

394
        return r0
×
395
}
396

397
// RecordActivityHeartbeatByID provides a mock function with given fields: ctx, domain, workflowID, runID, activityID, details
398
func (_m *Client) RecordActivityHeartbeatByID(ctx context.Context, domain string, workflowID string, runID string, activityID string, details ...interface{}) error {
×
399
        var _ca []interface{}
×
400
        _ca = append(_ca, ctx, domain, workflowID, runID, activityID)
×
401
        _ca = append(_ca, details...)
×
402
        ret := _m.Called(_ca...)
×
403

×
404
        var r0 error
×
405
        if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...interface{}) error); ok {
×
406
                r0 = rf(ctx, domain, workflowID, runID, activityID, details...)
×
407
        } else {
×
408
                r0 = ret.Error(0)
×
409
        }
×
410

411
        return r0
×
412
}
413

414
// RefreshWorkflowTasks provides a mock function with given fields: ctx, workflowID, runID
415
func (_m *Client) RefreshWorkflowTasks(ctx context.Context, workflowID string, runID string) error {
×
416
        ret := _m.Called(ctx, workflowID, runID)
×
417

×
418
        var r0 error
×
419
        if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
×
420
                r0 = rf(ctx, workflowID, runID)
×
421
        } else {
×
422
                r0 = ret.Error(0)
×
423
        }
×
424

425
        return r0
×
426
}
427

428
// ResetWorkflow provides a mock function with given fields: ctx, request
429
func (_m *Client) ResetWorkflow(ctx context.Context, request *shared.ResetWorkflowExecutionRequest) (*shared.ResetWorkflowExecutionResponse, error) {
×
430
        ret := _m.Called(ctx, request)
×
431

×
432
        var r0 *shared.ResetWorkflowExecutionResponse
×
433
        if rf, ok := ret.Get(0).(func(context.Context, *shared.ResetWorkflowExecutionRequest) *shared.ResetWorkflowExecutionResponse); ok {
×
434
                r0 = rf(ctx, request)
×
435
        } else {
×
436
                if ret.Get(0) != nil {
×
437
                        r0 = ret.Get(0).(*shared.ResetWorkflowExecutionResponse)
×
438
                }
×
439
        }
440

441
        var r1 error
×
442
        if rf, ok := ret.Get(1).(func(context.Context, *shared.ResetWorkflowExecutionRequest) error); ok {
×
443
                r1 = rf(ctx, request)
×
444
        } else {
×
445
                r1 = ret.Error(1)
×
446
        }
×
447

448
        return r0, r1
×
449
}
450

451
// ScanWorkflow provides a mock function with given fields: ctx, request
452
func (_m *Client) ScanWorkflow(ctx context.Context, request *shared.ListWorkflowExecutionsRequest) (*shared.ListWorkflowExecutionsResponse, error) {
×
453
        ret := _m.Called(ctx, request)
×
454

×
455
        var r0 *shared.ListWorkflowExecutionsResponse
×
456
        if rf, ok := ret.Get(0).(func(context.Context, *shared.ListWorkflowExecutionsRequest) *shared.ListWorkflowExecutionsResponse); ok {
×
457
                r0 = rf(ctx, request)
×
458
        } else {
×
459
                if ret.Get(0) != nil {
×
460
                        r0 = ret.Get(0).(*shared.ListWorkflowExecutionsResponse)
×
461
                }
×
462
        }
463

464
        var r1 error
×
465
        if rf, ok := ret.Get(1).(func(context.Context, *shared.ListWorkflowExecutionsRequest) error); ok {
×
466
                r1 = rf(ctx, request)
×
467
        } else {
×
468
                r1 = ret.Error(1)
×
469
        }
×
470

471
        return r0, r1
×
472
}
473

474
// SignalWithStartWorkflow provides a mock function with given fields: ctx, workflowID, signalName, signalArg, options, workflowFunc, workflowArgs
475
func (_m *Client) SignalWithStartWorkflow(ctx context.Context, workflowID string, signalName string, signalArg interface{}, options internal.StartWorkflowOptions, workflowFunc interface{}, workflowArgs ...interface{}) (*internal.WorkflowExecution, error) {
1✔
476
        var _ca []interface{}
1✔
477
        _ca = append(_ca, ctx, workflowID, signalName, signalArg, options, workflowFunc)
1✔
478
        _ca = append(_ca, workflowArgs...)
1✔
479
        ret := _m.Called(_ca...)
1✔
480

1✔
481
        var r0 *internal.WorkflowExecution
1✔
482
        if rf, ok := ret.Get(0).(func(context.Context, string, string, interface{}, internal.StartWorkflowOptions, interface{}, ...interface{}) *internal.WorkflowExecution); ok {
1✔
483
                r0 = rf(ctx, workflowID, signalName, signalArg, options, workflowFunc, workflowArgs...)
×
484
        } else {
1✔
485
                if ret.Get(0) != nil {
2✔
486
                        r0 = ret.Get(0).(*internal.WorkflowExecution)
1✔
487
                }
1✔
488
        }
489

490
        var r1 error
1✔
491
        if rf, ok := ret.Get(1).(func(context.Context, string, string, interface{}, internal.StartWorkflowOptions, interface{}, ...interface{}) error); ok {
1✔
492
                r1 = rf(ctx, workflowID, signalName, signalArg, options, workflowFunc, workflowArgs...)
×
493
        } else {
1✔
494
                r1 = ret.Error(1)
1✔
495
        }
1✔
496

497
        return r0, r1
1✔
498
}
499

500
// SignalWithStartWorkflowAsync provides a mock function with given fields: ctx, workflowID, signalName, signalArg, options, workflow, workflowArgs
NEW
501
func (_m *Client) SignalWithStartWorkflowAsync(ctx context.Context, workflowID string, signalName string, signalArg interface{}, options internal.StartWorkflowOptions, workflow interface{}, workflowArgs ...interface{}) (*internal.WorkflowExecutionAsync, error) {
×
NEW
502
        var _ca []interface{}
×
NEW
503
        _ca = append(_ca, ctx, workflowID, signalName, signalArg, options, workflow)
×
NEW
504
        _ca = append(_ca, workflowArgs...)
×
NEW
505
        ret := _m.Called(_ca...)
×
NEW
506

×
NEW
507
        var r0 *internal.WorkflowExecutionAsync
×
NEW
508
        if rf, ok := ret.Get(0).(func(context.Context, string, string, interface{}, internal.StartWorkflowOptions, interface{}, ...interface{}) *internal.WorkflowExecutionAsync); ok {
×
NEW
509
                r0 = rf(ctx, workflowID, signalName, signalArg, options, workflow, workflowArgs...)
×
NEW
510
        } else {
×
NEW
511
                if ret.Get(0) != nil {
×
NEW
512
                        r0 = ret.Get(0).(*internal.WorkflowExecutionAsync)
×
NEW
513
                }
×
514
        }
515

NEW
516
        var r1 error
×
NEW
517
        if rf, ok := ret.Get(1).(func(context.Context, string, string, interface{}, internal.StartWorkflowOptions, interface{}, ...interface{}) error); ok {
×
NEW
518
                r1 = rf(ctx, workflowID, signalName, signalArg, options, workflow, workflowArgs...)
×
NEW
519
        } else {
×
NEW
520
                r1 = ret.Error(1)
×
NEW
521
        }
×
522

NEW
523
        return r0, r1
×
524
}
525

526
// SignalWorkflow provides a mock function with given fields: ctx, workflowID, runID, signalName, arg
527
func (_m *Client) SignalWorkflow(ctx context.Context, workflowID string, runID string, signalName string, arg interface{}) error {
×
528
        ret := _m.Called(ctx, workflowID, runID, signalName, arg)
×
529

×
530
        var r0 error
×
531
        if rf, ok := ret.Get(0).(func(context.Context, string, string, string, interface{}) error); ok {
×
532
                r0 = rf(ctx, workflowID, runID, signalName, arg)
×
533
        } else {
×
534
                r0 = ret.Error(0)
×
535
        }
×
536

537
        return r0
×
538
}
539

540
// StartWorkflow provides a mock function with given fields: ctx, options, workflowFunc, args
541
func (_m *Client) StartWorkflow(ctx context.Context, options internal.StartWorkflowOptions, workflowFunc interface{}, args ...interface{}) (*internal.WorkflowExecution, error) {
1✔
542
        var _ca []interface{}
1✔
543
        _ca = append(_ca, ctx, options, workflowFunc)
1✔
544
        _ca = append(_ca, args...)
1✔
545
        ret := _m.Called(_ca...)
1✔
546

1✔
547
        var r0 *internal.WorkflowExecution
1✔
548
        if rf, ok := ret.Get(0).(func(context.Context, internal.StartWorkflowOptions, interface{}, ...interface{}) *internal.WorkflowExecution); ok {
1✔
549
                r0 = rf(ctx, options, workflowFunc, args...)
×
550
        } else {
1✔
551
                if ret.Get(0) != nil {
2✔
552
                        r0 = ret.Get(0).(*internal.WorkflowExecution)
1✔
553
                }
1✔
554
        }
555

556
        var r1 error
1✔
557
        if rf, ok := ret.Get(1).(func(context.Context, internal.StartWorkflowOptions, interface{}, ...interface{}) error); ok {
1✔
558
                r1 = rf(ctx, options, workflowFunc, args...)
×
559
        } else {
1✔
560
                r1 = ret.Error(1)
1✔
561
        }
1✔
562

563
        return r0, r1
1✔
564
}
565

566
// StartWorkflowAsync provides a mock function with given fields: ctx, options, workflow, args
NEW
567
func (_m *Client) StartWorkflowAsync(ctx context.Context, options internal.StartWorkflowOptions, workflow interface{}, args ...interface{}) (*internal.WorkflowExecutionAsync, error) {
×
NEW
568
        var _ca []interface{}
×
NEW
569
        _ca = append(_ca, ctx, options, workflow)
×
NEW
570
        _ca = append(_ca, args...)
×
NEW
571
        ret := _m.Called(_ca...)
×
NEW
572

×
NEW
573
        var r0 *internal.WorkflowExecutionAsync
×
NEW
574
        if rf, ok := ret.Get(0).(func(context.Context, internal.StartWorkflowOptions, interface{}, ...interface{}) *internal.WorkflowExecutionAsync); ok {
×
NEW
575
                r0 = rf(ctx, options, workflow, args...)
×
NEW
576
        } else {
×
NEW
577
                if ret.Get(0) != nil {
×
NEW
578
                        r0 = ret.Get(0).(*internal.WorkflowExecutionAsync)
×
NEW
579
                }
×
580
        }
581

NEW
582
        var r1 error
×
NEW
583
        if rf, ok := ret.Get(1).(func(context.Context, internal.StartWorkflowOptions, interface{}, ...interface{}) error); ok {
×
NEW
584
                r1 = rf(ctx, options, workflow, args...)
×
NEW
585
        } else {
×
NEW
586
                r1 = ret.Error(1)
×
NEW
587
        }
×
588

NEW
589
        return r0, r1
×
590
}
591

592
// TerminateWorkflow provides a mock function with given fields: ctx, workflowID, runID, reason, details
593
func (_m *Client) TerminateWorkflow(ctx context.Context, workflowID string, runID string, reason string, details []byte) error {
×
594
        ret := _m.Called(ctx, workflowID, runID, reason, details)
×
595

×
596
        var r0 error
×
597
        if rf, ok := ret.Get(0).(func(context.Context, string, string, string, []byte) error); ok {
×
598
                r0 = rf(ctx, workflowID, runID, reason, details)
×
599
        } else {
×
600
                r0 = ret.Error(0)
×
601
        }
×
602

603
        return r0
×
604
}
605

606
type mockConstructorTestingTNewClient interface {
607
        mock.TestingT
608
        Cleanup(func())
609
}
610

611
// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
612
func NewClient(t mockConstructorTestingTNewClient) *Client {
×
613
        mock := &Client{}
×
614
        mock.Mock.Test(t)
×
615

×
616
        t.Cleanup(func() { mock.AssertExpectations(t) })
×
617

618
        return mock
×
619
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc