-
Notifications
You must be signed in to change notification settings - Fork 137
/
reconciler.go
94 lines (75 loc) · 2.6 KB
/
reconciler.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
// Code generated by mockery. DO NOT EDIT.
package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
reconcile "sigs.k8s.io/controller-runtime/pkg/reconcile"
)
// Reconciler is an autogenerated mock type for the Reconciler type
type Reconciler struct {
mock.Mock
}
type Reconciler_Expecter struct {
mock *mock.Mock
}
func (_m *Reconciler) EXPECT() *Reconciler_Expecter {
return &Reconciler_Expecter{mock: &_m.Mock}
}
// Reconcile provides a mock function with given fields: _a0, _a1
func (_m *Reconciler) Reconcile(_a0 context.Context, _a1 reconcile.Request) (reconcile.Result, error) {
ret := _m.Called(_a0, _a1)
if len(ret) == 0 {
panic("no return value specified for Reconcile")
}
var r0 reconcile.Result
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, reconcile.Request) (reconcile.Result, error)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, reconcile.Request) reconcile.Result); ok {
r0 = rf(_a0, _a1)
} else {
r0 = ret.Get(0).(reconcile.Result)
}
if rf, ok := ret.Get(1).(func(context.Context, reconcile.Request) error); ok {
r1 = rf(_a0, _a1)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Reconciler_Reconcile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reconcile'
type Reconciler_Reconcile_Call struct {
*mock.Call
}
// Reconcile is a helper method to define mock.On call
// - _a0 context.Context
// - _a1 reconcile.Request
func (_e *Reconciler_Expecter) Reconcile(_a0 interface{}, _a1 interface{}) *Reconciler_Reconcile_Call {
return &Reconciler_Reconcile_Call{Call: _e.mock.On("Reconcile", _a0, _a1)}
}
func (_c *Reconciler_Reconcile_Call) Run(run func(_a0 context.Context, _a1 reconcile.Request)) *Reconciler_Reconcile_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(reconcile.Request))
})
return _c
}
func (_c *Reconciler_Reconcile_Call) Return(_a0 reconcile.Result, _a1 error) *Reconciler_Reconcile_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Reconciler_Reconcile_Call) RunAndReturn(run func(context.Context, reconcile.Request) (reconcile.Result, error)) *Reconciler_Reconcile_Call {
_c.Call.Return(run)
return _c
}
// NewReconciler creates a new instance of Reconciler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewReconciler(t interface {
mock.TestingT
Cleanup(func())
}) *Reconciler {
mock := &Reconciler{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}