@@ -198,6 +198,21 @@ var _ = Describe("bindingController", func() {
198198 })
199199 })
200200 })
201+
202+ Context ("finalizer" , func () {
203+ BeforeEach (func () {
204+ bindingName = "finalizer-test"
205+ })
206+
207+ It ("sets the correct deletion finalizer to the object" , func () {
208+ Expect (client .Create (ctx , & binding )).To (Succeed ())
209+ Eventually (func () []string {
210+ var fetched topology.Binding
211+ Expect (client .Get (ctx , types.NamespacedName {Name : binding .Name , Namespace : binding .Namespace }, & fetched )).To (Succeed ())
212+ return fetched .ObjectMeta .Finalizers
213+ }, 5 ).Should (ConsistOf ("deletion.finalizers.bindings.rabbitmq.com" ))
214+ })
215+ })
201216 })
202217
203218 When ("a binding references a cluster from a prohibited namespace" , func () {
@@ -235,21 +250,6 @@ var _ = Describe("bindingController", func() {
235250 })
236251 })
237252
238- Context ("finalizer" , func () {
239- BeforeEach (func () {
240- bindingName = "finalizer-test"
241- })
242-
243- It ("sets the correct deletion finalizer to the object" , func () {
244- Expect (client .Create (ctx , & binding )).To (Succeed ())
245- Eventually (func () []string {
246- var fetched topology.Binding
247- Expect (client .Get (ctx , types.NamespacedName {Name : binding .Name , Namespace : binding .Namespace }, & fetched )).To (Succeed ())
248- return fetched .ObjectMeta .Finalizers
249- }, 5 ).Should (ConsistOf ("deletion.finalizers.bindings.rabbitmq.com" ))
250- })
251- })
252-
253253 When ("a binding references a cluster from an allowed namespace" , func () {
254254 JustBeforeEach (func () {
255255 bindingName = "test-binding-allowed"
0 commit comments