Documentation
¶
Index ¶
- type ControllerServiceClientMock
- func (mock *ControllerServiceClientMock) CancelBuild(ctx context.Context, buildID string) error
- func (mock *ControllerServiceClientMock) CancelBuildCalls() []struct{ ... }
- func (mock *ControllerServiceClientMock) CancelBuildLocal(ctx context.Context, buildID string) error
- func (mock *ControllerServiceClientMock) CancelBuildLocalCalls() []struct{ ... }
- func (mock *ControllerServiceClientMock) DiscoverBuildLogInstance(ctx context.Context, buildID string) (*pb.AddressInfo, error)
- func (mock *ControllerServiceClientMock) DiscoverBuildLogInstanceCalls() []struct{ ... }
- func (mock *ControllerServiceClientMock) DiscoverBuildLogLocal(ctx context.Context, buildID string) (*pb.AddressInfo, error)
- func (mock *ControllerServiceClientMock) DiscoverBuildLogLocalCalls() []struct{ ... }
- func (mock *ControllerServiceClientMock) FetchRepository(ctx context.Context, repositoryID string) error
- func (mock *ControllerServiceClientMock) FetchRepositoryCalls() []struct{ ... }
- func (mock *ControllerServiceClientMock) GetSystemInfo(ctx context.Context) (*domain.SystemInfo, error)
- func (mock *ControllerServiceClientMock) GetSystemInfoCalls() []struct{ ... }
- func (mock *ControllerServiceClientMock) RegisterBuild(ctx context.Context, appID string) error
- func (mock *ControllerServiceClientMock) RegisterBuildCalls() []struct{ ... }
- func (mock *ControllerServiceClientMock) StartBuild(ctx context.Context) error
- func (mock *ControllerServiceClientMock) StartBuildCalls() []struct{ ... }
- func (mock *ControllerServiceClientMock) StartBuildLocal(ctx context.Context) error
- func (mock *ControllerServiceClientMock) StartBuildLocalCalls() []struct{ ... }
- func (mock *ControllerServiceClientMock) StreamBuildLog(ctx context.Context, address string, buildID string) (<-chan *pb.BuildLog, error)
- func (mock *ControllerServiceClientMock) StreamBuildLogCalls() []struct{ ... }
- func (mock *ControllerServiceClientMock) SyncDeployments(ctx context.Context) error
- func (mock *ControllerServiceClientMock) SyncDeploymentsCalls() []struct{ ... }
- func (mock *ControllerServiceClientMock) SyncDeploymentsLocal(ctx context.Context) error
- func (mock *ControllerServiceClientMock) SyncDeploymentsLocalCalls() []struct{ ... }
- type GitRepositoryMock
- type GitServiceMock
- func (mock *GitServiceMock) CloneRepository(ctx context.Context, dir string, repo *domain.Repository, commitHash string) error
- func (mock *GitServiceMock) CloneRepositoryCalls() []struct{ ... }
- func (mock *GitServiceMock) CreateBareRepository(dir string, repo *domain.Repository) (domain.GitRepository, error)
- func (mock *GitServiceMock) CreateBareRepositoryCalls() []struct{ ... }
- func (mock *GitServiceMock) ResolveRefs(ctx context.Context, repo *domain.Repository) (map[string]string, error)
- func (mock *GitServiceMock) ResolveRefsCalls() []struct{ ... }
- type MariaDBManagerMock
- func (mock *MariaDBManagerMock) Close(ctx context.Context) error
- func (mock *MariaDBManagerMock) CloseCalls() []struct{ ... }
- func (mock *MariaDBManagerMock) Create(ctx context.Context, args domain.CreateArgs) error
- func (mock *MariaDBManagerMock) CreateCalls() []struct{ ... }
- func (mock *MariaDBManagerMock) Delete(ctx context.Context, args domain.DeleteArgs) error
- func (mock *MariaDBManagerMock) DeleteCalls() []struct{ ... }
- func (mock *MariaDBManagerMock) GetHost() (string, int)
- func (mock *MariaDBManagerMock) GetHostCalls() []struct{}
- func (mock *MariaDBManagerMock) IsExist(ctx context.Context, dbname string) (bool, error)
- func (mock *MariaDBManagerMock) IsExistCalls() []struct{ ... }
- type MongoDBManagerMock
- func (mock *MongoDBManagerMock) Close(ctx context.Context) error
- func (mock *MongoDBManagerMock) CloseCalls() []struct{ ... }
- func (mock *MongoDBManagerMock) Create(ctx context.Context, args domain.CreateArgs) error
- func (mock *MongoDBManagerMock) CreateCalls() []struct{ ... }
- func (mock *MongoDBManagerMock) Delete(ctx context.Context, args domain.DeleteArgs) error
- func (mock *MongoDBManagerMock) DeleteCalls() []struct{ ... }
- func (mock *MongoDBManagerMock) GetHost() (string, int)
- func (mock *MongoDBManagerMock) GetHostCalls() []struct{}
- func (mock *MongoDBManagerMock) IsExist(ctx context.Context, dbname string) (bool, error)
- func (mock *MongoDBManagerMock) IsExistCalls() []struct{ ... }
- type RegistryClientMock
- func (mock *RegistryClientMock) DeleteImage(ctx context.Context, image string, tag string) error
- func (mock *RegistryClientMock) DeleteImageCalls() []struct{ ... }
- func (mock *RegistryClientMock) GetImageSize(ctx context.Context, image string, tag string) (int64, error)
- func (mock *RegistryClientMock) GetImageSizeCalls() []struct{ ... }
- func (mock *RegistryClientMock) GetTags(ctx context.Context, image string) ([]string, error)
- func (mock *RegistryClientMock) GetTagsCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControllerServiceClientMock ¶
type ControllerServiceClientMock struct {
// CancelBuildFunc mocks the CancelBuild method.
CancelBuildFunc func(ctx context.Context, buildID string) error
// CancelBuildLocalFunc mocks the CancelBuildLocal method.
CancelBuildLocalFunc func(ctx context.Context, buildID string) error
// DiscoverBuildLogInstanceFunc mocks the DiscoverBuildLogInstance method.
DiscoverBuildLogInstanceFunc func(ctx context.Context, buildID string) (*pb.AddressInfo, error)
// DiscoverBuildLogLocalFunc mocks the DiscoverBuildLogLocal method.
DiscoverBuildLogLocalFunc func(ctx context.Context, buildID string) (*pb.AddressInfo, error)
// FetchRepositoryFunc mocks the FetchRepository method.
FetchRepositoryFunc func(ctx context.Context, repositoryID string) error
// GetSystemInfoFunc mocks the GetSystemInfo method.
GetSystemInfoFunc func(ctx context.Context) (*domain.SystemInfo, error)
// RegisterBuildFunc mocks the RegisterBuild method.
RegisterBuildFunc func(ctx context.Context, appID string) error
// StartBuildFunc mocks the StartBuild method.
StartBuildFunc func(ctx context.Context) error
// StartBuildLocalFunc mocks the StartBuildLocal method.
StartBuildLocalFunc func(ctx context.Context) error
// StreamBuildLogFunc mocks the StreamBuildLog method.
StreamBuildLogFunc func(ctx context.Context, address string, buildID string) (<-chan *pb.BuildLog, error)
// SyncDeploymentsFunc mocks the SyncDeployments method.
SyncDeploymentsFunc func(ctx context.Context) error
// SyncDeploymentsLocalFunc mocks the SyncDeploymentsLocal method.
SyncDeploymentsLocalFunc func(ctx context.Context) error
// contains filtered or unexported fields
}
ControllerServiceClientMock is a mock implementation of domain.ControllerServiceClient.
func TestSomethingThatUsesControllerServiceClient(t *testing.T) {
// make and configure a mocked domain.ControllerServiceClient
mockedControllerServiceClient := &ControllerServiceClientMock{
CancelBuildFunc: func(ctx context.Context, buildID string) error {
panic("mock out the CancelBuild method")
},
CancelBuildLocalFunc: func(ctx context.Context, buildID string) error {
panic("mock out the CancelBuildLocal method")
},
DiscoverBuildLogInstanceFunc: func(ctx context.Context, buildID string) (*pb.AddressInfo, error) {
panic("mock out the DiscoverBuildLogInstance method")
},
DiscoverBuildLogLocalFunc: func(ctx context.Context, buildID string) (*pb.AddressInfo, error) {
panic("mock out the DiscoverBuildLogLocal method")
},
FetchRepositoryFunc: func(ctx context.Context, repositoryID string) error {
panic("mock out the FetchRepository method")
},
GetSystemInfoFunc: func(ctx context.Context) (*domain.SystemInfo, error) {
panic("mock out the GetSystemInfo method")
},
RegisterBuildFunc: func(ctx context.Context, appID string) error {
panic("mock out the RegisterBuild method")
},
StartBuildFunc: func(ctx context.Context) error {
panic("mock out the StartBuild method")
},
StartBuildLocalFunc: func(ctx context.Context) error {
panic("mock out the StartBuildLocal method")
},
StreamBuildLogFunc: func(ctx context.Context, address string, buildID string) (<-chan *pb.BuildLog, error) {
panic("mock out the StreamBuildLog method")
},
SyncDeploymentsFunc: func(ctx context.Context) error {
panic("mock out the SyncDeployments method")
},
SyncDeploymentsLocalFunc: func(ctx context.Context) error {
panic("mock out the SyncDeploymentsLocal method")
},
}
// use mockedControllerServiceClient in code that requires domain.ControllerServiceClient
// and then make assertions.
}
func (*ControllerServiceClientMock) CancelBuild ¶
func (mock *ControllerServiceClientMock) CancelBuild(ctx context.Context, buildID string) error
CancelBuild calls CancelBuildFunc.
func (*ControllerServiceClientMock) CancelBuildCalls ¶
func (mock *ControllerServiceClientMock) CancelBuildCalls() []struct { Ctx context.Context BuildID string }
CancelBuildCalls gets all the calls that were made to CancelBuild. Check the length with:
len(mockedControllerServiceClient.CancelBuildCalls())
func (*ControllerServiceClientMock) CancelBuildLocal ¶
func (mock *ControllerServiceClientMock) CancelBuildLocal(ctx context.Context, buildID string) error
CancelBuildLocal calls CancelBuildLocalFunc.
func (*ControllerServiceClientMock) CancelBuildLocalCalls ¶
func (mock *ControllerServiceClientMock) CancelBuildLocalCalls() []struct { Ctx context.Context BuildID string }
CancelBuildLocalCalls gets all the calls that were made to CancelBuildLocal. Check the length with:
len(mockedControllerServiceClient.CancelBuildLocalCalls())
func (*ControllerServiceClientMock) DiscoverBuildLogInstance ¶
func (mock *ControllerServiceClientMock) DiscoverBuildLogInstance(ctx context.Context, buildID string) (*pb.AddressInfo, error)
DiscoverBuildLogInstance calls DiscoverBuildLogInstanceFunc.
func (*ControllerServiceClientMock) DiscoverBuildLogInstanceCalls ¶
func (mock *ControllerServiceClientMock) DiscoverBuildLogInstanceCalls() []struct { Ctx context.Context BuildID string }
DiscoverBuildLogInstanceCalls gets all the calls that were made to DiscoverBuildLogInstance. Check the length with:
len(mockedControllerServiceClient.DiscoverBuildLogInstanceCalls())
func (*ControllerServiceClientMock) DiscoverBuildLogLocal ¶
func (mock *ControllerServiceClientMock) DiscoverBuildLogLocal(ctx context.Context, buildID string) (*pb.AddressInfo, error)
DiscoverBuildLogLocal calls DiscoverBuildLogLocalFunc.
func (*ControllerServiceClientMock) DiscoverBuildLogLocalCalls ¶
func (mock *ControllerServiceClientMock) DiscoverBuildLogLocalCalls() []struct { Ctx context.Context BuildID string }
DiscoverBuildLogLocalCalls gets all the calls that were made to DiscoverBuildLogLocal. Check the length with:
len(mockedControllerServiceClient.DiscoverBuildLogLocalCalls())
func (*ControllerServiceClientMock) FetchRepository ¶
func (mock *ControllerServiceClientMock) FetchRepository(ctx context.Context, repositoryID string) error
FetchRepository calls FetchRepositoryFunc.
func (*ControllerServiceClientMock) FetchRepositoryCalls ¶
func (mock *ControllerServiceClientMock) FetchRepositoryCalls() []struct { Ctx context.Context RepositoryID string }
FetchRepositoryCalls gets all the calls that were made to FetchRepository. Check the length with:
len(mockedControllerServiceClient.FetchRepositoryCalls())
func (*ControllerServiceClientMock) GetSystemInfo ¶
func (mock *ControllerServiceClientMock) GetSystemInfo(ctx context.Context) (*domain.SystemInfo, error)
GetSystemInfo calls GetSystemInfoFunc.
func (*ControllerServiceClientMock) GetSystemInfoCalls ¶
func (mock *ControllerServiceClientMock) GetSystemInfoCalls() []struct { Ctx context.Context }
GetSystemInfoCalls gets all the calls that were made to GetSystemInfo. Check the length with:
len(mockedControllerServiceClient.GetSystemInfoCalls())
func (*ControllerServiceClientMock) RegisterBuild ¶
func (mock *ControllerServiceClientMock) RegisterBuild(ctx context.Context, appID string) error
RegisterBuild calls RegisterBuildFunc.
func (*ControllerServiceClientMock) RegisterBuildCalls ¶
func (mock *ControllerServiceClientMock) RegisterBuildCalls() []struct { Ctx context.Context AppID string }
RegisterBuildCalls gets all the calls that were made to RegisterBuild. Check the length with:
len(mockedControllerServiceClient.RegisterBuildCalls())
func (*ControllerServiceClientMock) StartBuild ¶
func (mock *ControllerServiceClientMock) StartBuild(ctx context.Context) error
StartBuild calls StartBuildFunc.
func (*ControllerServiceClientMock) StartBuildCalls ¶
func (mock *ControllerServiceClientMock) StartBuildCalls() []struct { Ctx context.Context }
StartBuildCalls gets all the calls that were made to StartBuild. Check the length with:
len(mockedControllerServiceClient.StartBuildCalls())
func (*ControllerServiceClientMock) StartBuildLocal ¶
func (mock *ControllerServiceClientMock) StartBuildLocal(ctx context.Context) error
StartBuildLocal calls StartBuildLocalFunc.
func (*ControllerServiceClientMock) StartBuildLocalCalls ¶
func (mock *ControllerServiceClientMock) StartBuildLocalCalls() []struct { Ctx context.Context }
StartBuildLocalCalls gets all the calls that were made to StartBuildLocal. Check the length with:
len(mockedControllerServiceClient.StartBuildLocalCalls())
func (*ControllerServiceClientMock) StreamBuildLog ¶
func (mock *ControllerServiceClientMock) StreamBuildLog(ctx context.Context, address string, buildID string) (<-chan *pb.BuildLog, error)
StreamBuildLog calls StreamBuildLogFunc.
func (*ControllerServiceClientMock) StreamBuildLogCalls ¶
func (mock *ControllerServiceClientMock) StreamBuildLogCalls() []struct { Ctx context.Context Address string BuildID string }
StreamBuildLogCalls gets all the calls that were made to StreamBuildLog. Check the length with:
len(mockedControllerServiceClient.StreamBuildLogCalls())
func (*ControllerServiceClientMock) SyncDeployments ¶
func (mock *ControllerServiceClientMock) SyncDeployments(ctx context.Context) error
SyncDeployments calls SyncDeploymentsFunc.
func (*ControllerServiceClientMock) SyncDeploymentsCalls ¶
func (mock *ControllerServiceClientMock) SyncDeploymentsCalls() []struct { Ctx context.Context }
SyncDeploymentsCalls gets all the calls that were made to SyncDeployments. Check the length with:
len(mockedControllerServiceClient.SyncDeploymentsCalls())
func (*ControllerServiceClientMock) SyncDeploymentsLocal ¶
func (mock *ControllerServiceClientMock) SyncDeploymentsLocal(ctx context.Context) error
SyncDeploymentsLocal calls SyncDeploymentsLocalFunc.
func (*ControllerServiceClientMock) SyncDeploymentsLocalCalls ¶
func (mock *ControllerServiceClientMock) SyncDeploymentsLocalCalls() []struct { Ctx context.Context }
SyncDeploymentsLocalCalls gets all the calls that were made to SyncDeploymentsLocal. Check the length with:
len(mockedControllerServiceClient.SyncDeploymentsLocalCalls())
type GitRepositoryMock ¶
type GitRepositoryMock struct {
// FetchFunc mocks the Fetch method.
FetchFunc func(ctx context.Context, hashes []string) error
// GetCommitFunc mocks the GetCommit method.
GetCommitFunc func(hash string) (*domain.RepositoryCommit, error)
// contains filtered or unexported fields
}
GitRepositoryMock is a mock implementation of domain.GitRepository.
func TestSomethingThatUsesGitRepository(t *testing.T) {
// make and configure a mocked domain.GitRepository
mockedGitRepository := &GitRepositoryMock{
FetchFunc: func(ctx context.Context, hashes []string) error {
panic("mock out the Fetch method")
},
GetCommitFunc: func(hash string) (*domain.RepositoryCommit, error) {
panic("mock out the GetCommit method")
},
}
// use mockedGitRepository in code that requires domain.GitRepository
// and then make assertions.
}
func (*GitRepositoryMock) Fetch ¶
func (mock *GitRepositoryMock) Fetch(ctx context.Context, hashes []string) error
Fetch calls FetchFunc.
func (*GitRepositoryMock) FetchCalls ¶
func (mock *GitRepositoryMock) FetchCalls() []struct { Ctx context.Context Hashes []string }
FetchCalls gets all the calls that were made to Fetch. Check the length with:
len(mockedGitRepository.FetchCalls())
func (*GitRepositoryMock) GetCommit ¶
func (mock *GitRepositoryMock) GetCommit(hash string) (*domain.RepositoryCommit, error)
GetCommit calls GetCommitFunc.
func (*GitRepositoryMock) GetCommitCalls ¶
func (mock *GitRepositoryMock) GetCommitCalls() []struct { Hash string }
GetCommitCalls gets all the calls that were made to GetCommit. Check the length with:
len(mockedGitRepository.GetCommitCalls())
type GitServiceMock ¶
type GitServiceMock struct {
// CloneRepositoryFunc mocks the CloneRepository method.
CloneRepositoryFunc func(ctx context.Context, dir string, repo *domain.Repository, commitHash string) error
// CreateBareRepositoryFunc mocks the CreateBareRepository method.
CreateBareRepositoryFunc func(dir string, repo *domain.Repository) (domain.GitRepository, error)
// ResolveRefsFunc mocks the ResolveRefs method.
ResolveRefsFunc func(ctx context.Context, repo *domain.Repository) (map[string]string, error)
// contains filtered or unexported fields
}
GitServiceMock is a mock implementation of domain.GitService.
func TestSomethingThatUsesGitService(t *testing.T) {
// make and configure a mocked domain.GitService
mockedGitService := &GitServiceMock{
CloneRepositoryFunc: func(ctx context.Context, dir string, repo *domain.Repository, commitHash string) error {
panic("mock out the CloneRepository method")
},
CreateBareRepositoryFunc: func(dir string, repo *domain.Repository) (domain.GitRepository, error) {
panic("mock out the CreateBareRepository method")
},
ResolveRefsFunc: func(ctx context.Context, repo *domain.Repository) (map[string]string, error) {
panic("mock out the ResolveRefs method")
},
}
// use mockedGitService in code that requires domain.GitService
// and then make assertions.
}
func (*GitServiceMock) CloneRepository ¶
func (mock *GitServiceMock) CloneRepository(ctx context.Context, dir string, repo *domain.Repository, commitHash string) error
CloneRepository calls CloneRepositoryFunc.
func (*GitServiceMock) CloneRepositoryCalls ¶
func (mock *GitServiceMock) CloneRepositoryCalls() []struct { Ctx context.Context Dir string Repo *domain.Repository CommitHash string }
CloneRepositoryCalls gets all the calls that were made to CloneRepository. Check the length with:
len(mockedGitService.CloneRepositoryCalls())
func (*GitServiceMock) CreateBareRepository ¶
func (mock *GitServiceMock) CreateBareRepository(dir string, repo *domain.Repository) (domain.GitRepository, error)
CreateBareRepository calls CreateBareRepositoryFunc.
func (*GitServiceMock) CreateBareRepositoryCalls ¶
func (mock *GitServiceMock) CreateBareRepositoryCalls() []struct { Dir string Repo *domain.Repository }
CreateBareRepositoryCalls gets all the calls that were made to CreateBareRepository. Check the length with:
len(mockedGitService.CreateBareRepositoryCalls())
func (*GitServiceMock) ResolveRefs ¶
func (mock *GitServiceMock) ResolveRefs(ctx context.Context, repo *domain.Repository) (map[string]string, error)
ResolveRefs calls ResolveRefsFunc.
func (*GitServiceMock) ResolveRefsCalls ¶
func (mock *GitServiceMock) ResolveRefsCalls() []struct { Ctx context.Context Repo *domain.Repository }
ResolveRefsCalls gets all the calls that were made to ResolveRefs. Check the length with:
len(mockedGitService.ResolveRefsCalls())
type MariaDBManagerMock ¶
type MariaDBManagerMock struct {
// CloseFunc mocks the Close method.
CloseFunc func(ctx context.Context) error
// CreateFunc mocks the Create method.
CreateFunc func(ctx context.Context, args domain.CreateArgs) error
// DeleteFunc mocks the Delete method.
DeleteFunc func(ctx context.Context, args domain.DeleteArgs) error
// GetHostFunc mocks the GetHost method.
GetHostFunc func() (string, int)
// IsExistFunc mocks the IsExist method.
IsExistFunc func(ctx context.Context, dbname string) (bool, error)
// contains filtered or unexported fields
}
MariaDBManagerMock is a mock implementation of domain.MariaDBManager.
func TestSomethingThatUsesMariaDBManager(t *testing.T) {
// make and configure a mocked domain.MariaDBManager
mockedMariaDBManager := &MariaDBManagerMock{
CloseFunc: func(ctx context.Context) error {
panic("mock out the Close method")
},
CreateFunc: func(ctx context.Context, args domain.CreateArgs) error {
panic("mock out the Create method")
},
DeleteFunc: func(ctx context.Context, args domain.DeleteArgs) error {
panic("mock out the Delete method")
},
GetHostFunc: func() (string, int) {
panic("mock out the GetHost method")
},
IsExistFunc: func(ctx context.Context, dbname string) (bool, error) {
panic("mock out the IsExist method")
},
}
// use mockedMariaDBManager in code that requires domain.MariaDBManager
// and then make assertions.
}
func (*MariaDBManagerMock) Close ¶
func (mock *MariaDBManagerMock) Close(ctx context.Context) error
Close calls CloseFunc.
func (*MariaDBManagerMock) CloseCalls ¶
func (mock *MariaDBManagerMock) CloseCalls() []struct { Ctx context.Context }
CloseCalls gets all the calls that were made to Close. Check the length with:
len(mockedMariaDBManager.CloseCalls())
func (*MariaDBManagerMock) Create ¶
func (mock *MariaDBManagerMock) Create(ctx context.Context, args domain.CreateArgs) error
Create calls CreateFunc.
func (*MariaDBManagerMock) CreateCalls ¶
func (mock *MariaDBManagerMock) CreateCalls() []struct { Ctx context.Context Args domain.CreateArgs }
CreateCalls gets all the calls that were made to Create. Check the length with:
len(mockedMariaDBManager.CreateCalls())
func (*MariaDBManagerMock) Delete ¶
func (mock *MariaDBManagerMock) Delete(ctx context.Context, args domain.DeleteArgs) error
Delete calls DeleteFunc.
func (*MariaDBManagerMock) DeleteCalls ¶
func (mock *MariaDBManagerMock) DeleteCalls() []struct { Ctx context.Context Args domain.DeleteArgs }
DeleteCalls gets all the calls that were made to Delete. Check the length with:
len(mockedMariaDBManager.DeleteCalls())
func (*MariaDBManagerMock) GetHost ¶
func (mock *MariaDBManagerMock) GetHost() (string, int)
GetHost calls GetHostFunc.
func (*MariaDBManagerMock) GetHostCalls ¶
func (mock *MariaDBManagerMock) GetHostCalls() []struct { }
GetHostCalls gets all the calls that were made to GetHost. Check the length with:
len(mockedMariaDBManager.GetHostCalls())
func (*MariaDBManagerMock) IsExistCalls ¶
func (mock *MariaDBManagerMock) IsExistCalls() []struct { Ctx context.Context Dbname string }
IsExistCalls gets all the calls that were made to IsExist. Check the length with:
len(mockedMariaDBManager.IsExistCalls())
type MongoDBManagerMock ¶
type MongoDBManagerMock struct {
// CloseFunc mocks the Close method.
CloseFunc func(ctx context.Context) error
// CreateFunc mocks the Create method.
CreateFunc func(ctx context.Context, args domain.CreateArgs) error
// DeleteFunc mocks the Delete method.
DeleteFunc func(ctx context.Context, args domain.DeleteArgs) error
// GetHostFunc mocks the GetHost method.
GetHostFunc func() (string, int)
// IsExistFunc mocks the IsExist method.
IsExistFunc func(ctx context.Context, dbname string) (bool, error)
// contains filtered or unexported fields
}
MongoDBManagerMock is a mock implementation of domain.MongoDBManager.
func TestSomethingThatUsesMongoDBManager(t *testing.T) {
// make and configure a mocked domain.MongoDBManager
mockedMongoDBManager := &MongoDBManagerMock{
CloseFunc: func(ctx context.Context) error {
panic("mock out the Close method")
},
CreateFunc: func(ctx context.Context, args domain.CreateArgs) error {
panic("mock out the Create method")
},
DeleteFunc: func(ctx context.Context, args domain.DeleteArgs) error {
panic("mock out the Delete method")
},
GetHostFunc: func() (string, int) {
panic("mock out the GetHost method")
},
IsExistFunc: func(ctx context.Context, dbname string) (bool, error) {
panic("mock out the IsExist method")
},
}
// use mockedMongoDBManager in code that requires domain.MongoDBManager
// and then make assertions.
}
func (*MongoDBManagerMock) Close ¶
func (mock *MongoDBManagerMock) Close(ctx context.Context) error
Close calls CloseFunc.
func (*MongoDBManagerMock) CloseCalls ¶
func (mock *MongoDBManagerMock) CloseCalls() []struct { Ctx context.Context }
CloseCalls gets all the calls that were made to Close. Check the length with:
len(mockedMongoDBManager.CloseCalls())
func (*MongoDBManagerMock) Create ¶
func (mock *MongoDBManagerMock) Create(ctx context.Context, args domain.CreateArgs) error
Create calls CreateFunc.
func (*MongoDBManagerMock) CreateCalls ¶
func (mock *MongoDBManagerMock) CreateCalls() []struct { Ctx context.Context Args domain.CreateArgs }
CreateCalls gets all the calls that were made to Create. Check the length with:
len(mockedMongoDBManager.CreateCalls())
func (*MongoDBManagerMock) Delete ¶
func (mock *MongoDBManagerMock) Delete(ctx context.Context, args domain.DeleteArgs) error
Delete calls DeleteFunc.
func (*MongoDBManagerMock) DeleteCalls ¶
func (mock *MongoDBManagerMock) DeleteCalls() []struct { Ctx context.Context Args domain.DeleteArgs }
DeleteCalls gets all the calls that were made to Delete. Check the length with:
len(mockedMongoDBManager.DeleteCalls())
func (*MongoDBManagerMock) GetHost ¶
func (mock *MongoDBManagerMock) GetHost() (string, int)
GetHost calls GetHostFunc.
func (*MongoDBManagerMock) GetHostCalls ¶
func (mock *MongoDBManagerMock) GetHostCalls() []struct { }
GetHostCalls gets all the calls that were made to GetHost. Check the length with:
len(mockedMongoDBManager.GetHostCalls())
func (*MongoDBManagerMock) IsExistCalls ¶
func (mock *MongoDBManagerMock) IsExistCalls() []struct { Ctx context.Context Dbname string }
IsExistCalls gets all the calls that were made to IsExist. Check the length with:
len(mockedMongoDBManager.IsExistCalls())
type RegistryClientMock ¶
type RegistryClientMock struct {
// DeleteImageFunc mocks the DeleteImage method.
DeleteImageFunc func(ctx context.Context, image string, tag string) error
// GetImageSizeFunc mocks the GetImageSize method.
GetImageSizeFunc func(ctx context.Context, image string, tag string) (int64, error)
// GetTagsFunc mocks the GetTags method.
GetTagsFunc func(ctx context.Context, image string) ([]string, error)
// contains filtered or unexported fields
}
RegistryClientMock is a mock implementation of builder.RegistryClient.
func TestSomethingThatUsesRegistryClient(t *testing.T) {
// make and configure a mocked builder.RegistryClient
mockedRegistryClient := &RegistryClientMock{
DeleteImageFunc: func(ctx context.Context, image string, tag string) error {
panic("mock out the DeleteImage method")
},
GetImageSizeFunc: func(ctx context.Context, image string, tag string) (int64, error) {
panic("mock out the GetImageSize method")
},
GetTagsFunc: func(ctx context.Context, image string) ([]string, error) {
panic("mock out the GetTags method")
},
}
// use mockedRegistryClient in code that requires builder.RegistryClient
// and then make assertions.
}
func (*RegistryClientMock) DeleteImage ¶
DeleteImage calls DeleteImageFunc.
func (*RegistryClientMock) DeleteImageCalls ¶
func (mock *RegistryClientMock) DeleteImageCalls() []struct { Ctx context.Context Image string Tag string }
DeleteImageCalls gets all the calls that were made to DeleteImage. Check the length with:
len(mockedRegistryClient.DeleteImageCalls())
func (*RegistryClientMock) GetImageSize ¶
func (mock *RegistryClientMock) GetImageSize(ctx context.Context, image string, tag string) (int64, error)
GetImageSize calls GetImageSizeFunc.
func (*RegistryClientMock) GetImageSizeCalls ¶
func (mock *RegistryClientMock) GetImageSizeCalls() []struct { Ctx context.Context Image string Tag string }
GetImageSizeCalls gets all the calls that were made to GetImageSize. Check the length with:
len(mockedRegistryClient.GetImageSizeCalls())
func (*RegistryClientMock) GetTagsCalls ¶
func (mock *RegistryClientMock) GetTagsCalls() []struct { Ctx context.Context Image string }
GetTagsCalls gets all the calls that were made to GetTags. Check the length with:
len(mockedRegistryClient.GetTagsCalls())