Documentation ¶
Overview ¶
fakeservicebroker is a test helper for service broker tests. It can push an App that acts as a service broker, and as an optimisation, it will reuse the same App so that multiple pushes aren't necessary. This saves significant time when running tests.
To make use of this optimisation, set 'KEEP_FAKE_SERVICE_BROKERS' to 'true'
Index ¶
- func Cleanup()
- func Setup()
- type FakeServiceBroker
- func (f *FakeServiceBroker) Configure() *FakeServiceBroker
- func (f *FakeServiceBroker) Destroy()
- func (f *FakeServiceBroker) EnableServiceAccess() *FakeServiceBroker
- func (f *FakeServiceBroker) EnsureAppIsDeployed() *FakeServiceBroker
- func (f *FakeServiceBroker) EnsureBrokerIsAvailable() *FakeServiceBroker
- func (f *FakeServiceBroker) EnsureRegisteredViaV2() *FakeServiceBroker
- func (f *FakeServiceBroker) Name() string
- func (f *FakeServiceBroker) Password() string
- func (f *FakeServiceBroker) ServiceDescription() string
- func (f *FakeServiceBroker) ServiceName() string
- func (f *FakeServiceBroker) ServicePlanDescription() string
- func (f *FakeServiceBroker) ServicePlanName() string
- func (f *FakeServiceBroker) URL(paths ...string) string
- func (f *FakeServiceBroker) Update() *FakeServiceBroker
- func (f *FakeServiceBroker) Username() string
- func (f *FakeServiceBroker) WithAsyncBehaviour() *FakeServiceBroker
- func (f *FakeServiceBroker) WithCatalogStatus(statusCode int) *FakeServiceBroker
- func (f *FakeServiceBroker) WithName(name string) *FakeServiceBroker
- func (f *FakeServiceBroker) WithSpaceScoped() *FakeServiceBroker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FakeServiceBroker ¶
type FakeServiceBroker struct { Services []service // contains filtered or unexported fields }
func NewAlternate ¶
func NewAlternate() *FakeServiceBroker
NewAlternate returns a reusable broker with another name. Can be used in conjunction with New() if you need two brokers in the same test.
func (*FakeServiceBroker) Configure ¶
func (f *FakeServiceBroker) Configure() *FakeServiceBroker
Configure updates the config of a fake service broker app
func (*FakeServiceBroker) Destroy ¶
func (f *FakeServiceBroker) Destroy()
Destroy always deletes the broker and app, meaning it can't be reused. In general you should not destroy brokers as it makes tests slower.
func (*FakeServiceBroker) EnableServiceAccess ¶
func (f *FakeServiceBroker) EnableServiceAccess() *FakeServiceBroker
EnableServiceAccess enables access to all service offerings in all orgs for this service broker
func (*FakeServiceBroker) EnsureAppIsDeployed ¶
func (f *FakeServiceBroker) EnsureAppIsDeployed() *FakeServiceBroker
EnsureAppIsDeployed makes the fake service broker app available and does not run 'cf create-service-broker'
func (*FakeServiceBroker) EnsureBrokerIsAvailable ¶
func (f *FakeServiceBroker) EnsureBrokerIsAvailable() *FakeServiceBroker
EnsureBrokerIsAvailable makes the service broker app available and runs 'cf create-service-broker'
func (*FakeServiceBroker) EnsureRegisteredViaV2 ¶
func (f *FakeServiceBroker) EnsureRegisteredViaV2() *FakeServiceBroker
EnsureRegisteredViaV2 uses POST /v2/service_brokers to register the broker. Used to test what happens with old brokers when switching to V7/V3
func (*FakeServiceBroker) Name ¶
func (f *FakeServiceBroker) Name() string
func (*FakeServiceBroker) Password ¶
func (f *FakeServiceBroker) Password() string
func (*FakeServiceBroker) ServiceDescription ¶
func (f *FakeServiceBroker) ServiceDescription() string
func (*FakeServiceBroker) ServiceName ¶
func (f *FakeServiceBroker) ServiceName() string
func (*FakeServiceBroker) ServicePlanDescription ¶
func (f *FakeServiceBroker) ServicePlanDescription() string
func (*FakeServiceBroker) ServicePlanName ¶
func (f *FakeServiceBroker) ServicePlanName() string
func (*FakeServiceBroker) URL ¶
func (f *FakeServiceBroker) URL(paths ...string) string
func (*FakeServiceBroker) Update ¶
func (f *FakeServiceBroker) Update() *FakeServiceBroker
Update updates the config of a fake service broker app and kicks off catalog synchronization
func (*FakeServiceBroker) Username ¶
func (f *FakeServiceBroker) Username() string
func (*FakeServiceBroker) WithAsyncBehaviour ¶
func (f *FakeServiceBroker) WithAsyncBehaviour() *FakeServiceBroker
WithAsyncBehaviour makes service instance and binding operations async on the broker side
func (*FakeServiceBroker) WithCatalogStatus ¶
func (f *FakeServiceBroker) WithCatalogStatus(statusCode int) *FakeServiceBroker
func (*FakeServiceBroker) WithName ¶
func (f *FakeServiceBroker) WithName(name string) *FakeServiceBroker
WithName has the side-effect that the broker is not reusable
func (*FakeServiceBroker) WithSpaceScoped ¶
func (f *FakeServiceBroker) WithSpaceScoped() *FakeServiceBroker