Back to

Package fakeservicebroker

Latest Go to latest

The highest tagged major version is .

Published: Apr 7, 2020 | License: Apache-2.0 | Module:


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'


func Cleanup

func Cleanup()

Cleanup should be run in a SynchronizedAfterSuite() to clean up the reusable broker apps

func Setup

func Setup()

Setup should be run in a SynchronisedBeforeSuite() to create the org and space, otherwise the tests become flaky.

type FakeServiceBroker

type FakeServiceBroker struct {
	Services []service
	// contains filtered or unexported fields

func New

func New() *FakeServiceBroker

New creates a default object that can then be configured

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier