Documentation ¶
Overview ¶
This file was generated by counterfeiter
Package test was generated by counterfeiter
Index ¶
- Variables
- func CreateRandomValidTestName(name string) string
- func CreateTestIdentity(db *gorm.DB, username, providerType string) (account.Identity, error)
- func LoadTestData(filename string, provider TestDataProvider) ([]byte, error)
- 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 MockDB
- func (db *MockDB) Areas() area.Repository
- func (db *MockDB) BeginTransaction() (application.Transaction, error)
- func (db *MockDB) Codebases() codebase.Repository
- func (db *MockDB) Comments() comment.Repository
- func (db *MockDB) Commit() error
- func (db *MockDB) Identities() account.IdentityRepository
- func (db *MockDB) Iterations() iteration.Repository
- func (g *MockDB) OauthStates() auth.OauthStateReferenceRepository
- func (db *MockDB) Rollback() error
- func (db *MockDB) SearchItems() application.SearchRepository
- func (db *MockDB) SpaceResources() space.ResourceRepository
- func (db *MockDB) Spaces() space.Repository
- func (db *MockDB) TrackerQueries() application.TrackerQueryRepository
- func (db *MockDB) Trackers() application.TrackerRepository
- func (db *MockDB) Users() account.UserRepository
- func (db *MockDB) WorkItemLinkCategories() link.WorkItemLinkCategoryRepository
- func (db *MockDB) WorkItemLinkTypes() link.WorkItemLinkTypeRepository
- func (db *MockDB) WorkItemLinks() link.WorkItemLinkRepository
- func (db *MockDB) WorkItemTypes() workitem.WorkItemTypeRepository
- func (db *MockDB) WorkItems() workitem.WorkItemRepository
- type TestDataProvider
- type WorkItemRepository
- func (fake *WorkItemRepository) Count(ctx context.Context, spaceID uuid.UUID, c criteria.Expression) (int, error)
- func (fake *WorkItemRepository) Create(ctx context.Context, spaceID uuid.UUID, typeID uuid.UUID, ...) (*workitem.WorkItem, error)
- func (fake *WorkItemRepository) CreateArgsForCall(i int) (context.Context, uuid.UUID, uuid.UUID, map[string]interface{}, uuid.UUID)
- func (fake *WorkItemRepository) CreateCallCount() int
- func (fake *WorkItemRepository) CreateReturns(result1 *workitem.WorkItem, result2 error)
- func (fake *WorkItemRepository) Delete(ctx context.Context, spaceID uuid.UUID, ID string, suppressorID uuid.UUID) error
- func (fake *WorkItemRepository) DeleteArgsForCall(i int) (context.Context, uuid.UUID, string, uuid.UUID)
- func (fake *WorkItemRepository) DeleteCallCount() int
- func (fake *WorkItemRepository) DeleteReturns(result1 error)
- func (fake *WorkItemRepository) Fetch(ctx context.Context, spaceID uuid.UUID, c criteria.Expression) (*workitem.WorkItem, error)
- func (fake *WorkItemRepository) FetchArgsForCall(i int) (context.Context, uuid.UUID, criteria.Expression)
- func (fake *WorkItemRepository) FetchCallCount() int
- func (fake *WorkItemRepository) FetchReturns(result1 *workitem.WorkItem, result2 error)
- func (fake *WorkItemRepository) GetCountsForIteration(ctx context.Context, iterationID uuid.UUID) (map[string]workitem.WICountsPerIteration, error)
- func (fake *WorkItemRepository) GetCountsForIterationArgsForCall(i int) (context.Context, uuid.UUID)
- func (fake *WorkItemRepository) GetCountsForIterationCallCount() int
- func (fake *WorkItemRepository) GetCountsForIterationReturns(result1 map[string]workitem.WICountsPerIteration, result2 error)
- func (fake *WorkItemRepository) GetCountsPerIteration(ctx context.Context, spaceID uuid.UUID) (map[string]workitem.WICountsPerIteration, error)
- func (fake *WorkItemRepository) GetCountsPerIterationArgsForCall(i int) (context.Context, uuid.UUID)
- func (fake *WorkItemRepository) GetCountsPerIterationCallCount() int
- func (fake *WorkItemRepository) GetCountsPerIterationReturns(result1 map[string]workitem.WICountsPerIteration, result2 error)
- func (fake *WorkItemRepository) Invocations() map[string][][]interface{}
- func (fake *WorkItemRepository) List(ctx context.Context, spaceID uuid.UUID, c criteria.Expression, ...) ([]workitem.WorkItem, uint64, error)
- func (fake *WorkItemRepository) ListArgsForCall(i int) (context.Context, uuid.UUID, criteria.Expression, *int, *int)
- func (fake *WorkItemRepository) ListCallCount() int
- func (fake *WorkItemRepository) ListReturns(result1 []workitem.WorkItem, result2 uint64, result3 error)
- func (fake *WorkItemRepository) Load(ctx context.Context, spaceID uuid.UUID, ID string) (*workitem.WorkItem, error)
- func (fake *WorkItemRepository) LoadArgsForCall(i int) (context.Context, string)
- func (fake *WorkItemRepository) LoadByID(ctx context.Context, ID string) (*workitem.WorkItem, error)
- func (fake *WorkItemRepository) LoadByIDReturns(result1 *workitem.WorkItem, result2 error)
- func (fake *WorkItemRepository) LoadCallCount() int
- func (fake *WorkItemRepository) LoadReturns(result1 *workitem.WorkItem, result2 error)
- func (fake *WorkItemRepository) Reorder(ctx context.Context, direction workitem.DirectionType, targetID *string, ...) (*workitem.WorkItem, error)
- func (fake *WorkItemRepository) ReorderArgsForCall(i int) (context.Context, workitem.DirectionType, string, workitem.WorkItem, uuid.UUID)
- func (fake *WorkItemRepository) ReorderCallCount() int
- func (fake *WorkItemRepository) ReorderReturns(workItem *workitem.WorkItem, errr error)
- func (fake *WorkItemRepository) Save(ctx context.Context, spaceID uuid.UUID, wi workitem.WorkItem, ...) (*workitem.WorkItem, error)
- func (fake *WorkItemRepository) SaveArgsForCall(i int) (context.Context, uuid.UUID, workitem.WorkItem, uuid.UUID)
- func (fake *WorkItemRepository) SaveCallCount() int
- func (fake *WorkItemRepository) SaveReturns(result1 *workitem.WorkItem, result2 error)
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 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 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 authz.AuthorizationPayload) *goa.Service
ServiceAsUserWithAuthz creates a new service and fill the context with input Identity and resource authorization information
Types ¶
type MockDB ¶
type MockDB struct {
// contains filtered or unexported fields
}
func (*MockDB) Areas ¶
func (db *MockDB) Areas() area.Repository
func (*MockDB) BeginTransaction ¶
func (db *MockDB) BeginTransaction() (application.Transaction, error)
func (*MockDB) Codebases ¶
func (db *MockDB) Codebases() codebase.Repository
func (*MockDB) Comments ¶
func (db *MockDB) Comments() comment.Repository
func (*MockDB) Identities ¶
func (db *MockDB) Identities() account.IdentityRepository
func (*MockDB) Iterations ¶
func (db *MockDB) Iterations() iteration.Repository
func (*MockDB) OauthStates ¶
func (g *MockDB) OauthStates() auth.OauthStateReferenceRepository
func (*MockDB) SearchItems ¶
func (db *MockDB) SearchItems() application.SearchRepository
func (*MockDB) SpaceResources ¶
func (db *MockDB) SpaceResources() space.ResourceRepository
func (*MockDB) Spaces ¶
func (db *MockDB) Spaces() space.Repository
func (*MockDB) TrackerQueries ¶
func (db *MockDB) TrackerQueries() application.TrackerQueryRepository
func (*MockDB) Trackers ¶
func (db *MockDB) Trackers() application.TrackerRepository
func (*MockDB) Users ¶
func (db *MockDB) Users() account.UserRepository
func (*MockDB) WorkItemLinkCategories ¶
func (db *MockDB) WorkItemLinkCategories() link.WorkItemLinkCategoryRepository
func (*MockDB) WorkItemLinkTypes ¶
func (db *MockDB) WorkItemLinkTypes() link.WorkItemLinkTypeRepository
func (*MockDB) WorkItemLinks ¶
func (db *MockDB) WorkItemLinks() link.WorkItemLinkRepository
func (*MockDB) WorkItemTypes ¶
func (db *MockDB) WorkItemTypes() workitem.WorkItemTypeRepository
func (*MockDB) WorkItems ¶
func (db *MockDB) WorkItems() workitem.WorkItemRepository
type TestDataProvider ¶
TestDataProvider defines the simple funcion for returning data from a remote provider
type WorkItemRepository ¶
type WorkItemRepository struct { LoadStub func(ctx context.Context, spaceID uuid.UUID, ID string) (*workitem.WorkItem, error) LoadByIDStub func(ctx context.Context, ID string) (*workitem.WorkItem, error) SaveStub func(ctx context.Context, spaceID uuid.UUID, wi workitem.WorkItem, modifierID uuid.UUID) (*workitem.WorkItem, error) ReorderStub func(ctx context.Context, direction workitem.DirectionType, targetID *string, wi workitem.WorkItem, modifierID uuid.UUID) (*workitem.WorkItem, error) DeleteStub func(ctx context.Context, spaceID uuid.UUID, ID string, suppressorID uuid.UUID) error CreateStub func(ctx context.Context, spaceID uuid.UUID, typeID uuid.UUID, fields map[string]interface{}, creatorID uuid.UUID) (*workitem.WorkItem, error) CountStub func(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (int, error) ListStub func(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression, start *int, length *int) ([]workitem.WorkItem, uint64, error) FetchStub func(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (*workitem.WorkItem, error) GetCountsPerIterationStub func(ctx context.Context, spaceID uuid.UUID) (map[string]workitem.WICountsPerIteration, error) GetCountsForIterationStub func(ctx context.Context, iterationID uuid.UUID) (map[string]workitem.WICountsPerIteration, error) // contains filtered or unexported fields }
func (*WorkItemRepository) Count ¶
func (fake *WorkItemRepository) Count(ctx context.Context, spaceID uuid.UUID, c criteria.Expression) (int, error)
func (*WorkItemRepository) CreateArgsForCall ¶
func (*WorkItemRepository) CreateCallCount ¶
func (fake *WorkItemRepository) CreateCallCount() int
func (*WorkItemRepository) CreateReturns ¶
func (fake *WorkItemRepository) CreateReturns(result1 *workitem.WorkItem, result2 error)
func (*WorkItemRepository) DeleteArgsForCall ¶
func (*WorkItemRepository) DeleteCallCount ¶
func (fake *WorkItemRepository) DeleteCallCount() int
func (*WorkItemRepository) DeleteReturns ¶
func (fake *WorkItemRepository) DeleteReturns(result1 error)
func (*WorkItemRepository) Fetch ¶
func (fake *WorkItemRepository) Fetch(ctx context.Context, spaceID uuid.UUID, c criteria.Expression) (*workitem.WorkItem, error)
func (*WorkItemRepository) FetchArgsForCall ¶
func (fake *WorkItemRepository) FetchArgsForCall(i int) (context.Context, uuid.UUID, criteria.Expression)
func (*WorkItemRepository) FetchCallCount ¶
func (fake *WorkItemRepository) FetchCallCount() int
func (*WorkItemRepository) FetchReturns ¶
func (fake *WorkItemRepository) FetchReturns(result1 *workitem.WorkItem, result2 error)
func (*WorkItemRepository) GetCountsForIteration ¶
func (fake *WorkItemRepository) GetCountsForIteration(ctx context.Context, iterationID uuid.UUID) (map[string]workitem.WICountsPerIteration, error)
func (*WorkItemRepository) GetCountsForIterationArgsForCall ¶
func (*WorkItemRepository) GetCountsForIterationCallCount ¶
func (fake *WorkItemRepository) GetCountsForIterationCallCount() int
func (*WorkItemRepository) GetCountsForIterationReturns ¶
func (fake *WorkItemRepository) GetCountsForIterationReturns(result1 map[string]workitem.WICountsPerIteration, result2 error)
func (*WorkItemRepository) GetCountsPerIteration ¶
func (fake *WorkItemRepository) GetCountsPerIteration(ctx context.Context, spaceID uuid.UUID) (map[string]workitem.WICountsPerIteration, error)
func (*WorkItemRepository) GetCountsPerIterationArgsForCall ¶
func (*WorkItemRepository) GetCountsPerIterationCallCount ¶
func (fake *WorkItemRepository) GetCountsPerIterationCallCount() int
func (*WorkItemRepository) GetCountsPerIterationReturns ¶
func (fake *WorkItemRepository) GetCountsPerIterationReturns(result1 map[string]workitem.WICountsPerIteration, result2 error)
func (*WorkItemRepository) Invocations ¶
func (fake *WorkItemRepository) Invocations() map[string][][]interface{}
func (*WorkItemRepository) ListArgsForCall ¶
func (fake *WorkItemRepository) ListArgsForCall(i int) (context.Context, uuid.UUID, criteria.Expression, *int, *int)
func (*WorkItemRepository) ListCallCount ¶
func (fake *WorkItemRepository) ListCallCount() int
func (*WorkItemRepository) ListReturns ¶
func (fake *WorkItemRepository) ListReturns(result1 []workitem.WorkItem, result2 uint64, result3 error)
func (*WorkItemRepository) LoadArgsForCall ¶
func (fake *WorkItemRepository) LoadArgsForCall(i int) (context.Context, string)
func (*WorkItemRepository) LoadByIDReturns ¶
func (fake *WorkItemRepository) LoadByIDReturns(result1 *workitem.WorkItem, result2 error)
func (*WorkItemRepository) LoadCallCount ¶
func (fake *WorkItemRepository) LoadCallCount() int
func (*WorkItemRepository) LoadReturns ¶
func (fake *WorkItemRepository) LoadReturns(result1 *workitem.WorkItem, result2 error)
func (*WorkItemRepository) Reorder ¶
func (fake *WorkItemRepository) Reorder(ctx context.Context, direction workitem.DirectionType, targetID *string, wi workitem.WorkItem, modifierID uuid.UUID) (*workitem.WorkItem, error)
Reorder is a fake function for reordering of workitems Used for testing purpose
func (*WorkItemRepository) ReorderArgsForCall ¶
func (fake *WorkItemRepository) ReorderArgsForCall(i int) (context.Context, workitem.DirectionType, string, workitem.WorkItem, uuid.UUID)
ReorderArgsForCall returns fake arguments for Reorder function
func (*WorkItemRepository) ReorderCallCount ¶
func (fake *WorkItemRepository) ReorderCallCount() int
ReorderCallCount returns the length of fake arguments
func (*WorkItemRepository) ReorderReturns ¶
func (fake *WorkItemRepository) ReorderReturns(workItem *workitem.WorkItem, errr error)
ReorderReturns returns fake values for Reorder function
func (*WorkItemRepository) SaveArgsForCall ¶
func (*WorkItemRepository) SaveCallCount ¶
func (fake *WorkItemRepository) SaveCallCount() int
func (*WorkItemRepository) SaveReturns ¶
func (fake *WorkItemRepository) SaveReturns(result1 *workitem.WorkItem, result2 error)