-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmock_eventRecorder_test.go
167 lines (140 loc) · 6.29 KB
/
mock_eventRecorder_test.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
// Code generated by mockery v2.20.0. DO NOT EDIT.
package main
import (
mock "github.com/stretchr/testify/mock"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// mockEventRecorder is an autogenerated mock type for the eventRecorder type
type mockEventRecorder struct {
mock.Mock
}
type mockEventRecorder_Expecter struct {
mock *mock.Mock
}
func (_m *mockEventRecorder) EXPECT() *mockEventRecorder_Expecter {
return &mockEventRecorder_Expecter{mock: &_m.Mock}
}
// AnnotatedEventf provides a mock function with given fields: object, annotations, eventtype, reason, messageFmt, args
func (_m *mockEventRecorder) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype string, reason string, messageFmt string, args ...interface{}) {
var _ca []interface{}
_ca = append(_ca, object, annotations, eventtype, reason, messageFmt)
_ca = append(_ca, args...)
_m.Called(_ca...)
}
// mockEventRecorder_AnnotatedEventf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AnnotatedEventf'
type mockEventRecorder_AnnotatedEventf_Call struct {
*mock.Call
}
// AnnotatedEventf is a helper method to define mock.On call
// - object runtime.Object
// - annotations map[string]string
// - eventtype string
// - reason string
// - messageFmt string
// - args ...interface{}
func (_e *mockEventRecorder_Expecter) AnnotatedEventf(object interface{}, annotations interface{}, eventtype interface{}, reason interface{}, messageFmt interface{}, args ...interface{}) *mockEventRecorder_AnnotatedEventf_Call {
return &mockEventRecorder_AnnotatedEventf_Call{Call: _e.mock.On("AnnotatedEventf",
append([]interface{}{object, annotations, eventtype, reason, messageFmt}, args...)...)}
}
func (_c *mockEventRecorder_AnnotatedEventf_Call) Run(run func(object runtime.Object, annotations map[string]string, eventtype string, reason string, messageFmt string, args ...interface{})) *mockEventRecorder_AnnotatedEventf_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]interface{}, len(args)-5)
for i, a := range args[5:] {
if a != nil {
variadicArgs[i] = a.(interface{})
}
}
run(args[0].(runtime.Object), args[1].(map[string]string), args[2].(string), args[3].(string), args[4].(string), variadicArgs...)
})
return _c
}
func (_c *mockEventRecorder_AnnotatedEventf_Call) Return() *mockEventRecorder_AnnotatedEventf_Call {
_c.Call.Return()
return _c
}
func (_c *mockEventRecorder_AnnotatedEventf_Call) RunAndReturn(run func(runtime.Object, map[string]string, string, string, string, ...interface{})) *mockEventRecorder_AnnotatedEventf_Call {
_c.Call.Return(run)
return _c
}
// Event provides a mock function with given fields: object, eventtype, reason, message
func (_m *mockEventRecorder) Event(object runtime.Object, eventtype string, reason string, message string) {
_m.Called(object, eventtype, reason, message)
}
// mockEventRecorder_Event_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Event'
type mockEventRecorder_Event_Call struct {
*mock.Call
}
// Event is a helper method to define mock.On call
// - object runtime.Object
// - eventtype string
// - reason string
// - message string
func (_e *mockEventRecorder_Expecter) Event(object interface{}, eventtype interface{}, reason interface{}, message interface{}) *mockEventRecorder_Event_Call {
return &mockEventRecorder_Event_Call{Call: _e.mock.On("Event", object, eventtype, reason, message)}
}
func (_c *mockEventRecorder_Event_Call) Run(run func(object runtime.Object, eventtype string, reason string, message string)) *mockEventRecorder_Event_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(runtime.Object), args[1].(string), args[2].(string), args[3].(string))
})
return _c
}
func (_c *mockEventRecorder_Event_Call) Return() *mockEventRecorder_Event_Call {
_c.Call.Return()
return _c
}
func (_c *mockEventRecorder_Event_Call) RunAndReturn(run func(runtime.Object, string, string, string)) *mockEventRecorder_Event_Call {
_c.Call.Return(run)
return _c
}
// Eventf provides a mock function with given fields: object, eventtype, reason, messageFmt, args
func (_m *mockEventRecorder) Eventf(object runtime.Object, eventtype string, reason string, messageFmt string, args ...interface{}) {
var _ca []interface{}
_ca = append(_ca, object, eventtype, reason, messageFmt)
_ca = append(_ca, args...)
_m.Called(_ca...)
}
// mockEventRecorder_Eventf_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Eventf'
type mockEventRecorder_Eventf_Call struct {
*mock.Call
}
// Eventf is a helper method to define mock.On call
// - object runtime.Object
// - eventtype string
// - reason string
// - messageFmt string
// - args ...interface{}
func (_e *mockEventRecorder_Expecter) Eventf(object interface{}, eventtype interface{}, reason interface{}, messageFmt interface{}, args ...interface{}) *mockEventRecorder_Eventf_Call {
return &mockEventRecorder_Eventf_Call{Call: _e.mock.On("Eventf",
append([]interface{}{object, eventtype, reason, messageFmt}, args...)...)}
}
func (_c *mockEventRecorder_Eventf_Call) Run(run func(object runtime.Object, eventtype string, reason string, messageFmt string, args ...interface{})) *mockEventRecorder_Eventf_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]interface{}, len(args)-4)
for i, a := range args[4:] {
if a != nil {
variadicArgs[i] = a.(interface{})
}
}
run(args[0].(runtime.Object), args[1].(string), args[2].(string), args[3].(string), variadicArgs...)
})
return _c
}
func (_c *mockEventRecorder_Eventf_Call) Return() *mockEventRecorder_Eventf_Call {
_c.Call.Return()
return _c
}
func (_c *mockEventRecorder_Eventf_Call) RunAndReturn(run func(runtime.Object, string, string, string, ...interface{})) *mockEventRecorder_Eventf_Call {
_c.Call.Return(run)
return _c
}
type mockConstructorTestingTnewMockEventRecorder interface {
mock.TestingT
Cleanup(func())
}
// newMockEventRecorder creates a new instance of mockEventRecorder. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func newMockEventRecorder(t mockConstructorTestingTnewMockEventRecorder) *mockEventRecorder {
mock := &mockEventRecorder{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}