testutils

package
v0.0.0-...-2ae3120 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MockCNSIGUID        = "some-guid-1234"
	MockCNSIName        = "mockCF"
	MockCFGUID          = "some-cf-guid-1234"
	MockCFName          = "Some fancy CF Cluster"
	MockHCEGUID         = "some-hce-guid-1234"
	MockHCEName         = "Some fancy HCE Cluster"
	MockAPIEndpoint     = "https://api.127.0.0.1"
	MockAuthEndpoint    = "https://login.127.0.0.1"
	MockDopplerEndpoint = "https://doppler.127.0.0.1"
	MockClientId        = "stratos_clientid"
	MockClientSecret    = "stratos_secret"
	MockAccount         = "asd-gjfg-bob"
	MockTokenGUID       = "mock-token-guid"
	MockUAAToken        = `` /* 3260-byte string literal not displayed */
	MockTokenExpiry     = time.Now().AddDate(0, 0, 1).Unix()
	MockAdminGUID       = tokens.SystemSharedUserGuid

	MockEncryptionKey = make([]byte, 32)

	MockCipherClientSecret = make([]byte, 0)
)

Functions

func ExpectNoRows

func ExpectNoRows() *sqlmock.Rows

func ExpectOneRow

func ExpectOneRow() *sqlmock.Rows

func GetCNSIRows

func GetCNSIRows(records ...*api.CNSIRecord) *sqlmock.Rows

Gets a prefilled sqlmock.Rows with all the columns of the cnsis table. It contains entries corresponding to the records passed in

func GetConnectedEndpointsRows

func GetConnectedEndpointsRows(records ...*api.ConnectedEndpoint) *sqlmock.Rows

Gets a prefilled sqlmock.Rows with all the columns of the cnsis + tokens (connected endpoints) table. It contains entries corresponding to the records passed in

func GetEmptyCNSIRows

func GetEmptyCNSIRows(exclude ...string) *sqlmock.Rows

Gets an empty sqlmock.Rows with all the columns of the cnsis table, except the ones passed as exclude

func GetEmptyConnectedEndpointsRows

func GetEmptyConnectedEndpointsRows(exclude ...string) *sqlmock.Rows

Gets an empty sqlmock.Rows with all the columns of the cnsis + token (connected endpoints) table, except the ones passed as exclude

func GetEmptyTokenRows

func GetEmptyTokenRows(exclude ...string) *sqlmock.Rows

func GetTestCNSIRecord

func GetTestCNSIRecord() *api.CNSIRecord

Gets the default CNSI Record for testing

func GetTestConnectedEndpoint

func GetTestConnectedEndpoint() *api.ConnectedEndpoint

Gets the default Connected Enpoint Record for testing

func GetTokenRows

func GetTokenRows(encriptionKey []byte) *sqlmock.Rows

func GetTokenRowsWithExpiredToken

func GetTokenRowsWithExpiredToken(encriptionKey []byte) *sqlmock.Rows

Types

This section is empty.

Jump to

Keyboard shortcuts

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