github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/api/cloudcontroller/ccerror/service_offering_name_ambiguity_error_test.go (about)

     1  package ccerror_test
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/api/cloudcontroller/ccerror"
     5  	. "github.com/onsi/ginkgo"
     6  	. "github.com/onsi/gomega"
     7  )
     8  
     9  var _ = Describe("ServiceOfferingNameAmbiguityError", func() {
    10  	It("returns the right error message", func() {
    11  		err := ccerror.ServiceOfferingNameAmbiguityError{
    12  			ServiceOfferingName: "some-service-name",
    13  		}
    14  		Expect(err.Error()).To(Equal("Service 'some-service-name' is provided by multiple service brokers."))
    15  	})
    16  
    17  	When("service broker names are specified", func() {
    18  		It("returns the right error message", func() {
    19  			err := ccerror.ServiceOfferingNameAmbiguityError{
    20  				ServiceOfferingName: "some-service-name",
    21  				ServiceBrokerNames:  []string{"a-service-broker", "another-service-broker"},
    22  			}
    23  			Expect(err.Error()).To(Equal("Service 'some-service-name' is provided by multiple service brokers: a-service-broker, another-service-broker"))
    24  		})
    25  	})
    26  })