/
AsyncStep.go
132 lines (105 loc) · 3.49 KB
/
AsyncStep.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Code generated by mockery v2.20.0. DO NOT EDIT.
package mocks
import (
context "context"
v1 "github.com/cloudogu/k8s-dogu-operator/api/v1"
mock "github.com/stretchr/testify/mock"
)
// AsyncStep is an autogenerated mock type for the AsyncStep type
type AsyncStep struct {
mock.Mock
}
type AsyncStep_Expecter struct {
mock *mock.Mock
}
func (_m *AsyncStep) EXPECT() *AsyncStep_Expecter {
return &AsyncStep_Expecter{mock: &_m.Mock}
}
// Execute provides a mock function with given fields: ctx, dogu
func (_m *AsyncStep) Execute(ctx context.Context, dogu *v1.Dogu) (string, error) {
ret := _m.Called(ctx, dogu)
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *v1.Dogu) (string, error)); ok {
return rf(ctx, dogu)
}
if rf, ok := ret.Get(0).(func(context.Context, *v1.Dogu) string); ok {
r0 = rf(ctx, dogu)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, *v1.Dogu) error); ok {
r1 = rf(ctx, dogu)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AsyncStep_Execute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Execute'
type AsyncStep_Execute_Call struct {
*mock.Call
}
// Execute is a helper method to define mock.On call
// - ctx context.Context
// - dogu *v1.Dogu
func (_e *AsyncStep_Expecter) Execute(ctx interface{}, dogu interface{}) *AsyncStep_Execute_Call {
return &AsyncStep_Execute_Call{Call: _e.mock.On("Execute", ctx, dogu)}
}
func (_c *AsyncStep_Execute_Call) Run(run func(ctx context.Context, dogu *v1.Dogu)) *AsyncStep_Execute_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*v1.Dogu))
})
return _c
}
func (_c *AsyncStep_Execute_Call) Return(_a0 string, _a1 error) *AsyncStep_Execute_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AsyncStep_Execute_Call) RunAndReturn(run func(context.Context, *v1.Dogu) (string, error)) *AsyncStep_Execute_Call {
_c.Call.Return(run)
return _c
}
// GetStartCondition provides a mock function with given fields:
func (_m *AsyncStep) GetStartCondition() string {
ret := _m.Called()
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// AsyncStep_GetStartCondition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStartCondition'
type AsyncStep_GetStartCondition_Call struct {
*mock.Call
}
// GetStartCondition is a helper method to define mock.On call
func (_e *AsyncStep_Expecter) GetStartCondition() *AsyncStep_GetStartCondition_Call {
return &AsyncStep_GetStartCondition_Call{Call: _e.mock.On("GetStartCondition")}
}
func (_c *AsyncStep_GetStartCondition_Call) Run(run func()) *AsyncStep_GetStartCondition_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *AsyncStep_GetStartCondition_Call) Return(_a0 string) *AsyncStep_GetStartCondition_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *AsyncStep_GetStartCondition_Call) RunAndReturn(run func() string) *AsyncStep_GetStartCondition_Call {
_c.Call.Return(run)
return _c
}
type mockConstructorTestingTNewAsyncStep interface {
mock.TestingT
Cleanup(func())
}
// NewAsyncStep creates a new instance of AsyncStep. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewAsyncStep(t mockConstructorTestingTNewAsyncStep) *AsyncStep {
mock := &AsyncStep{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}