1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9
10 "bnema.dev/ermite/internal/domain"
11 "bnema.dev/ermite/internal/ports"
12 mock "github.com/stretchr/testify/mock"
13)
14
15// NewVariableService creates a new instance of VariableService. 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 NewVariableService(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *VariableService {
21 if helper, ok := t.(interface{ Helper() }); ok {
22 helper.Helper()
23 }
24
25 mock := &VariableService{}
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// VariableService is an autogenerated mock type for the VariableService type
39type VariableService struct {
40 mock.Mock
41}
42
43type VariableService_Expecter struct {
44 mock *mock.Mock
45}
46
47func (_m *VariableService) EXPECT() *VariableService_Expecter {
48 return &VariableService_Expecter{mock: &_m.Mock}
49}
50
51// DeleteVariable provides a mock function for the type VariableService
52func (_mock *VariableService) DeleteVariable(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string) error {
53 ret := _mock.Called(ctx, p, scope, name)
54
55 if len(ret) == 0 {
56 panic("no return value specified for DeleteVariable")
57 }
58
59 var r0 error
60 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, string) error); ok {
61 r0 = returnFunc(ctx, p, scope, name)
62 } else {
63 r0 = ret.Error(0)
64 }
65 return r0
66}
67
68// VariableService_DeleteVariable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteVariable'
69type VariableService_DeleteVariable_Call struct {
70 *mock.Call
71}
72
73// DeleteVariable is a helper method to define mock.On call
74// - ctx context.Context
75// - p domain.Principal
76// - scope domain.SettingsScope
77// - name string
78func (_e *VariableService_Expecter) DeleteVariable(ctx any, p any, scope any, name any) *VariableService_DeleteVariable_Call {
79 return &VariableService_DeleteVariable_Call{Call: _e.mock.On("DeleteVariable", ctx, p, scope, name)}
80}
81
82func (_c *VariableService_DeleteVariable_Call) Run(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string)) *VariableService_DeleteVariable_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.Principal
89 if args[1] != nil {
90 arg1 = args[1].(domain.Principal)
91 }
92 var arg2 domain.SettingsScope
93 if args[2] != nil {
94 arg2 = args[2].(domain.SettingsScope)
95 }
96 var arg3 string
97 if args[3] != nil {
98 arg3 = args[3].(string)
99 }
100 run(
101 arg0,
102 arg1,
103 arg2,
104 arg3,
105 )
106 })
107 return _c
108}
109
110func (_c *VariableService_DeleteVariable_Call) Return(err error) *VariableService_DeleteVariable_Call {
111 _c.Call.Return(err)
112 return _c
113}
114
115func (_c *VariableService_DeleteVariable_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string) error) *VariableService_DeleteVariable_Call {
116 _c.Call.Return(run)
117 return _c
118}
119
120// GetVariable provides a mock function for the type VariableService
121func (_mock *VariableService) GetVariable(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string) (domain.Variable, error) {
122 ret := _mock.Called(ctx, p, scope, name)
123
124 if len(ret) == 0 {
125 panic("no return value specified for GetVariable")
126 }
127
128 var r0 domain.Variable
129 var r1 error
130 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, string) (domain.Variable, error)); ok {
131 return returnFunc(ctx, p, scope, name)
132 }
133 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, string) domain.Variable); ok {
134 r0 = returnFunc(ctx, p, scope, name)
135 } else {
136 r0 = ret.Get(0).(domain.Variable)
137 }
138 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.SettingsScope, string) error); ok {
139 r1 = returnFunc(ctx, p, scope, name)
140 } else {
141 r1 = ret.Error(1)
142 }
143 return r0, r1
144}
145
146// VariableService_GetVariable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVariable'
147type VariableService_GetVariable_Call struct {
148 *mock.Call
149}
150
151// GetVariable is a helper method to define mock.On call
152// - ctx context.Context
153// - p domain.Principal
154// - scope domain.SettingsScope
155// - name string
156func (_e *VariableService_Expecter) GetVariable(ctx any, p any, scope any, name any) *VariableService_GetVariable_Call {
157 return &VariableService_GetVariable_Call{Call: _e.mock.On("GetVariable", ctx, p, scope, name)}
158}
159
160func (_c *VariableService_GetVariable_Call) Run(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string)) *VariableService_GetVariable_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.Principal
167 if args[1] != nil {
168 arg1 = args[1].(domain.Principal)
169 }
170 var arg2 domain.SettingsScope
171 if args[2] != nil {
172 arg2 = args[2].(domain.SettingsScope)
173 }
174 var arg3 string
175 if args[3] != nil {
176 arg3 = args[3].(string)
177 }
178 run(
179 arg0,
180 arg1,
181 arg2,
182 arg3,
183 )
184 })
185 return _c
186}
187
188func (_c *VariableService_GetVariable_Call) Return(variable domain.Variable, err error) *VariableService_GetVariable_Call {
189 _c.Call.Return(variable, err)
190 return _c
191}
192
193func (_c *VariableService_GetVariable_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string) (domain.Variable, error)) *VariableService_GetVariable_Call {
194 _c.Call.Return(run)
195 return _c
196}
197
198// ListVariables provides a mock function for the type VariableService
199func (_mock *VariableService) ListVariables(ctx context.Context, p domain.Principal, scope domain.SettingsScope, size int, token string) (ports.VariablePage, error) {
200 ret := _mock.Called(ctx, p, scope, size, token)
201
202 if len(ret) == 0 {
203 panic("no return value specified for ListVariables")
204 }
205
206 var r0 ports.VariablePage
207 var r1 error
208 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, int, string) (ports.VariablePage, error)); ok {
209 return returnFunc(ctx, p, scope, size, token)
210 }
211 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, int, string) ports.VariablePage); ok {
212 r0 = returnFunc(ctx, p, scope, size, token)
213 } else {
214 r0 = ret.Get(0).(ports.VariablePage)
215 }
216 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.SettingsScope, int, string) error); ok {
217 r1 = returnFunc(ctx, p, scope, size, token)
218 } else {
219 r1 = ret.Error(1)
220 }
221 return r0, r1
222}
223
224// VariableService_ListVariables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListVariables'
225type VariableService_ListVariables_Call struct {
226 *mock.Call
227}
228
229// ListVariables is a helper method to define mock.On call
230// - ctx context.Context
231// - p domain.Principal
232// - scope domain.SettingsScope
233// - size int
234// - token string
235func (_e *VariableService_Expecter) ListVariables(ctx any, p any, scope any, size any, token any) *VariableService_ListVariables_Call {
236 return &VariableService_ListVariables_Call{Call: _e.mock.On("ListVariables", ctx, p, scope, size, token)}
237}
238
239func (_c *VariableService_ListVariables_Call) Run(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, size int, token string)) *VariableService_ListVariables_Call {
240 _c.Call.Run(func(args mock.Arguments) {
241 var arg0 context.Context
242 if args[0] != nil {
243 arg0 = args[0].(context.Context)
244 }
245 var arg1 domain.Principal
246 if args[1] != nil {
247 arg1 = args[1].(domain.Principal)
248 }
249 var arg2 domain.SettingsScope
250 if args[2] != nil {
251 arg2 = args[2].(domain.SettingsScope)
252 }
253 var arg3 int
254 if args[3] != nil {
255 arg3 = args[3].(int)
256 }
257 var arg4 string
258 if args[4] != nil {
259 arg4 = args[4].(string)
260 }
261 run(
262 arg0,
263 arg1,
264 arg2,
265 arg3,
266 arg4,
267 )
268 })
269 return _c
270}
271
272func (_c *VariableService_ListVariables_Call) Return(variablePage ports.VariablePage, err error) *VariableService_ListVariables_Call {
273 _c.Call.Return(variablePage, err)
274 return _c
275}
276
277func (_c *VariableService_ListVariables_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, size int, token string) (ports.VariablePage, error)) *VariableService_ListVariables_Call {
278 _c.Call.Return(run)
279 return _c
280}
281
282// SetVariable provides a mock function for the type VariableService
283func (_mock *VariableService) SetVariable(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string, value string) (domain.Variable, error) {
284 ret := _mock.Called(ctx, p, scope, name, value)
285
286 if len(ret) == 0 {
287 panic("no return value specified for SetVariable")
288 }
289
290 var r0 domain.Variable
291 var r1 error
292 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, string, string) (domain.Variable, error)); ok {
293 return returnFunc(ctx, p, scope, name, value)
294 }
295 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.SettingsScope, string, string) domain.Variable); ok {
296 r0 = returnFunc(ctx, p, scope, name, value)
297 } else {
298 r0 = ret.Get(0).(domain.Variable)
299 }
300 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.SettingsScope, string, string) error); ok {
301 r1 = returnFunc(ctx, p, scope, name, value)
302 } else {
303 r1 = ret.Error(1)
304 }
305 return r0, r1
306}
307
308// VariableService_SetVariable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetVariable'
309type VariableService_SetVariable_Call struct {
310 *mock.Call
311}
312
313// SetVariable is a helper method to define mock.On call
314// - ctx context.Context
315// - p domain.Principal
316// - scope domain.SettingsScope
317// - name string
318// - value string
319func (_e *VariableService_Expecter) SetVariable(ctx any, p any, scope any, name any, value any) *VariableService_SetVariable_Call {
320 return &VariableService_SetVariable_Call{Call: _e.mock.On("SetVariable", ctx, p, scope, name, value)}
321}
322
323func (_c *VariableService_SetVariable_Call) Run(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string, value string)) *VariableService_SetVariable_Call {
324 _c.Call.Run(func(args mock.Arguments) {
325 var arg0 context.Context
326 if args[0] != nil {
327 arg0 = args[0].(context.Context)
328 }
329 var arg1 domain.Principal
330 if args[1] != nil {
331 arg1 = args[1].(domain.Principal)
332 }
333 var arg2 domain.SettingsScope
334 if args[2] != nil {
335 arg2 = args[2].(domain.SettingsScope)
336 }
337 var arg3 string
338 if args[3] != nil {
339 arg3 = args[3].(string)
340 }
341 var arg4 string
342 if args[4] != nil {
343 arg4 = args[4].(string)
344 }
345 run(
346 arg0,
347 arg1,
348 arg2,
349 arg3,
350 arg4,
351 )
352 })
353 return _c
354}
355
356func (_c *VariableService_SetVariable_Call) Return(variable domain.Variable, err error) *VariableService_SetVariable_Call {
357 _c.Call.Return(variable, err)
358 return _c
359}
360
361func (_c *VariableService_SetVariable_Call) RunAndReturn(run func(ctx context.Context, p domain.Principal, scope domain.SettingsScope, name string, value string) (domain.Variable, error)) *VariableService_SetVariable_Call {
362 _c.Call.Return(run)
363 return _c
364}