Documentation ¶
Overview ¶
This file was generated by counterfeiter
Index ¶
- Variables
- func CreateRandomValidTestName(name string) string
- func CreateTestIdentity(db *gorm.DB, username, providerType string) (account.Identity, error)
- func CreateTestIdentityForAccountIdentity(db *gorm.DB, identity *account.Identity) error
- func LoadTestData(filename string, provider TestDataProvider) ([]byte, error)
- func Run(b *testing.B, suite BenchingSuite)
- func ServiceAsSpaceUser(serviceName string, tm token.Manager, u account.Identity, ...) *goa.Service
- func ServiceAsUser(serviceName string, tm token.Manager, u account.Identity) *goa.Service
- func ServiceAsUserWithAuthz(serviceName string, tm token.Manager, key interface{}, u account.Identity, ...) *goa.Service
- func WithAuthz(ctx context.Context, key interface{}, ident account.Identity, ...) context.Context
- func WithIdentity(ctx context.Context, ident account.Identity) context.Context
- type AfterBenchmark
- type BeforeBenchmark
- type BenchingSuite
- type SetupAllSuite
- type SetupBenchmarkSuite
- type Suite
- type TearDownAllSuite
- type TearDownBenchmarkSuite
- type TestDataProvider
Constants ¶
This section is empty.
Variables ¶
var TestIdentity = account.Identity{ ID: uuid.NewV4(), Username: "TestDeveloper", User: TestUser, }
TestIdentity only creates in memory obj for testing purposes
var TestIdentity2 = account.Identity{ ID: uuid.NewV4(), Username: "TestDeveloper2", User: TestUser2, }
TestIdentity2 only creates in memory obj for testing purposes
var TestObserverIdentity = account.Identity{ ID: uuid.NewV4(), Username: "TestObserver", User: TestUser, }
TestObserverIdentity only creates in memory obj for testing purposes
var TestOversizedNameObj = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
var TestUser = account.User{ ID: uuid.NewV4(), Email: "testdeveloper@testalm.io", FullName: "Test Developer", }
TestUser only creates in memory obj for testing purposes
var TestUser2 = account.User{ ID: uuid.NewV4(), Email: "testdeveloper2@testalm.io", FullName: "Test Developer 2", }
TestUser2 only creates in memory obj for testing purposes. This TestUser2 can be used to verify that some entity created by TestUser can be later updated or deleted (or not) by another user.
Functions ¶
func CreateRandomValidTestName ¶
CreateRandomValidTestName functions creates a valid lenght name
func CreateTestIdentity ¶
CreateTestIdentity creates an identity with the given `username` in the database. For testing purpose only.
func CreateTestIdentityForAccountIdentity ¶
CreateTestIdentityForAccountIdentity creates an account.Identity in the database. For testing purpose only. This function unlike CreateTestIdentity() allows to create an Identity with pre-defined ID.
func LoadTestData ¶
func LoadTestData(filename string, provider TestDataProvider) ([]byte, error)
LoadTestData attempt to load test data from local disk unless; * It does not exist or, * Variable REFRESH_DATA is present in ENV
Data is stored under examples/test This is done to avoid always depending on remote systems, but also with an option to refresh/retest against the 'current' remote system data without manual copy/paste
func Run ¶
func Run(b *testing.B, suite BenchingSuite)
Run takes a testing suite and runs all of the benchmarks attached to it.
func ServiceAsSpaceUser ¶
func ServiceAsSpaceUser(serviceName string, tm token.Manager, u account.Identity, authzSrv authz.AuthzService) *goa.Service
ServiceAsSpaceUser creates a new service and fill the context with input Identity and space authz service
func ServiceAsUser ¶
ServiceAsUser creates a new service and fill the context with input Identity
func ServiceAsUserWithAuthz ¶
func ServiceAsUserWithAuthz(serviceName string, tm token.Manager, key interface{}, u account.Identity, authorizationPayload auth.AuthorizationPayload) *goa.Service
ServiceAsUserWithAuthz creates a new service and fill the context with input Identity and resource authorization information
Types ¶
type AfterBenchmark ¶
type AfterBenchmark interface {
AfterBenchmark(suiteName, testName string)
}
AfterBenchmark has a function to be executed right after the benchmark finishes and receives the suite and benchmark names as input
type BeforeBenchmark ¶
type BeforeBenchmark interface {
BeforeBenchmark(suiteName, testName string)
}
BeforeBenchmark has a function to be executed right before the benchmark starts and receives the suite and benchmark names as input
type BenchingSuite ¶
BenchingSuite can store and return the current *testing.B context generated by 'go test -bench=.'.
type SetupAllSuite ¶
type SetupAllSuite interface {
SetupSuite()
}
SetupAllSuite has a SetupSuite method, which will run before the benchmarks in the suite are run.
type SetupBenchmarkSuite ¶
type SetupBenchmarkSuite interface {
SetupBenchmark()
}
SetupBenchmarkSuite has a SetupBenchmark method, which will run before each benchmark in the suite.
type Suite ¶
type Suite struct {
// contains filtered or unexported fields
}
Suite is a basic testing suite with methods for storing and retrieving the current *testing.B context.
type TearDownAllSuite ¶
type TearDownAllSuite interface {
TearDownSuite()
}
TearDownAllSuite has a TearDownSuite method, which will run after all the benchmarks in the suite have been run.
type TearDownBenchmarkSuite ¶
type TearDownBenchmarkSuite interface {
TearDownBenchmark()
}
TearDownBenchmarkSuite has a TearDownBenchmark method, which will run after each benchmark in the suite.
type TestDataProvider ¶
TestDataProvider defines the simple funcion for returning data from a remote provider