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 ServiceAsServiceAccountUser(serviceName string, u account.Identity) *goa.Service
- func ServiceAsSpaceUser(serviceName string, u account.Identity, authzSrv authz.AuthzService) *goa.Service
- func ServiceAsUser(serviceName string, u account.Identity) *goa.Service
- func ServiceAsUserWithAuthz(serviceName string, 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
- func WithServiceAccountAuthz(ctx context.Context, key interface{}, 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 TestMaxsizedNameObj = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijk" // len=63 chars
var TestObserverIdentity = account.Identity{ ID: uuid.NewV4(), Username: "TestObserver", User: TestUser, }
TestObserverIdentity only creates in memory obj for testing purposes
var TestOversizedNameObj = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkl" // len=64 chars
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 ServiceAsServiceAccountUser ¶
ServiceAsServiceAccountUser generates the minimal service needed to satisfy the condition of being a service account.
func ServiceAsSpaceUser ¶
func ServiceAsSpaceUser(serviceName string, 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, key interface{}, u account.Identity, authorizationPayload token.AuthorizationPayload) *goa.Service
ServiceAsUserWithAuthz creates a new service and fill the context with input Identity and resource authorization information
func WithAuthz ¶
func WithAuthz(ctx context.Context, key interface{}, ident account.Identity, authz token.AuthorizationPayload) context.Context
WithAuthz fills the context with token Token is filled using input Identity object and resource authorization information
func WithIdentity ¶
WithIdentity fills the context with token Token is filled using input Identity object
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
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package testfixture helps you bootstrap test scenarios very effectively.
|
Package testfixture helps you bootstrap test scenarios very effectively. |