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()
- func (f *FakeServiceBroker) EnsureAppIsDeployed() *FakeServiceBroker
- func (f *FakeServiceBroker) EnsureBrokerIsAvailable() *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
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
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()
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) 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
func (*FakeServiceBroker) Username ¶
func (f *FakeServiceBroker) Username() string
func (*FakeServiceBroker) WithAsyncBehaviour ¶
func (f *FakeServiceBroker) WithAsyncBehaviour() *FakeServiceBroker
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