services, err := serviceBuilder.GetServicesForBroker("my-service-broker-guid1") Expect(err).NotTo(HaveOccurred()) service := services[0] Expect(service.Label).To(Equal("my-service1")) Expect(len(service.Plans)).To(Equal(2)) Expect(service.Plans[0].Name).To(Equal("service-plan1")) Expect(service.Plans[1].Name).To(Equal("service-plan2")) Expect(service.Plans[0].OrgNames).To(Equal([]string{"org1", "org2"})) }) }) Describe(".GetServicesForManyBrokers", func() { It("returns all the services for an array of broker guids, fully populated", func() { brokerGuids := []string{"my-service-broker-guid1", "my-service-broker-guid2"} services, err := serviceBuilder.GetServicesForManyBrokers(brokerGuids) Expect(err).NotTo(HaveOccurred()) Expect(services).To(HaveLen(2)) broker_service := services[0] Expect(broker_service.Label).To(Equal("my-service1")) Expect(len(broker_service.Plans)).To(Equal(2)) Expect(broker_service.Plans[0].Name).To(Equal("service-plan1")) Expect(broker_service.Plans[1].Name).To(Equal("service-plan2")) Expect(broker_service.Plans[0].OrgNames).To(Equal([]string{"org1", "org2"})) broker_service2 := services[1] Expect(broker_service2.Label).To(Equal("my-service2")) Expect(len(broker_service2.Plans)).To(Equal(1)) Expect(broker_service2.Plans[0].Name).To(Equal("service-plan3"))