Skip to content

Commit d571b4c

Browse files
committed
add default queue to internal test
Signed-off-by: Troy Connor <[email protected]>
1 parent 3086f3d commit d571b4c

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

pkg/internal/source/internal_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ var _ = Describe("Internal", func() {
7676
set = true
7777
},
7878
}
79-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, funcs, nil)
79+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, funcs, nil)
8080
})
8181

8282
Describe("EventHandler", func() {
@@ -101,38 +101,38 @@ var _ = Describe("Internal", func() {
101101
})
102102

103103
It("should used Predicates to filter CreateEvents", func() {
104-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
104+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
105105
predicate.Funcs{CreateFunc: func(event.CreateEvent) bool { return false }},
106106
})
107107
set = false
108108
instance.OnAdd(pod)
109109
Expect(set).To(BeFalse())
110110

111111
set = false
112-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
112+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
113113
predicate.Funcs{CreateFunc: func(event.CreateEvent) bool { return true }},
114114
})
115115
instance.OnAdd(pod)
116116
Expect(set).To(BeTrue())
117117

118118
set = false
119-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
119+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
120120
predicate.Funcs{CreateFunc: func(event.CreateEvent) bool { return true }},
121121
predicate.Funcs{CreateFunc: func(event.CreateEvent) bool { return false }},
122122
})
123123
instance.OnAdd(pod)
124124
Expect(set).To(BeFalse())
125125

126126
set = false
127-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
127+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
128128
predicate.Funcs{CreateFunc: func(event.CreateEvent) bool { return false }},
129129
predicate.Funcs{CreateFunc: func(event.CreateEvent) bool { return true }},
130130
})
131131
instance.OnAdd(pod)
132132
Expect(set).To(BeFalse())
133133

134134
set = false
135-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
135+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
136136
predicate.Funcs{CreateFunc: func(event.CreateEvent) bool { return true }},
137137
predicate.Funcs{CreateFunc: func(event.CreateEvent) bool { return true }},
138138
})
@@ -159,37 +159,37 @@ var _ = Describe("Internal", func() {
159159

160160
It("should used Predicates to filter UpdateEvents", func() {
161161
set = false
162-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
162+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
163163
predicate.Funcs{UpdateFunc: func(updateEvent event.UpdateEvent) bool { return false }},
164164
})
165165
instance.OnUpdate(pod, newPod)
166166
Expect(set).To(BeFalse())
167167

168168
set = false
169-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
169+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
170170
predicate.Funcs{UpdateFunc: func(event.UpdateEvent) bool { return true }},
171171
})
172172
instance.OnUpdate(pod, newPod)
173173
Expect(set).To(BeTrue())
174174

175175
set = false
176-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
176+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
177177
predicate.Funcs{UpdateFunc: func(event.UpdateEvent) bool { return true }},
178178
predicate.Funcs{UpdateFunc: func(event.UpdateEvent) bool { return false }},
179179
})
180180
instance.OnUpdate(pod, newPod)
181181
Expect(set).To(BeFalse())
182182

183183
set = false
184-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
184+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
185185
predicate.Funcs{UpdateFunc: func(event.UpdateEvent) bool { return false }},
186186
predicate.Funcs{UpdateFunc: func(event.UpdateEvent) bool { return true }},
187187
})
188188
instance.OnUpdate(pod, newPod)
189189
Expect(set).To(BeFalse())
190190

191191
set = false
192-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
192+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
193193
predicate.Funcs{CreateFunc: func(event.CreateEvent) bool { return true }},
194194
predicate.Funcs{CreateFunc: func(event.CreateEvent) bool { return true }},
195195
})
@@ -217,37 +217,37 @@ var _ = Describe("Internal", func() {
217217

218218
It("should used Predicates to filter DeleteEvents", func() {
219219
set = false
220-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
220+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
221221
predicate.Funcs{DeleteFunc: func(event.DeleteEvent) bool { return false }},
222222
})
223223
instance.OnDelete(pod)
224224
Expect(set).To(BeFalse())
225225

226226
set = false
227-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
227+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
228228
predicate.Funcs{DeleteFunc: func(event.DeleteEvent) bool { return true }},
229229
})
230230
instance.OnDelete(pod)
231231
Expect(set).To(BeTrue())
232232

233233
set = false
234-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
234+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
235235
predicate.Funcs{DeleteFunc: func(event.DeleteEvent) bool { return true }},
236236
predicate.Funcs{DeleteFunc: func(event.DeleteEvent) bool { return false }},
237237
})
238238
instance.OnDelete(pod)
239239
Expect(set).To(BeFalse())
240240

241241
set = false
242-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
242+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
243243
predicate.Funcs{DeleteFunc: func(event.DeleteEvent) bool { return false }},
244244
predicate.Funcs{DeleteFunc: func(event.DeleteEvent) bool { return true }},
245245
})
246246
instance.OnDelete(pod)
247247
Expect(set).To(BeFalse())
248248

249249
set = false
250-
instance = internal.NewEventHandler(ctx, &controllertest.Queue{}, setfuncs, []predicate.Predicate{
250+
instance = internal.NewEventHandler(ctx, &controllertest.Queue{TypedInterface: workqueue.NewTyped[reconcile.Request]()}, setfuncs, []predicate.Predicate{
251251
predicate.Funcs{DeleteFunc: func(event.DeleteEvent) bool { return true }},
252252
predicate.Funcs{DeleteFunc: func(event.DeleteEvent) bool { return true }},
253253
})

0 commit comments

Comments
 (0)