testdoubles

package
v0.0.0-...-bf90f01 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClusterMapping = SingleClusterMapping("http://api.cluster1/", "clusterUser", defaultClusterToken.Raw)
View Source
var DefaultUserInfo = UserInfo{
	OsUsername:  "developer",
	OsUserToken: "HMs8laMmBSsJi8hpMDOtiglbXJ-2eyymE1X46ax5wX8",
	NsBaseName:  "developer",
}

Functions

func AllDefaultObjects

func AllDefaultObjects(t *testing.T, config *configuration.Data) environment.Objects

func CountObjectsThat

func CountObjectsThat(objects environment.Objects, is func(map[interface{}]interface{}) bool) int

func CreateAndMockUser

func CreateAndMockUser(t *testing.T, sub string, internal, persist bool) context.Context

func CreateAndMockUserAndToken

func CreateAndMockUserAndToken(t *testing.T, sub string, internal bool) context.Context

func CreateAndMockUserAndTokenPersisted

func CreateAndMockUserAndTokenPersisted(t *testing.T, sub string, internal bool) context.Context

func CreateAndMockUserWithUsername

func CreateAndMockUserWithUsername(t *testing.T, sub, username string, internal, persist bool) context.Context

func CreateAndMockUserWithUsernameAndTokenPersisted

func CreateAndMockUserWithUsernameAndTokenPersisted(t *testing.T, sub, username string, internal bool) context.Context

func ExpectedNumberOfCallsWhenClean

func ExpectedNumberOfCallsWhenClean(envTypes ...environment.Type) int

func ExpectedNumberOfCallsWhenPatch

func ExpectedNumberOfCallsWhenPatch(t *testing.T, config *configuration.Data, envTypes ...environment.Type) int

func ExpectedNumberOfCallsWhenPost

func ExpectedNumberOfCallsWhenPost(t *testing.T, config *configuration.Data) int

func GetMappedVersions

func GetMappedVersions(envTypes ...environment.Type) map[environment.Type]string

func MockCleanRequestsToOS

func MockCleanRequestsToOS(calls *int, cluster string)

func MockCommunicationWithAuth

func MockCommunicationWithAuth(cluster string, otherClusters ...string)

func MockCommunicationWithAuthSettingCapacityFlag

func MockCommunicationWithAuthSettingCapacityFlag(cluster string, capacityExhausted, persist bool, otherClusters ...string)

func MockPatchRequestsToOS

func MockPatchRequestsToOS(calls *int, cluster string)

func MockPostRequestsToOS

func MockPostRequestsToOS(calls *int, cluster string, envs []environment.Type, nsBaseName string)

func MockRemoveRequestsToOS

func MockRemoveRequestsToOS(calls *int, cluster string)

func NewAuthService

func NewAuthService(t *testing.T, cassetteFile, authURL, saToken string, options ...recorder.Option) (auth.Service, func())

func NewAuthServiceWithRecorder

func NewAuthServiceWithRecorder(t *testing.T, cassetteFile, authURL, saToken string, options ...recorder.Option) (auth.Service, *vcrrecorder.Recorder, func())

func NewOSService

func NewOSService(config *configuration.Data, modifier UserModifier, repository tenant.Repository) *openshift.ServiceBuilder

func NewUserDataWithTenantConfig

func NewUserDataWithTenantConfig(templatesRepo, templatesRepoBlob, templatesRepoDir string) *authclient.UserDataAttributes

func NumberOfGetChecks

func NumberOfGetChecks(objects environment.Objects) int

func NumberOfObjectsToRemove

func NumberOfObjectsToRemove(objects environment.Objects) int

func PrepareConfigClusterAndAuthService

func PrepareConfigClusterAndAuthService(t *testing.T) (cluster.Service, auth.Service, *configuration.Data, func())

func PrepareConfigClusterAndAuthServiceWithRefreshInt

func PrepareConfigClusterAndAuthServiceWithRefreshInt(refreshInt time.Duration, t *testing.T) (cluster.Service, auth.Service, *configuration.Data, func())

func RetrieveObjects

func RetrieveObjects(t *testing.T, config *configuration.Data, clusterMapping cluster.ForType, userInfo UserInfo, envTypes ...environment.Type) environment.Objects

func SetTemplateSameVersion

func SetTemplateSameVersion(version string)

func SetTemplateVersions

func SetTemplateVersions()

func SingleClusterMapping

func SingleClusterMapping(url, user, token string) cluster.ForType

func SingleTemplatesObjects

func SingleTemplatesObjects(t *testing.T, config *configuration.Data, envType environment.Type, clusterMapping cluster.ForType, userInfo UserInfo) environment.Objects

func SingleTemplatesObjectsWithDefaults

func SingleTemplatesObjectsWithDefaults(t *testing.T, config *configuration.Data, envType environment.Type) environment.Objects

Types

type UserInfo

type UserInfo struct {
	OsUsername  string
	OsUserToken string
	NsBaseName  string
}

type UserModifier

type UserModifier func(user *auth.User)

func AddUser

func AddUser(osUsername string) UserModifier

func (UserModifier) NewUserInfo

func (m UserModifier) NewUserInfo(nsBaseName string) UserInfo

func (UserModifier) WithData

func (UserModifier) WithToken

func (m UserModifier) WithToken(osUserToken string) UserModifier

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL