detached ece7682

broker_store_mock.go RawHistoryFolder

1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package portsmocks
6
7import (
8	"context"
9
10	"github.com/bnema/vev/internal/ports"
11	mock "github.com/stretchr/testify/mock"
12)
13
14// NewMockBrokerHostAuthorityReader creates a new instance of MockBrokerHostAuthorityReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func NewMockBrokerHostAuthorityReader(t interface {
17	mock.TestingT
18	Cleanup(func())
19}) *MockBrokerHostAuthorityReader {
20	if helper, ok := t.(interface{ Helper() }); ok {
21		helper.Helper()
22	}
23
24	mock := &MockBrokerHostAuthorityReader{}
25	mock.Mock.Test(t)
26
27	t.Cleanup(func() {
28		if helper, ok := t.(interface{ Helper() }); ok {
29			helper.Helper()
30		}
31		mock.AssertExpectations(t)
32	})
33
34	return mock
35}
36
37// MockBrokerHostAuthorityReader is an autogenerated mock type for the BrokerHostAuthorityReader type
38type MockBrokerHostAuthorityReader struct {
39	mock.Mock
40}
41
42type MockBrokerHostAuthorityReader_Expecter struct {
43	mock *mock.Mock
44}
45
46func (_m *MockBrokerHostAuthorityReader) EXPECT() *MockBrokerHostAuthorityReader_Expecter {
47	return &MockBrokerHostAuthorityReader_Expecter{mock: &_m.Mock}
48}
49
50// LookupHost provides a mock function for the type MockBrokerHostAuthorityReader
51func (_mock *MockBrokerHostAuthorityReader) LookupHost(ctx context.Context, endpoint string) (ports.BrokerHostRecord, bool, error) {
52	ret := _mock.Called(ctx, endpoint)
53
54	if len(ret) == 0 {
55		panic("no return value specified for LookupHost")
56	}
57
58	var r0 ports.BrokerHostRecord
59	var r1 bool
60	var r2 error
61	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (ports.BrokerHostRecord, bool, error)); ok {
62		return returnFunc(ctx, endpoint)
63	}
64	if returnFunc, ok := ret.Get(0).(func(context.Context, string) ports.BrokerHostRecord); ok {
65		r0 = returnFunc(ctx, endpoint)
66	} else {
67		r0 = ret.Get(0).(ports.BrokerHostRecord)
68	}
69	if returnFunc, ok := ret.Get(1).(func(context.Context, string) bool); ok {
70		r1 = returnFunc(ctx, endpoint)
71	} else {
72		r1 = ret.Get(1).(bool)
73	}
74	if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok {
75		r2 = returnFunc(ctx, endpoint)
76	} else {
77		r2 = ret.Error(2)
78	}
79	return r0, r1, r2
80}
81
82// MockBrokerHostAuthorityReader_LookupHost_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LookupHost'
83type MockBrokerHostAuthorityReader_LookupHost_Call struct {
84	*mock.Call
85}
86
87// LookupHost is a helper method to define mock.On call
88//   - ctx context.Context
89//   - endpoint string
90func (_e *MockBrokerHostAuthorityReader_Expecter) LookupHost(ctx any, endpoint any) *MockBrokerHostAuthorityReader_LookupHost_Call {
91	return &MockBrokerHostAuthorityReader_LookupHost_Call{Call: _e.mock.On("LookupHost", ctx, endpoint)}
92}
93
94func (_c *MockBrokerHostAuthorityReader_LookupHost_Call) Run(run func(ctx context.Context, endpoint string)) *MockBrokerHostAuthorityReader_LookupHost_Call {
95	_c.Call.Run(func(args mock.Arguments) {
96		var arg0 context.Context
97		if args[0] != nil {
98			arg0 = args[0].(context.Context)
99		}
100		var arg1 string
101		if args[1] != nil {
102			arg1 = args[1].(string)
103		}
104		run(
105			arg0,
106			arg1,
107		)
108	})
109	return _c
110}
111
112func (_c *MockBrokerHostAuthorityReader_LookupHost_Call) Return(brokerHostRecord ports.BrokerHostRecord, b bool, err error) *MockBrokerHostAuthorityReader_LookupHost_Call {
113	_c.Call.Return(brokerHostRecord, b, err)
114	return _c
115}
116
117func (_c *MockBrokerHostAuthorityReader_LookupHost_Call) RunAndReturn(run func(ctx context.Context, endpoint string) (ports.BrokerHostRecord, bool, error)) *MockBrokerHostAuthorityReader_LookupHost_Call {
118	_c.Call.Return(run)
119	return _c
120}
121
122// NewMockBrokerHostStore creates a new instance of MockBrokerHostStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
123// The first argument is typically a *testing.T value.
124func NewMockBrokerHostStore(t interface {
125	mock.TestingT
126	Cleanup(func())
127}) *MockBrokerHostStore {
128	if helper, ok := t.(interface{ Helper() }); ok {
129		helper.Helper()
130	}
131
132	mock := &MockBrokerHostStore{}
133	mock.Mock.Test(t)
134
135	t.Cleanup(func() {
136		if helper, ok := t.(interface{ Helper() }); ok {
137			helper.Helper()
138		}
139		mock.AssertExpectations(t)
140	})
141
142	return mock
143}
144
145// MockBrokerHostStore is an autogenerated mock type for the BrokerHostStore type
146type MockBrokerHostStore struct {
147	mock.Mock
148}
149
150type MockBrokerHostStore_Expecter struct {
151	mock *mock.Mock
152}
153
154func (_m *MockBrokerHostStore) EXPECT() *MockBrokerHostStore_Expecter {
155	return &MockBrokerHostStore_Expecter{mock: &_m.Mock}
156}
157
158// Close provides a mock function for the type MockBrokerHostStore
159func (_mock *MockBrokerHostStore) Close() error {
160	ret := _mock.Called()
161
162	if len(ret) == 0 {
163		panic("no return value specified for Close")
164	}
165
166	var r0 error
167	if returnFunc, ok := ret.Get(0).(func() error); ok {
168		r0 = returnFunc()
169	} else {
170		r0 = ret.Error(0)
171	}
172	return r0
173}
174
175// MockBrokerHostStore_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
176type MockBrokerHostStore_Close_Call struct {
177	*mock.Call
178}
179
180// Close is a helper method to define mock.On call
181func (_e *MockBrokerHostStore_Expecter) Close() *MockBrokerHostStore_Close_Call {
182	return &MockBrokerHostStore_Close_Call{Call: _e.mock.On("Close")}
183}
184
185func (_c *MockBrokerHostStore_Close_Call) Run(run func()) *MockBrokerHostStore_Close_Call {
186	_c.Call.Run(func(args mock.Arguments) {
187		run()
188	})
189	return _c
190}
191
192func (_c *MockBrokerHostStore_Close_Call) Return(err error) *MockBrokerHostStore_Close_Call {
193	_c.Call.Return(err)
194	return _c
195}
196
197func (_c *MockBrokerHostStore_Close_Call) RunAndReturn(run func() error) *MockBrokerHostStore_Close_Call {
198	_c.Call.Return(run)
199	return _c
200}
201
202// Load provides a mock function for the type MockBrokerHostStore
203func (_mock *MockBrokerHostStore) Load() (ports.BrokerSnapshot, error) {
204	ret := _mock.Called()
205
206	if len(ret) == 0 {
207		panic("no return value specified for Load")
208	}
209
210	var r0 ports.BrokerSnapshot
211	var r1 error
212	if returnFunc, ok := ret.Get(0).(func() (ports.BrokerSnapshot, error)); ok {
213		return returnFunc()
214	}
215	if returnFunc, ok := ret.Get(0).(func() ports.BrokerSnapshot); ok {
216		r0 = returnFunc()
217	} else {
218		r0 = ret.Get(0).(ports.BrokerSnapshot)
219	}
220	if returnFunc, ok := ret.Get(1).(func() error); ok {
221		r1 = returnFunc()
222	} else {
223		r1 = ret.Error(1)
224	}
225	return r0, r1
226}
227
228// MockBrokerHostStore_Load_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Load'
229type MockBrokerHostStore_Load_Call struct {
230	*mock.Call
231}
232
233// Load is a helper method to define mock.On call
234func (_e *MockBrokerHostStore_Expecter) Load() *MockBrokerHostStore_Load_Call {
235	return &MockBrokerHostStore_Load_Call{Call: _e.mock.On("Load")}
236}
237
238func (_c *MockBrokerHostStore_Load_Call) Run(run func()) *MockBrokerHostStore_Load_Call {
239	_c.Call.Run(func(args mock.Arguments) {
240		run()
241	})
242	return _c
243}
244
245func (_c *MockBrokerHostStore_Load_Call) Return(brokerSnapshot ports.BrokerSnapshot, err error) *MockBrokerHostStore_Load_Call {
246	_c.Call.Return(brokerSnapshot, err)
247	return _c
248}
249
250func (_c *MockBrokerHostStore_Load_Call) RunAndReturn(run func() (ports.BrokerSnapshot, error)) *MockBrokerHostStore_Load_Call {
251	_c.Call.Return(run)
252	return _c
253}
254
255// LoadHosts provides a mock function for the type MockBrokerHostStore
256func (_mock *MockBrokerHostStore) LoadHosts() (ports.BrokerHosts, error) {
257	ret := _mock.Called()
258
259	if len(ret) == 0 {
260		panic("no return value specified for LoadHosts")
261	}
262
263	var r0 ports.BrokerHosts
264	var r1 error
265	if returnFunc, ok := ret.Get(0).(func() (ports.BrokerHosts, error)); ok {
266		return returnFunc()
267	}
268	if returnFunc, ok := ret.Get(0).(func() ports.BrokerHosts); ok {
269		r0 = returnFunc()
270	} else {
271		r0 = ret.Get(0).(ports.BrokerHosts)
272	}
273	if returnFunc, ok := ret.Get(1).(func() error); ok {
274		r1 = returnFunc()
275	} else {
276		r1 = ret.Error(1)
277	}
278	return r0, r1
279}
280
281// MockBrokerHostStore_LoadHosts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadHosts'
282type MockBrokerHostStore_LoadHosts_Call struct {
283	*mock.Call
284}
285
286// LoadHosts is a helper method to define mock.On call
287func (_e *MockBrokerHostStore_Expecter) LoadHosts() *MockBrokerHostStore_LoadHosts_Call {
288	return &MockBrokerHostStore_LoadHosts_Call{Call: _e.mock.On("LoadHosts")}
289}
290
291func (_c *MockBrokerHostStore_LoadHosts_Call) Run(run func()) *MockBrokerHostStore_LoadHosts_Call {
292	_c.Call.Run(func(args mock.Arguments) {
293		run()
294	})
295	return _c
296}
297
298func (_c *MockBrokerHostStore_LoadHosts_Call) Return(brokerHosts ports.BrokerHosts, err error) *MockBrokerHostStore_LoadHosts_Call {
299	_c.Call.Return(brokerHosts, err)
300	return _c
301}
302
303func (_c *MockBrokerHostStore_LoadHosts_Call) RunAndReturn(run func() (ports.BrokerHosts, error)) *MockBrokerHostStore_LoadHosts_Call {
304	_c.Call.Return(run)
305	return _c
306}
307
308// ReplaceHosts provides a mock function for the type MockBrokerHostStore
309func (_mock *MockBrokerHostStore) ReplaceHosts(expected uint64, hosts []ports.BrokerHostRecord) error {
310	ret := _mock.Called(expected, hosts)
311
312	if len(ret) == 0 {
313		panic("no return value specified for ReplaceHosts")
314	}
315
316	var r0 error
317	if returnFunc, ok := ret.Get(0).(func(uint64, []ports.BrokerHostRecord) error); ok {
318		r0 = returnFunc(expected, hosts)
319	} else {
320		r0 = ret.Error(0)
321	}
322	return r0
323}
324
325// MockBrokerHostStore_ReplaceHosts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplaceHosts'
326type MockBrokerHostStore_ReplaceHosts_Call struct {
327	*mock.Call
328}
329
330// ReplaceHosts is a helper method to define mock.On call
331//   - expected uint64
332//   - hosts []ports.BrokerHostRecord
333func (_e *MockBrokerHostStore_Expecter) ReplaceHosts(expected any, hosts any) *MockBrokerHostStore_ReplaceHosts_Call {
334	return &MockBrokerHostStore_ReplaceHosts_Call{Call: _e.mock.On("ReplaceHosts", expected, hosts)}
335}
336
337func (_c *MockBrokerHostStore_ReplaceHosts_Call) Run(run func(expected uint64, hosts []ports.BrokerHostRecord)) *MockBrokerHostStore_ReplaceHosts_Call {
338	_c.Call.Run(func(args mock.Arguments) {
339		var arg0 uint64
340		if args[0] != nil {
341			arg0 = args[0].(uint64)
342		}
343		var arg1 []ports.BrokerHostRecord
344		if args[1] != nil {
345			arg1 = args[1].([]ports.BrokerHostRecord)
346		}
347		run(
348			arg0,
349			arg1,
350		)
351	})
352	return _c
353}
354
355func (_c *MockBrokerHostStore_ReplaceHosts_Call) Return(err error) *MockBrokerHostStore_ReplaceHosts_Call {
356	_c.Call.Return(err)
357	return _c
358}
359
360func (_c *MockBrokerHostStore_ReplaceHosts_Call) RunAndReturn(run func(expected uint64, hosts []ports.BrokerHostRecord) error) *MockBrokerHostStore_ReplaceHosts_Call {
361	_c.Call.Return(run)
362	return _c
363}
364
365// Store provides a mock function for the type MockBrokerHostStore
366func (_mock *MockBrokerHostStore) Store(brokerSnapshot ports.BrokerSnapshot) error {
367	ret := _mock.Called(brokerSnapshot)
368
369	if len(ret) == 0 {
370		panic("no return value specified for Store")
371	}
372
373	var r0 error
374	if returnFunc, ok := ret.Get(0).(func(ports.BrokerSnapshot) error); ok {
375		r0 = returnFunc(brokerSnapshot)
376	} else {
377		r0 = ret.Error(0)
378	}
379	return r0
380}
381
382// MockBrokerHostStore_Store_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Store'
383type MockBrokerHostStore_Store_Call struct {
384	*mock.Call
385}
386
387// Store is a helper method to define mock.On call
388//   - brokerSnapshot ports.BrokerSnapshot
389func (_e *MockBrokerHostStore_Expecter) Store(brokerSnapshot any) *MockBrokerHostStore_Store_Call {
390	return &MockBrokerHostStore_Store_Call{Call: _e.mock.On("Store", brokerSnapshot)}
391}
392
393func (_c *MockBrokerHostStore_Store_Call) Run(run func(brokerSnapshot ports.BrokerSnapshot)) *MockBrokerHostStore_Store_Call {
394	_c.Call.Run(func(args mock.Arguments) {
395		var arg0 ports.BrokerSnapshot
396		if args[0] != nil {
397			arg0 = args[0].(ports.BrokerSnapshot)
398		}
399		run(
400			arg0,
401		)
402	})
403	return _c
404}
405
406func (_c *MockBrokerHostStore_Store_Call) Return(err error) *MockBrokerHostStore_Store_Call {
407	_c.Call.Return(err)
408	return _c
409}
410
411func (_c *MockBrokerHostStore_Store_Call) RunAndReturn(run func(brokerSnapshot ports.BrokerSnapshot) error) *MockBrokerHostStore_Store_Call {
412	_c.Call.Return(run)
413	return _c
414}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close