-
Notifications
You must be signed in to change notification settings - Fork 27
/
reader.go
169 lines (140 loc) · 4.93 KB
/
reader.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// Code generated by mockery. DO NOT EDIT.
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2024 Datadog, Inc.
package mocks
import (
context "context"
client "sigs.k8s.io/controller-runtime/pkg/client"
mock "github.com/stretchr/testify/mock"
types "k8s.io/apimachinery/pkg/types"
)
// ReaderMock is an autogenerated mock type for the Reader type
type ReaderMock struct {
mock.Mock
}
type ReaderMock_Expecter struct {
mock *mock.Mock
}
func (_m *ReaderMock) EXPECT() *ReaderMock_Expecter {
return &ReaderMock_Expecter{mock: &_m.Mock}
}
// Get provides a mock function with given fields: ctx, key, obj, opts
func (_m *ReaderMock) Get(ctx context.Context, key types.NamespacedName, obj client.Object, opts ...client.GetOption) error {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, key, obj)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for Get")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, types.NamespacedName, client.Object, ...client.GetOption) error); ok {
r0 = rf(ctx, key, obj, opts...)
} else {
r0 = ret.Error(0)
}
return r0
}
// ReaderMock_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
type ReaderMock_Get_Call struct {
*mock.Call
}
// Get is a helper method to define mock.On call
// - ctx context.Context
// - key types.NamespacedName
// - obj client.Object
// - opts ...client.GetOption
func (_e *ReaderMock_Expecter) Get(ctx interface{}, key interface{}, obj interface{}, opts ...interface{}) *ReaderMock_Get_Call {
return &ReaderMock_Get_Call{Call: _e.mock.On("Get",
append([]interface{}{ctx, key, obj}, opts...)...)}
}
func (_c *ReaderMock_Get_Call) Run(run func(ctx context.Context, key types.NamespacedName, obj client.Object, opts ...client.GetOption)) *ReaderMock_Get_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]client.GetOption, len(args)-3)
for i, a := range args[3:] {
if a != nil {
variadicArgs[i] = a.(client.GetOption)
}
}
run(args[0].(context.Context), args[1].(types.NamespacedName), args[2].(client.Object), variadicArgs...)
})
return _c
}
func (_c *ReaderMock_Get_Call) Return(_a0 error) *ReaderMock_Get_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *ReaderMock_Get_Call) RunAndReturn(run func(context.Context, types.NamespacedName, client.Object, ...client.GetOption) error) *ReaderMock_Get_Call {
_c.Call.Return(run)
return _c
}
// List provides a mock function with given fields: ctx, list, opts
func (_m *ReaderMock) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, list)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for List")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, client.ObjectList, ...client.ListOption) error); ok {
r0 = rf(ctx, list, opts...)
} else {
r0 = ret.Error(0)
}
return r0
}
// ReaderMock_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
type ReaderMock_List_Call struct {
*mock.Call
}
// List is a helper method to define mock.On call
// - ctx context.Context
// - list client.ObjectList
// - opts ...client.ListOption
func (_e *ReaderMock_Expecter) List(ctx interface{}, list interface{}, opts ...interface{}) *ReaderMock_List_Call {
return &ReaderMock_List_Call{Call: _e.mock.On("List",
append([]interface{}{ctx, list}, opts...)...)}
}
func (_c *ReaderMock_List_Call) Run(run func(ctx context.Context, list client.ObjectList, opts ...client.ListOption)) *ReaderMock_List_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]client.ListOption, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(client.ListOption)
}
}
run(args[0].(context.Context), args[1].(client.ObjectList), variadicArgs...)
})
return _c
}
func (_c *ReaderMock_List_Call) Return(_a0 error) *ReaderMock_List_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *ReaderMock_List_Call) RunAndReturn(run func(context.Context, client.ObjectList, ...client.ListOption) error) *ReaderMock_List_Call {
_c.Call.Return(run)
return _c
}
// NewReaderMock creates a new instance of ReaderMock. 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 NewReaderMock(t interface {
mock.TestingT
Cleanup(func())
}) *ReaderMock {
mock := &ReaderMock{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}