1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9 "time"
10
11 "bnema.dev/ermite/internal/domain"
12 mock "github.com/stretchr/testify/mock"
13)
14
15// NewCIWorkflowStore creates a new instance of CIWorkflowStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
16// The first argument is typically a *testing.T value.
17func NewCIWorkflowStore(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *CIWorkflowStore {
21 if helper, ok := t.(interface{ Helper() }); ok {
22 helper.Helper()
23 }
24
25 mock := &CIWorkflowStore{}
26 mock.Mock.Test(t)
27
28 t.Cleanup(func() {
29 if helper, ok := t.(interface{ Helper() }); ok {
30 helper.Helper()
31 }
32 mock.AssertExpectations(t)
33 })
34
35 return mock
36}
37
38// CIWorkflowStore is an autogenerated mock type for the CIWorkflowStore type
39type CIWorkflowStore struct {
40 mock.Mock
41}
42
43type CIWorkflowStore_Expecter struct {
44 mock *mock.Mock
45}
46
47func (_m *CIWorkflowStore) EXPECT() *CIWorkflowStore_Expecter {
48 return &CIWorkflowStore_Expecter{mock: &_m.Mock}
49}
50
51// DisableWorkflow provides a mock function for the type CIWorkflowStore
52func (_mock *CIWorkflowStore) DisableWorkflow(ctx context.Context, repo domain.RepoName, path string, at time.Time) error {
53 ret := _mock.Called(ctx, repo, path, at)
54
55 if len(ret) == 0 {
56 panic("no return value specified for DisableWorkflow")
57 }
58
59 var r0 error
60 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string, time.Time) error); ok {
61 r0 = returnFunc(ctx, repo, path, at)
62 } else {
63 r0 = ret.Error(0)
64 }
65 return r0
66}
67
68// CIWorkflowStore_DisableWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisableWorkflow'
69type CIWorkflowStore_DisableWorkflow_Call struct {
70 *mock.Call
71}
72
73// DisableWorkflow is a helper method to define mock.On call
74// - ctx context.Context
75// - repo domain.RepoName
76// - path string
77// - at time.Time
78func (_e *CIWorkflowStore_Expecter) DisableWorkflow(ctx any, repo any, path any, at any) *CIWorkflowStore_DisableWorkflow_Call {
79 return &CIWorkflowStore_DisableWorkflow_Call{Call: _e.mock.On("DisableWorkflow", ctx, repo, path, at)}
80}
81
82func (_c *CIWorkflowStore_DisableWorkflow_Call) Run(run func(ctx context.Context, repo domain.RepoName, path string, at time.Time)) *CIWorkflowStore_DisableWorkflow_Call {
83 _c.Call.Run(func(args mock.Arguments) {
84 var arg0 context.Context
85 if args[0] != nil {
86 arg0 = args[0].(context.Context)
87 }
88 var arg1 domain.RepoName
89 if args[1] != nil {
90 arg1 = args[1].(domain.RepoName)
91 }
92 var arg2 string
93 if args[2] != nil {
94 arg2 = args[2].(string)
95 }
96 var arg3 time.Time
97 if args[3] != nil {
98 arg3 = args[3].(time.Time)
99 }
100 run(
101 arg0,
102 arg1,
103 arg2,
104 arg3,
105 )
106 })
107 return _c
108}
109
110func (_c *CIWorkflowStore_DisableWorkflow_Call) Return(err error) *CIWorkflowStore_DisableWorkflow_Call {
111 _c.Call.Return(err)
112 return _c
113}
114
115func (_c *CIWorkflowStore_DisableWorkflow_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, path string, at time.Time) error) *CIWorkflowStore_DisableWorkflow_Call {
116 _c.Call.Return(run)
117 return _c
118}
119
120// DisabledWorkflows provides a mock function for the type CIWorkflowStore
121func (_mock *CIWorkflowStore) DisabledWorkflows(ctx context.Context, repo domain.RepoName) ([]string, error) {
122 ret := _mock.Called(ctx, repo)
123
124 if len(ret) == 0 {
125 panic("no return value specified for DisabledWorkflows")
126 }
127
128 var r0 []string
129 var r1 error
130 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) ([]string, error)); ok {
131 return returnFunc(ctx, repo)
132 }
133 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) []string); ok {
134 r0 = returnFunc(ctx, repo)
135 } else {
136 if ret.Get(0) != nil {
137 r0 = ret.Get(0).([]string)
138 }
139 }
140 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName) error); ok {
141 r1 = returnFunc(ctx, repo)
142 } else {
143 r1 = ret.Error(1)
144 }
145 return r0, r1
146}
147
148// CIWorkflowStore_DisabledWorkflows_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisabledWorkflows'
149type CIWorkflowStore_DisabledWorkflows_Call struct {
150 *mock.Call
151}
152
153// DisabledWorkflows is a helper method to define mock.On call
154// - ctx context.Context
155// - repo domain.RepoName
156func (_e *CIWorkflowStore_Expecter) DisabledWorkflows(ctx any, repo any) *CIWorkflowStore_DisabledWorkflows_Call {
157 return &CIWorkflowStore_DisabledWorkflows_Call{Call: _e.mock.On("DisabledWorkflows", ctx, repo)}
158}
159
160func (_c *CIWorkflowStore_DisabledWorkflows_Call) Run(run func(ctx context.Context, repo domain.RepoName)) *CIWorkflowStore_DisabledWorkflows_Call {
161 _c.Call.Run(func(args mock.Arguments) {
162 var arg0 context.Context
163 if args[0] != nil {
164 arg0 = args[0].(context.Context)
165 }
166 var arg1 domain.RepoName
167 if args[1] != nil {
168 arg1 = args[1].(domain.RepoName)
169 }
170 run(
171 arg0,
172 arg1,
173 )
174 })
175 return _c
176}
177
178func (_c *CIWorkflowStore_DisabledWorkflows_Call) Return(strings []string, err error) *CIWorkflowStore_DisabledWorkflows_Call {
179 _c.Call.Return(strings, err)
180 return _c
181}
182
183func (_c *CIWorkflowStore_DisabledWorkflows_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName) ([]string, error)) *CIWorkflowStore_DisabledWorkflows_Call {
184 _c.Call.Return(run)
185 return _c
186}
187
188// EnableWorkflow provides a mock function for the type CIWorkflowStore
189func (_mock *CIWorkflowStore) EnableWorkflow(ctx context.Context, repo domain.RepoName, path string) error {
190 ret := _mock.Called(ctx, repo, path)
191
192 if len(ret) == 0 {
193 panic("no return value specified for EnableWorkflow")
194 }
195
196 var r0 error
197 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, string) error); ok {
198 r0 = returnFunc(ctx, repo, path)
199 } else {
200 r0 = ret.Error(0)
201 }
202 return r0
203}
204
205// CIWorkflowStore_EnableWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableWorkflow'
206type CIWorkflowStore_EnableWorkflow_Call struct {
207 *mock.Call
208}
209
210// EnableWorkflow is a helper method to define mock.On call
211// - ctx context.Context
212// - repo domain.RepoName
213// - path string
214func (_e *CIWorkflowStore_Expecter) EnableWorkflow(ctx any, repo any, path any) *CIWorkflowStore_EnableWorkflow_Call {
215 return &CIWorkflowStore_EnableWorkflow_Call{Call: _e.mock.On("EnableWorkflow", ctx, repo, path)}
216}
217
218func (_c *CIWorkflowStore_EnableWorkflow_Call) Run(run func(ctx context.Context, repo domain.RepoName, path string)) *CIWorkflowStore_EnableWorkflow_Call {
219 _c.Call.Run(func(args mock.Arguments) {
220 var arg0 context.Context
221 if args[0] != nil {
222 arg0 = args[0].(context.Context)
223 }
224 var arg1 domain.RepoName
225 if args[1] != nil {
226 arg1 = args[1].(domain.RepoName)
227 }
228 var arg2 string
229 if args[2] != nil {
230 arg2 = args[2].(string)
231 }
232 run(
233 arg0,
234 arg1,
235 arg2,
236 )
237 })
238 return _c
239}
240
241func (_c *CIWorkflowStore_EnableWorkflow_Call) Return(err error) *CIWorkflowStore_EnableWorkflow_Call {
242 _c.Call.Return(err)
243 return _c
244}
245
246func (_c *CIWorkflowStore_EnableWorkflow_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, path string) error) *CIWorkflowStore_EnableWorkflow_Call {
247 _c.Call.Return(run)
248 return _c
249}