Documentation ¶
Index ¶
- Constants
- func Closer(s string) io.ReadCloser
- func DoHTTP(reaction *HTTPReaction, checks *HTTPExpectations) func(*http.Request) (*http.Response, error)
- func ExtractResourceIDs(entities []Object) []string
- func GenerateFreeTestPlan() string
- func GeneratePaidTestPlan() string
- func GenerateRandomNotification() *types.Notification
- func GenerateTestPlan() string
- func GenerateTestPlanFromTemplate(planTemplate string) string
- func GenerateTestServiceWithPlans(plans ...string) string
- func JSONToMap(j string) map[string]interface{}
- func MapContains(actual Object, expected Object)
- func MergeObjects(target, source Object)
- func Print(message string, args ...interface{})
- func RegisterPlatformInSM(platformJSON Object, SM *httpexpect.Expect, headers map[string]string) *types.Platform
- func RemoveAllBrokers(SM *httpexpect.Expect)
- func RemoveAllPlatforms(SM *httpexpect.Expect)
- func RemoveAllVisibilities(SM *httpexpect.Expect)
- func SetNotificationsCleanerSettings(set *pflag.FlagSet)
- func SetResponse(rw http.ResponseWriter, status int, message interface{})
- func SetTestFileLocation(set *pflag.FlagSet)
- func TestEnv(additionalFlagFuncs ...func(set *pflag.FlagSet)) env.Environment
- type Array
- type BrokerServer
- type FakeServer
- type FlagValue
- type HTTPExpectations
- type HTTPReaction
- type NopCloser
- type OAuthServer
- type Object
- func CopyObject(obj Object) Object
- func GenerateRandomBroker() Object
- func GenerateRandomPlatform() Object
- func MakePlatform(id string, name string, atype string, description string) Object
- func RegisterBrokerInSM(brokerJSON Object, SM *httpexpect.Expect, headers map[string]string) Object
- func RemoveNonJSONArgs(obj Object) Object
- func RemoveNonNumericArgs(obj Object) Object
- func RemoveNotNullableFieldAndLabels(obj Object, objithMandatoryFields Object) Object
- func RemoveNumericArgs(obj Object) Object
- type SBCatalog
- type TestContext
- func (ctx *TestContext) Cleanup()
- func (ctx *TestContext) CleanupAdditionalResources()
- func (ctx *TestContext) CleanupBroker(id string)
- func (ctx *TestContext) RegisterBroker() (string, Object, *BrokerServer)
- func (ctx *TestContext) RegisterBrokerWithCatalog(catalog SBCatalog) (string, Object, *BrokerServer)
- func (ctx *TestContext) RegisterBrokerWithCatalogAndLabels(catalog SBCatalog, brokerData Object) (string, Object, *BrokerServer)
- func (ctx *TestContext) RegisterPlatform() *types.Platform
- type TestContextBuilder
- func (tcb *TestContextBuilder) Build() *TestContext
- func (tcb *TestContextBuilder) SkipBasicAuthClientSetup(shouldSkip bool) *TestContextBuilder
- func (tcb *TestContextBuilder) WithAdditionalFakeServers(additionalFakeServers map[string]FakeServer) *TestContextBuilder
- func (tcb *TestContextBuilder) WithDefaultEnv(envCreateFunc func(f ...func(set *pflag.FlagSet)) env.Environment) *TestContextBuilder
- func (tcb *TestContextBuilder) WithDefaultTokenClaims(defaultTokenClaims map[string]interface{}) *TestContextBuilder
- func (tcb *TestContextBuilder) WithEnvPostExtensions(fs ...func(e env.Environment, servers map[string]FakeServer)) *TestContextBuilder
- func (tcb *TestContextBuilder) WithEnvPreExtensions(fs ...func(set *pflag.FlagSet)) *TestContextBuilder
- func (tcb *TestContextBuilder) WithSMExtensions(...) *TestContextBuilder
Constants ¶
View Source
const BrokerServerPrefix = "broker-"
View Source
const OauthServer = "oauth-server"
View Source
const SMServer = "sm-server"
Variables ¶
This section is empty.
Functions ¶
func Closer ¶
func Closer(s string) io.ReadCloser
func DoHTTP ¶
func DoHTTP(reaction *HTTPReaction, checks *HTTPExpectations) func(*http.Request) (*http.Response, error)
func ExtractResourceIDs ¶ added in v0.1.8
func GenerateFreeTestPlan ¶ added in v0.1.8
func GenerateFreeTestPlan() string
func GeneratePaidTestPlan ¶ added in v0.1.8
func GeneratePaidTestPlan() string
func GenerateRandomNotification ¶ added in v0.3.0
func GenerateRandomNotification() *types.Notification
func GenerateTestPlan ¶ added in v0.1.8
func GenerateTestPlan() string
func GenerateTestPlanFromTemplate ¶ added in v0.1.8
func GenerateTestServiceWithPlans ¶ added in v0.1.8
func MapContains ¶
func MergeObjects ¶ added in v0.1.11
func MergeObjects(target, source Object)
func RegisterPlatformInSM ¶ added in v0.1.2
func RemoveAllBrokers ¶
func RemoveAllBrokers(SM *httpexpect.Expect)
func RemoveAllPlatforms ¶
func RemoveAllPlatforms(SM *httpexpect.Expect)
func RemoveAllVisibilities ¶ added in v0.1.6
func RemoveAllVisibilities(SM *httpexpect.Expect)
func SetNotificationsCleanerSettings ¶ added in v0.3.0
func SetResponse ¶ added in v0.1.2
func SetResponse(rw http.ResponseWriter, status int, message interface{})
func SetTestFileLocation ¶ added in v0.1.2
Types ¶
type BrokerServer ¶ added in v0.1.2
type BrokerServer struct { *httptest.Server CatalogHandler http.HandlerFunc // /v2/catalog ServiceInstanceHandler http.HandlerFunc // /v2/service_instances/{instance_id} ServiceInstanceLastOpHandler http.HandlerFunc // /v2/service_instances/{instance_id}/last_operation BindingHandler http.HandlerFunc // /v2/service_instances/{instance_id}/service_bindings/{binding_id} BindingLastOpHandler http.HandlerFunc // /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation BindingAdaptCredentialsHandler http.HandlerFunc // /v2/service_instances/{instance_id}/service_bindings/{binding_id}/adapt_credentials Username, Password string Catalog SBCatalog LastRequestBody []byte LastRequest *http.Request CatalogEndpointRequests []*http.Request ServiceInstanceEndpointRequests []*http.Request ServiceInstanceLastOpEndpointRequests []*http.Request BindingEndpointRequests []*http.Request BindingLastOpEndpointRequests []*http.Request BindingAdaptCredentialsEndpointRequests []*http.Request // contains filtered or unexported fields }
func NewBrokerServer ¶ added in v0.1.2
func NewBrokerServer() *BrokerServer
func NewBrokerServerWithCatalog ¶ added in v0.1.6
func NewBrokerServerWithCatalog(catalog SBCatalog) *BrokerServer
func (*BrokerServer) Reset ¶ added in v0.1.2
func (b *BrokerServer) Reset()
func (*BrokerServer) ResetCallHistory ¶ added in v0.1.2
func (b *BrokerServer) ResetCallHistory()
func (*BrokerServer) ResetHandlers ¶ added in v0.1.2
func (b *BrokerServer) ResetHandlers()
func (*BrokerServer) ResetProperties ¶ added in v0.1.2
func (b *BrokerServer) ResetProperties()
func (*BrokerServer) URL ¶ added in v0.1.9
func (b *BrokerServer) URL() string
type FakeServer ¶ added in v0.1.9
type FakeServer interface {
// contains filtered or unexported methods
}
type FlagValue ¶ added in v0.1.2
type FlagValue struct {
// contains filtered or unexported fields
}
type HTTPExpectations ¶
type HTTPReaction ¶
type OAuthServer ¶
type OAuthServer struct { BaseURL string // contains filtered or unexported fields }
func NewOAuthServer ¶
func NewOAuthServer() *OAuthServer
func (*OAuthServer) Close ¶
func (os *OAuthServer) Close()
func (*OAuthServer) CreateToken ¶
func (os *OAuthServer) CreateToken(payload map[string]interface{}) string
func (*OAuthServer) Start ¶
func (os *OAuthServer) Start()
func (*OAuthServer) URL ¶
func (os *OAuthServer) URL() string
type Object ¶
type Object = map[string]interface{}
func CopyObject ¶ added in v0.1.8
func GenerateRandomBroker ¶ added in v0.1.8
func GenerateRandomBroker() Object
func GenerateRandomPlatform ¶ added in v0.1.8
func GenerateRandomPlatform() Object
func MakePlatform ¶
func RegisterBrokerInSM ¶ added in v0.1.2
func RemoveNonJSONArgs ¶ added in v0.1.8
func RemoveNonNumericArgs ¶ added in v0.1.8
func RemoveNotNullableFieldAndLabels ¶ added in v0.1.8
func RemoveNumericArgs ¶ added in v0.1.8
type SBCatalog ¶ added in v0.1.8
type SBCatalog string
func NewEmptySBCatalog ¶ added in v0.1.8
func NewEmptySBCatalog() SBCatalog
NewEmptySBCatalog returns an empty service broker catalog tha contains no services and no plans
func NewRandomSBCatalog ¶ added in v0.1.8
func NewRandomSBCatalog() SBCatalog
NewRandomSBCatalog returns a service broker catalog containg one random service with one free and one paid random plans
func (*SBCatalog) AddPlanToService ¶ added in v0.1.8
func (*SBCatalog) AddService ¶ added in v0.1.8
func (*SBCatalog) RemovePlan ¶ added in v0.1.8
type TestContext ¶
type TestContext struct { SM *httpexpect.Expect SMWithOAuth *httpexpect.Expect SMWithBasic *httpexpect.Expect SMRepository storage.Repository TestPlatform *types.Platform Servers map[string]FakeServer // contains filtered or unexported fields }
func DefaultTestContext ¶ added in v0.1.9
func DefaultTestContext() *TestContext
DefaultTestContext sets up a test context with default values
func (*TestContext) Cleanup ¶
func (ctx *TestContext) Cleanup()
func (*TestContext) CleanupAdditionalResources ¶ added in v0.1.8
func (ctx *TestContext) CleanupAdditionalResources()
func (*TestContext) CleanupBroker ¶
func (ctx *TestContext) CleanupBroker(id string)
func (*TestContext) RegisterBroker ¶
func (ctx *TestContext) RegisterBroker() (string, Object, *BrokerServer)
func (*TestContext) RegisterBrokerWithCatalog ¶ added in v0.1.6
func (ctx *TestContext) RegisterBrokerWithCatalog(catalog SBCatalog) (string, Object, *BrokerServer)
func (*TestContext) RegisterBrokerWithCatalogAndLabels ¶ added in v0.1.8
func (ctx *TestContext) RegisterBrokerWithCatalogAndLabels(catalog SBCatalog, brokerData Object) (string, Object, *BrokerServer)
func (*TestContext) RegisterPlatform ¶ added in v0.1.6
func (ctx *TestContext) RegisterPlatform() *types.Platform
type TestContextBuilder ¶ added in v0.1.9
type TestContextBuilder struct { Environment func(f ...func(set *pflag.FlagSet)) env.Environment Servers map[string]FakeServer // contains filtered or unexported fields }
func NewTestContextBuilder ¶ added in v0.1.9
func NewTestContextBuilder() *TestContextBuilder
NewTestContextBuilder sets up a builder with default values
func (*TestContextBuilder) Build ¶ added in v0.1.9
func (tcb *TestContextBuilder) Build() *TestContext
func (*TestContextBuilder) SkipBasicAuthClientSetup ¶ added in v0.1.9
func (tcb *TestContextBuilder) SkipBasicAuthClientSetup(shouldSkip bool) *TestContextBuilder
func (*TestContextBuilder) WithAdditionalFakeServers ¶ added in v0.1.9
func (tcb *TestContextBuilder) WithAdditionalFakeServers(additionalFakeServers map[string]FakeServer) *TestContextBuilder
func (*TestContextBuilder) WithDefaultEnv ¶ added in v0.1.9
func (tcb *TestContextBuilder) WithDefaultEnv(envCreateFunc func(f ...func(set *pflag.FlagSet)) env.Environment) *TestContextBuilder
func (*TestContextBuilder) WithDefaultTokenClaims ¶ added in v0.1.9
func (tcb *TestContextBuilder) WithDefaultTokenClaims(defaultTokenClaims map[string]interface{}) *TestContextBuilder
func (*TestContextBuilder) WithEnvPostExtensions ¶ added in v0.1.9
func (tcb *TestContextBuilder) WithEnvPostExtensions(fs ...func(e env.Environment, servers map[string]FakeServer)) *TestContextBuilder
func (*TestContextBuilder) WithEnvPreExtensions ¶ added in v0.1.9
func (tcb *TestContextBuilder) WithEnvPreExtensions(fs ...func(set *pflag.FlagSet)) *TestContextBuilder
func (*TestContextBuilder) WithSMExtensions ¶ added in v0.1.9
func (tcb *TestContextBuilder) WithSMExtensions(fs ...func(ctx context.Context, smb *sm.ServiceManagerBuilder, e env.Environment) error) *TestContextBuilder
Click to show internal directories.
Click to hide internal directories.