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// NewCISummaryStore creates a new instance of CISummaryStore. 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 NewCISummaryStore(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *CISummaryStore {
21 if helper, ok := t.(interface{ Helper() }); ok {
22 helper.Helper()
23 }
24
25 mock := &CISummaryStore{}
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// CISummaryStore is an autogenerated mock type for the CISummaryStore type
39type CISummaryStore struct {
40 mock.Mock
41}
42
43type CISummaryStore_Expecter struct {
44 mock *mock.Mock
45}
46
47func (_m *CISummaryStore) EXPECT() *CISummaryStore_Expecter {
48 return &CISummaryStore_Expecter{mock: &_m.Mock}
49}
50
51// List provides a mock function for the type CISummaryStore
52func (_mock *CISummaryStore) List(ctx context.Context, ref ports.CILogRef, limit int, maxBytes int64) ([]domain.CIStepSummary, bool, error) {
53 ret := _mock.Called(ctx, ref, limit, maxBytes)
54
55 if len(ret) == 0 {
56 panic("no return value specified for List")
57 }
58
59 var r0 []domain.CIStepSummary
60 var r1 bool
61 var r2 error
62 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef, int, int64) ([]domain.CIStepSummary, bool, error)); ok {
63 return returnFunc(ctx, ref, limit, maxBytes)
64 }
65 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef, int, int64) []domain.CIStepSummary); ok {
66 r0 = returnFunc(ctx, ref, limit, maxBytes)
67 } else {
68 if ret.Get(0) != nil {
69 r0 = ret.Get(0).([]domain.CIStepSummary)
70 }
71 }
72 if returnFunc, ok := ret.Get(1).(func(context.Context, ports.CILogRef, int, int64) bool); ok {
73 r1 = returnFunc(ctx, ref, limit, maxBytes)
74 } else {
75 r1 = ret.Get(1).(bool)
76 }
77 if returnFunc, ok := ret.Get(2).(func(context.Context, ports.CILogRef, int, int64) error); ok {
78 r2 = returnFunc(ctx, ref, limit, maxBytes)
79 } else {
80 r2 = ret.Error(2)
81 }
82 return r0, r1, r2
83}
84
85// CISummaryStore_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
86type CISummaryStore_List_Call struct {
87 *mock.Call
88}
89
90// List is a helper method to define mock.On call
91// - ctx context.Context
92// - ref ports.CILogRef
93// - limit int
94// - maxBytes int64
95func (_e *CISummaryStore_Expecter) List(ctx any, ref any, limit any, maxBytes any) *CISummaryStore_List_Call {
96 return &CISummaryStore_List_Call{Call: _e.mock.On("List", ctx, ref, limit, maxBytes)}
97}
98
99func (_c *CISummaryStore_List_Call) Run(run func(ctx context.Context, ref ports.CILogRef, limit int, maxBytes int64)) *CISummaryStore_List_Call {
100 _c.Call.Run(func(args mock.Arguments) {
101 var arg0 context.Context
102 if args[0] != nil {
103 arg0 = args[0].(context.Context)
104 }
105 var arg1 ports.CILogRef
106 if args[1] != nil {
107 arg1 = args[1].(ports.CILogRef)
108 }
109 var arg2 int
110 if args[2] != nil {
111 arg2 = args[2].(int)
112 }
113 var arg3 int64
114 if args[3] != nil {
115 arg3 = args[3].(int64)
116 }
117 run(
118 arg0,
119 arg1,
120 arg2,
121 arg3,
122 )
123 })
124 return _c
125}
126
127func (_c *CISummaryStore_List_Call) Return(summaries []domain.CIStepSummary, more bool, err error) *CISummaryStore_List_Call {
128 _c.Call.Return(summaries, more, err)
129 return _c
130}
131
132func (_c *CISummaryStore_List_Call) RunAndReturn(run func(ctx context.Context, ref ports.CILogRef, limit int, maxBytes int64) ([]domain.CIStepSummary, bool, error)) *CISummaryStore_List_Call {
133 _c.Call.Return(run)
134 return _c
135}
136
137// Put provides a mock function for the type CISummaryStore
138func (_mock *CISummaryStore) Put(ctx context.Context, ref ports.CILogRef, step int32, markdown string) error {
139 ret := _mock.Called(ctx, ref, step, markdown)
140
141 if len(ret) == 0 {
142 panic("no return value specified for Put")
143 }
144
145 var r0 error
146 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef, int32, string) error); ok {
147 r0 = returnFunc(ctx, ref, step, markdown)
148 } else {
149 r0 = ret.Error(0)
150 }
151 return r0
152}
153
154// CISummaryStore_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put'
155type CISummaryStore_Put_Call struct {
156 *mock.Call
157}
158
159// Put is a helper method to define mock.On call
160// - ctx context.Context
161// - ref ports.CILogRef
162// - step int32
163// - markdown string
164func (_e *CISummaryStore_Expecter) Put(ctx any, ref any, step any, markdown any) *CISummaryStore_Put_Call {
165 return &CISummaryStore_Put_Call{Call: _e.mock.On("Put", ctx, ref, step, markdown)}
166}
167
168func (_c *CISummaryStore_Put_Call) Run(run func(ctx context.Context, ref ports.CILogRef, step int32, markdown string)) *CISummaryStore_Put_Call {
169 _c.Call.Run(func(args mock.Arguments) {
170 var arg0 context.Context
171 if args[0] != nil {
172 arg0 = args[0].(context.Context)
173 }
174 var arg1 ports.CILogRef
175 if args[1] != nil {
176 arg1 = args[1].(ports.CILogRef)
177 }
178 var arg2 int32
179 if args[2] != nil {
180 arg2 = args[2].(int32)
181 }
182 var arg3 string
183 if args[3] != nil {
184 arg3 = args[3].(string)
185 }
186 run(
187 arg0,
188 arg1,
189 arg2,
190 arg3,
191 )
192 })
193 return _c
194}
195
196func (_c *CISummaryStore_Put_Call) Return(err error) *CISummaryStore_Put_Call {
197 _c.Call.Return(err)
198 return _c
199}
200
201func (_c *CISummaryStore_Put_Call) RunAndReturn(run func(ctx context.Context, ref ports.CILogRef, step int32, markdown string) error) *CISummaryStore_Put_Call {
202 _c.Call.Return(run)
203 return _c
204}
205
206// RemoveJob provides a mock function for the type CISummaryStore
207func (_mock *CISummaryStore) RemoveJob(ctx context.Context, ref ports.CILogRef) error {
208 ret := _mock.Called(ctx, ref)
209
210 if len(ret) == 0 {
211 panic("no return value specified for RemoveJob")
212 }
213
214 var r0 error
215 if returnFunc, ok := ret.Get(0).(func(context.Context, ports.CILogRef) error); ok {
216 r0 = returnFunc(ctx, ref)
217 } else {
218 r0 = ret.Error(0)
219 }
220 return r0
221}
222
223// CISummaryStore_RemoveJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveJob'
224type CISummaryStore_RemoveJob_Call struct {
225 *mock.Call
226}
227
228// RemoveJob is a helper method to define mock.On call
229// - ctx context.Context
230// - ref ports.CILogRef
231func (_e *CISummaryStore_Expecter) RemoveJob(ctx any, ref any) *CISummaryStore_RemoveJob_Call {
232 return &CISummaryStore_RemoveJob_Call{Call: _e.mock.On("RemoveJob", ctx, ref)}
233}
234
235func (_c *CISummaryStore_RemoveJob_Call) Run(run func(ctx context.Context, ref ports.CILogRef)) *CISummaryStore_RemoveJob_Call {
236 _c.Call.Run(func(args mock.Arguments) {
237 var arg0 context.Context
238 if args[0] != nil {
239 arg0 = args[0].(context.Context)
240 }
241 var arg1 ports.CILogRef
242 if args[1] != nil {
243 arg1 = args[1].(ports.CILogRef)
244 }
245 run(
246 arg0,
247 arg1,
248 )
249 })
250 return _c
251}
252
253func (_c *CISummaryStore_RemoveJob_Call) Return(err error) *CISummaryStore_RemoveJob_Call {
254 _c.Call.Return(err)
255 return _c
256}
257
258func (_c *CISummaryStore_RemoveJob_Call) RunAndReturn(run func(ctx context.Context, ref ports.CILogRef) error) *CISummaryStore_RemoveJob_Call {
259 _c.Call.Return(run)
260 return _c
261}
262
263// RemoveRuns provides a mock function for the type CISummaryStore
264func (_mock *CISummaryStore) RemoveRuns(ctx context.Context, runIDs []int64) error {
265 ret := _mock.Called(ctx, runIDs)
266
267 if len(ret) == 0 {
268 panic("no return value specified for RemoveRuns")
269 }
270
271 var r0 error
272 if returnFunc, ok := ret.Get(0).(func(context.Context, []int64) error); ok {
273 r0 = returnFunc(ctx, runIDs)
274 } else {
275 r0 = ret.Error(0)
276 }
277 return r0
278}
279
280// CISummaryStore_RemoveRuns_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRuns'
281type CISummaryStore_RemoveRuns_Call struct {
282 *mock.Call
283}
284
285// RemoveRuns is a helper method to define mock.On call
286// - ctx context.Context
287// - runIDs []int64
288func (_e *CISummaryStore_Expecter) RemoveRuns(ctx any, runIDs any) *CISummaryStore_RemoveRuns_Call {
289 return &CISummaryStore_RemoveRuns_Call{Call: _e.mock.On("RemoveRuns", ctx, runIDs)}
290}
291
292func (_c *CISummaryStore_RemoveRuns_Call) Run(run func(ctx context.Context, runIDs []int64)) *CISummaryStore_RemoveRuns_Call {
293 _c.Call.Run(func(args mock.Arguments) {
294 var arg0 context.Context
295 if args[0] != nil {
296 arg0 = args[0].(context.Context)
297 }
298 var arg1 []int64
299 if args[1] != nil {
300 arg1 = args[1].([]int64)
301 }
302 run(
303 arg0,
304 arg1,
305 )
306 })
307 return _c
308}
309
310func (_c *CISummaryStore_RemoveRuns_Call) Return(err error) *CISummaryStore_RemoveRuns_Call {
311 _c.Call.Return(err)
312 return _c
313}
314
315func (_c *CISummaryStore_RemoveRuns_Call) RunAndReturn(run func(ctx context.Context, runIDs []int64) error) *CISummaryStore_RemoveRuns_Call {
316 _c.Call.Return(run)
317 return _c
318}
319
320// RunIDs provides a mock function for the type CISummaryStore
321func (_mock *CISummaryStore) RunIDs(ctx context.Context) ([]int64, error) {
322 ret := _mock.Called(ctx)
323
324 if len(ret) == 0 {
325 panic("no return value specified for RunIDs")
326 }
327
328 var r0 []int64
329 var r1 error
330 if returnFunc, ok := ret.Get(0).(func(context.Context) ([]int64, error)); ok {
331 return returnFunc(ctx)
332 }
333 if returnFunc, ok := ret.Get(0).(func(context.Context) []int64); ok {
334 r0 = returnFunc(ctx)
335 } else {
336 if ret.Get(0) != nil {
337 r0 = ret.Get(0).([]int64)
338 }
339 }
340 if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
341 r1 = returnFunc(ctx)
342 } else {
343 r1 = ret.Error(1)
344 }
345 return r0, r1
346}
347
348// CISummaryStore_RunIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunIDs'
349type CISummaryStore_RunIDs_Call struct {
350 *mock.Call
351}
352
353// RunIDs is a helper method to define mock.On call
354// - ctx context.Context
355func (_e *CISummaryStore_Expecter) RunIDs(ctx any) *CISummaryStore_RunIDs_Call {
356 return &CISummaryStore_RunIDs_Call{Call: _e.mock.On("RunIDs", ctx)}
357}
358
359func (_c *CISummaryStore_RunIDs_Call) Run(run func(ctx context.Context)) *CISummaryStore_RunIDs_Call {
360 _c.Call.Run(func(args mock.Arguments) {
361 var arg0 context.Context
362 if args[0] != nil {
363 arg0 = args[0].(context.Context)
364 }
365 run(
366 arg0,
367 )
368 })
369 return _c
370}
371
372func (_c *CISummaryStore_RunIDs_Call) Return(int64s []int64, err error) *CISummaryStore_RunIDs_Call {
373 _c.Call.Return(int64s, err)
374 return _c
375}
376
377func (_c *CISummaryStore_RunIDs_Call) RunAndReturn(run func(ctx context.Context) ([]int64, error)) *CISummaryStore_RunIDs_Call {
378 _c.Call.Return(run)
379 return _c
380}