tests/catalog: remove assumption regarding ordering in list
The order of traffic policy objects cannot be assumed, compare
presence of element in list instead along with checking the
length of the list.
Resolves
@@ -33,8 +33,9 @@ var _ = Describe("Catalog tests", func() {
actual, err := mc.ListTrafficPolicies(tests.BookbuyerService)
Expect(err).ToNot(HaveOccurred())
- expected := []trafficpolicy.TrafficTarget{tests.BookstoreTrafficPolicy, tests.BookstoreApexTrafficPolicy}
- Expect(actual).To(Equal(expected))
+ Expect(len(actual)).To(Equal(2)) // bookstore and bookstore-apex traffic policies
+ Expect(tests.BookstoreTrafficPolicy).To(BeElementOf(actual))
+ Expect(tests.BookstoreApexTrafficPolicy).To(BeElementOf(actual))
})
})
