diff --git a/Gopkg.lock b/Gopkg.lock index ba30f0015e..3454107d78 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -474,8 +474,8 @@ "internal/verify", ] pruneopts = "UT" - revision = "cab79a9916fbfa874d47beb4ca9c1b3bb9a8e0cb" - version = "v2.1.0" + revision = "3821b977214496511e7e49a911307c68f0785ef9" + version = "v2.5.0" [[projects]] digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" diff --git a/Gopkg.toml b/Gopkg.toml index f99c50bc86..cf7c4cf65b 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -26,7 +26,7 @@ [[constraint]] name = "github.com/petergtz/pegomock" - version = "v2.1.0" + version = "v2.5.0" [[constraint]] name = "github.com/boltdb/bolt" diff --git a/server/events/locking/mocks/mock_backend.go b/server/events/locking/mocks/mock_backend.go index f5d0e97ee7..d5419e8fec 100644 --- a/server/events/locking/mocks/mock_backend.go +++ b/server/events/locking/mocks/mock_backend.go @@ -124,60 +124,60 @@ func (mock *MockBackend) UnlockByPull(repoFullName string, pullNum int) ([]model return ret0, ret1 } -func (mock *MockBackend) VerifyWasCalledOnce() *VerifierBackend { - return &VerifierBackend{ +func (mock *MockBackend) VerifyWasCalledOnce() *VerifierMockBackend { + return &VerifierMockBackend{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockBackend) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierBackend { - return &VerifierBackend{ +func (mock *MockBackend) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockBackend { + return &VerifierMockBackend{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockBackend) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierBackend { - return &VerifierBackend{ +func (mock *MockBackend) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockBackend { + return &VerifierMockBackend{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockBackend) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierBackend { - return &VerifierBackend{ +func (mock *MockBackend) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockBackend { + return &VerifierMockBackend{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierBackend struct { +type VerifierMockBackend struct { mock *MockBackend invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierBackend) TryLock(lock models.ProjectLock) *Backend_TryLock_OngoingVerification { +func (verifier *VerifierMockBackend) TryLock(lock models.ProjectLock) *MockBackend_TryLock_OngoingVerification { params := []pegomock.Param{lock} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLock", params, verifier.timeout) - return &Backend_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockBackend_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Backend_TryLock_OngoingVerification struct { +type MockBackend_TryLock_OngoingVerification struct { mock *MockBackend methodInvocations []pegomock.MethodInvocation } -func (c *Backend_TryLock_OngoingVerification) GetCapturedArguments() models.ProjectLock { +func (c *MockBackend_TryLock_OngoingVerification) GetCapturedArguments() models.ProjectLock { lock := c.GetAllCapturedArguments() return lock[len(lock)-1] } -func (c *Backend_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectLock) { +func (c *MockBackend_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectLock) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.ProjectLock, len(params[0])) @@ -188,23 +188,23 @@ func (c *Backend_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 return } -func (verifier *VerifierBackend) Unlock(project models.Project, workspace string) *Backend_Unlock_OngoingVerification { +func (verifier *VerifierMockBackend) Unlock(project models.Project, workspace string) *MockBackend_Unlock_OngoingVerification { params := []pegomock.Param{project, workspace} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Unlock", params, verifier.timeout) - return &Backend_Unlock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockBackend_Unlock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Backend_Unlock_OngoingVerification struct { +type MockBackend_Unlock_OngoingVerification struct { mock *MockBackend methodInvocations []pegomock.MethodInvocation } -func (c *Backend_Unlock_OngoingVerification) GetCapturedArguments() (models.Project, string) { +func (c *MockBackend_Unlock_OngoingVerification) GetCapturedArguments() (models.Project, string) { project, workspace := c.GetAllCapturedArguments() return project[len(project)-1], workspace[len(workspace)-1] } -func (c *Backend_Unlock_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Project, _param1 []string) { +func (c *MockBackend_Unlock_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Project, _param1 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Project, len(params[0])) @@ -219,40 +219,40 @@ func (c *Backend_Unlock_OngoingVerification) GetAllCapturedArguments() (_param0 return } -func (verifier *VerifierBackend) List() *Backend_List_OngoingVerification { +func (verifier *VerifierMockBackend) List() *MockBackend_List_OngoingVerification { params := []pegomock.Param{} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "List", params, verifier.timeout) - return &Backend_List_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockBackend_List_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Backend_List_OngoingVerification struct { +type MockBackend_List_OngoingVerification struct { mock *MockBackend methodInvocations []pegomock.MethodInvocation } -func (c *Backend_List_OngoingVerification) GetCapturedArguments() { +func (c *MockBackend_List_OngoingVerification) GetCapturedArguments() { } -func (c *Backend_List_OngoingVerification) GetAllCapturedArguments() { +func (c *MockBackend_List_OngoingVerification) GetAllCapturedArguments() { } -func (verifier *VerifierBackend) GetLock(project models.Project, workspace string) *Backend_GetLock_OngoingVerification { +func (verifier *VerifierMockBackend) GetLock(project models.Project, workspace string) *MockBackend_GetLock_OngoingVerification { params := []pegomock.Param{project, workspace} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetLock", params, verifier.timeout) - return &Backend_GetLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockBackend_GetLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Backend_GetLock_OngoingVerification struct { +type MockBackend_GetLock_OngoingVerification struct { mock *MockBackend methodInvocations []pegomock.MethodInvocation } -func (c *Backend_GetLock_OngoingVerification) GetCapturedArguments() (models.Project, string) { +func (c *MockBackend_GetLock_OngoingVerification) GetCapturedArguments() (models.Project, string) { project, workspace := c.GetAllCapturedArguments() return project[len(project)-1], workspace[len(workspace)-1] } -func (c *Backend_GetLock_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Project, _param1 []string) { +func (c *MockBackend_GetLock_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Project, _param1 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Project, len(params[0])) @@ -267,23 +267,23 @@ func (c *Backend_GetLock_OngoingVerification) GetAllCapturedArguments() (_param0 return } -func (verifier *VerifierBackend) UnlockByPull(repoFullName string, pullNum int) *Backend_UnlockByPull_OngoingVerification { +func (verifier *VerifierMockBackend) UnlockByPull(repoFullName string, pullNum int) *MockBackend_UnlockByPull_OngoingVerification { params := []pegomock.Param{repoFullName, pullNum} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UnlockByPull", params, verifier.timeout) - return &Backend_UnlockByPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockBackend_UnlockByPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Backend_UnlockByPull_OngoingVerification struct { +type MockBackend_UnlockByPull_OngoingVerification struct { mock *MockBackend methodInvocations []pegomock.MethodInvocation } -func (c *Backend_UnlockByPull_OngoingVerification) GetCapturedArguments() (string, int) { +func (c *MockBackend_UnlockByPull_OngoingVerification) GetCapturedArguments() (string, int) { repoFullName, pullNum := c.GetAllCapturedArguments() return repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1] } -func (c *Backend_UnlockByPull_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []int) { +func (c *MockBackend_UnlockByPull_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []int) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/events/locking/mocks/mock_locker.go b/server/events/locking/mocks/mock_locker.go index fb3845ebaa..dc76ae32e1 100644 --- a/server/events/locking/mocks/mock_locker.go +++ b/server/events/locking/mocks/mock_locker.go @@ -121,60 +121,60 @@ func (mock *MockLocker) GetLock(key string) (*models.ProjectLock, error) { return ret0, ret1 } -func (mock *MockLocker) VerifyWasCalledOnce() *VerifierLocker { - return &VerifierLocker{ +func (mock *MockLocker) VerifyWasCalledOnce() *VerifierMockLocker { + return &VerifierMockLocker{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockLocker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierLocker { - return &VerifierLocker{ +func (mock *MockLocker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockLocker { + return &VerifierMockLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierLocker { - return &VerifierLocker{ +func (mock *MockLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockLocker { + return &VerifierMockLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierLocker { - return &VerifierLocker{ +func (mock *MockLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockLocker { + return &VerifierMockLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierLocker struct { +type VerifierMockLocker struct { mock *MockLocker invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierLocker) TryLock(p models.Project, workspace string, pull models.PullRequest, user models.User) *Locker_TryLock_OngoingVerification { +func (verifier *VerifierMockLocker) TryLock(p models.Project, workspace string, pull models.PullRequest, user models.User) *MockLocker_TryLock_OngoingVerification { params := []pegomock.Param{p, workspace, pull, user} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLock", params, verifier.timeout) - return &Locker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockLocker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Locker_TryLock_OngoingVerification struct { +type MockLocker_TryLock_OngoingVerification struct { mock *MockLocker methodInvocations []pegomock.MethodInvocation } -func (c *Locker_TryLock_OngoingVerification) GetCapturedArguments() (models.Project, string, models.PullRequest, models.User) { +func (c *MockLocker_TryLock_OngoingVerification) GetCapturedArguments() (models.Project, string, models.PullRequest, models.User) { p, workspace, pull, user := c.GetAllCapturedArguments() return p[len(p)-1], workspace[len(workspace)-1], pull[len(pull)-1], user[len(user)-1] } -func (c *Locker_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Project, _param1 []string, _param2 []models.PullRequest, _param3 []models.User) { +func (c *MockLocker_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Project, _param1 []string, _param2 []models.PullRequest, _param3 []models.User) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Project, len(params[0])) @@ -197,23 +197,23 @@ func (c *Locker_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 return } -func (verifier *VerifierLocker) Unlock(key string) *Locker_Unlock_OngoingVerification { +func (verifier *VerifierMockLocker) Unlock(key string) *MockLocker_Unlock_OngoingVerification { params := []pegomock.Param{key} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Unlock", params, verifier.timeout) - return &Locker_Unlock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockLocker_Unlock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Locker_Unlock_OngoingVerification struct { +type MockLocker_Unlock_OngoingVerification struct { mock *MockLocker methodInvocations []pegomock.MethodInvocation } -func (c *Locker_Unlock_OngoingVerification) GetCapturedArguments() string { +func (c *MockLocker_Unlock_OngoingVerification) GetCapturedArguments() string { key := c.GetAllCapturedArguments() return key[len(key)-1] } -func (c *Locker_Unlock_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { +func (c *MockLocker_Unlock_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) @@ -224,40 +224,40 @@ func (c *Locker_Unlock_OngoingVerification) GetAllCapturedArguments() (_param0 [ return } -func (verifier *VerifierLocker) List() *Locker_List_OngoingVerification { +func (verifier *VerifierMockLocker) List() *MockLocker_List_OngoingVerification { params := []pegomock.Param{} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "List", params, verifier.timeout) - return &Locker_List_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockLocker_List_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Locker_List_OngoingVerification struct { +type MockLocker_List_OngoingVerification struct { mock *MockLocker methodInvocations []pegomock.MethodInvocation } -func (c *Locker_List_OngoingVerification) GetCapturedArguments() { +func (c *MockLocker_List_OngoingVerification) GetCapturedArguments() { } -func (c *Locker_List_OngoingVerification) GetAllCapturedArguments() { +func (c *MockLocker_List_OngoingVerification) GetAllCapturedArguments() { } -func (verifier *VerifierLocker) UnlockByPull(repoFullName string, pullNum int) *Locker_UnlockByPull_OngoingVerification { +func (verifier *VerifierMockLocker) UnlockByPull(repoFullName string, pullNum int) *MockLocker_UnlockByPull_OngoingVerification { params := []pegomock.Param{repoFullName, pullNum} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UnlockByPull", params, verifier.timeout) - return &Locker_UnlockByPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockLocker_UnlockByPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Locker_UnlockByPull_OngoingVerification struct { +type MockLocker_UnlockByPull_OngoingVerification struct { mock *MockLocker methodInvocations []pegomock.MethodInvocation } -func (c *Locker_UnlockByPull_OngoingVerification) GetCapturedArguments() (string, int) { +func (c *MockLocker_UnlockByPull_OngoingVerification) GetCapturedArguments() (string, int) { repoFullName, pullNum := c.GetAllCapturedArguments() return repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1] } -func (c *Locker_UnlockByPull_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []int) { +func (c *MockLocker_UnlockByPull_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []int) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) @@ -272,23 +272,23 @@ func (c *Locker_UnlockByPull_OngoingVerification) GetAllCapturedArguments() (_pa return } -func (verifier *VerifierLocker) GetLock(key string) *Locker_GetLock_OngoingVerification { +func (verifier *VerifierMockLocker) GetLock(key string) *MockLocker_GetLock_OngoingVerification { params := []pegomock.Param{key} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetLock", params, verifier.timeout) - return &Locker_GetLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockLocker_GetLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Locker_GetLock_OngoingVerification struct { +type MockLocker_GetLock_OngoingVerification struct { mock *MockLocker methodInvocations []pegomock.MethodInvocation } -func (c *Locker_GetLock_OngoingVerification) GetCapturedArguments() string { +func (c *MockLocker_GetLock_OngoingVerification) GetCapturedArguments() string { key := c.GetAllCapturedArguments() return key[len(key)-1] } -func (c *Locker_GetLock_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { +func (c *MockLocker_GetLock_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/events/mock_workingdir_test.go b/server/events/mock_workingdir_test.go index 481be79918..58d91d8d8b 100644 --- a/server/events/mock_workingdir_test.go +++ b/server/events/mock_workingdir_test.go @@ -114,60 +114,60 @@ func (mock *MockWorkingDir) DeleteForWorkspace(r models.Repo, p models.PullReque return ret0 } -func (mock *MockWorkingDir) VerifyWasCalledOnce() *VerifierWorkingDir { - return &VerifierWorkingDir{ +func (mock *MockWorkingDir) VerifyWasCalledOnce() *VerifierMockWorkingDir { + return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockWorkingDir) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierWorkingDir { - return &VerifierWorkingDir{ +func (mock *MockWorkingDir) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockWorkingDir { + return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierWorkingDir { - return &VerifierWorkingDir{ +func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDir { + return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierWorkingDir { - return &VerifierWorkingDir{ +func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockWorkingDir { + return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierWorkingDir struct { +type VerifierMockWorkingDir struct { mock *MockWorkingDir invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierWorkingDir) Clone(log *logging.SimpleLogger, baseRepo models.Repo, headRepo models.Repo, p models.PullRequest, workspace string) *WorkingDir_Clone_OngoingVerification { +func (verifier *VerifierMockWorkingDir) Clone(log *logging.SimpleLogger, baseRepo models.Repo, headRepo models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_Clone_OngoingVerification { params := []pegomock.Param{log, baseRepo, headRepo, p, workspace} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Clone", params, verifier.timeout) - return &WorkingDir_Clone_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDir_Clone_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDir_Clone_OngoingVerification struct { +type MockWorkingDir_Clone_OngoingVerification struct { mock *MockWorkingDir methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDir_Clone_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, models.Repo, models.Repo, models.PullRequest, string) { +func (c *MockWorkingDir_Clone_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, models.Repo, models.Repo, models.PullRequest, string) { log, baseRepo, headRepo, p, workspace := c.GetAllCapturedArguments() return log[len(log)-1], baseRepo[len(baseRepo)-1], headRepo[len(headRepo)-1], p[len(p)-1], workspace[len(workspace)-1] } -func (c *WorkingDir_Clone_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []models.Repo, _param2 []models.Repo, _param3 []models.PullRequest, _param4 []string) { +func (c *MockWorkingDir_Clone_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []models.Repo, _param2 []models.Repo, _param3 []models.PullRequest, _param4 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*logging.SimpleLogger, len(params[0])) @@ -194,23 +194,23 @@ func (c *WorkingDir_Clone_OngoingVerification) GetAllCapturedArguments() (_param return } -func (verifier *VerifierWorkingDir) GetWorkingDir(r models.Repo, p models.PullRequest, workspace string) *WorkingDir_GetWorkingDir_OngoingVerification { +func (verifier *VerifierMockWorkingDir) GetWorkingDir(r models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_GetWorkingDir_OngoingVerification { params := []pegomock.Param{r, p, workspace} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetWorkingDir", params, verifier.timeout) - return &WorkingDir_GetWorkingDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDir_GetWorkingDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDir_GetWorkingDir_OngoingVerification struct { +type MockWorkingDir_GetWorkingDir_OngoingVerification struct { mock *MockWorkingDir methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDir_GetWorkingDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, string) { +func (c *MockWorkingDir_GetWorkingDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, string) { r, p, workspace := c.GetAllCapturedArguments() return r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1] } -func (c *WorkingDir_GetWorkingDir_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []string) { +func (c *MockWorkingDir_GetWorkingDir_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -229,23 +229,23 @@ func (c *WorkingDir_GetWorkingDir_OngoingVerification) GetAllCapturedArguments() return } -func (verifier *VerifierWorkingDir) GetPullDir(r models.Repo, p models.PullRequest) *WorkingDir_GetPullDir_OngoingVerification { +func (verifier *VerifierMockWorkingDir) GetPullDir(r models.Repo, p models.PullRequest) *MockWorkingDir_GetPullDir_OngoingVerification { params := []pegomock.Param{r, p} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullDir", params, verifier.timeout) - return &WorkingDir_GetPullDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDir_GetPullDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDir_GetPullDir_OngoingVerification struct { +type MockWorkingDir_GetPullDir_OngoingVerification struct { mock *MockWorkingDir methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDir_GetPullDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { +func (c *MockWorkingDir_GetPullDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { r, p := c.GetAllCapturedArguments() return r[len(r)-1], p[len(p)-1] } -func (c *WorkingDir_GetPullDir_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { +func (c *MockWorkingDir_GetPullDir_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -260,23 +260,23 @@ func (c *WorkingDir_GetPullDir_OngoingVerification) GetAllCapturedArguments() (_ return } -func (verifier *VerifierWorkingDir) Delete(r models.Repo, p models.PullRequest) *WorkingDir_Delete_OngoingVerification { +func (verifier *VerifierMockWorkingDir) Delete(r models.Repo, p models.PullRequest) *MockWorkingDir_Delete_OngoingVerification { params := []pegomock.Param{r, p} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Delete", params, verifier.timeout) - return &WorkingDir_Delete_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDir_Delete_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDir_Delete_OngoingVerification struct { +type MockWorkingDir_Delete_OngoingVerification struct { mock *MockWorkingDir methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDir_Delete_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { +func (c *MockWorkingDir_Delete_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { r, p := c.GetAllCapturedArguments() return r[len(r)-1], p[len(p)-1] } -func (c *WorkingDir_Delete_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { +func (c *MockWorkingDir_Delete_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -291,23 +291,23 @@ func (c *WorkingDir_Delete_OngoingVerification) GetAllCapturedArguments() (_para return } -func (verifier *VerifierWorkingDir) DeleteForWorkspace(r models.Repo, p models.PullRequest, workspace string) *WorkingDir_DeleteForWorkspace_OngoingVerification { +func (verifier *VerifierMockWorkingDir) DeleteForWorkspace(r models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_DeleteForWorkspace_OngoingVerification { params := []pegomock.Param{r, p, workspace} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteForWorkspace", params, verifier.timeout) - return &WorkingDir_DeleteForWorkspace_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDir_DeleteForWorkspace_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDir_DeleteForWorkspace_OngoingVerification struct { +type MockWorkingDir_DeleteForWorkspace_OngoingVerification struct { mock *MockWorkingDir methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDir_DeleteForWorkspace_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, string) { +func (c *MockWorkingDir_DeleteForWorkspace_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, string) { r, p, workspace := c.GetAllCapturedArguments() return r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1] } -func (c *WorkingDir_DeleteForWorkspace_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []string) { +func (c *MockWorkingDir_DeleteForWorkspace_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) diff --git a/server/events/mocks/matchers/events_commandname.go b/server/events/mocks/matchers/events_commandname.go deleted file mode 100644 index abd83c5fbd..0000000000 --- a/server/events/mocks/matchers/events_commandname.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -package matchers - -import ( - "github.com/petergtz/pegomock" - "github.com/runatlantis/atlantis/server/events/models" - "reflect" -) - -func AnyEventsCommandName() models.CommandName { - pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(models.CommandName))(nil)).Elem())) - var nullValue models.CommandName - return nullValue -} - -func EqEventsCommandName(value models.CommandName) models.CommandName { - pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) - var nullValue models.CommandName - return nullValue -} diff --git a/server/events/mocks/matchers/events_commandresult.go b/server/events/mocks/matchers/events_commandresult.go deleted file mode 100644 index dbf10e3e79..0000000000 --- a/server/events/mocks/matchers/events_commandresult.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -package matchers - -import ( - "reflect" - "github.com/petergtz/pegomock" - events "github.com/runatlantis/atlantis/server/events" -) - -func AnyEventsCommandResult() events.CommandResult { - pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(events.CommandResult))(nil)).Elem())) - var nullValue events.CommandResult - return nullValue -} - -func EqEventsCommandResult(value events.CommandResult) events.CommandResult { - pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) - var nullValue events.CommandResult - return nullValue -} diff --git a/server/events/mocks/matchers/events_projectresult.go b/server/events/mocks/matchers/events_projectresult.go deleted file mode 100644 index 937d83ee9c..0000000000 --- a/server/events/mocks/matchers/events_projectresult.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -package matchers - -import ( - "github.com/petergtz/pegomock" - "github.com/runatlantis/atlantis/server/events/models" - "reflect" -) - -func AnyEventsProjectResult() models.ProjectResult { - pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(models.ProjectResult))(nil)).Elem())) - var nullValue models.ProjectResult - return nullValue -} - -func EqEventsProjectResult(value models.ProjectResult) models.ProjectResult { - pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) - var nullValue models.ProjectResult - return nullValue -} diff --git a/server/events/mocks/mock_command_runner.go b/server/events/mocks/mock_command_runner.go index 01998169c8..610bff2618 100644 --- a/server/events/mocks/mock_command_runner.go +++ b/server/events/mocks/mock_command_runner.go @@ -42,60 +42,60 @@ func (mock *MockCommandRunner) RunAutoplanCommand(baseRepo models.Repo, headRepo pegomock.GetGenericMockFrom(mock).Invoke("RunAutoplanCommand", params, []reflect.Type{}) } -func (mock *MockCommandRunner) VerifyWasCalledOnce() *VerifierCommandRunner { - return &VerifierCommandRunner{ +func (mock *MockCommandRunner) VerifyWasCalledOnce() *VerifierMockCommandRunner { + return &VerifierMockCommandRunner{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierCommandRunner { - return &VerifierCommandRunner{ +func (mock *MockCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockCommandRunner { + return &VerifierMockCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierCommandRunner { - return &VerifierCommandRunner{ +func (mock *MockCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommandRunner { + return &VerifierMockCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierCommandRunner { - return &VerifierCommandRunner{ +func (mock *MockCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockCommandRunner { + return &VerifierMockCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierCommandRunner struct { +type VerifierMockCommandRunner struct { mock *MockCommandRunner invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierCommandRunner) RunCommentCommand(baseRepo models.Repo, maybeHeadRepo *models.Repo, maybePull *models.PullRequest, user models.User, pullNum int, cmd *events.CommentCommand) *CommandRunner_RunCommentCommand_OngoingVerification { +func (verifier *VerifierMockCommandRunner) RunCommentCommand(baseRepo models.Repo, maybeHeadRepo *models.Repo, maybePull *models.PullRequest, user models.User, pullNum int, cmd *events.CommentCommand) *MockCommandRunner_RunCommentCommand_OngoingVerification { params := []pegomock.Param{baseRepo, maybeHeadRepo, maybePull, user, pullNum, cmd} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunCommentCommand", params, verifier.timeout) - return &CommandRunner_RunCommentCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockCommandRunner_RunCommentCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type CommandRunner_RunCommentCommand_OngoingVerification struct { +type MockCommandRunner_RunCommentCommand_OngoingVerification struct { mock *MockCommandRunner methodInvocations []pegomock.MethodInvocation } -func (c *CommandRunner_RunCommentCommand_OngoingVerification) GetCapturedArguments() (models.Repo, *models.Repo, *models.PullRequest, models.User, int, *events.CommentCommand) { +func (c *MockCommandRunner_RunCommentCommand_OngoingVerification) GetCapturedArguments() (models.Repo, *models.Repo, *models.PullRequest, models.User, int, *events.CommentCommand) { baseRepo, maybeHeadRepo, maybePull, user, pullNum, cmd := c.GetAllCapturedArguments() return baseRepo[len(baseRepo)-1], maybeHeadRepo[len(maybeHeadRepo)-1], maybePull[len(maybePull)-1], user[len(user)-1], pullNum[len(pullNum)-1], cmd[len(cmd)-1] } -func (c *CommandRunner_RunCommentCommand_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []*models.Repo, _param2 []*models.PullRequest, _param3 []models.User, _param4 []int, _param5 []*events.CommentCommand) { +func (c *MockCommandRunner_RunCommentCommand_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []*models.Repo, _param2 []*models.PullRequest, _param3 []models.User, _param4 []int, _param5 []*events.CommentCommand) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -126,23 +126,23 @@ func (c *CommandRunner_RunCommentCommand_OngoingVerification) GetAllCapturedArgu return } -func (verifier *VerifierCommandRunner) RunAutoplanCommand(baseRepo models.Repo, headRepo models.Repo, pull models.PullRequest, user models.User) *CommandRunner_RunAutoplanCommand_OngoingVerification { +func (verifier *VerifierMockCommandRunner) RunAutoplanCommand(baseRepo models.Repo, headRepo models.Repo, pull models.PullRequest, user models.User) *MockCommandRunner_RunAutoplanCommand_OngoingVerification { params := []pegomock.Param{baseRepo, headRepo, pull, user} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunAutoplanCommand", params, verifier.timeout) - return &CommandRunner_RunAutoplanCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockCommandRunner_RunAutoplanCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type CommandRunner_RunAutoplanCommand_OngoingVerification struct { +type MockCommandRunner_RunAutoplanCommand_OngoingVerification struct { mock *MockCommandRunner methodInvocations []pegomock.MethodInvocation } -func (c *CommandRunner_RunAutoplanCommand_OngoingVerification) GetCapturedArguments() (models.Repo, models.Repo, models.PullRequest, models.User) { +func (c *MockCommandRunner_RunAutoplanCommand_OngoingVerification) GetCapturedArguments() (models.Repo, models.Repo, models.PullRequest, models.User) { baseRepo, headRepo, pull, user := c.GetAllCapturedArguments() return baseRepo[len(baseRepo)-1], headRepo[len(headRepo)-1], pull[len(pull)-1], user[len(user)-1] } -func (c *CommandRunner_RunAutoplanCommand_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []models.User) { +func (c *MockCommandRunner_RunAutoplanCommand_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []models.User) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) diff --git a/server/events/mocks/mock_comment_parsing.go b/server/events/mocks/mock_comment_parsing.go index 527ced1d67..1f0fca40be 100644 --- a/server/events/mocks/mock_comment_parsing.go +++ b/server/events/mocks/mock_comment_parsing.go @@ -41,60 +41,60 @@ func (mock *MockCommentParsing) Parse(comment string, vcsHost models.VCSHostType return ret0 } -func (mock *MockCommentParsing) VerifyWasCalledOnce() *VerifierCommentParsing { - return &VerifierCommentParsing{ +func (mock *MockCommentParsing) VerifyWasCalledOnce() *VerifierMockCommentParsing { + return &VerifierMockCommentParsing{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockCommentParsing) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierCommentParsing { - return &VerifierCommentParsing{ +func (mock *MockCommentParsing) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockCommentParsing { + return &VerifierMockCommentParsing{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockCommentParsing) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierCommentParsing { - return &VerifierCommentParsing{ +func (mock *MockCommentParsing) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommentParsing { + return &VerifierMockCommentParsing{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockCommentParsing) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierCommentParsing { - return &VerifierCommentParsing{ +func (mock *MockCommentParsing) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockCommentParsing { + return &VerifierMockCommentParsing{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierCommentParsing struct { +type VerifierMockCommentParsing struct { mock *MockCommentParsing invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierCommentParsing) Parse(comment string, vcsHost models.VCSHostType) *CommentParsing_Parse_OngoingVerification { +func (verifier *VerifierMockCommentParsing) Parse(comment string, vcsHost models.VCSHostType) *MockCommentParsing_Parse_OngoingVerification { params := []pegomock.Param{comment, vcsHost} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Parse", params, verifier.timeout) - return &CommentParsing_Parse_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockCommentParsing_Parse_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type CommentParsing_Parse_OngoingVerification struct { +type MockCommentParsing_Parse_OngoingVerification struct { mock *MockCommentParsing methodInvocations []pegomock.MethodInvocation } -func (c *CommentParsing_Parse_OngoingVerification) GetCapturedArguments() (string, models.VCSHostType) { +func (c *MockCommentParsing_Parse_OngoingVerification) GetCapturedArguments() (string, models.VCSHostType) { comment, vcsHost := c.GetAllCapturedArguments() return comment[len(comment)-1], vcsHost[len(vcsHost)-1] } -func (c *CommentParsing_Parse_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []models.VCSHostType) { +func (c *MockCommentParsing_Parse_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []models.VCSHostType) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/events/mocks/mock_commit_status_updater.go b/server/events/mocks/mock_commit_status_updater.go index 818f094d81..8da53ded0b 100644 --- a/server/events/mocks/mock_commit_status_updater.go +++ b/server/events/mocks/mock_commit_status_updater.go @@ -70,60 +70,60 @@ func (mock *MockCommitStatusUpdater) UpdateProject(ctx models.ProjectCommandCont return ret0 } -func (mock *MockCommitStatusUpdater) VerifyWasCalledOnce() *VerifierCommitStatusUpdater { - return &VerifierCommitStatusUpdater{ +func (mock *MockCommitStatusUpdater) VerifyWasCalledOnce() *VerifierMockCommitStatusUpdater { + return &VerifierMockCommitStatusUpdater{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockCommitStatusUpdater) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierCommitStatusUpdater { - return &VerifierCommitStatusUpdater{ +func (mock *MockCommitStatusUpdater) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockCommitStatusUpdater { + return &VerifierMockCommitStatusUpdater{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockCommitStatusUpdater) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierCommitStatusUpdater { - return &VerifierCommitStatusUpdater{ +func (mock *MockCommitStatusUpdater) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommitStatusUpdater { + return &VerifierMockCommitStatusUpdater{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockCommitStatusUpdater) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierCommitStatusUpdater { - return &VerifierCommitStatusUpdater{ +func (mock *MockCommitStatusUpdater) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockCommitStatusUpdater { + return &VerifierMockCommitStatusUpdater{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierCommitStatusUpdater struct { +type VerifierMockCommitStatusUpdater struct { mock *MockCommitStatusUpdater invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierCommitStatusUpdater) UpdateCombined(repo models.Repo, pull models.PullRequest, status models.CommitStatus, command models.CommandName) *CommitStatusUpdater_UpdateCombined_OngoingVerification { +func (verifier *VerifierMockCommitStatusUpdater) UpdateCombined(repo models.Repo, pull models.PullRequest, status models.CommitStatus, command models.CommandName) *MockCommitStatusUpdater_UpdateCombined_OngoingVerification { params := []pegomock.Param{repo, pull, status, command} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateCombined", params, verifier.timeout) - return &CommitStatusUpdater_UpdateCombined_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockCommitStatusUpdater_UpdateCombined_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type CommitStatusUpdater_UpdateCombined_OngoingVerification struct { +type MockCommitStatusUpdater_UpdateCombined_OngoingVerification struct { mock *MockCommitStatusUpdater methodInvocations []pegomock.MethodInvocation } -func (c *CommitStatusUpdater_UpdateCombined_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, models.CommitStatus, models.CommandName) { +func (c *MockCommitStatusUpdater_UpdateCombined_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, models.CommitStatus, models.CommandName) { repo, pull, status, command := c.GetAllCapturedArguments() return repo[len(repo)-1], pull[len(pull)-1], status[len(status)-1], command[len(command)-1] } -func (c *CommitStatusUpdater_UpdateCombined_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []models.CommitStatus, _param3 []models.CommandName) { +func (c *MockCommitStatusUpdater_UpdateCombined_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []models.CommitStatus, _param3 []models.CommandName) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -146,23 +146,23 @@ func (c *CommitStatusUpdater_UpdateCombined_OngoingVerification) GetAllCapturedA return } -func (verifier *VerifierCommitStatusUpdater) UpdateCombinedCount(repo models.Repo, pull models.PullRequest, status models.CommitStatus, command models.CommandName, numSuccess int, numTotal int) *CommitStatusUpdater_UpdateCombinedCount_OngoingVerification { +func (verifier *VerifierMockCommitStatusUpdater) UpdateCombinedCount(repo models.Repo, pull models.PullRequest, status models.CommitStatus, command models.CommandName, numSuccess int, numTotal int) *MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification { params := []pegomock.Param{repo, pull, status, command, numSuccess, numTotal} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateCombinedCount", params, verifier.timeout) - return &CommitStatusUpdater_UpdateCombinedCount_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type CommitStatusUpdater_UpdateCombinedCount_OngoingVerification struct { +type MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification struct { mock *MockCommitStatusUpdater methodInvocations []pegomock.MethodInvocation } -func (c *CommitStatusUpdater_UpdateCombinedCount_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, models.CommitStatus, models.CommandName, int, int) { +func (c *MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, models.CommitStatus, models.CommandName, int, int) { repo, pull, status, command, numSuccess, numTotal := c.GetAllCapturedArguments() return repo[len(repo)-1], pull[len(pull)-1], status[len(status)-1], command[len(command)-1], numSuccess[len(numSuccess)-1], numTotal[len(numTotal)-1] } -func (c *CommitStatusUpdater_UpdateCombinedCount_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []models.CommitStatus, _param3 []models.CommandName, _param4 []int, _param5 []int) { +func (c *MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []models.CommitStatus, _param3 []models.CommandName, _param4 []int, _param5 []int) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -193,23 +193,23 @@ func (c *CommitStatusUpdater_UpdateCombinedCount_OngoingVerification) GetAllCapt return } -func (verifier *VerifierCommitStatusUpdater) UpdateProject(ctx models.ProjectCommandContext, cmdName models.CommandName, status models.CommitStatus, url string) *CommitStatusUpdater_UpdateProject_OngoingVerification { +func (verifier *VerifierMockCommitStatusUpdater) UpdateProject(ctx models.ProjectCommandContext, cmdName models.CommandName, status models.CommitStatus, url string) *MockCommitStatusUpdater_UpdateProject_OngoingVerification { params := []pegomock.Param{ctx, cmdName, status, url} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateProject", params, verifier.timeout) - return &CommitStatusUpdater_UpdateProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockCommitStatusUpdater_UpdateProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type CommitStatusUpdater_UpdateProject_OngoingVerification struct { +type MockCommitStatusUpdater_UpdateProject_OngoingVerification struct { mock *MockCommitStatusUpdater methodInvocations []pegomock.MethodInvocation } -func (c *CommitStatusUpdater_UpdateProject_OngoingVerification) GetCapturedArguments() (models.ProjectCommandContext, models.CommandName, models.CommitStatus, string) { +func (c *MockCommitStatusUpdater_UpdateProject_OngoingVerification) GetCapturedArguments() (models.ProjectCommandContext, models.CommandName, models.CommitStatus, string) { ctx, cmdName, status, url := c.GetAllCapturedArguments() return ctx[len(ctx)-1], cmdName[len(cmdName)-1], status[len(status)-1], url[len(url)-1] } -func (c *CommitStatusUpdater_UpdateProject_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext, _param1 []models.CommandName, _param2 []models.CommitStatus, _param3 []string) { +func (c *MockCommitStatusUpdater_UpdateProject_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext, _param1 []models.CommandName, _param2 []models.CommitStatus, _param3 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.ProjectCommandContext, len(params[0])) diff --git a/server/events/mocks/mock_custom_step_runner.go b/server/events/mocks/mock_custom_step_runner.go index abe32003a3..bb47e51fc5 100644 --- a/server/events/mocks/mock_custom_step_runner.go +++ b/server/events/mocks/mock_custom_step_runner.go @@ -44,60 +44,60 @@ func (mock *MockCustomStepRunner) Run(ctx models.ProjectCommandContext, cmd stri return ret0, ret1 } -func (mock *MockCustomStepRunner) VerifyWasCalledOnce() *VerifierCustomStepRunner { - return &VerifierCustomStepRunner{ +func (mock *MockCustomStepRunner) VerifyWasCalledOnce() *VerifierMockCustomStepRunner { + return &VerifierMockCustomStepRunner{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockCustomStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierCustomStepRunner { - return &VerifierCustomStepRunner{ +func (mock *MockCustomStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockCustomStepRunner { + return &VerifierMockCustomStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockCustomStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierCustomStepRunner { - return &VerifierCustomStepRunner{ +func (mock *MockCustomStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCustomStepRunner { + return &VerifierMockCustomStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockCustomStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierCustomStepRunner { - return &VerifierCustomStepRunner{ +func (mock *MockCustomStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockCustomStepRunner { + return &VerifierMockCustomStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierCustomStepRunner struct { +type VerifierMockCustomStepRunner struct { mock *MockCustomStepRunner invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierCustomStepRunner) Run(ctx models.ProjectCommandContext, cmd string, path string) *CustomStepRunner_Run_OngoingVerification { +func (verifier *VerifierMockCustomStepRunner) Run(ctx models.ProjectCommandContext, cmd string, path string) *MockCustomStepRunner_Run_OngoingVerification { params := []pegomock.Param{ctx, cmd, path} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", params, verifier.timeout) - return &CustomStepRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockCustomStepRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type CustomStepRunner_Run_OngoingVerification struct { +type MockCustomStepRunner_Run_OngoingVerification struct { mock *MockCustomStepRunner methodInvocations []pegomock.MethodInvocation } -func (c *CustomStepRunner_Run_OngoingVerification) GetCapturedArguments() (models.ProjectCommandContext, string, string) { +func (c *MockCustomStepRunner_Run_OngoingVerification) GetCapturedArguments() (models.ProjectCommandContext, string, string) { ctx, cmd, path := c.GetAllCapturedArguments() return ctx[len(ctx)-1], cmd[len(cmd)-1], path[len(path)-1] } -func (c *CustomStepRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext, _param1 []string, _param2 []string) { +func (c *MockCustomStepRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext, _param1 []string, _param2 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.ProjectCommandContext, len(params[0])) diff --git a/server/events/mocks/mock_event_parsing.go b/server/events/mocks/mock_event_parsing.go index e680d1cb46..2f46ec8e61 100644 --- a/server/events/mocks/mock_event_parsing.go +++ b/server/events/mocks/mock_event_parsing.go @@ -374,60 +374,60 @@ func (mock *MockEventParsing) GetBitbucketServerPullEventType(eventTypeHeader st return ret0 } -func (mock *MockEventParsing) VerifyWasCalledOnce() *VerifierEventParsing { - return &VerifierEventParsing{ +func (mock *MockEventParsing) VerifyWasCalledOnce() *VerifierMockEventParsing { + return &VerifierMockEventParsing{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockEventParsing) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierEventParsing { - return &VerifierEventParsing{ +func (mock *MockEventParsing) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockEventParsing { + return &VerifierMockEventParsing{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockEventParsing) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierEventParsing { - return &VerifierEventParsing{ +func (mock *MockEventParsing) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockEventParsing { + return &VerifierMockEventParsing{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockEventParsing) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierEventParsing { - return &VerifierEventParsing{ +func (mock *MockEventParsing) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockEventParsing { + return &VerifierMockEventParsing{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierEventParsing struct { +type VerifierMockEventParsing struct { mock *MockEventParsing invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierEventParsing) ParseGithubIssueCommentEvent(comment *github.IssueCommentEvent) *EventParsing_ParseGithubIssueCommentEvent_OngoingVerification { +func (verifier *VerifierMockEventParsing) ParseGithubIssueCommentEvent(comment *github.IssueCommentEvent) *MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification { params := []pegomock.Param{comment} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGithubIssueCommentEvent", params, verifier.timeout) - return &EventParsing_ParseGithubIssueCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_ParseGithubIssueCommentEvent_OngoingVerification struct { +type MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_ParseGithubIssueCommentEvent_OngoingVerification) GetCapturedArguments() *github.IssueCommentEvent { +func (c *MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification) GetCapturedArguments() *github.IssueCommentEvent { comment := c.GetAllCapturedArguments() return comment[len(comment)-1] } -func (c *EventParsing_ParseGithubIssueCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []*github.IssueCommentEvent) { +func (c *MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []*github.IssueCommentEvent) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*github.IssueCommentEvent, len(params[0])) @@ -438,23 +438,23 @@ func (c *EventParsing_ParseGithubIssueCommentEvent_OngoingVerification) GetAllCa return } -func (verifier *VerifierEventParsing) ParseGithubPull(ghPull *github.PullRequest) *EventParsing_ParseGithubPull_OngoingVerification { +func (verifier *VerifierMockEventParsing) ParseGithubPull(ghPull *github.PullRequest) *MockEventParsing_ParseGithubPull_OngoingVerification { params := []pegomock.Param{ghPull} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGithubPull", params, verifier.timeout) - return &EventParsing_ParseGithubPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_ParseGithubPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_ParseGithubPull_OngoingVerification struct { +type MockEventParsing_ParseGithubPull_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_ParseGithubPull_OngoingVerification) GetCapturedArguments() *github.PullRequest { +func (c *MockEventParsing_ParseGithubPull_OngoingVerification) GetCapturedArguments() *github.PullRequest { ghPull := c.GetAllCapturedArguments() return ghPull[len(ghPull)-1] } -func (c *EventParsing_ParseGithubPull_OngoingVerification) GetAllCapturedArguments() (_param0 []*github.PullRequest) { +func (c *MockEventParsing_ParseGithubPull_OngoingVerification) GetAllCapturedArguments() (_param0 []*github.PullRequest) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*github.PullRequest, len(params[0])) @@ -465,23 +465,23 @@ func (c *EventParsing_ParseGithubPull_OngoingVerification) GetAllCapturedArgumen return } -func (verifier *VerifierEventParsing) ParseGithubPullEvent(pullEvent *github.PullRequestEvent) *EventParsing_ParseGithubPullEvent_OngoingVerification { +func (verifier *VerifierMockEventParsing) ParseGithubPullEvent(pullEvent *github.PullRequestEvent) *MockEventParsing_ParseGithubPullEvent_OngoingVerification { params := []pegomock.Param{pullEvent} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGithubPullEvent", params, verifier.timeout) - return &EventParsing_ParseGithubPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_ParseGithubPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_ParseGithubPullEvent_OngoingVerification struct { +type MockEventParsing_ParseGithubPullEvent_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_ParseGithubPullEvent_OngoingVerification) GetCapturedArguments() *github.PullRequestEvent { +func (c *MockEventParsing_ParseGithubPullEvent_OngoingVerification) GetCapturedArguments() *github.PullRequestEvent { pullEvent := c.GetAllCapturedArguments() return pullEvent[len(pullEvent)-1] } -func (c *EventParsing_ParseGithubPullEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []*github.PullRequestEvent) { +func (c *MockEventParsing_ParseGithubPullEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []*github.PullRequestEvent) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*github.PullRequestEvent, len(params[0])) @@ -492,23 +492,23 @@ func (c *EventParsing_ParseGithubPullEvent_OngoingVerification) GetAllCapturedAr return } -func (verifier *VerifierEventParsing) ParseGithubRepo(ghRepo *github.Repository) *EventParsing_ParseGithubRepo_OngoingVerification { +func (verifier *VerifierMockEventParsing) ParseGithubRepo(ghRepo *github.Repository) *MockEventParsing_ParseGithubRepo_OngoingVerification { params := []pegomock.Param{ghRepo} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGithubRepo", params, verifier.timeout) - return &EventParsing_ParseGithubRepo_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_ParseGithubRepo_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_ParseGithubRepo_OngoingVerification struct { +type MockEventParsing_ParseGithubRepo_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_ParseGithubRepo_OngoingVerification) GetCapturedArguments() *github.Repository { +func (c *MockEventParsing_ParseGithubRepo_OngoingVerification) GetCapturedArguments() *github.Repository { ghRepo := c.GetAllCapturedArguments() return ghRepo[len(ghRepo)-1] } -func (c *EventParsing_ParseGithubRepo_OngoingVerification) GetAllCapturedArguments() (_param0 []*github.Repository) { +func (c *MockEventParsing_ParseGithubRepo_OngoingVerification) GetAllCapturedArguments() (_param0 []*github.Repository) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*github.Repository, len(params[0])) @@ -519,23 +519,23 @@ func (c *EventParsing_ParseGithubRepo_OngoingVerification) GetAllCapturedArgumen return } -func (verifier *VerifierEventParsing) ParseGitlabMergeRequestEvent(event go_gitlab.MergeEvent) *EventParsing_ParseGitlabMergeRequestEvent_OngoingVerification { +func (verifier *VerifierMockEventParsing) ParseGitlabMergeRequestEvent(event go_gitlab.MergeEvent) *MockEventParsing_ParseGitlabMergeRequestEvent_OngoingVerification { params := []pegomock.Param{event} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGitlabMergeRequestEvent", params, verifier.timeout) - return &EventParsing_ParseGitlabMergeRequestEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_ParseGitlabMergeRequestEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_ParseGitlabMergeRequestEvent_OngoingVerification struct { +type MockEventParsing_ParseGitlabMergeRequestEvent_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_ParseGitlabMergeRequestEvent_OngoingVerification) GetCapturedArguments() go_gitlab.MergeEvent { +func (c *MockEventParsing_ParseGitlabMergeRequestEvent_OngoingVerification) GetCapturedArguments() go_gitlab.MergeEvent { event := c.GetAllCapturedArguments() return event[len(event)-1] } -func (c *EventParsing_ParseGitlabMergeRequestEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []go_gitlab.MergeEvent) { +func (c *MockEventParsing_ParseGitlabMergeRequestEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []go_gitlab.MergeEvent) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]go_gitlab.MergeEvent, len(params[0])) @@ -546,23 +546,23 @@ func (c *EventParsing_ParseGitlabMergeRequestEvent_OngoingVerification) GetAllCa return } -func (verifier *VerifierEventParsing) ParseGitlabMergeRequestCommentEvent(event go_gitlab.MergeCommentEvent) *EventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification { +func (verifier *VerifierMockEventParsing) ParseGitlabMergeRequestCommentEvent(event go_gitlab.MergeCommentEvent) *MockEventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification { params := []pegomock.Param{event} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGitlabMergeRequestCommentEvent", params, verifier.timeout) - return &EventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification struct { +type MockEventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification) GetCapturedArguments() go_gitlab.MergeCommentEvent { +func (c *MockEventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification) GetCapturedArguments() go_gitlab.MergeCommentEvent { event := c.GetAllCapturedArguments() return event[len(event)-1] } -func (c *EventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []go_gitlab.MergeCommentEvent) { +func (c *MockEventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []go_gitlab.MergeCommentEvent) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]go_gitlab.MergeCommentEvent, len(params[0])) @@ -573,23 +573,23 @@ func (c *EventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification) G return } -func (verifier *VerifierEventParsing) ParseGitlabMergeRequest(mr *go_gitlab.MergeRequest, baseRepo models.Repo) *EventParsing_ParseGitlabMergeRequest_OngoingVerification { +func (verifier *VerifierMockEventParsing) ParseGitlabMergeRequest(mr *go_gitlab.MergeRequest, baseRepo models.Repo) *MockEventParsing_ParseGitlabMergeRequest_OngoingVerification { params := []pegomock.Param{mr, baseRepo} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGitlabMergeRequest", params, verifier.timeout) - return &EventParsing_ParseGitlabMergeRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_ParseGitlabMergeRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_ParseGitlabMergeRequest_OngoingVerification struct { +type MockEventParsing_ParseGitlabMergeRequest_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_ParseGitlabMergeRequest_OngoingVerification) GetCapturedArguments() (*go_gitlab.MergeRequest, models.Repo) { +func (c *MockEventParsing_ParseGitlabMergeRequest_OngoingVerification) GetCapturedArguments() (*go_gitlab.MergeRequest, models.Repo) { mr, baseRepo := c.GetAllCapturedArguments() return mr[len(mr)-1], baseRepo[len(baseRepo)-1] } -func (c *EventParsing_ParseGitlabMergeRequest_OngoingVerification) GetAllCapturedArguments() (_param0 []*go_gitlab.MergeRequest, _param1 []models.Repo) { +func (c *MockEventParsing_ParseGitlabMergeRequest_OngoingVerification) GetAllCapturedArguments() (_param0 []*go_gitlab.MergeRequest, _param1 []models.Repo) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*go_gitlab.MergeRequest, len(params[0])) @@ -604,23 +604,23 @@ func (c *EventParsing_ParseGitlabMergeRequest_OngoingVerification) GetAllCapture return } -func (verifier *VerifierEventParsing) ParseBitbucketCloudPullEvent(body []byte) *EventParsing_ParseBitbucketCloudPullEvent_OngoingVerification { +func (verifier *VerifierMockEventParsing) ParseBitbucketCloudPullEvent(body []byte) *MockEventParsing_ParseBitbucketCloudPullEvent_OngoingVerification { params := []pegomock.Param{body} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseBitbucketCloudPullEvent", params, verifier.timeout) - return &EventParsing_ParseBitbucketCloudPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_ParseBitbucketCloudPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_ParseBitbucketCloudPullEvent_OngoingVerification struct { +type MockEventParsing_ParseBitbucketCloudPullEvent_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_ParseBitbucketCloudPullEvent_OngoingVerification) GetCapturedArguments() []byte { +func (c *MockEventParsing_ParseBitbucketCloudPullEvent_OngoingVerification) GetCapturedArguments() []byte { body := c.GetAllCapturedArguments() return body[len(body)-1] } -func (c *EventParsing_ParseBitbucketCloudPullEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { +func (c *MockEventParsing_ParseBitbucketCloudPullEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([][]byte, len(params[0])) @@ -631,23 +631,23 @@ func (c *EventParsing_ParseBitbucketCloudPullEvent_OngoingVerification) GetAllCa return } -func (verifier *VerifierEventParsing) ParseBitbucketCloudPullCommentEvent(body []byte) *EventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification { +func (verifier *VerifierMockEventParsing) ParseBitbucketCloudPullCommentEvent(body []byte) *MockEventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification { params := []pegomock.Param{body} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseBitbucketCloudPullCommentEvent", params, verifier.timeout) - return &EventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification struct { +type MockEventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification) GetCapturedArguments() []byte { +func (c *MockEventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification) GetCapturedArguments() []byte { body := c.GetAllCapturedArguments() return body[len(body)-1] } -func (c *EventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { +func (c *MockEventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([][]byte, len(params[0])) @@ -658,23 +658,23 @@ func (c *EventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification) G return } -func (verifier *VerifierEventParsing) GetBitbucketCloudPullEventType(eventTypeHeader string) *EventParsing_GetBitbucketCloudPullEventType_OngoingVerification { +func (verifier *VerifierMockEventParsing) GetBitbucketCloudPullEventType(eventTypeHeader string) *MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification { params := []pegomock.Param{eventTypeHeader} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetBitbucketCloudPullEventType", params, verifier.timeout) - return &EventParsing_GetBitbucketCloudPullEventType_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_GetBitbucketCloudPullEventType_OngoingVerification struct { +type MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_GetBitbucketCloudPullEventType_OngoingVerification) GetCapturedArguments() string { +func (c *MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification) GetCapturedArguments() string { eventTypeHeader := c.GetAllCapturedArguments() return eventTypeHeader[len(eventTypeHeader)-1] } -func (c *EventParsing_GetBitbucketCloudPullEventType_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { +func (c *MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) @@ -685,23 +685,23 @@ func (c *EventParsing_GetBitbucketCloudPullEventType_OngoingVerification) GetAll return } -func (verifier *VerifierEventParsing) ParseBitbucketServerPullEvent(body []byte) *EventParsing_ParseBitbucketServerPullEvent_OngoingVerification { +func (verifier *VerifierMockEventParsing) ParseBitbucketServerPullEvent(body []byte) *MockEventParsing_ParseBitbucketServerPullEvent_OngoingVerification { params := []pegomock.Param{body} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseBitbucketServerPullEvent", params, verifier.timeout) - return &EventParsing_ParseBitbucketServerPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_ParseBitbucketServerPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_ParseBitbucketServerPullEvent_OngoingVerification struct { +type MockEventParsing_ParseBitbucketServerPullEvent_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_ParseBitbucketServerPullEvent_OngoingVerification) GetCapturedArguments() []byte { +func (c *MockEventParsing_ParseBitbucketServerPullEvent_OngoingVerification) GetCapturedArguments() []byte { body := c.GetAllCapturedArguments() return body[len(body)-1] } -func (c *EventParsing_ParseBitbucketServerPullEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { +func (c *MockEventParsing_ParseBitbucketServerPullEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([][]byte, len(params[0])) @@ -712,23 +712,23 @@ func (c *EventParsing_ParseBitbucketServerPullEvent_OngoingVerification) GetAllC return } -func (verifier *VerifierEventParsing) ParseBitbucketServerPullCommentEvent(body []byte) *EventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification { +func (verifier *VerifierMockEventParsing) ParseBitbucketServerPullCommentEvent(body []byte) *MockEventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification { params := []pegomock.Param{body} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseBitbucketServerPullCommentEvent", params, verifier.timeout) - return &EventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification struct { +type MockEventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification) GetCapturedArguments() []byte { +func (c *MockEventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification) GetCapturedArguments() []byte { body := c.GetAllCapturedArguments() return body[len(body)-1] } -func (c *EventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { +func (c *MockEventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([][]byte, len(params[0])) @@ -739,23 +739,23 @@ func (c *EventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification) return } -func (verifier *VerifierEventParsing) GetBitbucketServerPullEventType(eventTypeHeader string) *EventParsing_GetBitbucketServerPullEventType_OngoingVerification { +func (verifier *VerifierMockEventParsing) GetBitbucketServerPullEventType(eventTypeHeader string) *MockEventParsing_GetBitbucketServerPullEventType_OngoingVerification { params := []pegomock.Param{eventTypeHeader} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetBitbucketServerPullEventType", params, verifier.timeout) - return &EventParsing_GetBitbucketServerPullEventType_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockEventParsing_GetBitbucketServerPullEventType_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type EventParsing_GetBitbucketServerPullEventType_OngoingVerification struct { +type MockEventParsing_GetBitbucketServerPullEventType_OngoingVerification struct { mock *MockEventParsing methodInvocations []pegomock.MethodInvocation } -func (c *EventParsing_GetBitbucketServerPullEventType_OngoingVerification) GetCapturedArguments() string { +func (c *MockEventParsing_GetBitbucketServerPullEventType_OngoingVerification) GetCapturedArguments() string { eventTypeHeader := c.GetAllCapturedArguments() return eventTypeHeader[len(eventTypeHeader)-1] } -func (c *EventParsing_GetBitbucketServerPullEventType_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { +func (c *MockEventParsing_GetBitbucketServerPullEventType_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/events/mocks/mock_github_pull_getter.go b/server/events/mocks/mock_github_pull_getter.go index d48bb08db8..d0c6b00539 100644 --- a/server/events/mocks/mock_github_pull_getter.go +++ b/server/events/mocks/mock_github_pull_getter.go @@ -45,60 +45,60 @@ func (mock *MockGithubPullGetter) GetPullRequest(repo models.Repo, pullNum int) return ret0, ret1 } -func (mock *MockGithubPullGetter) VerifyWasCalledOnce() *VerifierGithubPullGetter { - return &VerifierGithubPullGetter{ +func (mock *MockGithubPullGetter) VerifyWasCalledOnce() *VerifierMockGithubPullGetter { + return &VerifierMockGithubPullGetter{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockGithubPullGetter) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierGithubPullGetter { - return &VerifierGithubPullGetter{ +func (mock *MockGithubPullGetter) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockGithubPullGetter { + return &VerifierMockGithubPullGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockGithubPullGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierGithubPullGetter { - return &VerifierGithubPullGetter{ +func (mock *MockGithubPullGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGithubPullGetter { + return &VerifierMockGithubPullGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockGithubPullGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierGithubPullGetter { - return &VerifierGithubPullGetter{ +func (mock *MockGithubPullGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockGithubPullGetter { + return &VerifierMockGithubPullGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierGithubPullGetter struct { +type VerifierMockGithubPullGetter struct { mock *MockGithubPullGetter invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierGithubPullGetter) GetPullRequest(repo models.Repo, pullNum int) *GithubPullGetter_GetPullRequest_OngoingVerification { +func (verifier *VerifierMockGithubPullGetter) GetPullRequest(repo models.Repo, pullNum int) *MockGithubPullGetter_GetPullRequest_OngoingVerification { params := []pegomock.Param{repo, pullNum} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullRequest", params, verifier.timeout) - return &GithubPullGetter_GetPullRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockGithubPullGetter_GetPullRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type GithubPullGetter_GetPullRequest_OngoingVerification struct { +type MockGithubPullGetter_GetPullRequest_OngoingVerification struct { mock *MockGithubPullGetter methodInvocations []pegomock.MethodInvocation } -func (c *GithubPullGetter_GetPullRequest_OngoingVerification) GetCapturedArguments() (models.Repo, int) { +func (c *MockGithubPullGetter_GetPullRequest_OngoingVerification) GetCapturedArguments() (models.Repo, int) { repo, pullNum := c.GetAllCapturedArguments() return repo[len(repo)-1], pullNum[len(pullNum)-1] } -func (c *GithubPullGetter_GetPullRequest_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []int) { +func (c *MockGithubPullGetter_GetPullRequest_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []int) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) diff --git a/server/events/mocks/mock_gitlab_merge_request_getter.go b/server/events/mocks/mock_gitlab_merge_request_getter.go index 144607367f..5ce9632981 100644 --- a/server/events/mocks/mock_gitlab_merge_request_getter.go +++ b/server/events/mocks/mock_gitlab_merge_request_getter.go @@ -44,60 +44,60 @@ func (mock *MockGitlabMergeRequestGetter) GetMergeRequest(repoFullName string, p return ret0, ret1 } -func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledOnce() *VerifierGitlabMergeRequestGetter { - return &VerifierGitlabMergeRequestGetter{ +func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledOnce() *VerifierMockGitlabMergeRequestGetter { + return &VerifierMockGitlabMergeRequestGetter{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockGitlabMergeRequestGetter) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierGitlabMergeRequestGetter { - return &VerifierGitlabMergeRequestGetter{ +func (mock *MockGitlabMergeRequestGetter) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockGitlabMergeRequestGetter { + return &VerifierMockGitlabMergeRequestGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierGitlabMergeRequestGetter { - return &VerifierGitlabMergeRequestGetter{ +func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGitlabMergeRequestGetter { + return &VerifierMockGitlabMergeRequestGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierGitlabMergeRequestGetter { - return &VerifierGitlabMergeRequestGetter{ +func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockGitlabMergeRequestGetter { + return &VerifierMockGitlabMergeRequestGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierGitlabMergeRequestGetter struct { +type VerifierMockGitlabMergeRequestGetter struct { mock *MockGitlabMergeRequestGetter invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierGitlabMergeRequestGetter) GetMergeRequest(repoFullName string, pullNum int) *GitlabMergeRequestGetter_GetMergeRequest_OngoingVerification { +func (verifier *VerifierMockGitlabMergeRequestGetter) GetMergeRequest(repoFullName string, pullNum int) *MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification { params := []pegomock.Param{repoFullName, pullNum} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetMergeRequest", params, verifier.timeout) - return &GitlabMergeRequestGetter_GetMergeRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type GitlabMergeRequestGetter_GetMergeRequest_OngoingVerification struct { +type MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification struct { mock *MockGitlabMergeRequestGetter methodInvocations []pegomock.MethodInvocation } -func (c *GitlabMergeRequestGetter_GetMergeRequest_OngoingVerification) GetCapturedArguments() (string, int) { +func (c *MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification) GetCapturedArguments() (string, int) { repoFullName, pullNum := c.GetAllCapturedArguments() return repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1] } -func (c *GitlabMergeRequestGetter_GetMergeRequest_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []int) { +func (c *MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []int) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/events/mocks/mock_lock_url_generator.go b/server/events/mocks/mock_lock_url_generator.go index c7a916fdf2..769a81b6b7 100644 --- a/server/events/mocks/mock_lock_url_generator.go +++ b/server/events/mocks/mock_lock_url_generator.go @@ -39,60 +39,60 @@ func (mock *MockLockURLGenerator) GenerateLockURL(lockID string) string { return ret0 } -func (mock *MockLockURLGenerator) VerifyWasCalledOnce() *VerifierLockURLGenerator { - return &VerifierLockURLGenerator{ +func (mock *MockLockURLGenerator) VerifyWasCalledOnce() *VerifierMockLockURLGenerator { + return &VerifierMockLockURLGenerator{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockLockURLGenerator) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierLockURLGenerator { - return &VerifierLockURLGenerator{ +func (mock *MockLockURLGenerator) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockLockURLGenerator { + return &VerifierMockLockURLGenerator{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockLockURLGenerator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierLockURLGenerator { - return &VerifierLockURLGenerator{ +func (mock *MockLockURLGenerator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockLockURLGenerator { + return &VerifierMockLockURLGenerator{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockLockURLGenerator) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierLockURLGenerator { - return &VerifierLockURLGenerator{ +func (mock *MockLockURLGenerator) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockLockURLGenerator { + return &VerifierMockLockURLGenerator{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierLockURLGenerator struct { +type VerifierMockLockURLGenerator struct { mock *MockLockURLGenerator invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierLockURLGenerator) GenerateLockURL(lockID string) *LockURLGenerator_GenerateLockURL_OngoingVerification { +func (verifier *VerifierMockLockURLGenerator) GenerateLockURL(lockID string) *MockLockURLGenerator_GenerateLockURL_OngoingVerification { params := []pegomock.Param{lockID} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GenerateLockURL", params, verifier.timeout) - return &LockURLGenerator_GenerateLockURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockLockURLGenerator_GenerateLockURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type LockURLGenerator_GenerateLockURL_OngoingVerification struct { +type MockLockURLGenerator_GenerateLockURL_OngoingVerification struct { mock *MockLockURLGenerator methodInvocations []pegomock.MethodInvocation } -func (c *LockURLGenerator_GenerateLockURL_OngoingVerification) GetCapturedArguments() string { +func (c *MockLockURLGenerator_GenerateLockURL_OngoingVerification) GetCapturedArguments() string { lockID := c.GetAllCapturedArguments() return lockID[len(lockID)-1] } -func (c *LockURLGenerator_GenerateLockURL_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { +func (c *MockLockURLGenerator_GenerateLockURL_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/events/mocks/mock_pending_plan_finder.go b/server/events/mocks/mock_pending_plan_finder.go index 6f989a8868..0d729fc5e2 100644 --- a/server/events/mocks/mock_pending_plan_finder.go +++ b/server/events/mocks/mock_pending_plan_finder.go @@ -59,60 +59,60 @@ func (mock *MockPendingPlanFinder) DeletePlans(pullDir string) error { return ret0 } -func (mock *MockPendingPlanFinder) VerifyWasCalledOnce() *VerifierPendingPlanFinder { - return &VerifierPendingPlanFinder{ +func (mock *MockPendingPlanFinder) VerifyWasCalledOnce() *VerifierMockPendingPlanFinder { + return &VerifierMockPendingPlanFinder{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockPendingPlanFinder) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierPendingPlanFinder { - return &VerifierPendingPlanFinder{ +func (mock *MockPendingPlanFinder) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockPendingPlanFinder { + return &VerifierMockPendingPlanFinder{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockPendingPlanFinder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierPendingPlanFinder { - return &VerifierPendingPlanFinder{ +func (mock *MockPendingPlanFinder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPendingPlanFinder { + return &VerifierMockPendingPlanFinder{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockPendingPlanFinder) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierPendingPlanFinder { - return &VerifierPendingPlanFinder{ +func (mock *MockPendingPlanFinder) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockPendingPlanFinder { + return &VerifierMockPendingPlanFinder{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierPendingPlanFinder struct { +type VerifierMockPendingPlanFinder struct { mock *MockPendingPlanFinder invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierPendingPlanFinder) Find(pullDir string) *PendingPlanFinder_Find_OngoingVerification { +func (verifier *VerifierMockPendingPlanFinder) Find(pullDir string) *MockPendingPlanFinder_Find_OngoingVerification { params := []pegomock.Param{pullDir} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Find", params, verifier.timeout) - return &PendingPlanFinder_Find_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockPendingPlanFinder_Find_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type PendingPlanFinder_Find_OngoingVerification struct { +type MockPendingPlanFinder_Find_OngoingVerification struct { mock *MockPendingPlanFinder methodInvocations []pegomock.MethodInvocation } -func (c *PendingPlanFinder_Find_OngoingVerification) GetCapturedArguments() string { +func (c *MockPendingPlanFinder_Find_OngoingVerification) GetCapturedArguments() string { pullDir := c.GetAllCapturedArguments() return pullDir[len(pullDir)-1] } -func (c *PendingPlanFinder_Find_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { +func (c *MockPendingPlanFinder_Find_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) @@ -123,23 +123,23 @@ func (c *PendingPlanFinder_Find_OngoingVerification) GetAllCapturedArguments() ( return } -func (verifier *VerifierPendingPlanFinder) DeletePlans(pullDir string) *PendingPlanFinder_DeletePlans_OngoingVerification { +func (verifier *VerifierMockPendingPlanFinder) DeletePlans(pullDir string) *MockPendingPlanFinder_DeletePlans_OngoingVerification { params := []pegomock.Param{pullDir} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeletePlans", params, verifier.timeout) - return &PendingPlanFinder_DeletePlans_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockPendingPlanFinder_DeletePlans_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type PendingPlanFinder_DeletePlans_OngoingVerification struct { +type MockPendingPlanFinder_DeletePlans_OngoingVerification struct { mock *MockPendingPlanFinder methodInvocations []pegomock.MethodInvocation } -func (c *PendingPlanFinder_DeletePlans_OngoingVerification) GetCapturedArguments() string { +func (c *MockPendingPlanFinder_DeletePlans_OngoingVerification) GetCapturedArguments() string { pullDir := c.GetAllCapturedArguments() return pullDir[len(pullDir)-1] } -func (c *PendingPlanFinder_DeletePlans_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { +func (c *MockPendingPlanFinder_DeletePlans_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/events/mocks/mock_project_command_builder.go b/server/events/mocks/mock_project_command_builder.go index 2aa75e9291..6d4651ffb6 100644 --- a/server/events/mocks/mock_project_command_builder.go +++ b/server/events/mocks/mock_project_command_builder.go @@ -45,11 +45,11 @@ func (mock *MockProjectCommandBuilder) BuildAutoplanCommands(ctx *events.Command return ret0, ret1 } -func (mock *MockProjectCommandBuilder) BuildPlanCommands(ctx *events.CommandContext, commentCommand *events.CommentCommand) ([]models.ProjectCommandContext, error) { +func (mock *MockProjectCommandBuilder) BuildPlanCommands(ctx *events.CommandContext, comment *events.CommentCommand) ([]models.ProjectCommandContext, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().") } - params := []pegomock.Param{ctx, commentCommand} + params := []pegomock.Param{ctx, comment} result := pegomock.GetGenericMockFrom(mock).Invoke("BuildPlanCommands", params, []reflect.Type{reflect.TypeOf((*[]models.ProjectCommandContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) var ret0 []models.ProjectCommandContext var ret1 error @@ -64,11 +64,11 @@ func (mock *MockProjectCommandBuilder) BuildPlanCommands(ctx *events.CommandCont return ret0, ret1 } -func (mock *MockProjectCommandBuilder) BuildApplyCommands(ctx *events.CommandContext, commentCommand *events.CommentCommand) ([]models.ProjectCommandContext, error) { +func (mock *MockProjectCommandBuilder) BuildApplyCommands(ctx *events.CommandContext, comment *events.CommentCommand) ([]models.ProjectCommandContext, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().") } - params := []pegomock.Param{ctx, commentCommand} + params := []pegomock.Param{ctx, comment} result := pegomock.GetGenericMockFrom(mock).Invoke("BuildApplyCommands", params, []reflect.Type{reflect.TypeOf((*[]models.ProjectCommandContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) var ret0 []models.ProjectCommandContext var ret1 error @@ -83,60 +83,60 @@ func (mock *MockProjectCommandBuilder) BuildApplyCommands(ctx *events.CommandCon return ret0, ret1 } -func (mock *MockProjectCommandBuilder) VerifyWasCalledOnce() *VerifierProjectCommandBuilder { - return &VerifierProjectCommandBuilder{ +func (mock *MockProjectCommandBuilder) VerifyWasCalledOnce() *VerifierMockProjectCommandBuilder { + return &VerifierMockProjectCommandBuilder{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockProjectCommandBuilder) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierProjectCommandBuilder { - return &VerifierProjectCommandBuilder{ +func (mock *MockProjectCommandBuilder) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockProjectCommandBuilder { + return &VerifierMockProjectCommandBuilder{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockProjectCommandBuilder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierProjectCommandBuilder { - return &VerifierProjectCommandBuilder{ +func (mock *MockProjectCommandBuilder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectCommandBuilder { + return &VerifierMockProjectCommandBuilder{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockProjectCommandBuilder) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierProjectCommandBuilder { - return &VerifierProjectCommandBuilder{ +func (mock *MockProjectCommandBuilder) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockProjectCommandBuilder { + return &VerifierMockProjectCommandBuilder{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierProjectCommandBuilder struct { +type VerifierMockProjectCommandBuilder struct { mock *MockProjectCommandBuilder invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierProjectCommandBuilder) BuildAutoplanCommands(ctx *events.CommandContext) *ProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification { +func (verifier *VerifierMockProjectCommandBuilder) BuildAutoplanCommands(ctx *events.CommandContext) *MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification { params := []pegomock.Param{ctx} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildAutoplanCommands", params, verifier.timeout) - return &ProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type ProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification struct { +type MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification struct { mock *MockProjectCommandBuilder methodInvocations []pegomock.MethodInvocation } -func (c *ProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification) GetCapturedArguments() *events.CommandContext { +func (c *MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification) GetCapturedArguments() *events.CommandContext { ctx := c.GetAllCapturedArguments() return ctx[len(ctx)-1] } -func (c *ProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*events.CommandContext) { +func (c *MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*events.CommandContext) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*events.CommandContext, len(params[0])) @@ -147,23 +147,23 @@ func (c *ProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification) GetAll return } -func (verifier *VerifierProjectCommandBuilder) BuildPlanCommands(ctx *events.CommandContext, commentCommand *events.CommentCommand) *ProjectCommandBuilder_BuildPlanCommands_OngoingVerification { - params := []pegomock.Param{ctx, commentCommand} +func (verifier *VerifierMockProjectCommandBuilder) BuildPlanCommands(ctx *events.CommandContext, comment *events.CommentCommand) *MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification { + params := []pegomock.Param{ctx, comment} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildPlanCommands", params, verifier.timeout) - return &ProjectCommandBuilder_BuildPlanCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type ProjectCommandBuilder_BuildPlanCommands_OngoingVerification struct { +type MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification struct { mock *MockProjectCommandBuilder methodInvocations []pegomock.MethodInvocation } -func (c *ProjectCommandBuilder_BuildPlanCommands_OngoingVerification) GetCapturedArguments() (*events.CommandContext, *events.CommentCommand) { - ctx, commentCommand := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], commentCommand[len(commentCommand)-1] +func (c *MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification) GetCapturedArguments() (*events.CommandContext, *events.CommentCommand) { + ctx, comment := c.GetAllCapturedArguments() + return ctx[len(ctx)-1], comment[len(comment)-1] } -func (c *ProjectCommandBuilder_BuildPlanCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*events.CommandContext, _param1 []*events.CommentCommand) { +func (c *MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*events.CommandContext, _param1 []*events.CommentCommand) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*events.CommandContext, len(params[0])) @@ -178,23 +178,23 @@ func (c *ProjectCommandBuilder_BuildPlanCommands_OngoingVerification) GetAllCapt return } -func (verifier *VerifierProjectCommandBuilder) BuildApplyCommands(ctx *events.CommandContext, commentCommand *events.CommentCommand) *ProjectCommandBuilder_BuildApplyCommands_OngoingVerification { - params := []pegomock.Param{ctx, commentCommand} +func (verifier *VerifierMockProjectCommandBuilder) BuildApplyCommands(ctx *events.CommandContext, comment *events.CommentCommand) *MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification { + params := []pegomock.Param{ctx, comment} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildApplyCommands", params, verifier.timeout) - return &ProjectCommandBuilder_BuildApplyCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type ProjectCommandBuilder_BuildApplyCommands_OngoingVerification struct { +type MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification struct { mock *MockProjectCommandBuilder methodInvocations []pegomock.MethodInvocation } -func (c *ProjectCommandBuilder_BuildApplyCommands_OngoingVerification) GetCapturedArguments() (*events.CommandContext, *events.CommentCommand) { - ctx, commentCommand := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], commentCommand[len(commentCommand)-1] +func (c *MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification) GetCapturedArguments() (*events.CommandContext, *events.CommentCommand) { + ctx, comment := c.GetAllCapturedArguments() + return ctx[len(ctx)-1], comment[len(comment)-1] } -func (c *ProjectCommandBuilder_BuildApplyCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*events.CommandContext, _param1 []*events.CommentCommand) { +func (c *MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*events.CommandContext, _param1 []*events.CommentCommand) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*events.CommandContext, len(params[0])) diff --git a/server/events/mocks/mock_project_command_runner.go b/server/events/mocks/mock_project_command_runner.go index 0a81e3ba71..f524e3ad7d 100644 --- a/server/events/mocks/mock_project_command_runner.go +++ b/server/events/mocks/mock_project_command_runner.go @@ -55,60 +55,60 @@ func (mock *MockProjectCommandRunner) Apply(ctx models.ProjectCommandContext) mo return ret0 } -func (mock *MockProjectCommandRunner) VerifyWasCalledOnce() *VerifierProjectCommandRunner { - return &VerifierProjectCommandRunner{ +func (mock *MockProjectCommandRunner) VerifyWasCalledOnce() *VerifierMockProjectCommandRunner { + return &VerifierMockProjectCommandRunner{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockProjectCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierProjectCommandRunner { - return &VerifierProjectCommandRunner{ +func (mock *MockProjectCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockProjectCommandRunner { + return &VerifierMockProjectCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockProjectCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierProjectCommandRunner { - return &VerifierProjectCommandRunner{ +func (mock *MockProjectCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectCommandRunner { + return &VerifierMockProjectCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockProjectCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierProjectCommandRunner { - return &VerifierProjectCommandRunner{ +func (mock *MockProjectCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockProjectCommandRunner { + return &VerifierMockProjectCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierProjectCommandRunner struct { +type VerifierMockProjectCommandRunner struct { mock *MockProjectCommandRunner invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierProjectCommandRunner) Plan(ctx models.ProjectCommandContext) *ProjectCommandRunner_Plan_OngoingVerification { +func (verifier *VerifierMockProjectCommandRunner) Plan(ctx models.ProjectCommandContext) *MockProjectCommandRunner_Plan_OngoingVerification { params := []pegomock.Param{ctx} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Plan", params, verifier.timeout) - return &ProjectCommandRunner_Plan_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockProjectCommandRunner_Plan_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type ProjectCommandRunner_Plan_OngoingVerification struct { +type MockProjectCommandRunner_Plan_OngoingVerification struct { mock *MockProjectCommandRunner methodInvocations []pegomock.MethodInvocation } -func (c *ProjectCommandRunner_Plan_OngoingVerification) GetCapturedArguments() models.ProjectCommandContext { +func (c *MockProjectCommandRunner_Plan_OngoingVerification) GetCapturedArguments() models.ProjectCommandContext { ctx := c.GetAllCapturedArguments() return ctx[len(ctx)-1] } -func (c *ProjectCommandRunner_Plan_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext) { +func (c *MockProjectCommandRunner_Plan_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.ProjectCommandContext, len(params[0])) @@ -119,23 +119,23 @@ func (c *ProjectCommandRunner_Plan_OngoingVerification) GetAllCapturedArguments( return } -func (verifier *VerifierProjectCommandRunner) Apply(ctx models.ProjectCommandContext) *ProjectCommandRunner_Apply_OngoingVerification { +func (verifier *VerifierMockProjectCommandRunner) Apply(ctx models.ProjectCommandContext) *MockProjectCommandRunner_Apply_OngoingVerification { params := []pegomock.Param{ctx} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Apply", params, verifier.timeout) - return &ProjectCommandRunner_Apply_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockProjectCommandRunner_Apply_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type ProjectCommandRunner_Apply_OngoingVerification struct { +type MockProjectCommandRunner_Apply_OngoingVerification struct { mock *MockProjectCommandRunner methodInvocations []pegomock.MethodInvocation } -func (c *ProjectCommandRunner_Apply_OngoingVerification) GetCapturedArguments() models.ProjectCommandContext { +func (c *MockProjectCommandRunner_Apply_OngoingVerification) GetCapturedArguments() models.ProjectCommandContext { ctx := c.GetAllCapturedArguments() return ctx[len(ctx)-1] } -func (c *ProjectCommandRunner_Apply_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext) { +func (c *MockProjectCommandRunner_Apply_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.ProjectCommandContext, len(params[0])) diff --git a/server/events/mocks/mock_project_lock.go b/server/events/mocks/mock_project_lock.go index 4915e66932..22fc90f117 100644 --- a/server/events/mocks/mock_project_lock.go +++ b/server/events/mocks/mock_project_lock.go @@ -46,60 +46,60 @@ func (mock *MockProjectLocker) TryLock(log *logging.SimpleLogger, pull models.Pu return ret0, ret1 } -func (mock *MockProjectLocker) VerifyWasCalledOnce() *VerifierProjectLocker { - return &VerifierProjectLocker{ +func (mock *MockProjectLocker) VerifyWasCalledOnce() *VerifierMockProjectLocker { + return &VerifierMockProjectLocker{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockProjectLocker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierProjectLocker { - return &VerifierProjectLocker{ +func (mock *MockProjectLocker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockProjectLocker { + return &VerifierMockProjectLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockProjectLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierProjectLocker { - return &VerifierProjectLocker{ +func (mock *MockProjectLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectLocker { + return &VerifierMockProjectLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockProjectLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierProjectLocker { - return &VerifierProjectLocker{ +func (mock *MockProjectLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockProjectLocker { + return &VerifierMockProjectLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierProjectLocker struct { +type VerifierMockProjectLocker struct { mock *MockProjectLocker invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierProjectLocker) TryLock(log *logging.SimpleLogger, pull models.PullRequest, user models.User, workspace string, project models.Project) *ProjectLocker_TryLock_OngoingVerification { +func (verifier *VerifierMockProjectLocker) TryLock(log *logging.SimpleLogger, pull models.PullRequest, user models.User, workspace string, project models.Project) *MockProjectLocker_TryLock_OngoingVerification { params := []pegomock.Param{log, pull, user, workspace, project} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLock", params, verifier.timeout) - return &ProjectLocker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockProjectLocker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type ProjectLocker_TryLock_OngoingVerification struct { +type MockProjectLocker_TryLock_OngoingVerification struct { mock *MockProjectLocker methodInvocations []pegomock.MethodInvocation } -func (c *ProjectLocker_TryLock_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, models.PullRequest, models.User, string, models.Project) { +func (c *MockProjectLocker_TryLock_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, models.PullRequest, models.User, string, models.Project) { log, pull, user, workspace, project := c.GetAllCapturedArguments() return log[len(log)-1], pull[len(pull)-1], user[len(user)-1], workspace[len(workspace)-1], project[len(project)-1] } -func (c *ProjectLocker_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []models.PullRequest, _param2 []models.User, _param3 []string, _param4 []models.Project) { +func (c *MockProjectLocker_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []models.PullRequest, _param2 []models.User, _param3 []string, _param4 []models.Project) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*logging.SimpleLogger, len(params[0])) diff --git a/server/events/mocks/mock_pull_cleaner.go b/server/events/mocks/mock_pull_cleaner.go index 777d86af6f..a021428855 100644 --- a/server/events/mocks/mock_pull_cleaner.go +++ b/server/events/mocks/mock_pull_cleaner.go @@ -40,60 +40,60 @@ func (mock *MockPullCleaner) CleanUpPull(repo models.Repo, pull models.PullReque return ret0 } -func (mock *MockPullCleaner) VerifyWasCalledOnce() *VerifierPullCleaner { - return &VerifierPullCleaner{ +func (mock *MockPullCleaner) VerifyWasCalledOnce() *VerifierMockPullCleaner { + return &VerifierMockPullCleaner{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockPullCleaner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierPullCleaner { - return &VerifierPullCleaner{ +func (mock *MockPullCleaner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockPullCleaner { + return &VerifierMockPullCleaner{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockPullCleaner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierPullCleaner { - return &VerifierPullCleaner{ +func (mock *MockPullCleaner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPullCleaner { + return &VerifierMockPullCleaner{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockPullCleaner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierPullCleaner { - return &VerifierPullCleaner{ +func (mock *MockPullCleaner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockPullCleaner { + return &VerifierMockPullCleaner{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierPullCleaner struct { +type VerifierMockPullCleaner struct { mock *MockPullCleaner invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierPullCleaner) CleanUpPull(repo models.Repo, pull models.PullRequest) *PullCleaner_CleanUpPull_OngoingVerification { +func (verifier *VerifierMockPullCleaner) CleanUpPull(repo models.Repo, pull models.PullRequest) *MockPullCleaner_CleanUpPull_OngoingVerification { params := []pegomock.Param{repo, pull} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CleanUpPull", params, verifier.timeout) - return &PullCleaner_CleanUpPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockPullCleaner_CleanUpPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type PullCleaner_CleanUpPull_OngoingVerification struct { +type MockPullCleaner_CleanUpPull_OngoingVerification struct { mock *MockPullCleaner methodInvocations []pegomock.MethodInvocation } -func (c *PullCleaner_CleanUpPull_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { +func (c *MockPullCleaner_CleanUpPull_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { repo, pull := c.GetAllCapturedArguments() return repo[len(repo)-1], pull[len(pull)-1] } -func (c *PullCleaner_CleanUpPull_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { +func (c *MockPullCleaner_CleanUpPull_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) diff --git a/server/events/mocks/mock_step_runner.go b/server/events/mocks/mock_step_runner.go index c090958169..4f5af225e3 100644 --- a/server/events/mocks/mock_step_runner.go +++ b/server/events/mocks/mock_step_runner.go @@ -44,60 +44,60 @@ func (mock *MockStepRunner) Run(ctx models.ProjectCommandContext, extraArgs []st return ret0, ret1 } -func (mock *MockStepRunner) VerifyWasCalledOnce() *VerifierStepRunner { - return &VerifierStepRunner{ +func (mock *MockStepRunner) VerifyWasCalledOnce() *VerifierMockStepRunner { + return &VerifierMockStepRunner{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierStepRunner { - return &VerifierStepRunner{ +func (mock *MockStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockStepRunner { + return &VerifierMockStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierStepRunner { - return &VerifierStepRunner{ +func (mock *MockStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockStepRunner { + return &VerifierMockStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierStepRunner { - return &VerifierStepRunner{ +func (mock *MockStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockStepRunner { + return &VerifierMockStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierStepRunner struct { +type VerifierMockStepRunner struct { mock *MockStepRunner invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierStepRunner) Run(ctx models.ProjectCommandContext, extraArgs []string, path string) *StepRunner_Run_OngoingVerification { +func (verifier *VerifierMockStepRunner) Run(ctx models.ProjectCommandContext, extraArgs []string, path string) *MockStepRunner_Run_OngoingVerification { params := []pegomock.Param{ctx, extraArgs, path} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", params, verifier.timeout) - return &StepRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockStepRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type StepRunner_Run_OngoingVerification struct { +type MockStepRunner_Run_OngoingVerification struct { mock *MockStepRunner methodInvocations []pegomock.MethodInvocation } -func (c *StepRunner_Run_OngoingVerification) GetCapturedArguments() (models.ProjectCommandContext, []string, string) { +func (c *MockStepRunner_Run_OngoingVerification) GetCapturedArguments() (models.ProjectCommandContext, []string, string) { ctx, extraArgs, path := c.GetAllCapturedArguments() return ctx[len(ctx)-1], extraArgs[len(extraArgs)-1], path[len(path)-1] } -func (c *StepRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext, _param1 [][]string, _param2 []string) { +func (c *MockStepRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []models.ProjectCommandContext, _param1 [][]string, _param2 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.ProjectCommandContext, len(params[0])) diff --git a/server/events/mocks/mock_webhooks_sender.go b/server/events/mocks/mock_webhooks_sender.go index c8b0be68bd..d12b3493dc 100644 --- a/server/events/mocks/mock_webhooks_sender.go +++ b/server/events/mocks/mock_webhooks_sender.go @@ -41,60 +41,60 @@ func (mock *MockWebhooksSender) Send(log *logging.SimpleLogger, res webhooks.App return ret0 } -func (mock *MockWebhooksSender) VerifyWasCalledOnce() *VerifierWebhooksSender { - return &VerifierWebhooksSender{ +func (mock *MockWebhooksSender) VerifyWasCalledOnce() *VerifierMockWebhooksSender { + return &VerifierMockWebhooksSender{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockWebhooksSender) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierWebhooksSender { - return &VerifierWebhooksSender{ +func (mock *MockWebhooksSender) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockWebhooksSender { + return &VerifierMockWebhooksSender{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockWebhooksSender) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierWebhooksSender { - return &VerifierWebhooksSender{ +func (mock *MockWebhooksSender) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWebhooksSender { + return &VerifierMockWebhooksSender{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockWebhooksSender) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierWebhooksSender { - return &VerifierWebhooksSender{ +func (mock *MockWebhooksSender) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockWebhooksSender { + return &VerifierMockWebhooksSender{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierWebhooksSender struct { +type VerifierMockWebhooksSender struct { mock *MockWebhooksSender invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierWebhooksSender) Send(log *logging.SimpleLogger, res webhooks.ApplyResult) *WebhooksSender_Send_OngoingVerification { +func (verifier *VerifierMockWebhooksSender) Send(log *logging.SimpleLogger, res webhooks.ApplyResult) *MockWebhooksSender_Send_OngoingVerification { params := []pegomock.Param{log, res} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Send", params, verifier.timeout) - return &WebhooksSender_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWebhooksSender_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WebhooksSender_Send_OngoingVerification struct { +type MockWebhooksSender_Send_OngoingVerification struct { mock *MockWebhooksSender methodInvocations []pegomock.MethodInvocation } -func (c *WebhooksSender_Send_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, webhooks.ApplyResult) { +func (c *MockWebhooksSender_Send_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, webhooks.ApplyResult) { log, res := c.GetAllCapturedArguments() return log[len(log)-1], res[len(res)-1] } -func (c *WebhooksSender_Send_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []webhooks.ApplyResult) { +func (c *MockWebhooksSender_Send_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []webhooks.ApplyResult) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*logging.SimpleLogger, len(params[0])) diff --git a/server/events/mocks/mock_working_dir.go b/server/events/mocks/mock_working_dir.go index 281feac17e..fbe85ae1f7 100644 --- a/server/events/mocks/mock_working_dir.go +++ b/server/events/mocks/mock_working_dir.go @@ -113,60 +113,60 @@ func (mock *MockWorkingDir) DeleteForWorkspace(r models.Repo, p models.PullReque return ret0 } -func (mock *MockWorkingDir) VerifyWasCalledOnce() *VerifierWorkingDir { - return &VerifierWorkingDir{ +func (mock *MockWorkingDir) VerifyWasCalledOnce() *VerifierMockWorkingDir { + return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockWorkingDir) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierWorkingDir { - return &VerifierWorkingDir{ +func (mock *MockWorkingDir) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockWorkingDir { + return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierWorkingDir { - return &VerifierWorkingDir{ +func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDir { + return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierWorkingDir { - return &VerifierWorkingDir{ +func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockWorkingDir { + return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierWorkingDir struct { +type VerifierMockWorkingDir struct { mock *MockWorkingDir invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierWorkingDir) Clone(log *logging.SimpleLogger, baseRepo models.Repo, headRepo models.Repo, p models.PullRequest, workspace string) *WorkingDir_Clone_OngoingVerification { +func (verifier *VerifierMockWorkingDir) Clone(log *logging.SimpleLogger, baseRepo models.Repo, headRepo models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_Clone_OngoingVerification { params := []pegomock.Param{log, baseRepo, headRepo, p, workspace} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Clone", params, verifier.timeout) - return &WorkingDir_Clone_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDir_Clone_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDir_Clone_OngoingVerification struct { +type MockWorkingDir_Clone_OngoingVerification struct { mock *MockWorkingDir methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDir_Clone_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, models.Repo, models.Repo, models.PullRequest, string) { +func (c *MockWorkingDir_Clone_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, models.Repo, models.Repo, models.PullRequest, string) { log, baseRepo, headRepo, p, workspace := c.GetAllCapturedArguments() return log[len(log)-1], baseRepo[len(baseRepo)-1], headRepo[len(headRepo)-1], p[len(p)-1], workspace[len(workspace)-1] } -func (c *WorkingDir_Clone_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []models.Repo, _param2 []models.Repo, _param3 []models.PullRequest, _param4 []string) { +func (c *MockWorkingDir_Clone_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []models.Repo, _param2 []models.Repo, _param3 []models.PullRequest, _param4 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*logging.SimpleLogger, len(params[0])) @@ -193,23 +193,23 @@ func (c *WorkingDir_Clone_OngoingVerification) GetAllCapturedArguments() (_param return } -func (verifier *VerifierWorkingDir) GetWorkingDir(r models.Repo, p models.PullRequest, workspace string) *WorkingDir_GetWorkingDir_OngoingVerification { +func (verifier *VerifierMockWorkingDir) GetWorkingDir(r models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_GetWorkingDir_OngoingVerification { params := []pegomock.Param{r, p, workspace} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetWorkingDir", params, verifier.timeout) - return &WorkingDir_GetWorkingDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDir_GetWorkingDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDir_GetWorkingDir_OngoingVerification struct { +type MockWorkingDir_GetWorkingDir_OngoingVerification struct { mock *MockWorkingDir methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDir_GetWorkingDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, string) { +func (c *MockWorkingDir_GetWorkingDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, string) { r, p, workspace := c.GetAllCapturedArguments() return r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1] } -func (c *WorkingDir_GetWorkingDir_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []string) { +func (c *MockWorkingDir_GetWorkingDir_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -228,23 +228,23 @@ func (c *WorkingDir_GetWorkingDir_OngoingVerification) GetAllCapturedArguments() return } -func (verifier *VerifierWorkingDir) GetPullDir(r models.Repo, p models.PullRequest) *WorkingDir_GetPullDir_OngoingVerification { +func (verifier *VerifierMockWorkingDir) GetPullDir(r models.Repo, p models.PullRequest) *MockWorkingDir_GetPullDir_OngoingVerification { params := []pegomock.Param{r, p} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullDir", params, verifier.timeout) - return &WorkingDir_GetPullDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDir_GetPullDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDir_GetPullDir_OngoingVerification struct { +type MockWorkingDir_GetPullDir_OngoingVerification struct { mock *MockWorkingDir methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDir_GetPullDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { +func (c *MockWorkingDir_GetPullDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { r, p := c.GetAllCapturedArguments() return r[len(r)-1], p[len(p)-1] } -func (c *WorkingDir_GetPullDir_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { +func (c *MockWorkingDir_GetPullDir_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -259,23 +259,23 @@ func (c *WorkingDir_GetPullDir_OngoingVerification) GetAllCapturedArguments() (_ return } -func (verifier *VerifierWorkingDir) Delete(r models.Repo, p models.PullRequest) *WorkingDir_Delete_OngoingVerification { +func (verifier *VerifierMockWorkingDir) Delete(r models.Repo, p models.PullRequest) *MockWorkingDir_Delete_OngoingVerification { params := []pegomock.Param{r, p} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Delete", params, verifier.timeout) - return &WorkingDir_Delete_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDir_Delete_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDir_Delete_OngoingVerification struct { +type MockWorkingDir_Delete_OngoingVerification struct { mock *MockWorkingDir methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDir_Delete_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { +func (c *MockWorkingDir_Delete_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { r, p := c.GetAllCapturedArguments() return r[len(r)-1], p[len(p)-1] } -func (c *WorkingDir_Delete_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { +func (c *MockWorkingDir_Delete_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -290,23 +290,23 @@ func (c *WorkingDir_Delete_OngoingVerification) GetAllCapturedArguments() (_para return } -func (verifier *VerifierWorkingDir) DeleteForWorkspace(r models.Repo, p models.PullRequest, workspace string) *WorkingDir_DeleteForWorkspace_OngoingVerification { +func (verifier *VerifierMockWorkingDir) DeleteForWorkspace(r models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_DeleteForWorkspace_OngoingVerification { params := []pegomock.Param{r, p, workspace} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteForWorkspace", params, verifier.timeout) - return &WorkingDir_DeleteForWorkspace_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDir_DeleteForWorkspace_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDir_DeleteForWorkspace_OngoingVerification struct { +type MockWorkingDir_DeleteForWorkspace_OngoingVerification struct { mock *MockWorkingDir methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDir_DeleteForWorkspace_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, string) { +func (c *MockWorkingDir_DeleteForWorkspace_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, string) { r, p, workspace := c.GetAllCapturedArguments() return r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1] } -func (c *WorkingDir_DeleteForWorkspace_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []string) { +func (c *MockWorkingDir_DeleteForWorkspace_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) diff --git a/server/events/mocks/mock_working_dir_locker.go b/server/events/mocks/mock_working_dir_locker.go index 94b67a8d3c..e9df152e3b 100644 --- a/server/events/mocks/mock_working_dir_locker.go +++ b/server/events/mocks/mock_working_dir_locker.go @@ -62,60 +62,60 @@ func (mock *MockWorkingDirLocker) TryLockPull(repoFullName string, pullNum int) return ret0, ret1 } -func (mock *MockWorkingDirLocker) VerifyWasCalledOnce() *VerifierWorkingDirLocker { - return &VerifierWorkingDirLocker{ +func (mock *MockWorkingDirLocker) VerifyWasCalledOnce() *VerifierMockWorkingDirLocker { + return &VerifierMockWorkingDirLocker{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockWorkingDirLocker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierWorkingDirLocker { - return &VerifierWorkingDirLocker{ +func (mock *MockWorkingDirLocker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockWorkingDirLocker { + return &VerifierMockWorkingDirLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockWorkingDirLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierWorkingDirLocker { - return &VerifierWorkingDirLocker{ +func (mock *MockWorkingDirLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDirLocker { + return &VerifierMockWorkingDirLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockWorkingDirLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierWorkingDirLocker { - return &VerifierWorkingDirLocker{ +func (mock *MockWorkingDirLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockWorkingDirLocker { + return &VerifierMockWorkingDirLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierWorkingDirLocker struct { +type VerifierMockWorkingDirLocker struct { mock *MockWorkingDirLocker invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierWorkingDirLocker) TryLock(repoFullName string, pullNum int, workspace string) *WorkingDirLocker_TryLock_OngoingVerification { +func (verifier *VerifierMockWorkingDirLocker) TryLock(repoFullName string, pullNum int, workspace string) *MockWorkingDirLocker_TryLock_OngoingVerification { params := []pegomock.Param{repoFullName, pullNum, workspace} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLock", params, verifier.timeout) - return &WorkingDirLocker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDirLocker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDirLocker_TryLock_OngoingVerification struct { +type MockWorkingDirLocker_TryLock_OngoingVerification struct { mock *MockWorkingDirLocker methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDirLocker_TryLock_OngoingVerification) GetCapturedArguments() (string, int, string) { +func (c *MockWorkingDirLocker_TryLock_OngoingVerification) GetCapturedArguments() (string, int, string) { repoFullName, pullNum, workspace := c.GetAllCapturedArguments() return repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1], workspace[len(workspace)-1] } -func (c *WorkingDirLocker_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []int, _param2 []string) { +func (c *MockWorkingDirLocker_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []int, _param2 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) @@ -134,23 +134,23 @@ func (c *WorkingDirLocker_TryLock_OngoingVerification) GetAllCapturedArguments() return } -func (verifier *VerifierWorkingDirLocker) TryLockPull(repoFullName string, pullNum int) *WorkingDirLocker_TryLockPull_OngoingVerification { +func (verifier *VerifierMockWorkingDirLocker) TryLockPull(repoFullName string, pullNum int) *MockWorkingDirLocker_TryLockPull_OngoingVerification { params := []pegomock.Param{repoFullName, pullNum} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLockPull", params, verifier.timeout) - return &WorkingDirLocker_TryLockPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockWorkingDirLocker_TryLockPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type WorkingDirLocker_TryLockPull_OngoingVerification struct { +type MockWorkingDirLocker_TryLockPull_OngoingVerification struct { mock *MockWorkingDirLocker methodInvocations []pegomock.MethodInvocation } -func (c *WorkingDirLocker_TryLockPull_OngoingVerification) GetCapturedArguments() (string, int) { +func (c *MockWorkingDirLocker_TryLockPull_OngoingVerification) GetCapturedArguments() (string, int) { repoFullName, pullNum := c.GetAllCapturedArguments() return repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1] } -func (c *WorkingDirLocker_TryLockPull_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []int) { +func (c *MockWorkingDirLocker_TryLockPull_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []int) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/events/runtime/mocks/mock_pull_approved_checker.go b/server/events/runtime/mocks/mock_pull_approved_checker.go index 430eae5f10..4e67a05344 100644 --- a/server/events/runtime/mocks/mock_pull_approved_checker.go +++ b/server/events/runtime/mocks/mock_pull_approved_checker.go @@ -44,60 +44,60 @@ func (mock *MockPullApprovedChecker) PullIsApproved(baseRepo models.Repo, pull m return ret0, ret1 } -func (mock *MockPullApprovedChecker) VerifyWasCalledOnce() *VerifierPullApprovedChecker { - return &VerifierPullApprovedChecker{ +func (mock *MockPullApprovedChecker) VerifyWasCalledOnce() *VerifierMockPullApprovedChecker { + return &VerifierMockPullApprovedChecker{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockPullApprovedChecker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierPullApprovedChecker { - return &VerifierPullApprovedChecker{ +func (mock *MockPullApprovedChecker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockPullApprovedChecker { + return &VerifierMockPullApprovedChecker{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockPullApprovedChecker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierPullApprovedChecker { - return &VerifierPullApprovedChecker{ +func (mock *MockPullApprovedChecker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPullApprovedChecker { + return &VerifierMockPullApprovedChecker{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockPullApprovedChecker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierPullApprovedChecker { - return &VerifierPullApprovedChecker{ +func (mock *MockPullApprovedChecker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockPullApprovedChecker { + return &VerifierMockPullApprovedChecker{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierPullApprovedChecker struct { +type VerifierMockPullApprovedChecker struct { mock *MockPullApprovedChecker invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierPullApprovedChecker) PullIsApproved(baseRepo models.Repo, pull models.PullRequest) *PullApprovedChecker_PullIsApproved_OngoingVerification { +func (verifier *VerifierMockPullApprovedChecker) PullIsApproved(baseRepo models.Repo, pull models.PullRequest) *MockPullApprovedChecker_PullIsApproved_OngoingVerification { params := []pegomock.Param{baseRepo, pull} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PullIsApproved", params, verifier.timeout) - return &PullApprovedChecker_PullIsApproved_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockPullApprovedChecker_PullIsApproved_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type PullApprovedChecker_PullIsApproved_OngoingVerification struct { +type MockPullApprovedChecker_PullIsApproved_OngoingVerification struct { mock *MockPullApprovedChecker methodInvocations []pegomock.MethodInvocation } -func (c *PullApprovedChecker_PullIsApproved_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { +func (c *MockPullApprovedChecker_PullIsApproved_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { baseRepo, pull := c.GetAllCapturedArguments() return baseRepo[len(baseRepo)-1], pull[len(pull)-1] } -func (c *PullApprovedChecker_PullIsApproved_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { +func (c *MockPullApprovedChecker_PullIsApproved_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) diff --git a/server/events/terraform/mocks/mock_downloader.go b/server/events/terraform/mocks/mock_downloader.go index 9788877e2b..f944f5b472 100644 --- a/server/events/terraform/mocks/mock_downloader.go +++ b/server/events/terraform/mocks/mock_downloader.go @@ -43,63 +43,63 @@ func (mock *MockDownloader) GetFile(dst string, src string, opts ...go_getter.Cl return ret0 } -func (mock *MockDownloader) VerifyWasCalledOnce() *VerifierDownloader { - return &VerifierDownloader{ +func (mock *MockDownloader) VerifyWasCalledOnce() *VerifierMockDownloader { + return &VerifierMockDownloader{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockDownloader) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierDownloader { - return &VerifierDownloader{ +func (mock *MockDownloader) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockDownloader { + return &VerifierMockDownloader{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockDownloader) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierDownloader { - return &VerifierDownloader{ +func (mock *MockDownloader) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockDownloader { + return &VerifierMockDownloader{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockDownloader) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierDownloader { - return &VerifierDownloader{ +func (mock *MockDownloader) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockDownloader { + return &VerifierMockDownloader{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierDownloader struct { +type VerifierMockDownloader struct { mock *MockDownloader invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierDownloader) GetFile(dst string, src string, opts ...go_getter.ClientOption) *Downloader_GetFile_OngoingVerification { +func (verifier *VerifierMockDownloader) GetFile(dst string, src string, opts ...go_getter.ClientOption) *MockDownloader_GetFile_OngoingVerification { params := []pegomock.Param{dst, src} for _, param := range opts { params = append(params, param) } methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetFile", params, verifier.timeout) - return &Downloader_GetFile_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockDownloader_GetFile_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Downloader_GetFile_OngoingVerification struct { +type MockDownloader_GetFile_OngoingVerification struct { mock *MockDownloader methodInvocations []pegomock.MethodInvocation } -func (c *Downloader_GetFile_OngoingVerification) GetCapturedArguments() (string, string, []go_getter.ClientOption) { +func (c *MockDownloader_GetFile_OngoingVerification) GetCapturedArguments() (string, string, []go_getter.ClientOption) { dst, src, opts := c.GetAllCapturedArguments() return dst[len(dst)-1], src[len(src)-1], opts[len(opts)-1] } -func (c *Downloader_GetFile_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 [][]go_getter.ClientOption) { +func (c *MockDownloader_GetFile_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 [][]go_getter.ClientOption) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/events/terraform/mocks/mock_terraform_client.go b/server/events/terraform/mocks/mock_terraform_client.go index fd7967dab8..bfb1d4dfc5 100644 --- a/server/events/terraform/mocks/mock_terraform_client.go +++ b/server/events/terraform/mocks/mock_terraform_client.go @@ -26,21 +26,6 @@ func NewMockClient(options ...pegomock.Option) *MockClient { func (mock *MockClient) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } func (mock *MockClient) FailHandler() pegomock.FailHandler { return mock.fail } -func (mock *MockClient) Version() *go_version.Version { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockClient().") - } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("DefaultVersion", params, []reflect.Type{reflect.TypeOf((**go_version.Version)(nil)).Elem()}) - var ret0 *go_version.Version - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*go_version.Version) - } - } - return ret0 -} - func (mock *MockClient) RunCommandWithVersion(log *logging.SimpleLogger, path string, args []string, v *go_version.Version, workspace string) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") @@ -60,77 +45,60 @@ func (mock *MockClient) RunCommandWithVersion(log *logging.SimpleLogger, path st return ret0, ret1 } -func (mock *MockClient) VerifyWasCalledOnce() *VerifierClient { - return &VerifierClient{ +func (mock *MockClient) VerifyWasCalledOnce() *VerifierMockClient { + return &VerifierMockClient{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierClient { - return &VerifierClient{ +func (mock *MockClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockClient { + return &VerifierMockClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierClient { - return &VerifierClient{ +func (mock *MockClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockClient { + return &VerifierMockClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierClient { - return &VerifierClient{ +func (mock *MockClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockClient { + return &VerifierMockClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierClient struct { +type VerifierMockClient struct { mock *MockClient invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierClient) Version() *Client_Version_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DefaultVersion", params, verifier.timeout) - return &Client_Version_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type Client_Version_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *Client_Version_OngoingVerification) GetCapturedArguments() { -} - -func (c *Client_Version_OngoingVerification) GetAllCapturedArguments() { -} - -func (verifier *VerifierClient) RunCommandWithVersion(log *logging.SimpleLogger, path string, args []string, v *go_version.Version, workspace string) *Client_RunCommandWithVersion_OngoingVerification { +func (verifier *VerifierMockClient) RunCommandWithVersion(log *logging.SimpleLogger, path string, args []string, v *go_version.Version, workspace string) *MockClient_RunCommandWithVersion_OngoingVerification { params := []pegomock.Param{log, path, args, v, workspace} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunCommandWithVersion", params, verifier.timeout) - return &Client_RunCommandWithVersion_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockClient_RunCommandWithVersion_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Client_RunCommandWithVersion_OngoingVerification struct { +type MockClient_RunCommandWithVersion_OngoingVerification struct { mock *MockClient methodInvocations []pegomock.MethodInvocation } -func (c *Client_RunCommandWithVersion_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, string, []string, *go_version.Version, string) { +func (c *MockClient_RunCommandWithVersion_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, string, []string, *go_version.Version, string) { log, path, args, v, workspace := c.GetAllCapturedArguments() return log[len(log)-1], path[len(path)-1], args[len(args)-1], v[len(v)-1], workspace[len(workspace)-1] } -func (c *Client_RunCommandWithVersion_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []string, _param2 [][]string, _param3 []*go_version.Version, _param4 []string) { +func (c *MockClient_RunCommandWithVersion_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []string, _param2 [][]string, _param3 []*go_version.Version, _param4 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*logging.SimpleLogger, len(params[0])) diff --git a/server/events/vcs/mocks/matchers/vcs_commitstatus.go b/server/events/vcs/mocks/matchers/vcs_commitstatus.go deleted file mode 100644 index 9d253c6091..0000000000 --- a/server/events/vcs/mocks/matchers/vcs_commitstatus.go +++ /dev/null @@ -1,20 +0,0 @@ -package matchers - -import ( - "reflect" - - "github.com/petergtz/pegomock" - models "github.com/runatlantis/atlantis/server/events/models" -) - -func AnyVcsCommitStatus() models.CommitStatus { - pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(models.CommitStatus))(nil)).Elem())) - var nullValue models.CommitStatus - return nullValue -} - -func EqVcsCommitStatus(value models.CommitStatus) models.CommitStatus { - pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) - var nullValue models.CommitStatus - return nullValue -} diff --git a/server/events/vcs/mocks/mock_client.go b/server/events/vcs/mocks/mock_client.go index 34ffbcf1be..f8e005906a 100644 --- a/server/events/vcs/mocks/mock_client.go +++ b/server/events/vcs/mocks/mock_client.go @@ -127,60 +127,60 @@ func (mock *MockClient) MergePull(pull models.PullRequest) error { return ret0 } -func (mock *MockClient) VerifyWasCalledOnce() *VerifierClient { - return &VerifierClient{ +func (mock *MockClient) VerifyWasCalledOnce() *VerifierMockClient { + return &VerifierMockClient{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierClient { - return &VerifierClient{ +func (mock *MockClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockClient { + return &VerifierMockClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierClient { - return &VerifierClient{ +func (mock *MockClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockClient { + return &VerifierMockClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierClient { - return &VerifierClient{ +func (mock *MockClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockClient { + return &VerifierMockClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierClient struct { +type VerifierMockClient struct { mock *MockClient invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierClient) GetModifiedFiles(repo models.Repo, pull models.PullRequest) *Client_GetModifiedFiles_OngoingVerification { +func (verifier *VerifierMockClient) GetModifiedFiles(repo models.Repo, pull models.PullRequest) *MockClient_GetModifiedFiles_OngoingVerification { params := []pegomock.Param{repo, pull} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetModifiedFiles", params, verifier.timeout) - return &Client_GetModifiedFiles_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockClient_GetModifiedFiles_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Client_GetModifiedFiles_OngoingVerification struct { +type MockClient_GetModifiedFiles_OngoingVerification struct { mock *MockClient methodInvocations []pegomock.MethodInvocation } -func (c *Client_GetModifiedFiles_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { +func (c *MockClient_GetModifiedFiles_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { repo, pull := c.GetAllCapturedArguments() return repo[len(repo)-1], pull[len(pull)-1] } -func (c *Client_GetModifiedFiles_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { +func (c *MockClient_GetModifiedFiles_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -195,23 +195,23 @@ func (c *Client_GetModifiedFiles_OngoingVerification) GetAllCapturedArguments() return } -func (verifier *VerifierClient) CreateComment(repo models.Repo, pullNum int, comment string) *Client_CreateComment_OngoingVerification { +func (verifier *VerifierMockClient) CreateComment(repo models.Repo, pullNum int, comment string) *MockClient_CreateComment_OngoingVerification { params := []pegomock.Param{repo, pullNum, comment} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CreateComment", params, verifier.timeout) - return &Client_CreateComment_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockClient_CreateComment_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Client_CreateComment_OngoingVerification struct { +type MockClient_CreateComment_OngoingVerification struct { mock *MockClient methodInvocations []pegomock.MethodInvocation } -func (c *Client_CreateComment_OngoingVerification) GetCapturedArguments() (models.Repo, int, string) { +func (c *MockClient_CreateComment_OngoingVerification) GetCapturedArguments() (models.Repo, int, string) { repo, pullNum, comment := c.GetAllCapturedArguments() return repo[len(repo)-1], pullNum[len(pullNum)-1], comment[len(comment)-1] } -func (c *Client_CreateComment_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []int, _param2 []string) { +func (c *MockClient_CreateComment_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []int, _param2 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -230,23 +230,23 @@ func (c *Client_CreateComment_OngoingVerification) GetAllCapturedArguments() (_p return } -func (verifier *VerifierClient) PullIsApproved(repo models.Repo, pull models.PullRequest) *Client_PullIsApproved_OngoingVerification { +func (verifier *VerifierMockClient) PullIsApproved(repo models.Repo, pull models.PullRequest) *MockClient_PullIsApproved_OngoingVerification { params := []pegomock.Param{repo, pull} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PullIsApproved", params, verifier.timeout) - return &Client_PullIsApproved_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockClient_PullIsApproved_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Client_PullIsApproved_OngoingVerification struct { +type MockClient_PullIsApproved_OngoingVerification struct { mock *MockClient methodInvocations []pegomock.MethodInvocation } -func (c *Client_PullIsApproved_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { +func (c *MockClient_PullIsApproved_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { repo, pull := c.GetAllCapturedArguments() return repo[len(repo)-1], pull[len(pull)-1] } -func (c *Client_PullIsApproved_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { +func (c *MockClient_PullIsApproved_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -261,23 +261,23 @@ func (c *Client_PullIsApproved_OngoingVerification) GetAllCapturedArguments() (_ return } -func (verifier *VerifierClient) PullIsMergeable(repo models.Repo, pull models.PullRequest) *Client_PullIsMergeable_OngoingVerification { +func (verifier *VerifierMockClient) PullIsMergeable(repo models.Repo, pull models.PullRequest) *MockClient_PullIsMergeable_OngoingVerification { params := []pegomock.Param{repo, pull} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PullIsMergeable", params, verifier.timeout) - return &Client_PullIsMergeable_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockClient_PullIsMergeable_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Client_PullIsMergeable_OngoingVerification struct { +type MockClient_PullIsMergeable_OngoingVerification struct { mock *MockClient methodInvocations []pegomock.MethodInvocation } -func (c *Client_PullIsMergeable_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { +func (c *MockClient_PullIsMergeable_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { repo, pull := c.GetAllCapturedArguments() return repo[len(repo)-1], pull[len(pull)-1] } -func (c *Client_PullIsMergeable_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { +func (c *MockClient_PullIsMergeable_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -292,23 +292,23 @@ func (c *Client_PullIsMergeable_OngoingVerification) GetAllCapturedArguments() ( return } -func (verifier *VerifierClient) UpdateStatus(repo models.Repo, pull models.PullRequest, state models.CommitStatus, src string, description string, url string) *Client_UpdateStatus_OngoingVerification { +func (verifier *VerifierMockClient) UpdateStatus(repo models.Repo, pull models.PullRequest, state models.CommitStatus, src string, description string, url string) *MockClient_UpdateStatus_OngoingVerification { params := []pegomock.Param{repo, pull, state, src, description, url} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateStatus", params, verifier.timeout) - return &Client_UpdateStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockClient_UpdateStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Client_UpdateStatus_OngoingVerification struct { +type MockClient_UpdateStatus_OngoingVerification struct { mock *MockClient methodInvocations []pegomock.MethodInvocation } -func (c *Client_UpdateStatus_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, models.CommitStatus, string, string, string) { +func (c *MockClient_UpdateStatus_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, models.CommitStatus, string, string, string) { repo, pull, state, src, description, url := c.GetAllCapturedArguments() return repo[len(repo)-1], pull[len(pull)-1], state[len(state)-1], src[len(src)-1], description[len(description)-1], url[len(url)-1] } -func (c *Client_UpdateStatus_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []models.CommitStatus, _param3 []string, _param4 []string, _param5 []string) { +func (c *MockClient_UpdateStatus_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []models.CommitStatus, _param3 []string, _param4 []string, _param5 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.Repo, len(params[0])) @@ -339,23 +339,23 @@ func (c *Client_UpdateStatus_OngoingVerification) GetAllCapturedArguments() (_pa return } -func (verifier *VerifierClient) MergePull(pull models.PullRequest) *Client_MergePull_OngoingVerification { +func (verifier *VerifierMockClient) MergePull(pull models.PullRequest) *MockClient_MergePull_OngoingVerification { params := []pegomock.Param{pull} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "MergePull", params, verifier.timeout) - return &Client_MergePull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockClient_MergePull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Client_MergePull_OngoingVerification struct { +type MockClient_MergePull_OngoingVerification struct { mock *MockClient methodInvocations []pegomock.MethodInvocation } -func (c *Client_MergePull_OngoingVerification) GetCapturedArguments() models.PullRequest { +func (c *MockClient_MergePull_OngoingVerification) GetCapturedArguments() models.PullRequest { pull := c.GetAllCapturedArguments() return pull[len(pull)-1] } -func (c *Client_MergePull_OngoingVerification) GetAllCapturedArguments() (_param0 []models.PullRequest) { +func (c *MockClient_MergePull_OngoingVerification) GetAllCapturedArguments() (_param0 []models.PullRequest) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]models.PullRequest, len(params[0])) diff --git a/server/events/webhooks/mocks/mock_sender.go b/server/events/webhooks/mocks/mock_sender.go index 1173f72190..7f4b5f72ec 100644 --- a/server/events/webhooks/mocks/mock_sender.go +++ b/server/events/webhooks/mocks/mock_sender.go @@ -41,60 +41,60 @@ func (mock *MockSender) Send(log *logging.SimpleLogger, applyResult webhooks.App return ret0 } -func (mock *MockSender) VerifyWasCalledOnce() *VerifierSender { - return &VerifierSender{ +func (mock *MockSender) VerifyWasCalledOnce() *VerifierMockSender { + return &VerifierMockSender{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockSender) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierSender { - return &VerifierSender{ +func (mock *MockSender) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockSender { + return &VerifierMockSender{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockSender) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierSender { - return &VerifierSender{ +func (mock *MockSender) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockSender { + return &VerifierMockSender{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockSender) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierSender { - return &VerifierSender{ +func (mock *MockSender) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockSender { + return &VerifierMockSender{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierSender struct { +type VerifierMockSender struct { mock *MockSender invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierSender) Send(log *logging.SimpleLogger, applyResult webhooks.ApplyResult) *Sender_Send_OngoingVerification { +func (verifier *VerifierMockSender) Send(log *logging.SimpleLogger, applyResult webhooks.ApplyResult) *MockSender_Send_OngoingVerification { params := []pegomock.Param{log, applyResult} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Send", params, verifier.timeout) - return &Sender_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSender_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type Sender_Send_OngoingVerification struct { +type MockSender_Send_OngoingVerification struct { mock *MockSender methodInvocations []pegomock.MethodInvocation } -func (c *Sender_Send_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, webhooks.ApplyResult) { +func (c *MockSender_Send_OngoingVerification) GetCapturedArguments() (*logging.SimpleLogger, webhooks.ApplyResult) { log, applyResult := c.GetAllCapturedArguments() return log[len(log)-1], applyResult[len(applyResult)-1] } -func (c *Sender_Send_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []webhooks.ApplyResult) { +func (c *MockSender_Send_OngoingVerification) GetAllCapturedArguments() (_param0 []*logging.SimpleLogger, _param1 []webhooks.ApplyResult) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*logging.SimpleLogger, len(params[0])) diff --git a/server/events/webhooks/mocks/mock_slack_client.go b/server/events/webhooks/mocks/mock_slack_client.go index d75d8e19ab..58b0717128 100644 --- a/server/events/webhooks/mocks/mock_slack_client.go +++ b/server/events/webhooks/mocks/mock_slack_client.go @@ -89,94 +89,94 @@ func (mock *MockSlackClient) PostMessage(channel string, applyResult webhooks.Ap return ret0 } -func (mock *MockSlackClient) VerifyWasCalledOnce() *VerifierSlackClient { - return &VerifierSlackClient{ +func (mock *MockSlackClient) VerifyWasCalledOnce() *VerifierMockSlackClient { + return &VerifierMockSlackClient{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockSlackClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierSlackClient { - return &VerifierSlackClient{ +func (mock *MockSlackClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockSlackClient { + return &VerifierMockSlackClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockSlackClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierSlackClient { - return &VerifierSlackClient{ +func (mock *MockSlackClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockSlackClient { + return &VerifierMockSlackClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockSlackClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierSlackClient { - return &VerifierSlackClient{ +func (mock *MockSlackClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockSlackClient { + return &VerifierMockSlackClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierSlackClient struct { +type VerifierMockSlackClient struct { mock *MockSlackClient invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierSlackClient) AuthTest() *SlackClient_AuthTest_OngoingVerification { +func (verifier *VerifierMockSlackClient) AuthTest() *MockSlackClient_AuthTest_OngoingVerification { params := []pegomock.Param{} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "AuthTest", params, verifier.timeout) - return &SlackClient_AuthTest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSlackClient_AuthTest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SlackClient_AuthTest_OngoingVerification struct { +type MockSlackClient_AuthTest_OngoingVerification struct { mock *MockSlackClient methodInvocations []pegomock.MethodInvocation } -func (c *SlackClient_AuthTest_OngoingVerification) GetCapturedArguments() { +func (c *MockSlackClient_AuthTest_OngoingVerification) GetCapturedArguments() { } -func (c *SlackClient_AuthTest_OngoingVerification) GetAllCapturedArguments() { +func (c *MockSlackClient_AuthTest_OngoingVerification) GetAllCapturedArguments() { } -func (verifier *VerifierSlackClient) TokenIsSet() *SlackClient_TokenIsSet_OngoingVerification { +func (verifier *VerifierMockSlackClient) TokenIsSet() *MockSlackClient_TokenIsSet_OngoingVerification { params := []pegomock.Param{} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TokenIsSet", params, verifier.timeout) - return &SlackClient_TokenIsSet_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSlackClient_TokenIsSet_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SlackClient_TokenIsSet_OngoingVerification struct { +type MockSlackClient_TokenIsSet_OngoingVerification struct { mock *MockSlackClient methodInvocations []pegomock.MethodInvocation } -func (c *SlackClient_TokenIsSet_OngoingVerification) GetCapturedArguments() { +func (c *MockSlackClient_TokenIsSet_OngoingVerification) GetCapturedArguments() { } -func (c *SlackClient_TokenIsSet_OngoingVerification) GetAllCapturedArguments() { +func (c *MockSlackClient_TokenIsSet_OngoingVerification) GetAllCapturedArguments() { } -func (verifier *VerifierSlackClient) ChannelExists(channelName string) *SlackClient_ChannelExists_OngoingVerification { +func (verifier *VerifierMockSlackClient) ChannelExists(channelName string) *MockSlackClient_ChannelExists_OngoingVerification { params := []pegomock.Param{channelName} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ChannelExists", params, verifier.timeout) - return &SlackClient_ChannelExists_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSlackClient_ChannelExists_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SlackClient_ChannelExists_OngoingVerification struct { +type MockSlackClient_ChannelExists_OngoingVerification struct { mock *MockSlackClient methodInvocations []pegomock.MethodInvocation } -func (c *SlackClient_ChannelExists_OngoingVerification) GetCapturedArguments() string { +func (c *MockSlackClient_ChannelExists_OngoingVerification) GetCapturedArguments() string { channelName := c.GetAllCapturedArguments() return channelName[len(channelName)-1] } -func (c *SlackClient_ChannelExists_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { +func (c *MockSlackClient_ChannelExists_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) @@ -187,23 +187,23 @@ func (c *SlackClient_ChannelExists_OngoingVerification) GetAllCapturedArguments( return } -func (verifier *VerifierSlackClient) PostMessage(channel string, applyResult webhooks.ApplyResult) *SlackClient_PostMessage_OngoingVerification { +func (verifier *VerifierMockSlackClient) PostMessage(channel string, applyResult webhooks.ApplyResult) *MockSlackClient_PostMessage_OngoingVerification { params := []pegomock.Param{channel, applyResult} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PostMessage", params, verifier.timeout) - return &SlackClient_PostMessage_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSlackClient_PostMessage_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SlackClient_PostMessage_OngoingVerification struct { +type MockSlackClient_PostMessage_OngoingVerification struct { mock *MockSlackClient methodInvocations []pegomock.MethodInvocation } -func (c *SlackClient_PostMessage_OngoingVerification) GetCapturedArguments() (string, webhooks.ApplyResult) { +func (c *MockSlackClient_PostMessage_OngoingVerification) GetCapturedArguments() (string, webhooks.ApplyResult) { channel, applyResult := c.GetAllCapturedArguments() return channel[len(channel)-1], applyResult[len(applyResult)-1] } -func (c *SlackClient_PostMessage_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []webhooks.ApplyResult) { +func (c *MockSlackClient_PostMessage_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []webhooks.ApplyResult) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/events/webhooks/mocks/mock_underlying_slack_client.go b/server/events/webhooks/mocks/mock_underlying_slack_client.go index cac8985b9e..9ca44b69d2 100644 --- a/server/events/webhooks/mocks/mock_underlying_slack_client.go +++ b/server/events/webhooks/mocks/mock_underlying_slack_client.go @@ -86,77 +86,77 @@ func (mock *MockUnderlyingSlackClient) PostMessage(channel string, text string, return ret0, ret1, ret2 } -func (mock *MockUnderlyingSlackClient) VerifyWasCalledOnce() *VerifierUnderlyingSlackClient { - return &VerifierUnderlyingSlackClient{ +func (mock *MockUnderlyingSlackClient) VerifyWasCalledOnce() *VerifierMockUnderlyingSlackClient { + return &VerifierMockUnderlyingSlackClient{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockUnderlyingSlackClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierUnderlyingSlackClient { - return &VerifierUnderlyingSlackClient{ +func (mock *MockUnderlyingSlackClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockUnderlyingSlackClient { + return &VerifierMockUnderlyingSlackClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockUnderlyingSlackClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierUnderlyingSlackClient { - return &VerifierUnderlyingSlackClient{ +func (mock *MockUnderlyingSlackClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockUnderlyingSlackClient { + return &VerifierMockUnderlyingSlackClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockUnderlyingSlackClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierUnderlyingSlackClient { - return &VerifierUnderlyingSlackClient{ +func (mock *MockUnderlyingSlackClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockUnderlyingSlackClient { + return &VerifierMockUnderlyingSlackClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierUnderlyingSlackClient struct { +type VerifierMockUnderlyingSlackClient struct { mock *MockUnderlyingSlackClient invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierUnderlyingSlackClient) AuthTest() *UnderlyingSlackClient_AuthTest_OngoingVerification { +func (verifier *VerifierMockUnderlyingSlackClient) AuthTest() *MockUnderlyingSlackClient_AuthTest_OngoingVerification { params := []pegomock.Param{} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "AuthTest", params, verifier.timeout) - return &UnderlyingSlackClient_AuthTest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockUnderlyingSlackClient_AuthTest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type UnderlyingSlackClient_AuthTest_OngoingVerification struct { +type MockUnderlyingSlackClient_AuthTest_OngoingVerification struct { mock *MockUnderlyingSlackClient methodInvocations []pegomock.MethodInvocation } -func (c *UnderlyingSlackClient_AuthTest_OngoingVerification) GetCapturedArguments() { +func (c *MockUnderlyingSlackClient_AuthTest_OngoingVerification) GetCapturedArguments() { } -func (c *UnderlyingSlackClient_AuthTest_OngoingVerification) GetAllCapturedArguments() { +func (c *MockUnderlyingSlackClient_AuthTest_OngoingVerification) GetAllCapturedArguments() { } -func (verifier *VerifierUnderlyingSlackClient) GetChannels(excludeArchived bool) *UnderlyingSlackClient_GetChannels_OngoingVerification { +func (verifier *VerifierMockUnderlyingSlackClient) GetChannels(excludeArchived bool) *MockUnderlyingSlackClient_GetChannels_OngoingVerification { params := []pegomock.Param{excludeArchived} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetChannels", params, verifier.timeout) - return &UnderlyingSlackClient_GetChannels_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockUnderlyingSlackClient_GetChannels_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type UnderlyingSlackClient_GetChannels_OngoingVerification struct { +type MockUnderlyingSlackClient_GetChannels_OngoingVerification struct { mock *MockUnderlyingSlackClient methodInvocations []pegomock.MethodInvocation } -func (c *UnderlyingSlackClient_GetChannels_OngoingVerification) GetCapturedArguments() bool { +func (c *MockUnderlyingSlackClient_GetChannels_OngoingVerification) GetCapturedArguments() bool { excludeArchived := c.GetAllCapturedArguments() return excludeArchived[len(excludeArchived)-1] } -func (c *UnderlyingSlackClient_GetChannels_OngoingVerification) GetAllCapturedArguments() (_param0 []bool) { +func (c *MockUnderlyingSlackClient_GetChannels_OngoingVerification) GetAllCapturedArguments() (_param0 []bool) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]bool, len(params[0])) @@ -167,23 +167,23 @@ func (c *UnderlyingSlackClient_GetChannels_OngoingVerification) GetAllCapturedAr return } -func (verifier *VerifierUnderlyingSlackClient) PostMessage(channel string, text string, parameters slack.PostMessageParameters) *UnderlyingSlackClient_PostMessage_OngoingVerification { +func (verifier *VerifierMockUnderlyingSlackClient) PostMessage(channel string, text string, parameters slack.PostMessageParameters) *MockUnderlyingSlackClient_PostMessage_OngoingVerification { params := []pegomock.Param{channel, text, parameters} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PostMessage", params, verifier.timeout) - return &UnderlyingSlackClient_PostMessage_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockUnderlyingSlackClient_PostMessage_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type UnderlyingSlackClient_PostMessage_OngoingVerification struct { +type MockUnderlyingSlackClient_PostMessage_OngoingVerification struct { mock *MockUnderlyingSlackClient methodInvocations []pegomock.MethodInvocation } -func (c *UnderlyingSlackClient_PostMessage_OngoingVerification) GetCapturedArguments() (string, string, slack.PostMessageParameters) { +func (c *MockUnderlyingSlackClient_PostMessage_OngoingVerification) GetCapturedArguments() (string, string, slack.PostMessageParameters) { channel, text, parameters := c.GetAllCapturedArguments() return channel[len(channel)-1], text[len(text)-1], parameters[len(parameters)-1] } -func (c *UnderlyingSlackClient_PostMessage_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []slack.PostMessageParameters) { +func (c *MockUnderlyingSlackClient_PostMessage_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []slack.PostMessageParameters) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/logging/mocks/mock_simple_logging.go b/server/logging/mocks/mock_simple_logging.go index 4eb250f35d..93d7029ed9 100644 --- a/server/logging/mocks/mock_simple_logging.go +++ b/server/logging/mocks/mock_simple_logging.go @@ -126,63 +126,63 @@ func (mock *MockSimpleLogging) NewLogger(_param0 string, _param1 bool, _param2 l return ret0 } -func (mock *MockSimpleLogging) VerifyWasCalledOnce() *VerifierSimpleLogging { - return &VerifierSimpleLogging{ +func (mock *MockSimpleLogging) VerifyWasCalledOnce() *VerifierMockSimpleLogging { + return &VerifierMockSimpleLogging{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockSimpleLogging) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierSimpleLogging { - return &VerifierSimpleLogging{ +func (mock *MockSimpleLogging) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockSimpleLogging { + return &VerifierMockSimpleLogging{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockSimpleLogging) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierSimpleLogging { - return &VerifierSimpleLogging{ +func (mock *MockSimpleLogging) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockSimpleLogging { + return &VerifierMockSimpleLogging{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockSimpleLogging) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierSimpleLogging { - return &VerifierSimpleLogging{ +func (mock *MockSimpleLogging) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockSimpleLogging { + return &VerifierMockSimpleLogging{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierSimpleLogging struct { +type VerifierMockSimpleLogging struct { mock *MockSimpleLogging invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierSimpleLogging) Debug(format string, a ...interface{}) *SimpleLogging_Debug_OngoingVerification { +func (verifier *VerifierMockSimpleLogging) Debug(format string, a ...interface{}) *MockSimpleLogging_Debug_OngoingVerification { params := []pegomock.Param{format} for _, param := range a { params = append(params, param) } methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Debug", params, verifier.timeout) - return &SimpleLogging_Debug_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSimpleLogging_Debug_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SimpleLogging_Debug_OngoingVerification struct { +type MockSimpleLogging_Debug_OngoingVerification struct { mock *MockSimpleLogging methodInvocations []pegomock.MethodInvocation } -func (c *SimpleLogging_Debug_OngoingVerification) GetCapturedArguments() (string, []interface{}) { +func (c *MockSimpleLogging_Debug_OngoingVerification) GetCapturedArguments() (string, []interface{}) { format, a := c.GetAllCapturedArguments() return format[len(format)-1], a[len(a)-1] } -func (c *SimpleLogging_Debug_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 [][]interface{}) { +func (c *MockSimpleLogging_Debug_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 [][]interface{}) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) @@ -202,26 +202,26 @@ func (c *SimpleLogging_Debug_OngoingVerification) GetAllCapturedArguments() (_pa return } -func (verifier *VerifierSimpleLogging) Info(format string, a ...interface{}) *SimpleLogging_Info_OngoingVerification { +func (verifier *VerifierMockSimpleLogging) Info(format string, a ...interface{}) *MockSimpleLogging_Info_OngoingVerification { params := []pegomock.Param{format} for _, param := range a { params = append(params, param) } methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Info", params, verifier.timeout) - return &SimpleLogging_Info_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSimpleLogging_Info_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SimpleLogging_Info_OngoingVerification struct { +type MockSimpleLogging_Info_OngoingVerification struct { mock *MockSimpleLogging methodInvocations []pegomock.MethodInvocation } -func (c *SimpleLogging_Info_OngoingVerification) GetCapturedArguments() (string, []interface{}) { +func (c *MockSimpleLogging_Info_OngoingVerification) GetCapturedArguments() (string, []interface{}) { format, a := c.GetAllCapturedArguments() return format[len(format)-1], a[len(a)-1] } -func (c *SimpleLogging_Info_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 [][]interface{}) { +func (c *MockSimpleLogging_Info_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 [][]interface{}) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) @@ -241,26 +241,26 @@ func (c *SimpleLogging_Info_OngoingVerification) GetAllCapturedArguments() (_par return } -func (verifier *VerifierSimpleLogging) Warn(format string, a ...interface{}) *SimpleLogging_Warn_OngoingVerification { +func (verifier *VerifierMockSimpleLogging) Warn(format string, a ...interface{}) *MockSimpleLogging_Warn_OngoingVerification { params := []pegomock.Param{format} for _, param := range a { params = append(params, param) } methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Warn", params, verifier.timeout) - return &SimpleLogging_Warn_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSimpleLogging_Warn_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SimpleLogging_Warn_OngoingVerification struct { +type MockSimpleLogging_Warn_OngoingVerification struct { mock *MockSimpleLogging methodInvocations []pegomock.MethodInvocation } -func (c *SimpleLogging_Warn_OngoingVerification) GetCapturedArguments() (string, []interface{}) { +func (c *MockSimpleLogging_Warn_OngoingVerification) GetCapturedArguments() (string, []interface{}) { format, a := c.GetAllCapturedArguments() return format[len(format)-1], a[len(a)-1] } -func (c *SimpleLogging_Warn_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 [][]interface{}) { +func (c *MockSimpleLogging_Warn_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 [][]interface{}) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) @@ -280,26 +280,26 @@ func (c *SimpleLogging_Warn_OngoingVerification) GetAllCapturedArguments() (_par return } -func (verifier *VerifierSimpleLogging) Err(format string, a ...interface{}) *SimpleLogging_Err_OngoingVerification { +func (verifier *VerifierMockSimpleLogging) Err(format string, a ...interface{}) *MockSimpleLogging_Err_OngoingVerification { params := []pegomock.Param{format} for _, param := range a { params = append(params, param) } methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Err", params, verifier.timeout) - return &SimpleLogging_Err_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSimpleLogging_Err_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SimpleLogging_Err_OngoingVerification struct { +type MockSimpleLogging_Err_OngoingVerification struct { mock *MockSimpleLogging methodInvocations []pegomock.MethodInvocation } -func (c *SimpleLogging_Err_OngoingVerification) GetCapturedArguments() (string, []interface{}) { +func (c *MockSimpleLogging_Err_OngoingVerification) GetCapturedArguments() (string, []interface{}) { format, a := c.GetAllCapturedArguments() return format[len(format)-1], a[len(a)-1] } -func (c *SimpleLogging_Err_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 [][]interface{}) { +func (c *MockSimpleLogging_Err_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 [][]interface{}) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) @@ -319,26 +319,26 @@ func (c *SimpleLogging_Err_OngoingVerification) GetAllCapturedArguments() (_para return } -func (verifier *VerifierSimpleLogging) Log(level logging.LogLevel, format string, a ...interface{}) *SimpleLogging_Log_OngoingVerification { +func (verifier *VerifierMockSimpleLogging) Log(level logging.LogLevel, format string, a ...interface{}) *MockSimpleLogging_Log_OngoingVerification { params := []pegomock.Param{level, format} for _, param := range a { params = append(params, param) } methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Log", params, verifier.timeout) - return &SimpleLogging_Log_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSimpleLogging_Log_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SimpleLogging_Log_OngoingVerification struct { +type MockSimpleLogging_Log_OngoingVerification struct { mock *MockSimpleLogging methodInvocations []pegomock.MethodInvocation } -func (c *SimpleLogging_Log_OngoingVerification) GetCapturedArguments() (logging.LogLevel, string, []interface{}) { +func (c *MockSimpleLogging_Log_OngoingVerification) GetCapturedArguments() (logging.LogLevel, string, []interface{}) { level, format, a := c.GetAllCapturedArguments() return level[len(level)-1], format[len(format)-1], a[len(a)-1] } -func (c *SimpleLogging_Log_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.LogLevel, _param1 []string, _param2 [][]interface{}) { +func (c *MockSimpleLogging_Log_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.LogLevel, _param1 []string, _param2 [][]interface{}) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]logging.LogLevel, len(params[0])) @@ -362,57 +362,57 @@ func (c *SimpleLogging_Log_OngoingVerification) GetAllCapturedArguments() (_para return } -func (verifier *VerifierSimpleLogging) Underlying() *SimpleLogging_Underlying_OngoingVerification { +func (verifier *VerifierMockSimpleLogging) Underlying() *MockSimpleLogging_Underlying_OngoingVerification { params := []pegomock.Param{} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Underlying", params, verifier.timeout) - return &SimpleLogging_Underlying_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSimpleLogging_Underlying_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SimpleLogging_Underlying_OngoingVerification struct { +type MockSimpleLogging_Underlying_OngoingVerification struct { mock *MockSimpleLogging methodInvocations []pegomock.MethodInvocation } -func (c *SimpleLogging_Underlying_OngoingVerification) GetCapturedArguments() { +func (c *MockSimpleLogging_Underlying_OngoingVerification) GetCapturedArguments() { } -func (c *SimpleLogging_Underlying_OngoingVerification) GetAllCapturedArguments() { +func (c *MockSimpleLogging_Underlying_OngoingVerification) GetAllCapturedArguments() { } -func (verifier *VerifierSimpleLogging) GetLevel() *SimpleLogging_GetLevel_OngoingVerification { +func (verifier *VerifierMockSimpleLogging) GetLevel() *MockSimpleLogging_GetLevel_OngoingVerification { params := []pegomock.Param{} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetLevel", params, verifier.timeout) - return &SimpleLogging_GetLevel_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSimpleLogging_GetLevel_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SimpleLogging_GetLevel_OngoingVerification struct { +type MockSimpleLogging_GetLevel_OngoingVerification struct { mock *MockSimpleLogging methodInvocations []pegomock.MethodInvocation } -func (c *SimpleLogging_GetLevel_OngoingVerification) GetCapturedArguments() { +func (c *MockSimpleLogging_GetLevel_OngoingVerification) GetCapturedArguments() { } -func (c *SimpleLogging_GetLevel_OngoingVerification) GetAllCapturedArguments() { +func (c *MockSimpleLogging_GetLevel_OngoingVerification) GetAllCapturedArguments() { } -func (verifier *VerifierSimpleLogging) NewLogger(_param0 string, _param1 bool, _param2 logging.LogLevel) *SimpleLogging_NewLogger_OngoingVerification { +func (verifier *VerifierMockSimpleLogging) NewLogger(_param0 string, _param1 bool, _param2 logging.LogLevel) *MockSimpleLogging_NewLogger_OngoingVerification { params := []pegomock.Param{_param0, _param1, _param2} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "NewLogger", params, verifier.timeout) - return &SimpleLogging_NewLogger_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockSimpleLogging_NewLogger_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type SimpleLogging_NewLogger_OngoingVerification struct { +type MockSimpleLogging_NewLogger_OngoingVerification struct { mock *MockSimpleLogging methodInvocations []pegomock.MethodInvocation } -func (c *SimpleLogging_NewLogger_OngoingVerification) GetCapturedArguments() (string, bool, logging.LogLevel) { +func (c *MockSimpleLogging_NewLogger_OngoingVerification) GetCapturedArguments() (string, bool, logging.LogLevel) { _param0, _param1, _param2 := c.GetAllCapturedArguments() return _param0[len(_param0)-1], _param1[len(_param1)-1], _param2[len(_param2)-1] } -func (c *SimpleLogging_NewLogger_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []bool, _param2 []logging.LogLevel) { +func (c *MockSimpleLogging_NewLogger_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []bool, _param2 []logging.LogLevel) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(params[0])) diff --git a/server/mocks/mock_github_request_validator.go b/server/mocks/mock_github_request_validator.go index 0f59683b7a..3d9dfc55ad 100644 --- a/server/mocks/mock_github_request_validator.go +++ b/server/mocks/mock_github_request_validator.go @@ -44,60 +44,60 @@ func (mock *MockGithubRequestValidator) Validate(r *http.Request, secret []byte) return ret0, ret1 } -func (mock *MockGithubRequestValidator) VerifyWasCalledOnce() *VerifierGithubRequestValidator { - return &VerifierGithubRequestValidator{ +func (mock *MockGithubRequestValidator) VerifyWasCalledOnce() *VerifierMockGithubRequestValidator { + return &VerifierMockGithubRequestValidator{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockGithubRequestValidator) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierGithubRequestValidator { - return &VerifierGithubRequestValidator{ +func (mock *MockGithubRequestValidator) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockGithubRequestValidator { + return &VerifierMockGithubRequestValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockGithubRequestValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierGithubRequestValidator { - return &VerifierGithubRequestValidator{ +func (mock *MockGithubRequestValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGithubRequestValidator { + return &VerifierMockGithubRequestValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockGithubRequestValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierGithubRequestValidator { - return &VerifierGithubRequestValidator{ +func (mock *MockGithubRequestValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockGithubRequestValidator { + return &VerifierMockGithubRequestValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierGithubRequestValidator struct { +type VerifierMockGithubRequestValidator struct { mock *MockGithubRequestValidator invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierGithubRequestValidator) Validate(r *http.Request, secret []byte) *GithubRequestValidator_Validate_OngoingVerification { +func (verifier *VerifierMockGithubRequestValidator) Validate(r *http.Request, secret []byte) *MockGithubRequestValidator_Validate_OngoingVerification { params := []pegomock.Param{r, secret} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Validate", params, verifier.timeout) - return &GithubRequestValidator_Validate_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockGithubRequestValidator_Validate_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type GithubRequestValidator_Validate_OngoingVerification struct { +type MockGithubRequestValidator_Validate_OngoingVerification struct { mock *MockGithubRequestValidator methodInvocations []pegomock.MethodInvocation } -func (c *GithubRequestValidator_Validate_OngoingVerification) GetCapturedArguments() (*http.Request, []byte) { +func (c *MockGithubRequestValidator_Validate_OngoingVerification) GetCapturedArguments() (*http.Request, []byte) { r, secret := c.GetAllCapturedArguments() return r[len(r)-1], secret[len(secret)-1] } -func (c *GithubRequestValidator_Validate_OngoingVerification) GetAllCapturedArguments() (_param0 []*http.Request, _param1 [][]byte) { +func (c *MockGithubRequestValidator_Validate_OngoingVerification) GetAllCapturedArguments() (_param0 []*http.Request, _param1 [][]byte) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*http.Request, len(params[0])) diff --git a/server/mocks/mock_gitlab_request_parser_validator.go b/server/mocks/mock_gitlab_request_parser_validator.go index 7569c8da39..faadae976b 100644 --- a/server/mocks/mock_gitlab_request_parser_validator.go +++ b/server/mocks/mock_gitlab_request_parser_validator.go @@ -44,60 +44,60 @@ func (mock *MockGitlabRequestParserValidator) ParseAndValidate(r *http.Request, return ret0, ret1 } -func (mock *MockGitlabRequestParserValidator) VerifyWasCalledOnce() *VerifierGitlabRequestParserValidator { - return &VerifierGitlabRequestParserValidator{ +func (mock *MockGitlabRequestParserValidator) VerifyWasCalledOnce() *VerifierMockGitlabRequestParserValidator { + return &VerifierMockGitlabRequestParserValidator{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockGitlabRequestParserValidator) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierGitlabRequestParserValidator { - return &VerifierGitlabRequestParserValidator{ +func (mock *MockGitlabRequestParserValidator) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockGitlabRequestParserValidator { + return &VerifierMockGitlabRequestParserValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockGitlabRequestParserValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierGitlabRequestParserValidator { - return &VerifierGitlabRequestParserValidator{ +func (mock *MockGitlabRequestParserValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGitlabRequestParserValidator { + return &VerifierMockGitlabRequestParserValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockGitlabRequestParserValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierGitlabRequestParserValidator { - return &VerifierGitlabRequestParserValidator{ +func (mock *MockGitlabRequestParserValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockGitlabRequestParserValidator { + return &VerifierMockGitlabRequestParserValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierGitlabRequestParserValidator struct { +type VerifierMockGitlabRequestParserValidator struct { mock *MockGitlabRequestParserValidator invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierGitlabRequestParserValidator) ParseAndValidate(r *http.Request, secret []byte) *GitlabRequestParserValidator_ParseAndValidate_OngoingVerification { +func (verifier *VerifierMockGitlabRequestParserValidator) ParseAndValidate(r *http.Request, secret []byte) *MockGitlabRequestParserValidator_ParseAndValidate_OngoingVerification { params := []pegomock.Param{r, secret} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseAndValidate", params, verifier.timeout) - return &GitlabRequestParserValidator_ParseAndValidate_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockGitlabRequestParserValidator_ParseAndValidate_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type GitlabRequestParserValidator_ParseAndValidate_OngoingVerification struct { +type MockGitlabRequestParserValidator_ParseAndValidate_OngoingVerification struct { mock *MockGitlabRequestParserValidator methodInvocations []pegomock.MethodInvocation } -func (c *GitlabRequestParserValidator_ParseAndValidate_OngoingVerification) GetCapturedArguments() (*http.Request, []byte) { +func (c *MockGitlabRequestParserValidator_ParseAndValidate_OngoingVerification) GetCapturedArguments() (*http.Request, []byte) { r, secret := c.GetAllCapturedArguments() return r[len(r)-1], secret[len(secret)-1] } -func (c *GitlabRequestParserValidator_ParseAndValidate_OngoingVerification) GetAllCapturedArguments() (_param0 []*http.Request, _param1 [][]byte) { +func (c *MockGitlabRequestParserValidator_ParseAndValidate_OngoingVerification) GetAllCapturedArguments() (_param0 []*http.Request, _param1 [][]byte) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]*http.Request, len(params[0])) diff --git a/server/mocks/mock_template_writer.go b/server/mocks/mock_template_writer.go index bef09d50dc..44dc3795f9 100644 --- a/server/mocks/mock_template_writer.go +++ b/server/mocks/mock_template_writer.go @@ -40,60 +40,60 @@ func (mock *MockTemplateWriter) Execute(wr io.Writer, data interface{}) error { return ret0 } -func (mock *MockTemplateWriter) VerifyWasCalledOnce() *VerifierTemplateWriter { - return &VerifierTemplateWriter{ +func (mock *MockTemplateWriter) VerifyWasCalledOnce() *VerifierMockTemplateWriter { + return &VerifierMockTemplateWriter{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } -func (mock *MockTemplateWriter) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierTemplateWriter { - return &VerifierTemplateWriter{ +func (mock *MockTemplateWriter) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockTemplateWriter { + return &VerifierMockTemplateWriter{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockTemplateWriter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierTemplateWriter { - return &VerifierTemplateWriter{ +func (mock *MockTemplateWriter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockTemplateWriter { + return &VerifierMockTemplateWriter{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } -func (mock *MockTemplateWriter) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierTemplateWriter { - return &VerifierTemplateWriter{ +func (mock *MockTemplateWriter) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockTemplateWriter { + return &VerifierMockTemplateWriter{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } -type VerifierTemplateWriter struct { +type VerifierMockTemplateWriter struct { mock *MockTemplateWriter invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } -func (verifier *VerifierTemplateWriter) Execute(wr io.Writer, data interface{}) *TemplateWriter_Execute_OngoingVerification { +func (verifier *VerifierMockTemplateWriter) Execute(wr io.Writer, data interface{}) *MockTemplateWriter_Execute_OngoingVerification { params := []pegomock.Param{wr, data} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Execute", params, verifier.timeout) - return &TemplateWriter_Execute_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} + return &MockTemplateWriter_Execute_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } -type TemplateWriter_Execute_OngoingVerification struct { +type MockTemplateWriter_Execute_OngoingVerification struct { mock *MockTemplateWriter methodInvocations []pegomock.MethodInvocation } -func (c *TemplateWriter_Execute_OngoingVerification) GetCapturedArguments() (io.Writer, interface{}) { +func (c *MockTemplateWriter_Execute_OngoingVerification) GetCapturedArguments() (io.Writer, interface{}) { wr, data := c.GetAllCapturedArguments() return wr[len(wr)-1], data[len(data)-1] } -func (c *TemplateWriter_Execute_OngoingVerification) GetAllCapturedArguments() (_param0 []io.Writer, _param1 []interface{}) { +func (c *MockTemplateWriter_Execute_OngoingVerification) GetAllCapturedArguments() (_param0 []io.Writer, _param1 []interface{}) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]io.Writer, len(params[0]))