diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c64cde6e5e..be7f509ee5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -149,7 +149,7 @@ We use [pegomock](https://github.com/petergtz/pegomock) for mocking. If you're modifying any interfaces that are mocked, you'll need to regen the mocks for that interface. -Install using `go install github.com/petergtz/pegomock/pegomock` +Install using `go install github.com/petergtz/pegomock/v4/pegomock@latest` If you see errors like: ``` @@ -174,10 +174,8 @@ To regen the mock, run `go generate` on that file, e.g. go generate server/events/project_command_builder.go ``` -If you get an error about `pegomock` not being available, install it: -```sh -go get github.com/petergtz/pegomock/... -``` +Alternatively, you can run `make go-generate` to execute `go generate` across all packages + # Backporting Fixes Atlantis now uses a [cherry-pick-bot](https://github.com/googleapis/repo-automation-bots/tree/main/packages/cherry-pick-bot) from Google. The bot assists in maintaining changes across releases branches by easily cherry-picking changes via pull requests. diff --git a/server/controllers/events/mocks/mock_azuredevops_request_validator.go b/server/controllers/events/mocks/mock_azuredevops_request_validator.go index 3f10953352..0829c5e79c 100644 --- a/server/controllers/events/mocks/mock_azuredevops_request_validator.go +++ b/server/controllers/events/mocks/mock_azuredevops_request_validator.go @@ -29,19 +29,19 @@ func (mock *MockAzureDevopsRequestValidator) Validate(r *http.Request, user []by if mock == nil { panic("mock must not be nil. Use myMock := NewMockAzureDevopsRequestValidator().") } - params := []pegomock.Param{r, user, pass} - result := pegomock.GetGenericMockFrom(mock).Invoke("Validate", params, []reflect.Type{reflect.TypeOf((*[]byte)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []byte - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]byte) + _params := []pegomock.Param{r, user, pass} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Validate", _params, []reflect.Type{reflect.TypeOf((*[]byte)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []byte + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]byte) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockAzureDevopsRequestValidator) VerifyWasCalledOnce() *VerifierMockAzureDevopsRequestValidator { @@ -82,8 +82,8 @@ type VerifierMockAzureDevopsRequestValidator struct { } func (verifier *VerifierMockAzureDevopsRequestValidator) Validate(r *http.Request, user []byte, pass []byte) *MockAzureDevopsRequestValidator_Validate_OngoingVerification { - params := []pegomock.Param{r, user, pass} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Validate", params, verifier.timeout) + _params := []pegomock.Param{r, user, pass} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Validate", _params, verifier.timeout) return &MockAzureDevopsRequestValidator_Validate_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -98,19 +98,25 @@ func (c *MockAzureDevopsRequestValidator_Validate_OngoingVerification) GetCaptur } func (c *MockAzureDevopsRequestValidator_Validate_OngoingVerification) GetAllCapturedArguments() (_param0 []*http.Request, _param1 [][]byte, _param2 [][]byte) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*http.Request, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*http.Request) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*http.Request, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*http.Request) + } } - _param1 = make([][]byte, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.([]byte) + if len(_params) > 1 { + _param1 = make([][]byte, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.([]byte) + } } - _param2 = make([][]byte, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.([]byte) + if len(_params) > 2 { + _param2 = make([][]byte, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.([]byte) + } } } return diff --git a/server/controllers/events/mocks/mock_github_request_validator.go b/server/controllers/events/mocks/mock_github_request_validator.go index d3f0d0d21e..b3cd8ada42 100644 --- a/server/controllers/events/mocks/mock_github_request_validator.go +++ b/server/controllers/events/mocks/mock_github_request_validator.go @@ -29,19 +29,19 @@ func (mock *MockGithubRequestValidator) Validate(r *http.Request, secret []byte) if mock == nil { panic("mock must not be nil. Use myMock := NewMockGithubRequestValidator().") } - params := []pegomock.Param{r, secret} - result := pegomock.GetGenericMockFrom(mock).Invoke("Validate", params, []reflect.Type{reflect.TypeOf((*[]byte)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []byte - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]byte) + _params := []pegomock.Param{r, secret} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Validate", _params, []reflect.Type{reflect.TypeOf((*[]byte)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []byte + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]byte) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockGithubRequestValidator) VerifyWasCalledOnce() *VerifierMockGithubRequestValidator { @@ -82,8 +82,8 @@ type VerifierMockGithubRequestValidator struct { } 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) + _params := []pegomock.Param{r, secret} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Validate", _params, verifier.timeout) return &MockGithubRequestValidator_Validate_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -98,15 +98,19 @@ func (c *MockGithubRequestValidator_Validate_OngoingVerification) GetCapturedArg } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*http.Request) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*http.Request, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*http.Request) + } } - _param1 = make([][]byte, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.([]byte) + if len(_params) > 1 { + _param1 = make([][]byte, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.([]byte) + } } } return diff --git a/server/controllers/events/mocks/mock_gitlab_request_parser_validator.go b/server/controllers/events/mocks/mock_gitlab_request_parser_validator.go index 671fd8127d..e23b6c4996 100644 --- a/server/controllers/events/mocks/mock_gitlab_request_parser_validator.go +++ b/server/controllers/events/mocks/mock_gitlab_request_parser_validator.go @@ -29,19 +29,19 @@ func (mock *MockGitlabRequestParserValidator) ParseAndValidate(r *http.Request, if mock == nil { panic("mock must not be nil. Use myMock := NewMockGitlabRequestParserValidator().") } - params := []pegomock.Param{r, secret} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseAndValidate", params, []reflect.Type{reflect.TypeOf((*interface{})(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 interface{} - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(interface{}) + _params := []pegomock.Param{r, secret} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseAndValidate", _params, []reflect.Type{reflect.TypeOf((*interface{})(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 interface{} + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(interface{}) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockGitlabRequestParserValidator) VerifyWasCalledOnce() *VerifierMockGitlabRequestParserValidator { @@ -82,8 +82,8 @@ type VerifierMockGitlabRequestParserValidator struct { } 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) + _params := []pegomock.Param{r, secret} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseAndValidate", _params, verifier.timeout) return &MockGitlabRequestParserValidator_ParseAndValidate_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -98,15 +98,19 @@ func (c *MockGitlabRequestParserValidator_ParseAndValidate_OngoingVerification) } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*http.Request) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*http.Request, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*http.Request) + } } - _param1 = make([][]byte, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.([]byte) + if len(_params) > 1 { + _param1 = make([][]byte, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.([]byte) + } } } return diff --git a/server/controllers/web_templates/mocks/mock_template_writer.go b/server/controllers/web_templates/mocks/mock_template_writer.go index 5d3e33a2ef..35075abec4 100644 --- a/server/controllers/web_templates/mocks/mock_template_writer.go +++ b/server/controllers/web_templates/mocks/mock_template_writer.go @@ -29,15 +29,15 @@ func (mock *MockTemplateWriter) Execute(wr io.Writer, data interface{}) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockTemplateWriter().") } - params := []pegomock.Param{wr, data} - result := pegomock.GetGenericMockFrom(mock).Invoke("Execute", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{wr, data} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Execute", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockTemplateWriter) VerifyWasCalledOnce() *VerifierMockTemplateWriter { @@ -78,8 +78,8 @@ type VerifierMockTemplateWriter struct { } 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) + _params := []pegomock.Param{wr, data} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Execute", _params, verifier.timeout) return &MockTemplateWriter_Execute_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -94,15 +94,19 @@ func (c *MockTemplateWriter_Execute_OngoingVerification) GetCapturedArguments() } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(io.Writer) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]io.Writer, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(io.Writer) + } } - _param1 = make([]interface{}, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(interface{}) + if len(_params) > 1 { + _param1 = make([]interface{}, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(interface{}) + } } } return diff --git a/server/core/locking/mocks/mock_apply_lock_checker.go b/server/core/locking/mocks/mock_apply_lock_checker.go index cfe777fa3b..a5789e5067 100644 --- a/server/core/locking/mocks/mock_apply_lock_checker.go +++ b/server/core/locking/mocks/mock_apply_lock_checker.go @@ -29,19 +29,19 @@ func (mock *MockApplyLockChecker) CheckApplyLock() (locking.ApplyCommandLock, er if mock == nil { panic("mock must not be nil. Use myMock := NewMockApplyLockChecker().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("CheckApplyLock", params, []reflect.Type{reflect.TypeOf((*locking.ApplyCommandLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 locking.ApplyCommandLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(locking.ApplyCommandLock) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("CheckApplyLock", _params, []reflect.Type{reflect.TypeOf((*locking.ApplyCommandLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 locking.ApplyCommandLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(locking.ApplyCommandLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockApplyLockChecker) VerifyWasCalledOnce() *VerifierMockApplyLockChecker { @@ -82,8 +82,8 @@ type VerifierMockApplyLockChecker struct { } func (verifier *VerifierMockApplyLockChecker) CheckApplyLock() *MockApplyLockChecker_CheckApplyLock_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CheckApplyLock", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CheckApplyLock", _params, verifier.timeout) return &MockApplyLockChecker_CheckApplyLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } diff --git a/server/core/locking/mocks/mock_apply_locker.go b/server/core/locking/mocks/mock_apply_locker.go index 691d1b268b..6cac4c91e2 100644 --- a/server/core/locking/mocks/mock_apply_locker.go +++ b/server/core/locking/mocks/mock_apply_locker.go @@ -29,53 +29,53 @@ func (mock *MockApplyLocker) CheckApplyLock() (locking.ApplyCommandLock, error) if mock == nil { panic("mock must not be nil. Use myMock := NewMockApplyLocker().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("CheckApplyLock", params, []reflect.Type{reflect.TypeOf((*locking.ApplyCommandLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 locking.ApplyCommandLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(locking.ApplyCommandLock) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("CheckApplyLock", _params, []reflect.Type{reflect.TypeOf((*locking.ApplyCommandLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 locking.ApplyCommandLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(locking.ApplyCommandLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockApplyLocker) LockApply() (locking.ApplyCommandLock, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockApplyLocker().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("LockApply", params, []reflect.Type{reflect.TypeOf((*locking.ApplyCommandLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 locking.ApplyCommandLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(locking.ApplyCommandLock) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("LockApply", _params, []reflect.Type{reflect.TypeOf((*locking.ApplyCommandLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 locking.ApplyCommandLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(locking.ApplyCommandLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockApplyLocker) UnlockApply() error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockApplyLocker().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("UnlockApply", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UnlockApply", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockApplyLocker) VerifyWasCalledOnce() *VerifierMockApplyLocker { @@ -116,8 +116,8 @@ type VerifierMockApplyLocker struct { } func (verifier *VerifierMockApplyLocker) CheckApplyLock() *MockApplyLocker_CheckApplyLock_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CheckApplyLock", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CheckApplyLock", _params, verifier.timeout) return &MockApplyLocker_CheckApplyLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -133,8 +133,8 @@ func (c *MockApplyLocker_CheckApplyLock_OngoingVerification) GetAllCapturedArgum } func (verifier *VerifierMockApplyLocker) LockApply() *MockApplyLocker_LockApply_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "LockApply", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "LockApply", _params, verifier.timeout) return &MockApplyLocker_LockApply_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -150,8 +150,8 @@ func (c *MockApplyLocker_LockApply_OngoingVerification) GetAllCapturedArguments( } func (verifier *VerifierMockApplyLocker) UnlockApply() *MockApplyLocker_UnlockApply_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UnlockApply", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UnlockApply", _params, verifier.timeout) return &MockApplyLocker_UnlockApply_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } diff --git a/server/core/locking/mocks/mock_backend.go b/server/core/locking/mocks/mock_backend.go index f2174476a1..9d552bfe38 100644 --- a/server/core/locking/mocks/mock_backend.go +++ b/server/core/locking/mocks/mock_backend.go @@ -30,220 +30,220 @@ func (mock *MockBackend) CheckCommandLock(cmdName command.Name) (*command.Lock, if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{cmdName} - result := pegomock.GetGenericMockFrom(mock).Invoke("CheckCommandLock", params, []reflect.Type{reflect.TypeOf((**command.Lock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *command.Lock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*command.Lock) + _params := []pegomock.Param{cmdName} + _result := pegomock.GetGenericMockFrom(mock).Invoke("CheckCommandLock", _params, []reflect.Type{reflect.TypeOf((**command.Lock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *command.Lock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*command.Lock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockBackend) DeletePullStatus(pull models.PullRequest) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{pull} - result := pegomock.GetGenericMockFrom(mock).Invoke("DeletePullStatus", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{pull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("DeletePullStatus", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockBackend) GetLock(project models.Project, workspace string) (*models.ProjectLock, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{project, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetLock", params, []reflect.Type{reflect.TypeOf((**models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *models.ProjectLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*models.ProjectLock) + _params := []pegomock.Param{project, workspace} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetLock", _params, []reflect.Type{reflect.TypeOf((**models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *models.ProjectLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*models.ProjectLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockBackend) GetPullStatus(pull models.PullRequest) (*models.PullStatus, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{pull} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullStatus", params, []reflect.Type{reflect.TypeOf((**models.PullStatus)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *models.PullStatus - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*models.PullStatus) + _params := []pegomock.Param{pull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullStatus", _params, []reflect.Type{reflect.TypeOf((**models.PullStatus)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *models.PullStatus + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*models.PullStatus) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockBackend) List() ([]models.ProjectLock, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("List", params, []reflect.Type{reflect.TypeOf((*[]models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []models.ProjectLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]models.ProjectLock) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("List", _params, []reflect.Type{reflect.TypeOf((*[]models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []models.ProjectLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]models.ProjectLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockBackend) LockCommand(cmdName command.Name, lockTime time.Time) (*command.Lock, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{cmdName, lockTime} - result := pegomock.GetGenericMockFrom(mock).Invoke("LockCommand", params, []reflect.Type{reflect.TypeOf((**command.Lock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *command.Lock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*command.Lock) + _params := []pegomock.Param{cmdName, lockTime} + _result := pegomock.GetGenericMockFrom(mock).Invoke("LockCommand", _params, []reflect.Type{reflect.TypeOf((**command.Lock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *command.Lock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*command.Lock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockBackend) TryLock(lock models.ProjectLock) (bool, models.ProjectLock, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{lock} - result := pegomock.GetGenericMockFrom(mock).Invoke("TryLock", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 bool - var ret1 models.ProjectLock - var ret2 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(bool) + _params := []pegomock.Param{lock} + _result := pegomock.GetGenericMockFrom(mock).Invoke("TryLock", _params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 bool + var _ret1 models.ProjectLock + var _ret2 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(bool) } - if result[1] != nil { - ret1 = result[1].(models.ProjectLock) + if _result[1] != nil { + _ret1 = _result[1].(models.ProjectLock) } - if result[2] != nil { - ret2 = result[2].(error) + if _result[2] != nil { + _ret2 = _result[2].(error) } } - return ret0, ret1, ret2 + return _ret0, _ret1, _ret2 } func (mock *MockBackend) Unlock(project models.Project, workspace string) (*models.ProjectLock, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{project, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("Unlock", params, []reflect.Type{reflect.TypeOf((**models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *models.ProjectLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*models.ProjectLock) + _params := []pegomock.Param{project, workspace} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Unlock", _params, []reflect.Type{reflect.TypeOf((**models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *models.ProjectLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*models.ProjectLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockBackend) UnlockByPull(repoFullName string, pullNum int) ([]models.ProjectLock, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{repoFullName, pullNum} - result := pegomock.GetGenericMockFrom(mock).Invoke("UnlockByPull", params, []reflect.Type{reflect.TypeOf((*[]models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []models.ProjectLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]models.ProjectLock) + _params := []pegomock.Param{repoFullName, pullNum} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UnlockByPull", _params, []reflect.Type{reflect.TypeOf((*[]models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []models.ProjectLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]models.ProjectLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockBackend) UnlockCommand(cmdName command.Name) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{cmdName} - result := pegomock.GetGenericMockFrom(mock).Invoke("UnlockCommand", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{cmdName} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UnlockCommand", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockBackend) UpdateProjectStatus(pull models.PullRequest, workspace string, repoRelDir string, newStatus models.ProjectPlanStatus) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{pull, workspace, repoRelDir, newStatus} - result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateProjectStatus", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{pull, workspace, repoRelDir, newStatus} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateProjectStatus", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockBackend) UpdatePullWithResults(pull models.PullRequest, newResults []command.ProjectResult) (models.PullStatus, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockBackend().") } - params := []pegomock.Param{pull, newResults} - result := pegomock.GetGenericMockFrom(mock).Invoke("UpdatePullWithResults", params, []reflect.Type{reflect.TypeOf((*models.PullStatus)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullStatus - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullStatus) + _params := []pegomock.Param{pull, newResults} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UpdatePullWithResults", _params, []reflect.Type{reflect.TypeOf((*models.PullStatus)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullStatus + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullStatus) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockBackend) VerifyWasCalledOnce() *VerifierMockBackend { @@ -284,8 +284,8 @@ type VerifierMockBackend struct { } func (verifier *VerifierMockBackend) CheckCommandLock(cmdName command.Name) *MockBackend_CheckCommandLock_OngoingVerification { - params := []pegomock.Param{cmdName} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CheckCommandLock", params, verifier.timeout) + _params := []pegomock.Param{cmdName} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CheckCommandLock", _params, verifier.timeout) return &MockBackend_CheckCommandLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -300,19 +300,21 @@ func (c *MockBackend_CheckCommandLock_OngoingVerification) GetCapturedArguments( } func (c *MockBackend_CheckCommandLock_OngoingVerification) GetAllCapturedArguments() (_param0 []command.Name) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.Name, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.Name) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.Name, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.Name) + } } } return } func (verifier *VerifierMockBackend) DeletePullStatus(pull models.PullRequest) *MockBackend_DeletePullStatus_OngoingVerification { - params := []pegomock.Param{pull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeletePullStatus", params, verifier.timeout) + _params := []pegomock.Param{pull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeletePullStatus", _params, verifier.timeout) return &MockBackend_DeletePullStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -327,19 +329,21 @@ func (c *MockBackend_DeletePullStatus_OngoingVerification) GetCapturedArguments( } func (c *MockBackend_DeletePullStatus_OngoingVerification) GetAllCapturedArguments() (_param0 []models.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.PullRequest) + } } } return } 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) + _params := []pegomock.Param{project, workspace} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetLock", _params, verifier.timeout) return &MockBackend_GetLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -354,23 +358,27 @@ func (c *MockBackend_GetLock_OngoingVerification) GetCapturedArguments() (models } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Project) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Project, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Project) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } } return } func (verifier *VerifierMockBackend) GetPullStatus(pull models.PullRequest) *MockBackend_GetPullStatus_OngoingVerification { - params := []pegomock.Param{pull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullStatus", params, verifier.timeout) + _params := []pegomock.Param{pull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullStatus", _params, verifier.timeout) return &MockBackend_GetPullStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -385,19 +393,21 @@ func (c *MockBackend_GetPullStatus_OngoingVerification) GetCapturedArguments() m } func (c *MockBackend_GetPullStatus_OngoingVerification) GetAllCapturedArguments() (_param0 []models.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.PullRequest) + } } } return } func (verifier *VerifierMockBackend) List() *MockBackend_List_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "List", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "List", _params, verifier.timeout) return &MockBackend_List_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -413,8 +423,8 @@ func (c *MockBackend_List_OngoingVerification) GetAllCapturedArguments() { } func (verifier *VerifierMockBackend) LockCommand(cmdName command.Name, lockTime time.Time) *MockBackend_LockCommand_OngoingVerification { - params := []pegomock.Param{cmdName, lockTime} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "LockCommand", params, verifier.timeout) + _params := []pegomock.Param{cmdName, lockTime} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "LockCommand", _params, verifier.timeout) return &MockBackend_LockCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -429,23 +439,27 @@ func (c *MockBackend_LockCommand_OngoingVerification) GetCapturedArguments() (co } func (c *MockBackend_LockCommand_OngoingVerification) GetAllCapturedArguments() (_param0 []command.Name, _param1 []time.Time) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.Name, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.Name) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.Name, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.Name) + } } - _param1 = make([]time.Time, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(time.Time) + if len(_params) > 1 { + _param1 = make([]time.Time, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(time.Time) + } } } return } 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) + _params := []pegomock.Param{lock} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLock", _params, verifier.timeout) return &MockBackend_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -460,19 +474,21 @@ func (c *MockBackend_TryLock_OngoingVerification) GetCapturedArguments() models. } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.ProjectLock) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.ProjectLock, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.ProjectLock) + } } } return } 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) + _params := []pegomock.Param{project, workspace} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Unlock", _params, verifier.timeout) return &MockBackend_Unlock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -487,23 +503,27 @@ func (c *MockBackend_Unlock_OngoingVerification) GetCapturedArguments() (models. } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Project) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Project, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Project) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } } return } 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) + _params := []pegomock.Param{repoFullName, pullNum} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UnlockByPull", _params, verifier.timeout) return &MockBackend_UnlockByPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -518,23 +538,27 @@ func (c *MockBackend_UnlockByPull_OngoingVerification) GetCapturedArguments() (s } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } - _param1 = make([]int, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(int) + if len(_params) > 1 { + _param1 = make([]int, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(int) + } } } return } func (verifier *VerifierMockBackend) UnlockCommand(cmdName command.Name) *MockBackend_UnlockCommand_OngoingVerification { - params := []pegomock.Param{cmdName} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UnlockCommand", params, verifier.timeout) + _params := []pegomock.Param{cmdName} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UnlockCommand", _params, verifier.timeout) return &MockBackend_UnlockCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -549,19 +573,21 @@ func (c *MockBackend_UnlockCommand_OngoingVerification) GetCapturedArguments() c } func (c *MockBackend_UnlockCommand_OngoingVerification) GetAllCapturedArguments() (_param0 []command.Name) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.Name, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.Name) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.Name, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.Name) + } } } return } func (verifier *VerifierMockBackend) UpdateProjectStatus(pull models.PullRequest, workspace string, repoRelDir string, newStatus models.ProjectPlanStatus) *MockBackend_UpdateProjectStatus_OngoingVerification { - params := []pegomock.Param{pull, workspace, repoRelDir, newStatus} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateProjectStatus", params, verifier.timeout) + _params := []pegomock.Param{pull, workspace, repoRelDir, newStatus} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateProjectStatus", _params, verifier.timeout) return &MockBackend_UpdateProjectStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -576,31 +602,39 @@ func (c *MockBackend_UpdateProjectStatus_OngoingVerification) GetCapturedArgumen } func (c *MockBackend_UpdateProjectStatus_OngoingVerification) GetAllCapturedArguments() (_param0 []models.PullRequest, _param1 []string, _param2 []string, _param3 []models.ProjectPlanStatus) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.PullRequest) - } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) - } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) - } - _param3 = make([]models.ProjectPlanStatus, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(models.ProjectPlanStatus) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.PullRequest) + } + } + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } + } + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } + } + if len(_params) > 3 { + _param3 = make([]models.ProjectPlanStatus, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(models.ProjectPlanStatus) + } } } return } func (verifier *VerifierMockBackend) UpdatePullWithResults(pull models.PullRequest, newResults []command.ProjectResult) *MockBackend_UpdatePullWithResults_OngoingVerification { - params := []pegomock.Param{pull, newResults} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdatePullWithResults", params, verifier.timeout) + _params := []pegomock.Param{pull, newResults} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdatePullWithResults", _params, verifier.timeout) return &MockBackend_UpdatePullWithResults_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -615,15 +649,19 @@ func (c *MockBackend_UpdatePullWithResults_OngoingVerification) GetCapturedArgum } func (c *MockBackend_UpdatePullWithResults_OngoingVerification) GetAllCapturedArguments() (_param0 []models.PullRequest, _param1 [][]command.ProjectResult) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.PullRequest) - } - _param1 = make([][]command.ProjectResult, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.([]command.ProjectResult) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.PullRequest) + } + } + if len(_params) > 1 { + _param1 = make([][]command.ProjectResult, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.([]command.ProjectResult) + } } } return diff --git a/server/core/locking/mocks/mock_locker.go b/server/core/locking/mocks/mock_locker.go index 1efcb2c64b..7305b6c2b0 100644 --- a/server/core/locking/mocks/mock_locker.go +++ b/server/core/locking/mocks/mock_locker.go @@ -30,95 +30,95 @@ func (mock *MockLocker) GetLock(key string) (*models.ProjectLock, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockLocker().") } - params := []pegomock.Param{key} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetLock", params, []reflect.Type{reflect.TypeOf((**models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *models.ProjectLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*models.ProjectLock) + _params := []pegomock.Param{key} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetLock", _params, []reflect.Type{reflect.TypeOf((**models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *models.ProjectLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*models.ProjectLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockLocker) List() (map[string]models.ProjectLock, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockLocker().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("List", params, []reflect.Type{reflect.TypeOf((*map[string]models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 map[string]models.ProjectLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(map[string]models.ProjectLock) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("List", _params, []reflect.Type{reflect.TypeOf((*map[string]models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 map[string]models.ProjectLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(map[string]models.ProjectLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockLocker) TryLock(p models.Project, workspace string, pull models.PullRequest, user models.User) (locking.TryLockResponse, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockLocker().") } - params := []pegomock.Param{p, workspace, pull, user} - result := pegomock.GetGenericMockFrom(mock).Invoke("TryLock", params, []reflect.Type{reflect.TypeOf((*locking.TryLockResponse)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 locking.TryLockResponse - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(locking.TryLockResponse) + _params := []pegomock.Param{p, workspace, pull, user} + _result := pegomock.GetGenericMockFrom(mock).Invoke("TryLock", _params, []reflect.Type{reflect.TypeOf((*locking.TryLockResponse)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 locking.TryLockResponse + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(locking.TryLockResponse) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockLocker) Unlock(key string) (*models.ProjectLock, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockLocker().") } - params := []pegomock.Param{key} - result := pegomock.GetGenericMockFrom(mock).Invoke("Unlock", params, []reflect.Type{reflect.TypeOf((**models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *models.ProjectLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*models.ProjectLock) + _params := []pegomock.Param{key} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Unlock", _params, []reflect.Type{reflect.TypeOf((**models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *models.ProjectLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*models.ProjectLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockLocker) UnlockByPull(repoFullName string, pullNum int) ([]models.ProjectLock, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockLocker().") } - params := []pegomock.Param{repoFullName, pullNum} - result := pegomock.GetGenericMockFrom(mock).Invoke("UnlockByPull", params, []reflect.Type{reflect.TypeOf((*[]models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []models.ProjectLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]models.ProjectLock) + _params := []pegomock.Param{repoFullName, pullNum} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UnlockByPull", _params, []reflect.Type{reflect.TypeOf((*[]models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []models.ProjectLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]models.ProjectLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockLocker) VerifyWasCalledOnce() *VerifierMockLocker { @@ -159,8 +159,8 @@ type VerifierMockLocker struct { } 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) + _params := []pegomock.Param{key} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetLock", _params, verifier.timeout) return &MockLocker_GetLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -175,19 +175,21 @@ func (c *MockLocker_GetLock_OngoingVerification) GetCapturedArguments() 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } } return } func (verifier *VerifierMockLocker) List() *MockLocker_List_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "List", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "List", _params, verifier.timeout) return &MockLocker_List_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -203,8 +205,8 @@ func (c *MockLocker_List_OngoingVerification) GetAllCapturedArguments() { } 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) + _params := []pegomock.Param{p, workspace, pull, user} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLock", _params, verifier.timeout) return &MockLocker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -219,31 +221,39 @@ func (c *MockLocker_TryLock_OngoingVerification) GetCapturedArguments() (models. } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Project) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Project, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Project) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } - _param3 = make([]models.User, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(models.User) + if len(_params) > 3 { + _param3 = make([]models.User, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(models.User) + } } } return } 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) + _params := []pegomock.Param{key} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Unlock", _params, verifier.timeout) return &MockLocker_Unlock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -258,19 +268,21 @@ func (c *MockLocker_Unlock_OngoingVerification) GetCapturedArguments() 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } } return } 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) + _params := []pegomock.Param{repoFullName, pullNum} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UnlockByPull", _params, verifier.timeout) return &MockLocker_UnlockByPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -285,15 +297,19 @@ func (c *MockLocker_UnlockByPull_OngoingVerification) GetCapturedArguments() (st } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } - _param1 = make([]int, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(int) + if len(_params) > 1 { + _param1 = make([]int, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(int) + } } } return diff --git a/server/core/runtime/cache/mocks/mock_key_serializer.go b/server/core/runtime/cache/mocks/mock_key_serializer.go index 043ece8054..dfcfd73f61 100644 --- a/server/core/runtime/cache/mocks/mock_key_serializer.go +++ b/server/core/runtime/cache/mocks/mock_key_serializer.go @@ -29,19 +29,19 @@ func (mock *MockKeySerializer) Serialize(key *go_version.Version) (string, error if mock == nil { panic("mock must not be nil. Use myMock := NewMockKeySerializer().") } - params := []pegomock.Param{key} - result := pegomock.GetGenericMockFrom(mock).Invoke("Serialize", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{key} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Serialize", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockKeySerializer) VerifyWasCalledOnce() *VerifierMockKeySerializer { @@ -82,8 +82,8 @@ type VerifierMockKeySerializer struct { } func (verifier *VerifierMockKeySerializer) Serialize(key *go_version.Version) *MockKeySerializer_Serialize_OngoingVerification { - params := []pegomock.Param{key} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Serialize", params, verifier.timeout) + _params := []pegomock.Param{key} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Serialize", _params, verifier.timeout) return &MockKeySerializer_Serialize_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -98,11 +98,13 @@ func (c *MockKeySerializer_Serialize_OngoingVerification) GetCapturedArguments() } func (c *MockKeySerializer_Serialize_OngoingVerification) GetAllCapturedArguments() (_param0 []*go_version.Version) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*go_version.Version, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*go_version.Version) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*go_version.Version, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*go_version.Version) + } } } return diff --git a/server/core/runtime/cache/mocks/mock_version_path.go b/server/core/runtime/cache/mocks/mock_version_path.go index 84c2bd5f76..1cd9584eb3 100644 --- a/server/core/runtime/cache/mocks/mock_version_path.go +++ b/server/core/runtime/cache/mocks/mock_version_path.go @@ -29,19 +29,19 @@ func (mock *MockExecutionVersionCache) Get(key *go_version.Version) (string, err if mock == nil { panic("mock must not be nil. Use myMock := NewMockExecutionVersionCache().") } - params := []pegomock.Param{key} - result := pegomock.GetGenericMockFrom(mock).Invoke("Get", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{key} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Get", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockExecutionVersionCache) VerifyWasCalledOnce() *VerifierMockExecutionVersionCache { @@ -82,8 +82,8 @@ type VerifierMockExecutionVersionCache struct { } func (verifier *VerifierMockExecutionVersionCache) Get(key *go_version.Version) *MockExecutionVersionCache_Get_OngoingVerification { - params := []pegomock.Param{key} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Get", params, verifier.timeout) + _params := []pegomock.Param{key} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Get", _params, verifier.timeout) return &MockExecutionVersionCache_Get_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -98,11 +98,13 @@ func (c *MockExecutionVersionCache_Get_OngoingVerification) GetCapturedArguments } func (c *MockExecutionVersionCache_Get_OngoingVerification) GetAllCapturedArguments() (_param0 []*go_version.Version) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*go_version.Version, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*go_version.Version) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*go_version.Version, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*go_version.Version) + } } } return diff --git a/server/core/runtime/mocks/mock_async_tfexec.go b/server/core/runtime/mocks/mock_async_tfexec.go index fc93fde915..662571ed0b 100644 --- a/server/core/runtime/mocks/mock_async_tfexec.go +++ b/server/core/runtime/mocks/mock_async_tfexec.go @@ -31,27 +31,27 @@ func (mock *MockAsyncTFExec) RunCommandAsync(ctx command.ProjectContext, path st if mock == nil { panic("mock must not be nil. Use myMock := NewMockAsyncTFExec().") } - params := []pegomock.Param{ctx, path, args, envs, v, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("RunCommandAsync", params, []reflect.Type{reflect.TypeOf((*chan<- string)(nil)).Elem(), reflect.TypeOf((*<-chan models.Line)(nil)).Elem()}) - var ret0 chan<- string - var ret1 <-chan models.Line - if len(result) != 0 { - if result[0] != nil { + _params := []pegomock.Param{ctx, path, args, envs, v, workspace} + _result := pegomock.GetGenericMockFrom(mock).Invoke("RunCommandAsync", _params, []reflect.Type{reflect.TypeOf((*chan<- string)(nil)).Elem(), reflect.TypeOf((*<-chan models.Line)(nil)).Elem()}) + var _ret0 chan<- string + var _ret1 <-chan models.Line + if len(_result) != 0 { + if _result[0] != nil { var ok bool - ret0, ok = result[0].(chan string) + _ret0, ok = _result[0].(chan string) if !ok { - ret0 = result[0].(chan<- string) + _ret0 = _result[0].(chan<- string) } } - if result[1] != nil { + if _result[1] != nil { var ok bool - ret1, ok = result[1].(chan models.Line) + _ret1, ok = _result[1].(chan models.Line) if !ok { - ret1 = result[1].(<-chan models.Line) + _ret1 = _result[1].(<-chan models.Line) } } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockAsyncTFExec) VerifyWasCalledOnce() *VerifierMockAsyncTFExec { @@ -92,8 +92,8 @@ type VerifierMockAsyncTFExec struct { } func (verifier *VerifierMockAsyncTFExec) RunCommandAsync(ctx command.ProjectContext, path string, args []string, envs map[string]string, v *go_version.Version, workspace string) *MockAsyncTFExec_RunCommandAsync_OngoingVerification { - params := []pegomock.Param{ctx, path, args, envs, v, workspace} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunCommandAsync", params, verifier.timeout) + _params := []pegomock.Param{ctx, path, args, envs, v, workspace} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunCommandAsync", _params, verifier.timeout) return &MockAsyncTFExec_RunCommandAsync_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -108,31 +108,43 @@ func (c *MockAsyncTFExec_RunCommandAsync_OngoingVerification) GetCapturedArgumen } func (c *MockAsyncTFExec_RunCommandAsync_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []string, _param2 [][]string, _param3 []map[string]string, _param4 []*go_version.Version, _param5 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } - _param2 = make([][]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.([]string) + if len(_params) > 2 { + _param2 = make([][]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.([]string) + } } - _param3 = make([]map[string]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(map[string]string) + if len(_params) > 3 { + _param3 = make([]map[string]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(map[string]string) + } } - _param4 = make([]*go_version.Version, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(*go_version.Version) + if len(_params) > 4 { + _param4 = make([]*go_version.Version, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(*go_version.Version) + } } - _param5 = make([]string, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[u] = param.(string) + if len(_params) > 5 { + _param5 = make([]string, len(c.methodInvocations)) + for u, param := range _params[5] { + _param5[u] = param.(string) + } } } return diff --git a/server/core/runtime/mocks/mock_post_workflows_hook_runner.go b/server/core/runtime/mocks/mock_post_workflows_hook_runner.go index 2674bf3e0e..5ae84dfce0 100644 --- a/server/core/runtime/mocks/mock_post_workflows_hook_runner.go +++ b/server/core/runtime/mocks/mock_post_workflows_hook_runner.go @@ -29,23 +29,23 @@ func (mock *MockPostWorkflowHookRunner) Run(ctx models.WorkflowHookCommandContex if mock == nil { panic("mock must not be nil. Use myMock := NewMockPostWorkflowHookRunner().") } - params := []pegomock.Param{ctx, command, shell, shellArgs, path} - result := pegomock.GetGenericMockFrom(mock).Invoke("Run", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 string - var ret2 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{ctx, command, shell, shellArgs, path} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Run", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 string + var _ret2 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(string) + if _result[1] != nil { + _ret1 = _result[1].(string) } - if result[2] != nil { - ret2 = result[2].(error) + if _result[2] != nil { + _ret2 = _result[2].(error) } } - return ret0, ret1, ret2 + return _ret0, _ret1, _ret2 } func (mock *MockPostWorkflowHookRunner) VerifyWasCalledOnce() *VerifierMockPostWorkflowHookRunner { @@ -86,8 +86,8 @@ type VerifierMockPostWorkflowHookRunner struct { } func (verifier *VerifierMockPostWorkflowHookRunner) Run(ctx models.WorkflowHookCommandContext, command string, shell string, shellArgs string, path string) *MockPostWorkflowHookRunner_Run_OngoingVerification { - params := []pegomock.Param{ctx, command, shell, shellArgs, path} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", params, verifier.timeout) + _params := []pegomock.Param{ctx, command, shell, shellArgs, path} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", _params, verifier.timeout) return &MockPostWorkflowHookRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -102,27 +102,37 @@ func (c *MockPostWorkflowHookRunner_Run_OngoingVerification) GetCapturedArgument } func (c *MockPostWorkflowHookRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []models.WorkflowHookCommandContext, _param1 []string, _param2 []string, _param3 []string, _param4 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]models.WorkflowHookCommandContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.WorkflowHookCommandContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.WorkflowHookCommandContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.WorkflowHookCommandContext) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } - _param4 = make([]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(string) + if len(_params) > 4 { + _param4 = make([]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(string) + } } } return diff --git a/server/core/runtime/mocks/mock_pre_workflows_hook_runner.go b/server/core/runtime/mocks/mock_pre_workflows_hook_runner.go index c9894c5cdd..91e29864bc 100644 --- a/server/core/runtime/mocks/mock_pre_workflows_hook_runner.go +++ b/server/core/runtime/mocks/mock_pre_workflows_hook_runner.go @@ -29,23 +29,23 @@ func (mock *MockPreWorkflowHookRunner) Run(ctx models.WorkflowHookCommandContext if mock == nil { panic("mock must not be nil. Use myMock := NewMockPreWorkflowHookRunner().") } - params := []pegomock.Param{ctx, command, shell, shellArgs, path} - result := pegomock.GetGenericMockFrom(mock).Invoke("Run", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 string - var ret2 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{ctx, command, shell, shellArgs, path} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Run", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 string + var _ret2 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(string) + if _result[1] != nil { + _ret1 = _result[1].(string) } - if result[2] != nil { - ret2 = result[2].(error) + if _result[2] != nil { + _ret2 = _result[2].(error) } } - return ret0, ret1, ret2 + return _ret0, _ret1, _ret2 } func (mock *MockPreWorkflowHookRunner) VerifyWasCalledOnce() *VerifierMockPreWorkflowHookRunner { @@ -86,8 +86,8 @@ type VerifierMockPreWorkflowHookRunner struct { } func (verifier *VerifierMockPreWorkflowHookRunner) Run(ctx models.WorkflowHookCommandContext, command string, shell string, shellArgs string, path string) *MockPreWorkflowHookRunner_Run_OngoingVerification { - params := []pegomock.Param{ctx, command, shell, shellArgs, path} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", params, verifier.timeout) + _params := []pegomock.Param{ctx, command, shell, shellArgs, path} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", _params, verifier.timeout) return &MockPreWorkflowHookRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -102,27 +102,37 @@ func (c *MockPreWorkflowHookRunner_Run_OngoingVerification) GetCapturedArguments } func (c *MockPreWorkflowHookRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []models.WorkflowHookCommandContext, _param1 []string, _param2 []string, _param3 []string, _param4 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]models.WorkflowHookCommandContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.WorkflowHookCommandContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.WorkflowHookCommandContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.WorkflowHookCommandContext) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } - _param4 = make([]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(string) + if len(_params) > 4 { + _param4 = make([]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(string) + } } } return diff --git a/server/core/runtime/mocks/mock_pull_approved_checker.go b/server/core/runtime/mocks/mock_pull_approved_checker.go index fc43172cee..b2b134f7c3 100644 --- a/server/core/runtime/mocks/mock_pull_approved_checker.go +++ b/server/core/runtime/mocks/mock_pull_approved_checker.go @@ -30,19 +30,19 @@ func (mock *MockPullApprovedChecker) PullIsApproved(logger logging.SimpleLogging if mock == nil { panic("mock must not be nil. Use myMock := NewMockPullApprovedChecker().") } - params := []pegomock.Param{logger, baseRepo, pull} - result := pegomock.GetGenericMockFrom(mock).Invoke("PullIsApproved", params, []reflect.Type{reflect.TypeOf((*models.ApprovalStatus)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.ApprovalStatus - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.ApprovalStatus) + _params := []pegomock.Param{logger, baseRepo, pull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("PullIsApproved", _params, []reflect.Type{reflect.TypeOf((*models.ApprovalStatus)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.ApprovalStatus + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.ApprovalStatus) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockPullApprovedChecker) VerifyWasCalledOnce() *VerifierMockPullApprovedChecker { @@ -83,8 +83,8 @@ type VerifierMockPullApprovedChecker struct { } func (verifier *VerifierMockPullApprovedChecker) PullIsApproved(logger logging.SimpleLogging, baseRepo models.Repo, pull models.PullRequest) *MockPullApprovedChecker_PullIsApproved_OngoingVerification { - params := []pegomock.Param{logger, baseRepo, pull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PullIsApproved", params, verifier.timeout) + _params := []pegomock.Param{logger, baseRepo, pull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PullIsApproved", _params, verifier.timeout) return &MockPullApprovedChecker_PullIsApproved_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -99,19 +99,25 @@ func (c *MockPullApprovedChecker_PullIsApproved_OngoingVerification) GetCaptured } func (c *MockPullApprovedChecker_PullIsApproved_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } } return diff --git a/server/core/runtime/mocks/mock_runner.go b/server/core/runtime/mocks/mock_runner.go index d29757facf..758fa38fd0 100644 --- a/server/core/runtime/mocks/mock_runner.go +++ b/server/core/runtime/mocks/mock_runner.go @@ -29,19 +29,19 @@ func (mock *MockRunner) Run(ctx command.ProjectContext, extraArgs []string, path if mock == nil { panic("mock must not be nil. Use myMock := NewMockRunner().") } - params := []pegomock.Param{ctx, extraArgs, path, envs} - result := pegomock.GetGenericMockFrom(mock).Invoke("Run", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{ctx, extraArgs, path, envs} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Run", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockRunner) VerifyWasCalledOnce() *VerifierMockRunner { @@ -82,8 +82,8 @@ type VerifierMockRunner struct { } func (verifier *VerifierMockRunner) Run(ctx command.ProjectContext, extraArgs []string, path string, envs map[string]string) *MockRunner_Run_OngoingVerification { - params := []pegomock.Param{ctx, extraArgs, path, envs} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", params, verifier.timeout) + _params := []pegomock.Param{ctx, extraArgs, path, envs} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", _params, verifier.timeout) return &MockRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -98,23 +98,31 @@ func (c *MockRunner_Run_OngoingVerification) GetCapturedArguments() (command.Pro } func (c *MockRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 [][]string, _param2 []string, _param3 []map[string]string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } - _param1 = make([][]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.([]string) + if len(_params) > 1 { + _param1 = make([][]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.([]string) + } } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } - _param3 = make([]map[string]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(map[string]string) + if len(_params) > 3 { + _param3 = make([]map[string]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(map[string]string) + } } } return diff --git a/server/core/runtime/mocks/mock_status_updater.go b/server/core/runtime/mocks/mock_status_updater.go index 70f8edf1d3..8f36ee0d10 100644 --- a/server/core/runtime/mocks/mock_status_updater.go +++ b/server/core/runtime/mocks/mock_status_updater.go @@ -30,15 +30,15 @@ func (mock *MockStatusUpdater) UpdateProject(ctx command.ProjectContext, cmdName if mock == nil { panic("mock must not be nil. Use myMock := NewMockStatusUpdater().") } - params := []pegomock.Param{ctx, cmdName, status, url, res} - result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateProject", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{ctx, cmdName, status, url, res} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateProject", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockStatusUpdater) VerifyWasCalledOnce() *VerifierMockStatusUpdater { @@ -79,8 +79,8 @@ type VerifierMockStatusUpdater struct { } func (verifier *VerifierMockStatusUpdater) UpdateProject(ctx command.ProjectContext, cmdName command.Name, status models.CommitStatus, url string, res *command.ProjectResult) *MockStatusUpdater_UpdateProject_OngoingVerification { - params := []pegomock.Param{ctx, cmdName, status, url, res} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateProject", params, verifier.timeout) + _params := []pegomock.Param{ctx, cmdName, status, url, res} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateProject", _params, verifier.timeout) return &MockStatusUpdater_UpdateProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -95,27 +95,37 @@ func (c *MockStatusUpdater_UpdateProject_OngoingVerification) GetCapturedArgumen } func (c *MockStatusUpdater_UpdateProject_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []command.Name, _param2 []models.CommitStatus, _param3 []string, _param4 []*command.ProjectResult) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } - _param1 = make([]command.Name, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(command.Name) + if len(_params) > 1 { + _param1 = make([]command.Name, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(command.Name) + } } - _param2 = make([]models.CommitStatus, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.CommitStatus) + if len(_params) > 2 { + _param2 = make([]models.CommitStatus, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.CommitStatus) + } } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } - _param4 = make([]*command.ProjectResult, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(*command.ProjectResult) + if len(_params) > 4 { + _param4 = make([]*command.ProjectResult, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(*command.ProjectResult) + } } } return diff --git a/server/core/runtime/mocks/mock_versionedexecutorworkflow.go b/server/core/runtime/mocks/mock_versionedexecutorworkflow.go index ca6686fe5c..acf94e1496 100644 --- a/server/core/runtime/mocks/mock_versionedexecutorworkflow.go +++ b/server/core/runtime/mocks/mock_versionedexecutorworkflow.go @@ -31,38 +31,38 @@ func (mock *MockVersionedExecutorWorkflow) EnsureExecutorVersion(log logging.Sim if mock == nil { panic("mock must not be nil. Use myMock := NewMockVersionedExecutorWorkflow().") } - params := []pegomock.Param{log, v} - result := pegomock.GetGenericMockFrom(mock).Invoke("EnsureExecutorVersion", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{log, v} + _result := pegomock.GetGenericMockFrom(mock).Invoke("EnsureExecutorVersion", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockVersionedExecutorWorkflow) Run(ctx command.ProjectContext, executablePath string, envs map[string]string, workdir string, extraArgs []string) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockVersionedExecutorWorkflow().") } - params := []pegomock.Param{ctx, executablePath, envs, workdir, extraArgs} - result := pegomock.GetGenericMockFrom(mock).Invoke("Run", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{ctx, executablePath, envs, workdir, extraArgs} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Run", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockVersionedExecutorWorkflow) VerifyWasCalledOnce() *VerifierMockVersionedExecutorWorkflow { @@ -103,8 +103,8 @@ type VerifierMockVersionedExecutorWorkflow struct { } func (verifier *VerifierMockVersionedExecutorWorkflow) EnsureExecutorVersion(log logging.SimpleLogging, v *go_version.Version) *MockVersionedExecutorWorkflow_EnsureExecutorVersion_OngoingVerification { - params := []pegomock.Param{log, v} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "EnsureExecutorVersion", params, verifier.timeout) + _params := []pegomock.Param{log, v} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "EnsureExecutorVersion", _params, verifier.timeout) return &MockVersionedExecutorWorkflow_EnsureExecutorVersion_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -119,23 +119,27 @@ func (c *MockVersionedExecutorWorkflow_EnsureExecutorVersion_OngoingVerification } func (c *MockVersionedExecutorWorkflow_EnsureExecutorVersion_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []*go_version.Version) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]*go_version.Version, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*go_version.Version) + if len(_params) > 1 { + _param1 = make([]*go_version.Version, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*go_version.Version) + } } } return } func (verifier *VerifierMockVersionedExecutorWorkflow) Run(ctx command.ProjectContext, executablePath string, envs map[string]string, workdir string, extraArgs []string) *MockVersionedExecutorWorkflow_Run_OngoingVerification { - params := []pegomock.Param{ctx, executablePath, envs, workdir, extraArgs} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", params, verifier.timeout) + _params := []pegomock.Param{ctx, executablePath, envs, workdir, extraArgs} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", _params, verifier.timeout) return &MockVersionedExecutorWorkflow_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -150,27 +154,37 @@ func (c *MockVersionedExecutorWorkflow_Run_OngoingVerification) GetCapturedArgum } func (c *MockVersionedExecutorWorkflow_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []string, _param2 []map[string]string, _param3 []string, _param4 [][]string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } - _param2 = make([]map[string]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(map[string]string) + if len(_params) > 2 { + _param2 = make([]map[string]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(map[string]string) + } } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } - _param4 = make([][]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.([]string) + if len(_params) > 4 { + _param4 = make([][]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.([]string) + } } } return diff --git a/server/core/runtime/models/mocks/mock_exec.go b/server/core/runtime/models/mocks/mock_exec.go index 35386315c9..e528ba3260 100644 --- a/server/core/runtime/models/mocks/mock_exec.go +++ b/server/core/runtime/models/mocks/mock_exec.go @@ -28,38 +28,38 @@ func (mock *MockExec) CombinedOutput(args []string, envs map[string]string, work if mock == nil { panic("mock must not be nil. Use myMock := NewMockExec().") } - params := []pegomock.Param{args, envs, workdir} - result := pegomock.GetGenericMockFrom(mock).Invoke("CombinedOutput", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{args, envs, workdir} + _result := pegomock.GetGenericMockFrom(mock).Invoke("CombinedOutput", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockExec) LookPath(file string) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockExec().") } - params := []pegomock.Param{file} - result := pegomock.GetGenericMockFrom(mock).Invoke("LookPath", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{file} + _result := pegomock.GetGenericMockFrom(mock).Invoke("LookPath", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockExec) VerifyWasCalledOnce() *VerifierMockExec { @@ -100,8 +100,8 @@ type VerifierMockExec struct { } func (verifier *VerifierMockExec) CombinedOutput(args []string, envs map[string]string, workdir string) *MockExec_CombinedOutput_OngoingVerification { - params := []pegomock.Param{args, envs, workdir} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CombinedOutput", params, verifier.timeout) + _params := []pegomock.Param{args, envs, workdir} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CombinedOutput", _params, verifier.timeout) return &MockExec_CombinedOutput_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -116,27 +116,33 @@ func (c *MockExec_CombinedOutput_OngoingVerification) GetCapturedArguments() ([] } func (c *MockExec_CombinedOutput_OngoingVerification) GetAllCapturedArguments() (_param0 [][]string, _param1 []map[string]string, _param2 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([][]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.([]string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([][]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.([]string) + } } - _param1 = make([]map[string]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(map[string]string) + if len(_params) > 1 { + _param1 = make([]map[string]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(map[string]string) + } } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } } return } func (verifier *VerifierMockExec) LookPath(file string) *MockExec_LookPath_OngoingVerification { - params := []pegomock.Param{file} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "LookPath", params, verifier.timeout) + _params := []pegomock.Param{file} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "LookPath", _params, verifier.timeout) return &MockExec_LookPath_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -151,11 +157,13 @@ func (c *MockExec_LookPath_OngoingVerification) GetCapturedArguments() string { } func (c *MockExec_LookPath_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } } return diff --git a/server/core/runtime/models/mocks/mock_filepath.go b/server/core/runtime/models/mocks/mock_filepath.go index cdfd8995f0..c09613a8c7 100644 --- a/server/core/runtime/models/mocks/mock_filepath.go +++ b/server/core/runtime/models/mocks/mock_filepath.go @@ -29,67 +29,67 @@ func (mock *MockFilePath) Join(elem ...string) models.FilePath { if mock == nil { panic("mock must not be nil. Use myMock := NewMockFilePath().") } - params := []pegomock.Param{} + _params := []pegomock.Param{} for _, param := range elem { - params = append(params, param) + _params = append(_params, param) } - result := pegomock.GetGenericMockFrom(mock).Invoke("Join", params, []reflect.Type{reflect.TypeOf((*models.FilePath)(nil)).Elem()}) - var ret0 models.FilePath - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.FilePath) + _result := pegomock.GetGenericMockFrom(mock).Invoke("Join", _params, []reflect.Type{reflect.TypeOf((*models.FilePath)(nil)).Elem()}) + var _ret0 models.FilePath + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.FilePath) } } - return ret0 + return _ret0 } func (mock *MockFilePath) NotExists() bool { if mock == nil { panic("mock must not be nil. Use myMock := NewMockFilePath().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("NotExists", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) - var ret0 bool - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(bool) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("NotExists", _params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) + var _ret0 bool + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(bool) } } - return ret0 + return _ret0 } func (mock *MockFilePath) Resolve() string { if mock == nil { panic("mock must not be nil. Use myMock := NewMockFilePath().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("Resolve", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem()}) - var ret0 string - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Resolve", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem()}) + var _ret0 string + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } } - return ret0 + return _ret0 } func (mock *MockFilePath) Symlink(newname string) (models.FilePath, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockFilePath().") } - params := []pegomock.Param{newname} - result := pegomock.GetGenericMockFrom(mock).Invoke("Symlink", params, []reflect.Type{reflect.TypeOf((*models.FilePath)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.FilePath - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.FilePath) + _params := []pegomock.Param{newname} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Symlink", _params, []reflect.Type{reflect.TypeOf((*models.FilePath)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.FilePath + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.FilePath) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockFilePath) VerifyWasCalledOnce() *VerifierMockFilePath { @@ -130,11 +130,11 @@ type VerifierMockFilePath struct { } func (verifier *VerifierMockFilePath) Join(elem ...string) *MockFilePath_Join_OngoingVerification { - params := []pegomock.Param{} + _params := []pegomock.Param{} for _, param := range elem { - params = append(params, param) + _params = append(_params, param) } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Join", params, verifier.timeout) + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Join", _params, verifier.timeout) return &MockFilePath_Join_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -149,14 +149,14 @@ func (c *MockFilePath_Join_OngoingVerification) GetCapturedArguments() []string } func (c *MockFilePath_Join_OngoingVerification) GetAllCapturedArguments() (_param0 [][]string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { _param0 = make([][]string, len(c.methodInvocations)) for u := 0; u < len(c.methodInvocations); u++ { - _param0[u] = make([]string, len(params)-0) - for x := 0; x < len(params); x++ { - if params[x][u] != nil { - _param0[u][x-0] = params[x][u].(string) + _param0[u] = make([]string, len(_params)-0) + for x := 0; x < len(_params); x++ { + if _params[x][u] != nil { + _param0[u][x-0] = _params[x][u].(string) } } } @@ -165,8 +165,8 @@ func (c *MockFilePath_Join_OngoingVerification) GetAllCapturedArguments() (_para } func (verifier *VerifierMockFilePath) NotExists() *MockFilePath_NotExists_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "NotExists", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "NotExists", _params, verifier.timeout) return &MockFilePath_NotExists_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -182,8 +182,8 @@ func (c *MockFilePath_NotExists_OngoingVerification) GetAllCapturedArguments() { } func (verifier *VerifierMockFilePath) Resolve() *MockFilePath_Resolve_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Resolve", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Resolve", _params, verifier.timeout) return &MockFilePath_Resolve_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -199,8 +199,8 @@ func (c *MockFilePath_Resolve_OngoingVerification) GetAllCapturedArguments() { } func (verifier *VerifierMockFilePath) Symlink(newname string) *MockFilePath_Symlink_OngoingVerification { - params := []pegomock.Param{newname} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Symlink", params, verifier.timeout) + _params := []pegomock.Param{newname} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Symlink", _params, verifier.timeout) return &MockFilePath_Symlink_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -215,11 +215,13 @@ func (c *MockFilePath_Symlink_OngoingVerification) GetCapturedArguments() string } func (c *MockFilePath_Symlink_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } } return diff --git a/server/core/runtime/policy/mocks/mock_conftest_client.go b/server/core/runtime/policy/mocks/mock_conftest_client.go index 441fc606f4..d16e837aa6 100644 --- a/server/core/runtime/policy/mocks/mock_conftest_client.go +++ b/server/core/runtime/policy/mocks/mock_conftest_client.go @@ -29,19 +29,19 @@ func (mock *MockSourceResolver) Resolve(policySet valid.PolicySet) (string, erro if mock == nil { panic("mock must not be nil. Use myMock := NewMockSourceResolver().") } - params := []pegomock.Param{policySet} - result := pegomock.GetGenericMockFrom(mock).Invoke("Resolve", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{policySet} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Resolve", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockSourceResolver) VerifyWasCalledOnce() *VerifierMockSourceResolver { @@ -82,8 +82,8 @@ type VerifierMockSourceResolver struct { } func (verifier *VerifierMockSourceResolver) Resolve(policySet valid.PolicySet) *MockSourceResolver_Resolve_OngoingVerification { - params := []pegomock.Param{policySet} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Resolve", params, verifier.timeout) + _params := []pegomock.Param{policySet} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Resolve", _params, verifier.timeout) return &MockSourceResolver_Resolve_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -98,11 +98,13 @@ func (c *MockSourceResolver_Resolve_OngoingVerification) GetCapturedArguments() } func (c *MockSourceResolver_Resolve_OngoingVerification) GetAllCapturedArguments() (_param0 []valid.PolicySet) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]valid.PolicySet, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(valid.PolicySet) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]valid.PolicySet, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(valid.PolicySet) + } } } return diff --git a/server/events/mock_workingdir_test.go b/server/events/mock_workingdir_test.go index d298b2cee7..c11b9e28bf 100644 --- a/server/events/mock_workingdir_test.go +++ b/server/events/mock_workingdir_test.go @@ -31,148 +31,148 @@ func (mock *MockWorkingDir) Clone(logger logging.SimpleLogging, headRepo models. if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, headRepo, p, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("Clone", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 bool - var ret2 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{logger, headRepo, p, workspace} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Clone", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 bool + var _ret2 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(bool) + if _result[1] != nil { + _ret1 = _result[1].(bool) } - if result[2] != nil { - ret2 = result[2].(error) + if _result[2] != nil { + _ret2 = _result[2].(error) } } - return ret0, ret1, ret2 + return _ret0, _ret1, _ret2 } func (mock *MockWorkingDir) Delete(logger logging.SimpleLogging, r models.Repo, p models.PullRequest) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, r, p} - result := pegomock.GetGenericMockFrom(mock).Invoke("Delete", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, r, p} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Delete", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockWorkingDir) DeleteForWorkspace(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, r, p, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteForWorkspace", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, r, p, workspace} + _result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteForWorkspace", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockWorkingDir) DeletePlan(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string, path string, projectName string) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, r, p, workspace, path, projectName} - result := pegomock.GetGenericMockFrom(mock).Invoke("DeletePlan", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, r, p, workspace, path, projectName} + _result := pegomock.GetGenericMockFrom(mock).Invoke("DeletePlan", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockWorkingDir) GetGitUntrackedFiles(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string) ([]string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, r, p, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetGitUntrackedFiles", params, []reflect.Type{reflect.TypeOf((*[]string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]string) + _params := []pegomock.Param{logger, r, p, workspace} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetGitUntrackedFiles", _params, []reflect.Type{reflect.TypeOf((*[]string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockWorkingDir) GetPullDir(r models.Repo, p models.PullRequest) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{r, p} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullDir", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{r, p} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullDir", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockWorkingDir) GetWorkingDir(r models.Repo, p models.PullRequest, workspace string) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{r, p, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetWorkingDir", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{r, p, workspace} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetWorkingDir", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockWorkingDir) HasDiverged(logger logging.SimpleLogging, cloneDir string) bool { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, cloneDir} - result := pegomock.GetGenericMockFrom(mock).Invoke("HasDiverged", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) - var ret0 bool - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(bool) + _params := []pegomock.Param{logger, cloneDir} + _result := pegomock.GetGenericMockFrom(mock).Invoke("HasDiverged", _params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) + var _ret0 bool + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(bool) } } - return ret0 + return _ret0 } func (mock *MockWorkingDir) SetCheckForUpstreamChanges() { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{} - pegomock.GetGenericMockFrom(mock).Invoke("SetCheckForUpstreamChanges", params, []reflect.Type{}) + _params := []pegomock.Param{} + pegomock.GetGenericMockFrom(mock).Invoke("SetCheckForUpstreamChanges", _params, []reflect.Type{}) } func (mock *MockWorkingDir) VerifyWasCalledOnce() *VerifierMockWorkingDir { @@ -213,8 +213,8 @@ type VerifierMockWorkingDir struct { } func (verifier *VerifierMockWorkingDir) Clone(logger logging.SimpleLogging, headRepo models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_Clone_OngoingVerification { - params := []pegomock.Param{logger, headRepo, p, workspace} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Clone", params, verifier.timeout) + _params := []pegomock.Param{logger, headRepo, p, workspace} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Clone", _params, verifier.timeout) return &MockWorkingDir_Clone_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -229,31 +229,39 @@ func (c *MockWorkingDir_Clone_OngoingVerification) GetCapturedArguments() (loggi } func (c *MockWorkingDir_Clone_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) - } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } + } + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } } return } func (verifier *VerifierMockWorkingDir) Delete(logger logging.SimpleLogging, r models.Repo, p models.PullRequest) *MockWorkingDir_Delete_OngoingVerification { - params := []pegomock.Param{logger, r, p} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Delete", params, verifier.timeout) + _params := []pegomock.Param{logger, r, p} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Delete", _params, verifier.timeout) return &MockWorkingDir_Delete_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -268,27 +276,33 @@ func (c *MockWorkingDir_Delete_OngoingVerification) GetCapturedArguments() (logg } func (c *MockWorkingDir_Delete_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } } return } func (verifier *VerifierMockWorkingDir) DeleteForWorkspace(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_DeleteForWorkspace_OngoingVerification { - params := []pegomock.Param{logger, r, p, workspace} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteForWorkspace", params, verifier.timeout) + _params := []pegomock.Param{logger, r, p, workspace} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteForWorkspace", _params, verifier.timeout) return &MockWorkingDir_DeleteForWorkspace_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -303,31 +317,39 @@ func (c *MockWorkingDir_DeleteForWorkspace_OngoingVerification) GetCapturedArgum } func (c *MockWorkingDir_DeleteForWorkspace_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) - } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } + } + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } } return } func (verifier *VerifierMockWorkingDir) DeletePlan(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string, path string, projectName string) *MockWorkingDir_DeletePlan_OngoingVerification { - params := []pegomock.Param{logger, r, p, workspace, path, projectName} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeletePlan", params, verifier.timeout) + _params := []pegomock.Param{logger, r, p, workspace, path, projectName} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeletePlan", _params, verifier.timeout) return &MockWorkingDir_DeletePlan_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -342,39 +364,51 @@ func (c *MockWorkingDir_DeletePlan_OngoingVerification) GetCapturedArguments() ( } func (c *MockWorkingDir_DeletePlan_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []string, _param4 []string, _param5 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) - } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) - } - _param4 = make([]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(string) - } - _param5 = make([]string, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } + } + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } + } + if len(_params) > 4 { + _param4 = make([]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(string) + } + } + if len(_params) > 5 { + _param5 = make([]string, len(c.methodInvocations)) + for u, param := range _params[5] { + _param5[u] = param.(string) + } } } return } func (verifier *VerifierMockWorkingDir) GetGitUntrackedFiles(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_GetGitUntrackedFiles_OngoingVerification { - params := []pegomock.Param{logger, r, p, workspace} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetGitUntrackedFiles", params, verifier.timeout) + _params := []pegomock.Param{logger, r, p, workspace} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetGitUntrackedFiles", _params, verifier.timeout) return &MockWorkingDir_GetGitUntrackedFiles_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -389,31 +423,39 @@ func (c *MockWorkingDir_GetGitUntrackedFiles_OngoingVerification) GetCapturedArg } func (c *MockWorkingDir_GetGitUntrackedFiles_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) - } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } + } + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } } return } 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) + _params := []pegomock.Param{r, p} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullDir", _params, verifier.timeout) return &MockWorkingDir_GetPullDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -428,23 +470,27 @@ func (c *MockWorkingDir_GetPullDir_OngoingVerification) GetCapturedArguments() ( } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Repo) - } - _param1 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Repo) + } + } + if len(_params) > 1 { + _param1 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.PullRequest) + } } } return } 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) + _params := []pegomock.Param{r, p, workspace} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetWorkingDir", _params, verifier.timeout) return &MockWorkingDir_GetWorkingDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -459,27 +505,33 @@ func (c *MockWorkingDir_GetWorkingDir_OngoingVerification) GetCapturedArguments( } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Repo) - } - _param1 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.PullRequest) - } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Repo) + } + } + if len(_params) > 1 { + _param1 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.PullRequest) + } + } + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } } return } func (verifier *VerifierMockWorkingDir) HasDiverged(logger logging.SimpleLogging, cloneDir string) *MockWorkingDir_HasDiverged_OngoingVerification { - params := []pegomock.Param{logger, cloneDir} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "HasDiverged", params, verifier.timeout) + _params := []pegomock.Param{logger, cloneDir} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "HasDiverged", _params, verifier.timeout) return &MockWorkingDir_HasDiverged_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -494,23 +546,27 @@ func (c *MockWorkingDir_HasDiverged_OngoingVerification) GetCapturedArguments() } func (c *MockWorkingDir_HasDiverged_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } } return } func (verifier *VerifierMockWorkingDir) SetCheckForUpstreamChanges() *MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SetCheckForUpstreamChanges", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SetCheckForUpstreamChanges", _params, verifier.timeout) return &MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } diff --git a/server/events/mocks/mock_azuredevops_pull_getter.go b/server/events/mocks/mock_azuredevops_pull_getter.go index 95c57e0e89..1ed64c3a10 100644 --- a/server/events/mocks/mock_azuredevops_pull_getter.go +++ b/server/events/mocks/mock_azuredevops_pull_getter.go @@ -31,19 +31,19 @@ func (mock *MockAzureDevopsPullGetter) GetPullRequest(logger logging.SimpleLoggi if mock == nil { panic("mock must not be nil. Use myMock := NewMockAzureDevopsPullGetter().") } - params := []pegomock.Param{logger, repo, pullNum} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullRequest", params, []reflect.Type{reflect.TypeOf((**azuredevops.GitPullRequest)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *azuredevops.GitPullRequest - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*azuredevops.GitPullRequest) + _params := []pegomock.Param{logger, repo, pullNum} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullRequest", _params, []reflect.Type{reflect.TypeOf((**azuredevops.GitPullRequest)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *azuredevops.GitPullRequest + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*azuredevops.GitPullRequest) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockAzureDevopsPullGetter) VerifyWasCalledOnce() *VerifierMockAzureDevopsPullGetter { @@ -84,8 +84,8 @@ type VerifierMockAzureDevopsPullGetter struct { } func (verifier *VerifierMockAzureDevopsPullGetter) GetPullRequest(logger logging.SimpleLogging, repo models.Repo, pullNum int) *MockAzureDevopsPullGetter_GetPullRequest_OngoingVerification { - params := []pegomock.Param{logger, repo, pullNum} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullRequest", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pullNum} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullRequest", _params, verifier.timeout) return &MockAzureDevopsPullGetter_GetPullRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -100,19 +100,25 @@ func (c *MockAzureDevopsPullGetter_GetPullRequest_OngoingVerification) GetCaptur } func (c *MockAzureDevopsPullGetter_GetPullRequest_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []int) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } } - _param2 = make([]int, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(int) + if len(_params) > 2 { + _param2 = make([]int, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(int) + } } } return diff --git a/server/events/mocks/mock_command_requirement_handler.go b/server/events/mocks/mock_command_requirement_handler.go index d5a36f20eb..459bf58d46 100644 --- a/server/events/mocks/mock_command_requirement_handler.go +++ b/server/events/mocks/mock_command_requirement_handler.go @@ -29,76 +29,76 @@ func (mock *MockCommandRequirementHandler) ValidateApplyProject(repoDir string, if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommandRequirementHandler().") } - params := []pegomock.Param{repoDir, ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("ValidateApplyProject", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{repoDir, ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ValidateApplyProject", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockCommandRequirementHandler) ValidateImportProject(repoDir string, ctx command.ProjectContext) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommandRequirementHandler().") } - params := []pegomock.Param{repoDir, ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("ValidateImportProject", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{repoDir, ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ValidateImportProject", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockCommandRequirementHandler) ValidatePlanProject(repoDir string, ctx command.ProjectContext) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommandRequirementHandler().") } - params := []pegomock.Param{repoDir, ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("ValidatePlanProject", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{repoDir, ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ValidatePlanProject", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockCommandRequirementHandler) ValidateProjectDependencies(ctx command.ProjectContext) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommandRequirementHandler().") } - params := []pegomock.Param{ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("ValidateProjectDependencies", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ValidateProjectDependencies", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockCommandRequirementHandler) VerifyWasCalledOnce() *VerifierMockCommandRequirementHandler { @@ -139,8 +139,8 @@ type VerifierMockCommandRequirementHandler struct { } func (verifier *VerifierMockCommandRequirementHandler) ValidateApplyProject(repoDir string, ctx command.ProjectContext) *MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification { - params := []pegomock.Param{repoDir, ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidateApplyProject", params, verifier.timeout) + _params := []pegomock.Param{repoDir, ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidateApplyProject", _params, verifier.timeout) return &MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -155,23 +155,27 @@ func (c *MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification) } func (c *MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } - _param1 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(command.ProjectContext) + if len(_params) > 1 { + _param1 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(command.ProjectContext) + } } } return } func (verifier *VerifierMockCommandRequirementHandler) ValidateImportProject(repoDir string, ctx command.ProjectContext) *MockCommandRequirementHandler_ValidateImportProject_OngoingVerification { - params := []pegomock.Param{repoDir, ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidateImportProject", params, verifier.timeout) + _params := []pegomock.Param{repoDir, ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidateImportProject", _params, verifier.timeout) return &MockCommandRequirementHandler_ValidateImportProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -186,23 +190,27 @@ func (c *MockCommandRequirementHandler_ValidateImportProject_OngoingVerification } func (c *MockCommandRequirementHandler_ValidateImportProject_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } - _param1 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(command.ProjectContext) + if len(_params) > 1 { + _param1 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(command.ProjectContext) + } } } return } func (verifier *VerifierMockCommandRequirementHandler) ValidatePlanProject(repoDir string, ctx command.ProjectContext) *MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification { - params := []pegomock.Param{repoDir, ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidatePlanProject", params, verifier.timeout) + _params := []pegomock.Param{repoDir, ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidatePlanProject", _params, verifier.timeout) return &MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -217,23 +225,27 @@ func (c *MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification) } func (c *MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } - _param1 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(command.ProjectContext) + if len(_params) > 1 { + _param1 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(command.ProjectContext) + } } } return } func (verifier *VerifierMockCommandRequirementHandler) ValidateProjectDependencies(ctx command.ProjectContext) *MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerification { - params := []pegomock.Param{ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidateProjectDependencies", params, verifier.timeout) + _params := []pegomock.Param{ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidateProjectDependencies", _params, verifier.timeout) return &MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -248,11 +260,13 @@ func (c *MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerifi } func (c *MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } } return diff --git a/server/events/mocks/mock_command_runner.go b/server/events/mocks/mock_command_runner.go index c0267c222a..b7be22a76b 100644 --- a/server/events/mocks/mock_command_runner.go +++ b/server/events/mocks/mock_command_runner.go @@ -30,16 +30,16 @@ func (mock *MockCommandRunner) RunAutoplanCommand(baseRepo models.Repo, headRepo if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommandRunner().") } - params := []pegomock.Param{baseRepo, headRepo, pull, user} - pegomock.GetGenericMockFrom(mock).Invoke("RunAutoplanCommand", params, []reflect.Type{}) + _params := []pegomock.Param{baseRepo, headRepo, pull, user} + pegomock.GetGenericMockFrom(mock).Invoke("RunAutoplanCommand", _params, []reflect.Type{}) } func (mock *MockCommandRunner) RunCommentCommand(baseRepo models.Repo, maybeHeadRepo *models.Repo, maybePull *models.PullRequest, user models.User, pullNum int, cmd *events.CommentCommand) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommandRunner().") } - params := []pegomock.Param{baseRepo, maybeHeadRepo, maybePull, user, pullNum, cmd} - pegomock.GetGenericMockFrom(mock).Invoke("RunCommentCommand", params, []reflect.Type{}) + _params := []pegomock.Param{baseRepo, maybeHeadRepo, maybePull, user, pullNum, cmd} + pegomock.GetGenericMockFrom(mock).Invoke("RunCommentCommand", _params, []reflect.Type{}) } func (mock *MockCommandRunner) VerifyWasCalledOnce() *VerifierMockCommandRunner { @@ -80,8 +80,8 @@ type VerifierMockCommandRunner struct { } 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) + _params := []pegomock.Param{baseRepo, headRepo, pull, user} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunAutoplanCommand", _params, verifier.timeout) return &MockCommandRunner_RunAutoplanCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -96,31 +96,39 @@ func (c *MockCommandRunner_RunAutoplanCommand_OngoingVerification) GetCapturedAr } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Repo) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Repo) + } } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } - _param3 = make([]models.User, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(models.User) + if len(_params) > 3 { + _param3 = make([]models.User, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(models.User) + } } } return } 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) + _params := []pegomock.Param{baseRepo, maybeHeadRepo, maybePull, user, pullNum, cmd} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunCommentCommand", _params, verifier.timeout) return &MockCommandRunner_RunCommentCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -135,31 +143,43 @@ func (c *MockCommandRunner_RunCommentCommand_OngoingVerification) GetCapturedArg } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Repo) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Repo) + } } - _param1 = make([]*models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*models.Repo) + if len(_params) > 1 { + _param1 = make([]*models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*models.Repo) + } } - _param2 = make([]*models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(*models.PullRequest) + if len(_params) > 2 { + _param2 = make([]*models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(*models.PullRequest) + } } - _param3 = make([]models.User, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(models.User) + if len(_params) > 3 { + _param3 = make([]models.User, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(models.User) + } } - _param4 = make([]int, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(int) + if len(_params) > 4 { + _param4 = make([]int, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(int) + } } - _param5 = make([]*events.CommentCommand, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[u] = param.(*events.CommentCommand) + if len(_params) > 5 { + _param5 = make([]*events.CommentCommand, len(c.methodInvocations)) + for u, param := range _params[5] { + _param5[u] = param.(*events.CommentCommand) + } } } return diff --git a/server/events/mocks/mock_comment_building.go b/server/events/mocks/mock_comment_building.go index 1d25d4eacd..b340a09969 100644 --- a/server/events/mocks/mock_comment_building.go +++ b/server/events/mocks/mock_comment_building.go @@ -24,11 +24,11 @@ func NewMockCommentBuilder(options ...pegomock.Option) *MockCommentBuilder { func (mock *MockCommentBuilder) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } func (mock *MockCommentBuilder) FailHandler() pegomock.FailHandler { return mock.fail } -func (mock *MockCommentBuilder) BuildApplyComment(repoRelDir string, workspace string, project string, autoMergeDisabled bool, mergeMethod string) string { +func (mock *MockCommentBuilder) BuildApplyComment(repoRelDir string, workspace string, project string, autoMergeDisabled bool, autoMergeMethod string) string { if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommentBuilder().") } - _params := []pegomock.Param{repoRelDir, workspace, project, autoMergeDisabled, mergeMethod} + _params := []pegomock.Param{repoRelDir, workspace, project, autoMergeDisabled, autoMergeMethod} _result := pegomock.GetGenericMockFrom(mock).Invoke("BuildApplyComment", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem()}) var _ret0 string if len(_result) != 0 { @@ -106,8 +106,8 @@ type VerifierMockCommentBuilder struct { timeout time.Duration } -func (verifier *VerifierMockCommentBuilder) BuildApplyComment(repoRelDir string, workspace string, project string, autoMergeDisabled bool, mergeMethod string) *MockCommentBuilder_BuildApplyComment_OngoingVerification { - _params := []pegomock.Param{repoRelDir, workspace, project, autoMergeDisabled, mergeMethod} +func (verifier *VerifierMockCommentBuilder) BuildApplyComment(repoRelDir string, workspace string, project string, autoMergeDisabled bool, autoMergeMethod string) *MockCommentBuilder_BuildApplyComment_OngoingVerification { + _params := []pegomock.Param{repoRelDir, workspace, project, autoMergeDisabled, autoMergeMethod} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildApplyComment", _params, verifier.timeout) return &MockCommentBuilder_BuildApplyComment_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -118,8 +118,8 @@ type MockCommentBuilder_BuildApplyComment_OngoingVerification struct { } func (c *MockCommentBuilder_BuildApplyComment_OngoingVerification) GetCapturedArguments() (string, string, string, bool, string) { - repoRelDir, workspace, project, autoMergeDisabled, mergeMethod := c.GetAllCapturedArguments() - return repoRelDir[len(repoRelDir)-1], workspace[len(workspace)-1], project[len(project)-1], autoMergeDisabled[len(autoMergeDisabled)-1], mergeMethod[len(mergeMethod)-1] + repoRelDir, workspace, project, autoMergeDisabled, autoMergeMethod := c.GetAllCapturedArguments() + return repoRelDir[len(repoRelDir)-1], workspace[len(workspace)-1], project[len(project)-1], autoMergeDisabled[len(autoMergeDisabled)-1], autoMergeMethod[len(autoMergeMethod)-1] } func (c *MockCommentBuilder_BuildApplyComment_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []string, _param3 []bool, _param4 []string) { diff --git a/server/events/mocks/mock_comment_parsing.go b/server/events/mocks/mock_comment_parsing.go index 73a26e00ae..238b5e0633 100644 --- a/server/events/mocks/mock_comment_parsing.go +++ b/server/events/mocks/mock_comment_parsing.go @@ -30,15 +30,15 @@ func (mock *MockCommentParsing) Parse(comment string, vcsHost models.VCSHostType if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommentParsing().") } - params := []pegomock.Param{comment, vcsHost} - result := pegomock.GetGenericMockFrom(mock).Invoke("Parse", params, []reflect.Type{reflect.TypeOf((*events.CommentParseResult)(nil)).Elem()}) - var ret0 events.CommentParseResult - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(events.CommentParseResult) + _params := []pegomock.Param{comment, vcsHost} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Parse", _params, []reflect.Type{reflect.TypeOf((*events.CommentParseResult)(nil)).Elem()}) + var _ret0 events.CommentParseResult + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(events.CommentParseResult) } } - return ret0 + return _ret0 } func (mock *MockCommentParsing) VerifyWasCalledOnce() *VerifierMockCommentParsing { @@ -79,8 +79,8 @@ type VerifierMockCommentParsing struct { } 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) + _params := []pegomock.Param{comment, vcsHost} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Parse", _params, verifier.timeout) return &MockCommentParsing_Parse_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -95,15 +95,19 @@ func (c *MockCommentParsing_Parse_OngoingVerification) GetCapturedArguments() (s } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } - _param1 = make([]models.VCSHostType, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.VCSHostType) + if len(_params) > 1 { + _param1 = make([]models.VCSHostType, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.VCSHostType) + } } } return diff --git a/server/events/mocks/mock_commit_status_updater.go b/server/events/mocks/mock_commit_status_updater.go index b0e5fcea97..764ac85059 100644 --- a/server/events/mocks/mock_commit_status_updater.go +++ b/server/events/mocks/mock_commit_status_updater.go @@ -31,60 +31,60 @@ func (mock *MockCommitStatusUpdater) UpdateCombined(logger logging.SimpleLogging if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommitStatusUpdater().") } - params := []pegomock.Param{logger, repo, pull, status, cmdName} - result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateCombined", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, repo, pull, status, cmdName} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateCombined", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockCommitStatusUpdater) UpdateCombinedCount(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, status models.CommitStatus, cmdName command.Name, numSuccess int, numTotal int) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommitStatusUpdater().") } - params := []pegomock.Param{logger, repo, pull, status, cmdName, numSuccess, numTotal} - result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateCombinedCount", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, repo, pull, status, cmdName, numSuccess, numTotal} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateCombinedCount", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockCommitStatusUpdater) UpdatePostWorkflowHook(logger logging.SimpleLogging, pull models.PullRequest, status models.CommitStatus, hookDescription string, runtimeDescription string, url string) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommitStatusUpdater().") } - params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url} - result := pegomock.GetGenericMockFrom(mock).Invoke("UpdatePostWorkflowHook", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UpdatePostWorkflowHook", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockCommitStatusUpdater) UpdatePreWorkflowHook(logger logging.SimpleLogging, pull models.PullRequest, status models.CommitStatus, hookDescription string, runtimeDescription string, url string) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockCommitStatusUpdater().") } - params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url} - result := pegomock.GetGenericMockFrom(mock).Invoke("UpdatePreWorkflowHook", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UpdatePreWorkflowHook", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockCommitStatusUpdater) VerifyWasCalledOnce() *VerifierMockCommitStatusUpdater { @@ -125,8 +125,8 @@ type VerifierMockCommitStatusUpdater struct { } func (verifier *VerifierMockCommitStatusUpdater) UpdateCombined(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, status models.CommitStatus, cmdName command.Name) *MockCommitStatusUpdater_UpdateCombined_OngoingVerification { - params := []pegomock.Param{logger, repo, pull, status, cmdName} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateCombined", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pull, status, cmdName} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateCombined", _params, verifier.timeout) return &MockCommitStatusUpdater_UpdateCombined_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -141,35 +141,45 @@ func (c *MockCommitStatusUpdater_UpdateCombined_OngoingVerification) GetCaptured } func (c *MockCommitStatusUpdater_UpdateCombined_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []models.CommitStatus, _param4 []command.Name) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } - _param3 = make([]models.CommitStatus, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(models.CommitStatus) + if len(_params) > 3 { + _param3 = make([]models.CommitStatus, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(models.CommitStatus) + } } - _param4 = make([]command.Name, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(command.Name) + if len(_params) > 4 { + _param4 = make([]command.Name, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(command.Name) + } } } return } func (verifier *VerifierMockCommitStatusUpdater) UpdateCombinedCount(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, status models.CommitStatus, cmdName command.Name, numSuccess int, numTotal int) *MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification { - params := []pegomock.Param{logger, repo, pull, status, cmdName, numSuccess, numTotal} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateCombinedCount", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pull, status, cmdName, numSuccess, numTotal} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateCombinedCount", _params, verifier.timeout) return &MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -184,43 +194,57 @@ func (c *MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification) GetCap } func (c *MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []models.CommitStatus, _param4 []command.Name, _param5 []int, _param6 []int) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } - _param3 = make([]models.CommitStatus, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(models.CommitStatus) + if len(_params) > 3 { + _param3 = make([]models.CommitStatus, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(models.CommitStatus) + } } - _param4 = make([]command.Name, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(command.Name) + if len(_params) > 4 { + _param4 = make([]command.Name, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(command.Name) + } } - _param5 = make([]int, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[u] = param.(int) + if len(_params) > 5 { + _param5 = make([]int, len(c.methodInvocations)) + for u, param := range _params[5] { + _param5[u] = param.(int) + } } - _param6 = make([]int, len(c.methodInvocations)) - for u, param := range params[6] { - _param6[u] = param.(int) + if len(_params) > 6 { + _param6 = make([]int, len(c.methodInvocations)) + for u, param := range _params[6] { + _param6[u] = param.(int) + } } } return } func (verifier *VerifierMockCommitStatusUpdater) UpdatePostWorkflowHook(logger logging.SimpleLogging, pull models.PullRequest, status models.CommitStatus, hookDescription string, runtimeDescription string, url string) *MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification { - params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdatePostWorkflowHook", params, verifier.timeout) + _params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdatePostWorkflowHook", _params, verifier.timeout) return &MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -235,39 +259,51 @@ func (c *MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification) Get } func (c *MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _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([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.PullRequest) + if len(_params) > 1 { + _param1 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.PullRequest) + } } - _param2 = make([]models.CommitStatus, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.CommitStatus) + if len(_params) > 2 { + _param2 = make([]models.CommitStatus, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.CommitStatus) + } } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } - _param4 = make([]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(string) + if len(_params) > 4 { + _param4 = make([]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(string) + } } - _param5 = make([]string, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[u] = param.(string) + if len(_params) > 5 { + _param5 = make([]string, len(c.methodInvocations)) + for u, param := range _params[5] { + _param5[u] = param.(string) + } } } return } func (verifier *VerifierMockCommitStatusUpdater) UpdatePreWorkflowHook(logger logging.SimpleLogging, pull models.PullRequest, status models.CommitStatus, hookDescription string, runtimeDescription string, url string) *MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification { - params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdatePreWorkflowHook", params, verifier.timeout) + _params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdatePreWorkflowHook", _params, verifier.timeout) return &MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -282,31 +318,43 @@ func (c *MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification) GetC } func (c *MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _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([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.PullRequest) + if len(_params) > 1 { + _param1 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.PullRequest) + } } - _param2 = make([]models.CommitStatus, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.CommitStatus) + if len(_params) > 2 { + _param2 = make([]models.CommitStatus, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.CommitStatus) + } } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } - _param4 = make([]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(string) + if len(_params) > 4 { + _param4 = make([]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(string) + } } - _param5 = make([]string, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[u] = param.(string) + if len(_params) > 5 { + _param5 = make([]string, len(c.methodInvocations)) + for u, param := range _params[5] { + _param5[u] = param.(string) + } } } return diff --git a/server/events/mocks/mock_custom_step_runner.go b/server/events/mocks/mock_custom_step_runner.go index 7662d22ba0..cab3dab109 100644 --- a/server/events/mocks/mock_custom_step_runner.go +++ b/server/events/mocks/mock_custom_step_runner.go @@ -30,19 +30,19 @@ func (mock *MockCustomStepRunner) Run(ctx command.ProjectContext, shell *valid.C if mock == nil { panic("mock must not be nil. Use myMock := NewMockCustomStepRunner().") } - params := []pegomock.Param{ctx, cmd, path, envs, streamOutput, postProcessOutput} - result := pegomock.GetGenericMockFrom(mock).Invoke("Run", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{ctx, shell, cmd, path, envs, streamOutput, postProcessOutput} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Run", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockCustomStepRunner) VerifyWasCalledOnce() *VerifierMockCustomStepRunner { @@ -83,8 +83,8 @@ type VerifierMockCustomStepRunner struct { } func (verifier *VerifierMockCustomStepRunner) Run(ctx command.ProjectContext, shell *valid.CommandShell, cmd string, path string, envs map[string]string, streamOutput bool, postProcessOutput valid.PostProcessRunOutputOption) *MockCustomStepRunner_Run_OngoingVerification { - params := []pegomock.Param{ctx, cmd, path, envs, streamOutput, postProcessOutput} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", params, verifier.timeout) + _params := []pegomock.Param{ctx, shell, cmd, path, envs, streamOutput, postProcessOutput} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", _params, verifier.timeout) return &MockCustomStepRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -93,37 +93,55 @@ type MockCustomStepRunner_Run_OngoingVerification struct { methodInvocations []pegomock.MethodInvocation } -func (c *MockCustomStepRunner_Run_OngoingVerification) GetCapturedArguments() (command.ProjectContext, string, string, map[string]string, bool, valid.PostProcessRunOutputOption) { - ctx, cmd, path, envs, streamOutput, postProcessOutput := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], cmd[len(cmd)-1], path[len(path)-1], envs[len(envs)-1], streamOutput[len(streamOutput)-1], postProcessOutput[len(postProcessOutput)-1] +func (c *MockCustomStepRunner_Run_OngoingVerification) GetCapturedArguments() (command.ProjectContext, *valid.CommandShell, string, string, map[string]string, bool, valid.PostProcessRunOutputOption) { + ctx, shell, cmd, path, envs, streamOutput, postProcessOutput := c.GetAllCapturedArguments() + return ctx[len(ctx)-1], shell[len(shell)-1], cmd[len(cmd)-1], path[len(path)-1], envs[len(envs)-1], streamOutput[len(streamOutput)-1], postProcessOutput[len(postProcessOutput)-1] } -func (c *MockCustomStepRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []string, _param2 []string, _param3 []map[string]string, _param4 []bool, _param5 []valid.PostProcessRunOutputOption) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) +func (c *MockCustomStepRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []*valid.CommandShell, _param2 []string, _param3 []string, _param4 []map[string]string, _param5 []bool, _param6 []valid.PostProcessRunOutputOption) { + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]*valid.CommandShell, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*valid.CommandShell) + } } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } - _param3 = make([]map[string]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(map[string]string) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } - _param4 = make([]bool, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(bool) + if len(_params) > 4 { + _param4 = make([]map[string]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(map[string]string) + } } - _param5 = make([]valid.PostProcessRunOutputOption, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[u] = param.(valid.PostProcessRunOutputOption) + if len(_params) > 5 { + _param5 = make([]bool, len(c.methodInvocations)) + for u, param := range _params[5] { + _param5[u] = param.(bool) + } + } + if len(_params) > 6 { + _param6 = make([]valid.PostProcessRunOutputOption, len(c.methodInvocations)) + for u, param := range _params[6] { + _param6[u] = param.(valid.PostProcessRunOutputOption) + } } } return diff --git a/server/events/mocks/mock_delete_lock_command.go b/server/events/mocks/mock_delete_lock_command.go index a8511f28c8..b9e409f594 100644 --- a/server/events/mocks/mock_delete_lock_command.go +++ b/server/events/mocks/mock_delete_lock_command.go @@ -30,38 +30,38 @@ func (mock *MockDeleteLockCommand) DeleteLock(logger logging.SimpleLogging, id s if mock == nil { panic("mock must not be nil. Use myMock := NewMockDeleteLockCommand().") } - params := []pegomock.Param{logger, id} - result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteLock", params, []reflect.Type{reflect.TypeOf((**models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *models.ProjectLock - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*models.ProjectLock) + _params := []pegomock.Param{logger, id} + _result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteLock", _params, []reflect.Type{reflect.TypeOf((**models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *models.ProjectLock + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*models.ProjectLock) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockDeleteLockCommand) DeleteLocksByPull(logger logging.SimpleLogging, repoFullName string, pullNum int) (int, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockDeleteLockCommand().") } - params := []pegomock.Param{logger, repoFullName, pullNum} - result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteLocksByPull", params, []reflect.Type{reflect.TypeOf((*int)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 int - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(int) + _params := []pegomock.Param{logger, repoFullName, pullNum} + _result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteLocksByPull", _params, []reflect.Type{reflect.TypeOf((*int)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 int + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(int) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockDeleteLockCommand) VerifyWasCalledOnce() *VerifierMockDeleteLockCommand { @@ -102,8 +102,8 @@ type VerifierMockDeleteLockCommand struct { } func (verifier *VerifierMockDeleteLockCommand) DeleteLock(logger logging.SimpleLogging, id string) *MockDeleteLockCommand_DeleteLock_OngoingVerification { - params := []pegomock.Param{logger, id} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteLock", params, verifier.timeout) + _params := []pegomock.Param{logger, id} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteLock", _params, verifier.timeout) return &MockDeleteLockCommand_DeleteLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -118,23 +118,27 @@ func (c *MockDeleteLockCommand_DeleteLock_OngoingVerification) GetCapturedArgume } func (c *MockDeleteLockCommand_DeleteLock_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } } return } func (verifier *VerifierMockDeleteLockCommand) DeleteLocksByPull(logger logging.SimpleLogging, repoFullName string, pullNum int) *MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification { - params := []pegomock.Param{logger, repoFullName, pullNum} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteLocksByPull", params, verifier.timeout) + _params := []pegomock.Param{logger, repoFullName, pullNum} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteLocksByPull", _params, verifier.timeout) return &MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -149,19 +153,25 @@ func (c *MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification) GetCapture } func (c *MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []string, _param2 []int) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } - _param2 = make([]int, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(int) + if len(_params) > 2 { + _param2 = make([]int, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(int) + } } } return diff --git a/server/events/mocks/mock_env_step_runner.go b/server/events/mocks/mock_env_step_runner.go index 0d99311987..ffa62d3a1c 100644 --- a/server/events/mocks/mock_env_step_runner.go +++ b/server/events/mocks/mock_env_step_runner.go @@ -4,12 +4,11 @@ package mocks import ( - "reflect" - "time" - pegomock "github.com/petergtz/pegomock/v4" - "github.com/runatlantis/atlantis/server/core/config/valid" + valid "github.com/runatlantis/atlantis/server/core/config/valid" command "github.com/runatlantis/atlantis/server/events/command" + "reflect" + "time" ) type MockEnvStepRunner struct { @@ -31,19 +30,19 @@ func (mock *MockEnvStepRunner) Run(ctx command.ProjectContext, shell *valid.Comm if mock == nil { panic("mock must not be nil. Use myMock := NewMockEnvStepRunner().") } - params := []pegomock.Param{ctx, cmd, value, path, envs} - result := pegomock.GetGenericMockFrom(mock).Invoke("Run", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{ctx, shell, cmd, value, path, envs} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Run", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockEnvStepRunner) VerifyWasCalledOnce() *VerifierMockEnvStepRunner { @@ -84,8 +83,8 @@ type VerifierMockEnvStepRunner struct { } func (verifier *VerifierMockEnvStepRunner) Run(ctx command.ProjectContext, shell *valid.CommandShell, cmd string, value string, path string, envs map[string]string) *MockEnvStepRunner_Run_OngoingVerification { - params := []pegomock.Param{ctx, cmd, value, path, envs} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", params, verifier.timeout) + _params := []pegomock.Param{ctx, shell, cmd, value, path, envs} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", _params, verifier.timeout) return &MockEnvStepRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -94,33 +93,49 @@ type MockEnvStepRunner_Run_OngoingVerification struct { methodInvocations []pegomock.MethodInvocation } -func (c *MockEnvStepRunner_Run_OngoingVerification) GetCapturedArguments() (command.ProjectContext, string, string, string, map[string]string) { - ctx, cmd, value, path, envs := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], cmd[len(cmd)-1], value[len(value)-1], path[len(path)-1], envs[len(envs)-1] +func (c *MockEnvStepRunner_Run_OngoingVerification) GetCapturedArguments() (command.ProjectContext, *valid.CommandShell, string, string, string, map[string]string) { + ctx, shell, cmd, value, path, envs := c.GetAllCapturedArguments() + return ctx[len(ctx)-1], shell[len(shell)-1], cmd[len(cmd)-1], value[len(value)-1], path[len(path)-1], envs[len(envs)-1] } -func (c *MockEnvStepRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []string, _param2 []string, _param3 []string, _param4 []map[string]string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) +func (c *MockEnvStepRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []*valid.CommandShell, _param2 []string, _param3 []string, _param4 []string, _param5 []map[string]string) { + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } + } + if len(_params) > 1 { + _param1 = make([]*valid.CommandShell, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*valid.CommandShell) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + if len(_params) > 4 { + _param4 = make([]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(string) + } } - _param4 = make([]map[string]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(map[string]string) + if len(_params) > 5 { + _param5 = make([]map[string]string, len(c.methodInvocations)) + for u, param := range _params[5] { + _param5[u] = param.(map[string]string) + } } } return diff --git a/server/events/mocks/mock_event_parsing.go b/server/events/mocks/mock_event_parsing.go index 036efc0e30..85403ea95c 100644 --- a/server/events/mocks/mock_event_parsing.go +++ b/server/events/mocks/mock_event_parsing.go @@ -35,555 +35,555 @@ func (mock *MockEventParsing) GetBitbucketCloudPullEventType(eventTypeHeader str if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{eventTypeHeader, sha, pr} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetBitbucketCloudPullEventType", params, []reflect.Type{reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem()}) - var ret0 models.PullRequestEventType - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequestEventType) + _params := []pegomock.Param{eventTypeHeader, sha, pr} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetBitbucketCloudPullEventType", _params, []reflect.Type{reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem()}) + var _ret0 models.PullRequestEventType + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequestEventType) } } - return ret0 + return _ret0 } func (mock *MockEventParsing) GetBitbucketServerPullEventType(eventTypeHeader string) models.PullRequestEventType { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{eventTypeHeader} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetBitbucketServerPullEventType", params, []reflect.Type{reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem()}) - var ret0 models.PullRequestEventType - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequestEventType) + _params := []pegomock.Param{eventTypeHeader} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetBitbucketServerPullEventType", _params, []reflect.Type{reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem()}) + var _ret0 models.PullRequestEventType + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequestEventType) } } - return ret0 + return _ret0 } func (mock *MockEventParsing) ParseAPIPlanRequest(vcsHostType models.VCSHostType, path string, cloneURL string) (models.Repo, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{vcsHostType, path, cloneURL} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseAPIPlanRequest", params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.Repo - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.Repo) + _params := []pegomock.Param{vcsHostType, path, cloneURL} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseAPIPlanRequest", _params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.Repo + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.Repo) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockEventParsing) ParseAzureDevopsPull(adPull *azuredevops.GitPullRequest) (models.PullRequest, models.Repo, models.Repo, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{adPull} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseAzureDevopsPull", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullRequest - var ret1 models.Repo - var ret2 models.Repo - var ret3 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{adPull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseAzureDevopsPull", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullRequest + var _ret1 models.Repo + var _ret2 models.Repo + var _ret3 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } - if result[1] != nil { - ret1 = result[1].(models.Repo) + if _result[1] != nil { + _ret1 = _result[1].(models.Repo) } - if result[2] != nil { - ret2 = result[2].(models.Repo) + if _result[2] != nil { + _ret2 = _result[2].(models.Repo) } - if result[3] != nil { - ret3 = result[3].(error) + if _result[3] != nil { + _ret3 = _result[3].(error) } } - return ret0, ret1, ret2, ret3 + return _ret0, _ret1, _ret2, _ret3 } func (mock *MockEventParsing) ParseAzureDevopsPullEvent(pullEvent azuredevops.Event) (models.PullRequest, models.PullRequestEventType, models.Repo, models.Repo, models.User, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{pullEvent} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseAzureDevopsPullEvent", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullRequest - var ret1 models.PullRequestEventType - var ret2 models.Repo - var ret3 models.Repo - var ret4 models.User - var ret5 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{pullEvent} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseAzureDevopsPullEvent", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullRequest + var _ret1 models.PullRequestEventType + var _ret2 models.Repo + var _ret3 models.Repo + var _ret4 models.User + var _ret5 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } - if result[1] != nil { - ret1 = result[1].(models.PullRequestEventType) + if _result[1] != nil { + _ret1 = _result[1].(models.PullRequestEventType) } - if result[2] != nil { - ret2 = result[2].(models.Repo) + if _result[2] != nil { + _ret2 = _result[2].(models.Repo) } - if result[3] != nil { - ret3 = result[3].(models.Repo) + if _result[3] != nil { + _ret3 = _result[3].(models.Repo) } - if result[4] != nil { - ret4 = result[4].(models.User) + if _result[4] != nil { + _ret4 = _result[4].(models.User) } - if result[5] != nil { - ret5 = result[5].(error) + if _result[5] != nil { + _ret5 = _result[5].(error) } } - return ret0, ret1, ret2, ret3, ret4, ret5 + return _ret0, _ret1, _ret2, _ret3, _ret4, _ret5 } func (mock *MockEventParsing) ParseAzureDevopsRepo(adRepo *azuredevops.GitRepository) (models.Repo, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{adRepo} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseAzureDevopsRepo", params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.Repo - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.Repo) + _params := []pegomock.Param{adRepo} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseAzureDevopsRepo", _params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.Repo + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.Repo) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockEventParsing) ParseBitbucketCloudPullCommentEvent(body []byte) (models.PullRequest, models.Repo, models.Repo, models.User, string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{body} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseBitbucketCloudPullCommentEvent", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullRequest - var ret1 models.Repo - var ret2 models.Repo - var ret3 models.User - var ret4 string - var ret5 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{body} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseBitbucketCloudPullCommentEvent", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullRequest + var _ret1 models.Repo + var _ret2 models.Repo + var _ret3 models.User + var _ret4 string + var _ret5 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } - if result[1] != nil { - ret1 = result[1].(models.Repo) + if _result[1] != nil { + _ret1 = _result[1].(models.Repo) } - if result[2] != nil { - ret2 = result[2].(models.Repo) + if _result[2] != nil { + _ret2 = _result[2].(models.Repo) } - if result[3] != nil { - ret3 = result[3].(models.User) + if _result[3] != nil { + _ret3 = _result[3].(models.User) } - if result[4] != nil { - ret4 = result[4].(string) + if _result[4] != nil { + _ret4 = _result[4].(string) } - if result[5] != nil { - ret5 = result[5].(error) + if _result[5] != nil { + _ret5 = _result[5].(error) } } - return ret0, ret1, ret2, ret3, ret4, ret5 + return _ret0, _ret1, _ret2, _ret3, _ret4, _ret5 } func (mock *MockEventParsing) ParseBitbucketCloudPullEvent(body []byte) (models.PullRequest, models.Repo, models.Repo, models.User, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{body} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseBitbucketCloudPullEvent", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullRequest - var ret1 models.Repo - var ret2 models.Repo - var ret3 models.User - var ret4 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{body} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseBitbucketCloudPullEvent", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullRequest + var _ret1 models.Repo + var _ret2 models.Repo + var _ret3 models.User + var _ret4 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } - if result[1] != nil { - ret1 = result[1].(models.Repo) + if _result[1] != nil { + _ret1 = _result[1].(models.Repo) } - if result[2] != nil { - ret2 = result[2].(models.Repo) + if _result[2] != nil { + _ret2 = _result[2].(models.Repo) } - if result[3] != nil { - ret3 = result[3].(models.User) + if _result[3] != nil { + _ret3 = _result[3].(models.User) } - if result[4] != nil { - ret4 = result[4].(error) + if _result[4] != nil { + _ret4 = _result[4].(error) } } - return ret0, ret1, ret2, ret3, ret4 + return _ret0, _ret1, _ret2, _ret3, _ret4 } func (mock *MockEventParsing) ParseBitbucketServerPullCommentEvent(body []byte) (models.PullRequest, models.Repo, models.Repo, models.User, string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{body} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseBitbucketServerPullCommentEvent", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullRequest - var ret1 models.Repo - var ret2 models.Repo - var ret3 models.User - var ret4 string - var ret5 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{body} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseBitbucketServerPullCommentEvent", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullRequest + var _ret1 models.Repo + var _ret2 models.Repo + var _ret3 models.User + var _ret4 string + var _ret5 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } - if result[1] != nil { - ret1 = result[1].(models.Repo) + if _result[1] != nil { + _ret1 = _result[1].(models.Repo) } - if result[2] != nil { - ret2 = result[2].(models.Repo) + if _result[2] != nil { + _ret2 = _result[2].(models.Repo) } - if result[3] != nil { - ret3 = result[3].(models.User) + if _result[3] != nil { + _ret3 = _result[3].(models.User) } - if result[4] != nil { - ret4 = result[4].(string) + if _result[4] != nil { + _ret4 = _result[4].(string) } - if result[5] != nil { - ret5 = result[5].(error) + if _result[5] != nil { + _ret5 = _result[5].(error) } } - return ret0, ret1, ret2, ret3, ret4, ret5 + return _ret0, _ret1, _ret2, _ret3, _ret4, _ret5 } func (mock *MockEventParsing) ParseBitbucketServerPullEvent(body []byte) (models.PullRequest, models.Repo, models.Repo, models.User, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{body} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseBitbucketServerPullEvent", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullRequest - var ret1 models.Repo - var ret2 models.Repo - var ret3 models.User - var ret4 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{body} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseBitbucketServerPullEvent", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullRequest + var _ret1 models.Repo + var _ret2 models.Repo + var _ret3 models.User + var _ret4 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } - if result[1] != nil { - ret1 = result[1].(models.Repo) + if _result[1] != nil { + _ret1 = _result[1].(models.Repo) } - if result[2] != nil { - ret2 = result[2].(models.Repo) + if _result[2] != nil { + _ret2 = _result[2].(models.Repo) } - if result[3] != nil { - ret3 = result[3].(models.User) + if _result[3] != nil { + _ret3 = _result[3].(models.User) } - if result[4] != nil { - ret4 = result[4].(error) + if _result[4] != nil { + _ret4 = _result[4].(error) } } - return ret0, ret1, ret2, ret3, ret4 + return _ret0, _ret1, _ret2, _ret3, _ret4 } func (mock *MockEventParsing) ParseGiteaIssueCommentEvent(event gitea0.GiteaIssueCommentPayload) (models.Repo, models.User, int, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{event} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGiteaIssueCommentEvent", params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*int)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.Repo - var ret1 models.User - var ret2 int - var ret3 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.Repo) + _params := []pegomock.Param{event} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGiteaIssueCommentEvent", _params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*int)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.Repo + var _ret1 models.User + var _ret2 int + var _ret3 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.Repo) } - if result[1] != nil { - ret1 = result[1].(models.User) + if _result[1] != nil { + _ret1 = _result[1].(models.User) } - if result[2] != nil { - ret2 = result[2].(int) + if _result[2] != nil { + _ret2 = _result[2].(int) } - if result[3] != nil { - ret3 = result[3].(error) + if _result[3] != nil { + _ret3 = _result[3].(error) } } - return ret0, ret1, ret2, ret3 + return _ret0, _ret1, _ret2, _ret3 } func (mock *MockEventParsing) ParseGiteaPull(pull *gitea.PullRequest) (models.PullRequest, models.Repo, models.Repo, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{pull} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGiteaPull", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullRequest - var ret1 models.Repo - var ret2 models.Repo - var ret3 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{pull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGiteaPull", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullRequest + var _ret1 models.Repo + var _ret2 models.Repo + var _ret3 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } - if result[1] != nil { - ret1 = result[1].(models.Repo) + if _result[1] != nil { + _ret1 = _result[1].(models.Repo) } - if result[2] != nil { - ret2 = result[2].(models.Repo) + if _result[2] != nil { + _ret2 = _result[2].(models.Repo) } - if result[3] != nil { - ret3 = result[3].(error) + if _result[3] != nil { + _ret3 = _result[3].(error) } } - return ret0, ret1, ret2, ret3 + return _ret0, _ret1, _ret2, _ret3 } func (mock *MockEventParsing) ParseGiteaPullRequestEvent(event gitea.PullRequest) (models.PullRequest, models.PullRequestEventType, models.Repo, models.Repo, models.User, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{event} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGiteaPullRequestEvent", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullRequest - var ret1 models.PullRequestEventType - var ret2 models.Repo - var ret3 models.Repo - var ret4 models.User - var ret5 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{event} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGiteaPullRequestEvent", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullRequest + var _ret1 models.PullRequestEventType + var _ret2 models.Repo + var _ret3 models.Repo + var _ret4 models.User + var _ret5 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } - if result[1] != nil { - ret1 = result[1].(models.PullRequestEventType) + if _result[1] != nil { + _ret1 = _result[1].(models.PullRequestEventType) } - if result[2] != nil { - ret2 = result[2].(models.Repo) + if _result[2] != nil { + _ret2 = _result[2].(models.Repo) } - if result[3] != nil { - ret3 = result[3].(models.Repo) + if _result[3] != nil { + _ret3 = _result[3].(models.Repo) } - if result[4] != nil { - ret4 = result[4].(models.User) + if _result[4] != nil { + _ret4 = _result[4].(models.User) } - if result[5] != nil { - ret5 = result[5].(error) + if _result[5] != nil { + _ret5 = _result[5].(error) } } - return ret0, ret1, ret2, ret3, ret4, ret5 + return _ret0, _ret1, _ret2, _ret3, _ret4, _ret5 } func (mock *MockEventParsing) ParseGithubIssueCommentEvent(logger logging.SimpleLogging, comment *github.IssueCommentEvent) (models.Repo, models.User, int, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{logger, comment} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGithubIssueCommentEvent", params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*int)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.Repo - var ret1 models.User - var ret2 int - var ret3 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.Repo) + _params := []pegomock.Param{logger, comment} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGithubIssueCommentEvent", _params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*int)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.Repo + var _ret1 models.User + var _ret2 int + var _ret3 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.Repo) } - if result[1] != nil { - ret1 = result[1].(models.User) + if _result[1] != nil { + _ret1 = _result[1].(models.User) } - if result[2] != nil { - ret2 = result[2].(int) + if _result[2] != nil { + _ret2 = _result[2].(int) } - if result[3] != nil { - ret3 = result[3].(error) + if _result[3] != nil { + _ret3 = _result[3].(error) } } - return ret0, ret1, ret2, ret3 + return _ret0, _ret1, _ret2, _ret3 } func (mock *MockEventParsing) ParseGithubPull(logger logging.SimpleLogging, ghPull *github.PullRequest) (models.PullRequest, models.Repo, models.Repo, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{logger, ghPull} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGithubPull", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullRequest - var ret1 models.Repo - var ret2 models.Repo - var ret3 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{logger, ghPull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGithubPull", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullRequest + var _ret1 models.Repo + var _ret2 models.Repo + var _ret3 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } - if result[1] != nil { - ret1 = result[1].(models.Repo) + if _result[1] != nil { + _ret1 = _result[1].(models.Repo) } - if result[2] != nil { - ret2 = result[2].(models.Repo) + if _result[2] != nil { + _ret2 = _result[2].(models.Repo) } - if result[3] != nil { - ret3 = result[3].(error) + if _result[3] != nil { + _ret3 = _result[3].(error) } } - return ret0, ret1, ret2, ret3 + return _ret0, _ret1, _ret2, _ret3 } func (mock *MockEventParsing) ParseGithubPullEvent(logger logging.SimpleLogging, pullEvent *github.PullRequestEvent) (models.PullRequest, models.PullRequestEventType, models.Repo, models.Repo, models.User, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{logger, pullEvent} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGithubPullEvent", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullRequest - var ret1 models.PullRequestEventType - var ret2 models.Repo - var ret3 models.Repo - var ret4 models.User - var ret5 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{logger, pullEvent} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGithubPullEvent", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullRequest + var _ret1 models.PullRequestEventType + var _ret2 models.Repo + var _ret3 models.Repo + var _ret4 models.User + var _ret5 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } - if result[1] != nil { - ret1 = result[1].(models.PullRequestEventType) + if _result[1] != nil { + _ret1 = _result[1].(models.PullRequestEventType) } - if result[2] != nil { - ret2 = result[2].(models.Repo) + if _result[2] != nil { + _ret2 = _result[2].(models.Repo) } - if result[3] != nil { - ret3 = result[3].(models.Repo) + if _result[3] != nil { + _ret3 = _result[3].(models.Repo) } - if result[4] != nil { - ret4 = result[4].(models.User) + if _result[4] != nil { + _ret4 = _result[4].(models.User) } - if result[5] != nil { - ret5 = result[5].(error) + if _result[5] != nil { + _ret5 = _result[5].(error) } } - return ret0, ret1, ret2, ret3, ret4, ret5 + return _ret0, _ret1, _ret2, _ret3, _ret4, _ret5 } func (mock *MockEventParsing) ParseGithubRepo(ghRepo *github.Repository) (models.Repo, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{ghRepo} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGithubRepo", params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.Repo - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.Repo) + _params := []pegomock.Param{ghRepo} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGithubRepo", _params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.Repo + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.Repo) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockEventParsing) ParseGitlabMergeRequest(mr *go_gitlab.MergeRequest, baseRepo models.Repo) models.PullRequest { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{mr, baseRepo} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGitlabMergeRequest", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem()}) - var ret0 models.PullRequest - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{mr, baseRepo} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGitlabMergeRequest", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem()}) + var _ret0 models.PullRequest + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } } - return ret0 + return _ret0 } func (mock *MockEventParsing) ParseGitlabMergeRequestCommentEvent(event go_gitlab.MergeCommentEvent) (models.Repo, models.Repo, int, models.User, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{event} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGitlabMergeRequestCommentEvent", params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*int)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.Repo - var ret1 models.Repo - var ret2 int - var ret3 models.User - var ret4 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.Repo) + _params := []pegomock.Param{event} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGitlabMergeRequestCommentEvent", _params, []reflect.Type{reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*int)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.Repo + var _ret1 models.Repo + var _ret2 int + var _ret3 models.User + var _ret4 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.Repo) } - if result[1] != nil { - ret1 = result[1].(models.Repo) + if _result[1] != nil { + _ret1 = _result[1].(models.Repo) } - if result[2] != nil { - ret2 = result[2].(int) + if _result[2] != nil { + _ret2 = _result[2].(int) } - if result[3] != nil { - ret3 = result[3].(models.User) + if _result[3] != nil { + _ret3 = _result[3].(models.User) } - if result[4] != nil { - ret4 = result[4].(error) + if _result[4] != nil { + _ret4 = _result[4].(error) } } - return ret0, ret1, ret2, ret3, ret4 + return _ret0, _ret1, _ret2, _ret3, _ret4 } func (mock *MockEventParsing) ParseGitlabMergeRequestEvent(event go_gitlab.MergeEvent) (models.PullRequest, models.PullRequestEventType, models.Repo, models.Repo, models.User, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{event} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGitlabMergeRequestEvent", params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullRequest - var ret1 models.PullRequestEventType - var ret2 models.Repo - var ret3 models.Repo - var ret4 models.User - var ret5 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequest) + _params := []pegomock.Param{event} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGitlabMergeRequestEvent", _params, []reflect.Type{reflect.TypeOf((*models.PullRequest)(nil)).Elem(), reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.Repo)(nil)).Elem(), reflect.TypeOf((*models.User)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullRequest + var _ret1 models.PullRequestEventType + var _ret2 models.Repo + var _ret3 models.Repo + var _ret4 models.User + var _ret5 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequest) } - if result[1] != nil { - ret1 = result[1].(models.PullRequestEventType) + if _result[1] != nil { + _ret1 = _result[1].(models.PullRequestEventType) } - if result[2] != nil { - ret2 = result[2].(models.Repo) + if _result[2] != nil { + _ret2 = _result[2].(models.Repo) } - if result[3] != nil { - ret3 = result[3].(models.Repo) + if _result[3] != nil { + _ret3 = _result[3].(models.Repo) } - if result[4] != nil { - ret4 = result[4].(models.User) + if _result[4] != nil { + _ret4 = _result[4].(models.User) } - if result[5] != nil { - ret5 = result[5].(error) + if _result[5] != nil { + _ret5 = _result[5].(error) } } - return ret0, ret1, ret2, ret3, ret4, ret5 + return _ret0, _ret1, _ret2, _ret3, _ret4, _ret5 } func (mock *MockEventParsing) ParseGitlabMergeRequestUpdateEvent(event go_gitlab.MergeEvent) models.PullRequestEventType { if mock == nil { panic("mock must not be nil. Use myMock := NewMockEventParsing().") } - params := []pegomock.Param{event} - result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGitlabMergeRequestUpdateEvent", params, []reflect.Type{reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem()}) - var ret0 models.PullRequestEventType - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullRequestEventType) + _params := []pegomock.Param{event} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ParseGitlabMergeRequestUpdateEvent", _params, []reflect.Type{reflect.TypeOf((*models.PullRequestEventType)(nil)).Elem()}) + var _ret0 models.PullRequestEventType + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullRequestEventType) } } - return ret0 + return _ret0 } func (mock *MockEventParsing) VerifyWasCalledOnce() *VerifierMockEventParsing { @@ -624,8 +624,8 @@ type VerifierMockEventParsing struct { } func (verifier *VerifierMockEventParsing) GetBitbucketCloudPullEventType(eventTypeHeader string, sha string, pr string) *MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification { - params := []pegomock.Param{eventTypeHeader, sha, pr} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetBitbucketCloudPullEventType", params, verifier.timeout) + _params := []pegomock.Param{eventTypeHeader, sha, pr} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetBitbucketCloudPullEventType", _params, verifier.timeout) return &MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -640,27 +640,33 @@ func (c *MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification) Ge } func (c *MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) - } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) - } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } + } + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } + } + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } } return } 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) + _params := []pegomock.Param{eventTypeHeader} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetBitbucketServerPullEventType", _params, verifier.timeout) return &MockEventParsing_GetBitbucketServerPullEventType_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -675,19 +681,21 @@ func (c *MockEventParsing_GetBitbucketServerPullEventType_OngoingVerification) G } func (c *MockEventParsing_GetBitbucketServerPullEventType_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } } return } func (verifier *VerifierMockEventParsing) ParseAPIPlanRequest(vcsHostType models.VCSHostType, path string, cloneURL string) *MockEventParsing_ParseAPIPlanRequest_OngoingVerification { - params := []pegomock.Param{vcsHostType, path, cloneURL} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseAPIPlanRequest", params, verifier.timeout) + _params := []pegomock.Param{vcsHostType, path, cloneURL} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseAPIPlanRequest", _params, verifier.timeout) return &MockEventParsing_ParseAPIPlanRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -702,27 +710,33 @@ func (c *MockEventParsing_ParseAPIPlanRequest_OngoingVerification) GetCapturedAr } func (c *MockEventParsing_ParseAPIPlanRequest_OngoingVerification) GetAllCapturedArguments() (_param0 []models.VCSHostType, _param1 []string, _param2 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]models.VCSHostType, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.VCSHostType) - } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) - } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.VCSHostType, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.VCSHostType) + } + } + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } + } + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } } return } func (verifier *VerifierMockEventParsing) ParseAzureDevopsPull(adPull *azuredevops.GitPullRequest) *MockEventParsing_ParseAzureDevopsPull_OngoingVerification { - params := []pegomock.Param{adPull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseAzureDevopsPull", params, verifier.timeout) + _params := []pegomock.Param{adPull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseAzureDevopsPull", _params, verifier.timeout) return &MockEventParsing_ParseAzureDevopsPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -737,19 +751,21 @@ func (c *MockEventParsing_ParseAzureDevopsPull_OngoingVerification) GetCapturedA } func (c *MockEventParsing_ParseAzureDevopsPull_OngoingVerification) GetAllCapturedArguments() (_param0 []*azuredevops.GitPullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*azuredevops.GitPullRequest, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*azuredevops.GitPullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*azuredevops.GitPullRequest, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*azuredevops.GitPullRequest) + } } } return } func (verifier *VerifierMockEventParsing) ParseAzureDevopsPullEvent(pullEvent azuredevops.Event) *MockEventParsing_ParseAzureDevopsPullEvent_OngoingVerification { - params := []pegomock.Param{pullEvent} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseAzureDevopsPullEvent", params, verifier.timeout) + _params := []pegomock.Param{pullEvent} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseAzureDevopsPullEvent", _params, verifier.timeout) return &MockEventParsing_ParseAzureDevopsPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -764,19 +780,21 @@ func (c *MockEventParsing_ParseAzureDevopsPullEvent_OngoingVerification) GetCapt } func (c *MockEventParsing_ParseAzureDevopsPullEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []azuredevops.Event) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]azuredevops.Event, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(azuredevops.Event) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]azuredevops.Event, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(azuredevops.Event) + } } } return } func (verifier *VerifierMockEventParsing) ParseAzureDevopsRepo(adRepo *azuredevops.GitRepository) *MockEventParsing_ParseAzureDevopsRepo_OngoingVerification { - params := []pegomock.Param{adRepo} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseAzureDevopsRepo", params, verifier.timeout) + _params := []pegomock.Param{adRepo} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseAzureDevopsRepo", _params, verifier.timeout) return &MockEventParsing_ParseAzureDevopsRepo_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -791,19 +809,21 @@ func (c *MockEventParsing_ParseAzureDevopsRepo_OngoingVerification) GetCapturedA } func (c *MockEventParsing_ParseAzureDevopsRepo_OngoingVerification) GetAllCapturedArguments() (_param0 []*azuredevops.GitRepository) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*azuredevops.GitRepository, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*azuredevops.GitRepository) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*azuredevops.GitRepository, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*azuredevops.GitRepository) + } } } return } 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) + _params := []pegomock.Param{body} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseBitbucketCloudPullCommentEvent", _params, verifier.timeout) return &MockEventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -818,19 +838,21 @@ func (c *MockEventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerificatio } func (c *MockEventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([][]byte, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.([]byte) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([][]byte, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.([]byte) + } } } return } 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) + _params := []pegomock.Param{body} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseBitbucketCloudPullEvent", _params, verifier.timeout) return &MockEventParsing_ParseBitbucketCloudPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -845,19 +867,21 @@ func (c *MockEventParsing_ParseBitbucketCloudPullEvent_OngoingVerification) GetC } func (c *MockEventParsing_ParseBitbucketCloudPullEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([][]byte, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.([]byte) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([][]byte, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.([]byte) + } } } return } 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) + _params := []pegomock.Param{body} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseBitbucketServerPullCommentEvent", _params, verifier.timeout) return &MockEventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -872,19 +896,21 @@ func (c *MockEventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerificati } func (c *MockEventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([][]byte, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.([]byte) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([][]byte, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.([]byte) + } } } return } 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) + _params := []pegomock.Param{body} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseBitbucketServerPullEvent", _params, verifier.timeout) return &MockEventParsing_ParseBitbucketServerPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -899,19 +925,21 @@ func (c *MockEventParsing_ParseBitbucketServerPullEvent_OngoingVerification) Get } func (c *MockEventParsing_ParseBitbucketServerPullEvent_OngoingVerification) GetAllCapturedArguments() (_param0 [][]byte) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([][]byte, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.([]byte) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([][]byte, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.([]byte) + } } } return } func (verifier *VerifierMockEventParsing) ParseGiteaIssueCommentEvent(event gitea0.GiteaIssueCommentPayload) *MockEventParsing_ParseGiteaIssueCommentEvent_OngoingVerification { - params := []pegomock.Param{event} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGiteaIssueCommentEvent", params, verifier.timeout) + _params := []pegomock.Param{event} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGiteaIssueCommentEvent", _params, verifier.timeout) return &MockEventParsing_ParseGiteaIssueCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -926,19 +954,21 @@ func (c *MockEventParsing_ParseGiteaIssueCommentEvent_OngoingVerification) GetCa } func (c *MockEventParsing_ParseGiteaIssueCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []gitea0.GiteaIssueCommentPayload) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]gitea0.GiteaIssueCommentPayload, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(gitea0.GiteaIssueCommentPayload) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]gitea0.GiteaIssueCommentPayload, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(gitea0.GiteaIssueCommentPayload) + } } } return } func (verifier *VerifierMockEventParsing) ParseGiteaPull(pull *gitea.PullRequest) *MockEventParsing_ParseGiteaPull_OngoingVerification { - params := []pegomock.Param{pull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGiteaPull", params, verifier.timeout) + _params := []pegomock.Param{pull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGiteaPull", _params, verifier.timeout) return &MockEventParsing_ParseGiteaPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -953,19 +983,21 @@ func (c *MockEventParsing_ParseGiteaPull_OngoingVerification) GetCapturedArgumen } func (c *MockEventParsing_ParseGiteaPull_OngoingVerification) GetAllCapturedArguments() (_param0 []*gitea.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*gitea.PullRequest, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*gitea.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*gitea.PullRequest, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*gitea.PullRequest) + } } } return } func (verifier *VerifierMockEventParsing) ParseGiteaPullRequestEvent(event gitea.PullRequest) *MockEventParsing_ParseGiteaPullRequestEvent_OngoingVerification { - params := []pegomock.Param{event} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGiteaPullRequestEvent", params, verifier.timeout) + _params := []pegomock.Param{event} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGiteaPullRequestEvent", _params, verifier.timeout) return &MockEventParsing_ParseGiteaPullRequestEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -980,19 +1012,21 @@ func (c *MockEventParsing_ParseGiteaPullRequestEvent_OngoingVerification) GetCap } func (c *MockEventParsing_ParseGiteaPullRequestEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []gitea.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]gitea.PullRequest, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(gitea.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]gitea.PullRequest, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(gitea.PullRequest) + } } } return } func (verifier *VerifierMockEventParsing) ParseGithubIssueCommentEvent(logger logging.SimpleLogging, comment *github.IssueCommentEvent) *MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification { - params := []pegomock.Param{logger, comment} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGithubIssueCommentEvent", params, verifier.timeout) + _params := []pegomock.Param{logger, comment} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGithubIssueCommentEvent", _params, verifier.timeout) return &MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -1007,23 +1041,27 @@ func (c *MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification) GetC } func (c *MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []*github.IssueCommentEvent) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]*github.IssueCommentEvent, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*github.IssueCommentEvent) + if len(_params) > 1 { + _param1 = make([]*github.IssueCommentEvent, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*github.IssueCommentEvent) + } } } return } func (verifier *VerifierMockEventParsing) ParseGithubPull(logger logging.SimpleLogging, ghPull *github.PullRequest) *MockEventParsing_ParseGithubPull_OngoingVerification { - params := []pegomock.Param{logger, ghPull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGithubPull", params, verifier.timeout) + _params := []pegomock.Param{logger, ghPull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGithubPull", _params, verifier.timeout) return &MockEventParsing_ParseGithubPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -1038,23 +1076,27 @@ func (c *MockEventParsing_ParseGithubPull_OngoingVerification) GetCapturedArgume } func (c *MockEventParsing_ParseGithubPull_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []*github.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]*github.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*github.PullRequest) + if len(_params) > 1 { + _param1 = make([]*github.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*github.PullRequest) + } } } return } func (verifier *VerifierMockEventParsing) ParseGithubPullEvent(logger logging.SimpleLogging, pullEvent *github.PullRequestEvent) *MockEventParsing_ParseGithubPullEvent_OngoingVerification { - params := []pegomock.Param{logger, pullEvent} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGithubPullEvent", params, verifier.timeout) + _params := []pegomock.Param{logger, pullEvent} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGithubPullEvent", _params, verifier.timeout) return &MockEventParsing_ParseGithubPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -1069,23 +1111,27 @@ func (c *MockEventParsing_ParseGithubPullEvent_OngoingVerification) GetCapturedA } func (c *MockEventParsing_ParseGithubPullEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []*github.PullRequestEvent) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]*github.PullRequestEvent, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*github.PullRequestEvent) + if len(_params) > 1 { + _param1 = make([]*github.PullRequestEvent, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*github.PullRequestEvent) + } } } return } 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) + _params := []pegomock.Param{ghRepo} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGithubRepo", _params, verifier.timeout) return &MockEventParsing_ParseGithubRepo_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -1100,19 +1146,21 @@ func (c *MockEventParsing_ParseGithubRepo_OngoingVerification) GetCapturedArgume } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*github.Repository) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*github.Repository, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*github.Repository) + } } } return } 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) + _params := []pegomock.Param{mr, baseRepo} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGitlabMergeRequest", _params, verifier.timeout) return &MockEventParsing_ParseGitlabMergeRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -1127,23 +1175,27 @@ func (c *MockEventParsing_ParseGitlabMergeRequest_OngoingVerification) GetCaptur } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*go_gitlab.MergeRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*go_gitlab.MergeRequest, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*go_gitlab.MergeRequest) + } } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } } } return } 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) + _params := []pegomock.Param{event} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGitlabMergeRequestCommentEvent", _params, verifier.timeout) return &MockEventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -1158,19 +1210,21 @@ func (c *MockEventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerificatio } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(go_gitlab.MergeCommentEvent) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]go_gitlab.MergeCommentEvent, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(go_gitlab.MergeCommentEvent) + } } } return } 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) + _params := []pegomock.Param{event} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGitlabMergeRequestEvent", _params, verifier.timeout) return &MockEventParsing_ParseGitlabMergeRequestEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -1185,19 +1239,21 @@ func (c *MockEventParsing_ParseGitlabMergeRequestEvent_OngoingVerification) GetC } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(go_gitlab.MergeEvent) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]go_gitlab.MergeEvent, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(go_gitlab.MergeEvent) + } } } return } func (verifier *VerifierMockEventParsing) ParseGitlabMergeRequestUpdateEvent(event go_gitlab.MergeEvent) *MockEventParsing_ParseGitlabMergeRequestUpdateEvent_OngoingVerification { - params := []pegomock.Param{event} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGitlabMergeRequestUpdateEvent", params, verifier.timeout) + _params := []pegomock.Param{event} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseGitlabMergeRequestUpdateEvent", _params, verifier.timeout) return &MockEventParsing_ParseGitlabMergeRequestUpdateEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -1212,11 +1268,13 @@ func (c *MockEventParsing_ParseGitlabMergeRequestUpdateEvent_OngoingVerification } func (c *MockEventParsing_ParseGitlabMergeRequestUpdateEvent_OngoingVerification) GetAllCapturedArguments() (_param0 []go_gitlab.MergeEvent) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]go_gitlab.MergeEvent, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(go_gitlab.MergeEvent) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]go_gitlab.MergeEvent, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(go_gitlab.MergeEvent) + } } } return diff --git a/server/events/mocks/mock_github_pull_getter.go b/server/events/mocks/mock_github_pull_getter.go index b1d76c1dd5..c904e371e4 100644 --- a/server/events/mocks/mock_github_pull_getter.go +++ b/server/events/mocks/mock_github_pull_getter.go @@ -31,19 +31,19 @@ func (mock *MockGithubPullGetter) GetPullRequest(logger logging.SimpleLogging, r if mock == nil { panic("mock must not be nil. Use myMock := NewMockGithubPullGetter().") } - params := []pegomock.Param{logger, repo, pullNum} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullRequest", params, []reflect.Type{reflect.TypeOf((**github.PullRequest)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *github.PullRequest - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*github.PullRequest) + _params := []pegomock.Param{logger, repo, pullNum} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullRequest", _params, []reflect.Type{reflect.TypeOf((**github.PullRequest)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *github.PullRequest + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*github.PullRequest) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockGithubPullGetter) VerifyWasCalledOnce() *VerifierMockGithubPullGetter { @@ -84,8 +84,8 @@ type VerifierMockGithubPullGetter struct { } func (verifier *VerifierMockGithubPullGetter) GetPullRequest(logger logging.SimpleLogging, repo models.Repo, pullNum int) *MockGithubPullGetter_GetPullRequest_OngoingVerification { - params := []pegomock.Param{logger, repo, pullNum} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullRequest", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pullNum} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullRequest", _params, verifier.timeout) return &MockGithubPullGetter_GetPullRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -100,19 +100,25 @@ func (c *MockGithubPullGetter_GetPullRequest_OngoingVerification) GetCapturedArg } func (c *MockGithubPullGetter_GetPullRequest_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []int) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } } - _param2 = make([]int, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(int) + if len(_params) > 2 { + _param2 = make([]int, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(int) + } } } return diff --git a/server/events/mocks/mock_gitlab_merge_request_getter.go b/server/events/mocks/mock_gitlab_merge_request_getter.go index cdb481741d..dfaa1396b9 100644 --- a/server/events/mocks/mock_gitlab_merge_request_getter.go +++ b/server/events/mocks/mock_gitlab_merge_request_getter.go @@ -30,19 +30,19 @@ func (mock *MockGitlabMergeRequestGetter) GetMergeRequest(logger logging.SimpleL if mock == nil { panic("mock must not be nil. Use myMock := NewMockGitlabMergeRequestGetter().") } - params := []pegomock.Param{logger, repoFullName, pullNum} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetMergeRequest", params, []reflect.Type{reflect.TypeOf((**go_gitlab.MergeRequest)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *go_gitlab.MergeRequest - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*go_gitlab.MergeRequest) + _params := []pegomock.Param{logger, repoFullName, pullNum} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetMergeRequest", _params, []reflect.Type{reflect.TypeOf((**go_gitlab.MergeRequest)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *go_gitlab.MergeRequest + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*go_gitlab.MergeRequest) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledOnce() *VerifierMockGitlabMergeRequestGetter { @@ -83,8 +83,8 @@ type VerifierMockGitlabMergeRequestGetter struct { } func (verifier *VerifierMockGitlabMergeRequestGetter) GetMergeRequest(logger logging.SimpleLogging, repoFullName string, pullNum int) *MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification { - params := []pegomock.Param{logger, repoFullName, pullNum} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetMergeRequest", params, verifier.timeout) + _params := []pegomock.Param{logger, repoFullName, pullNum} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetMergeRequest", _params, verifier.timeout) return &MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -99,19 +99,25 @@ func (c *MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification) GetCa } func (c *MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []string, _param2 []int) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } - _param2 = make([]int, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(int) + if len(_params) > 2 { + _param2 = make([]int, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(int) + } } } return diff --git a/server/events/mocks/mock_job_message_sender.go b/server/events/mocks/mock_job_message_sender.go index 380cd22674..76f7d59a75 100644 --- a/server/events/mocks/mock_job_message_sender.go +++ b/server/events/mocks/mock_job_message_sender.go @@ -29,8 +29,8 @@ func (mock *MockJobMessageSender) Send(ctx command.ProjectContext, msg string, o if mock == nil { panic("mock must not be nil. Use myMock := NewMockJobMessageSender().") } - params := []pegomock.Param{ctx, msg, operationComplete} - pegomock.GetGenericMockFrom(mock).Invoke("Send", params, []reflect.Type{}) + _params := []pegomock.Param{ctx, msg, operationComplete} + pegomock.GetGenericMockFrom(mock).Invoke("Send", _params, []reflect.Type{}) } func (mock *MockJobMessageSender) VerifyWasCalledOnce() *VerifierMockJobMessageSender { @@ -71,8 +71,8 @@ type VerifierMockJobMessageSender struct { } func (verifier *VerifierMockJobMessageSender) Send(ctx command.ProjectContext, msg string, operationComplete bool) *MockJobMessageSender_Send_OngoingVerification { - params := []pegomock.Param{ctx, msg, operationComplete} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Send", params, verifier.timeout) + _params := []pegomock.Param{ctx, msg, operationComplete} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Send", _params, verifier.timeout) return &MockJobMessageSender_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -87,19 +87,25 @@ func (c *MockJobMessageSender_Send_OngoingVerification) GetCapturedArguments() ( } func (c *MockJobMessageSender_Send_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []string, _param2 []bool) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } - _param2 = make([]bool, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(bool) + if len(_params) > 2 { + _param2 = make([]bool, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(bool) + } } } return diff --git a/server/events/mocks/mock_job_url_setter.go b/server/events/mocks/mock_job_url_setter.go index 427e081f27..6455c4a201 100644 --- a/server/events/mocks/mock_job_url_setter.go +++ b/server/events/mocks/mock_job_url_setter.go @@ -30,15 +30,15 @@ func (mock *MockJobURLSetter) SetJobURLWithStatus(ctx command.ProjectContext, cm if mock == nil { panic("mock must not be nil. Use myMock := NewMockJobURLSetter().") } - params := []pegomock.Param{ctx, cmdName, status, res} - result := pegomock.GetGenericMockFrom(mock).Invoke("SetJobURLWithStatus", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{ctx, cmdName, status, res} + _result := pegomock.GetGenericMockFrom(mock).Invoke("SetJobURLWithStatus", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockJobURLSetter) VerifyWasCalledOnce() *VerifierMockJobURLSetter { @@ -79,8 +79,8 @@ type VerifierMockJobURLSetter struct { } func (verifier *VerifierMockJobURLSetter) SetJobURLWithStatus(ctx command.ProjectContext, cmdName command.Name, status models.CommitStatus, res *command.ProjectResult) *MockJobURLSetter_SetJobURLWithStatus_OngoingVerification { - params := []pegomock.Param{ctx, cmdName, status, res} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SetJobURLWithStatus", params, verifier.timeout) + _params := []pegomock.Param{ctx, cmdName, status, res} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SetJobURLWithStatus", _params, verifier.timeout) return &MockJobURLSetter_SetJobURLWithStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -95,23 +95,31 @@ func (c *MockJobURLSetter_SetJobURLWithStatus_OngoingVerification) GetCapturedAr } func (c *MockJobURLSetter_SetJobURLWithStatus_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []command.Name, _param2 []models.CommitStatus, _param3 []*command.ProjectResult) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } - _param1 = make([]command.Name, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(command.Name) + if len(_params) > 1 { + _param1 = make([]command.Name, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(command.Name) + } } - _param2 = make([]models.CommitStatus, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.CommitStatus) + if len(_params) > 2 { + _param2 = make([]models.CommitStatus, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.CommitStatus) + } } - _param3 = make([]*command.ProjectResult, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(*command.ProjectResult) + if len(_params) > 3 { + _param3 = make([]*command.ProjectResult, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(*command.ProjectResult) + } } } return diff --git a/server/events/mocks/mock_lock_url_generator.go b/server/events/mocks/mock_lock_url_generator.go index bb3f40a49a..6e581d65ea 100644 --- a/server/events/mocks/mock_lock_url_generator.go +++ b/server/events/mocks/mock_lock_url_generator.go @@ -28,15 +28,15 @@ func (mock *MockLockURLGenerator) GenerateLockURL(lockID string) string { if mock == nil { panic("mock must not be nil. Use myMock := NewMockLockURLGenerator().") } - params := []pegomock.Param{lockID} - result := pegomock.GetGenericMockFrom(mock).Invoke("GenerateLockURL", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem()}) - var ret0 string - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{lockID} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GenerateLockURL", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem()}) + var _ret0 string + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } } - return ret0 + return _ret0 } func (mock *MockLockURLGenerator) VerifyWasCalledOnce() *VerifierMockLockURLGenerator { @@ -77,8 +77,8 @@ type VerifierMockLockURLGenerator struct { } 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) + _params := []pegomock.Param{lockID} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GenerateLockURL", _params, verifier.timeout) return &MockLockURLGenerator_GenerateLockURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -93,11 +93,13 @@ func (c *MockLockURLGenerator_GenerateLockURL_OngoingVerification) GetCapturedAr } func (c *MockLockURLGenerator_GenerateLockURL_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } } return diff --git a/server/events/mocks/mock_pending_plan_finder.go b/server/events/mocks/mock_pending_plan_finder.go index 51cc57f071..56fb6b8c6a 100644 --- a/server/events/mocks/mock_pending_plan_finder.go +++ b/server/events/mocks/mock_pending_plan_finder.go @@ -29,34 +29,34 @@ func (mock *MockPendingPlanFinder) DeletePlans(pullDir string) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockPendingPlanFinder().") } - params := []pegomock.Param{pullDir} - result := pegomock.GetGenericMockFrom(mock).Invoke("DeletePlans", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{pullDir} + _result := pegomock.GetGenericMockFrom(mock).Invoke("DeletePlans", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockPendingPlanFinder) Find(pullDir string) ([]events.PendingPlan, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockPendingPlanFinder().") } - params := []pegomock.Param{pullDir} - result := pegomock.GetGenericMockFrom(mock).Invoke("Find", params, []reflect.Type{reflect.TypeOf((*[]events.PendingPlan)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []events.PendingPlan - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]events.PendingPlan) + _params := []pegomock.Param{pullDir} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Find", _params, []reflect.Type{reflect.TypeOf((*[]events.PendingPlan)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []events.PendingPlan + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]events.PendingPlan) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockPendingPlanFinder) VerifyWasCalledOnce() *VerifierMockPendingPlanFinder { @@ -97,8 +97,8 @@ type VerifierMockPendingPlanFinder struct { } 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) + _params := []pegomock.Param{pullDir} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeletePlans", _params, verifier.timeout) return &MockPendingPlanFinder_DeletePlans_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -113,19 +113,21 @@ func (c *MockPendingPlanFinder_DeletePlans_OngoingVerification) GetCapturedArgum } func (c *MockPendingPlanFinder_DeletePlans_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } } return } 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) + _params := []pegomock.Param{pullDir} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Find", _params, verifier.timeout) return &MockPendingPlanFinder_Find_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -140,11 +142,13 @@ func (c *MockPendingPlanFinder_Find_OngoingVerification) GetCapturedArguments() } func (c *MockPendingPlanFinder_Find_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } } return diff --git a/server/events/mocks/mock_post_workflow_hook_url_generator.go b/server/events/mocks/mock_post_workflow_hook_url_generator.go index dce0a93560..71e577f464 100644 --- a/server/events/mocks/mock_post_workflow_hook_url_generator.go +++ b/server/events/mocks/mock_post_workflow_hook_url_generator.go @@ -28,19 +28,19 @@ func (mock *MockPostWorkflowHookURLGenerator) GenerateProjectWorkflowHookURL(hoo if mock == nil { panic("mock must not be nil. Use myMock := NewMockPostWorkflowHookURLGenerator().") } - params := []pegomock.Param{hookID} - result := pegomock.GetGenericMockFrom(mock).Invoke("GenerateProjectWorkflowHookURL", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{hookID} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GenerateProjectWorkflowHookURL", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockPostWorkflowHookURLGenerator) VerifyWasCalledOnce() *VerifierMockPostWorkflowHookURLGenerator { @@ -81,8 +81,8 @@ type VerifierMockPostWorkflowHookURLGenerator struct { } func (verifier *VerifierMockPostWorkflowHookURLGenerator) GenerateProjectWorkflowHookURL(hookID string) *MockPostWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification { - params := []pegomock.Param{hookID} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GenerateProjectWorkflowHookURL", params, verifier.timeout) + _params := []pegomock.Param{hookID} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GenerateProjectWorkflowHookURL", _params, verifier.timeout) return &MockPostWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -97,11 +97,13 @@ func (c *MockPostWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_Ongoing } func (c *MockPostWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } } return diff --git a/server/events/mocks/mock_post_workflows_hooks_command_runner.go b/server/events/mocks/mock_post_workflows_hooks_command_runner.go index 3163ccb52a..cec7aaec6d 100644 --- a/server/events/mocks/mock_post_workflows_hooks_command_runner.go +++ b/server/events/mocks/mock_post_workflows_hooks_command_runner.go @@ -32,15 +32,15 @@ func (mock *MockPostWorkflowHooksCommandRunner) RunPostHooks(ctx *command.Contex if mock == nil { panic("mock must not be nil. Use myMock := NewMockPostWorkflowHooksCommandRunner().") } - params := []pegomock.Param{ctx, cmd} - result := pegomock.GetGenericMockFrom(mock).Invoke("RunPostHooks", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{ctx, cmd} + _result := pegomock.GetGenericMockFrom(mock).Invoke("RunPostHooks", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockPostWorkflowHooksCommandRunner) VerifyWasCalledOnce() *VerifierMockPostWorkflowHooksCommandRunner { @@ -81,8 +81,8 @@ type VerifierMockPostWorkflowHooksCommandRunner struct { } func (verifier *VerifierMockPostWorkflowHooksCommandRunner) RunPostHooks(ctx *command.Context, cmd *events.CommentCommand) *MockPostWorkflowHooksCommandRunner_RunPostHooks_OngoingVerification { - params := []pegomock.Param{ctx, cmd} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunPostHooks", params, verifier.timeout) + _params := []pegomock.Param{ctx, cmd} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunPostHooks", _params, verifier.timeout) return &MockPostWorkflowHooksCommandRunner_RunPostHooks_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -97,15 +97,19 @@ func (c *MockPostWorkflowHooksCommandRunner_RunPostHooks_OngoingVerification) Ge } func (c *MockPostWorkflowHooksCommandRunner_RunPostHooks_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*command.Context, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*command.Context) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*command.Context, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*command.Context) + } } - _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*events.CommentCommand) + if len(_params) > 1 { + _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*events.CommentCommand) + } } } return diff --git a/server/events/mocks/mock_pre_workflow_hook_url_generator.go b/server/events/mocks/mock_pre_workflow_hook_url_generator.go index 389562b40a..e779202327 100644 --- a/server/events/mocks/mock_pre_workflow_hook_url_generator.go +++ b/server/events/mocks/mock_pre_workflow_hook_url_generator.go @@ -28,19 +28,19 @@ func (mock *MockPreWorkflowHookURLGenerator) GenerateProjectWorkflowHookURL(hook if mock == nil { panic("mock must not be nil. Use myMock := NewMockPreWorkflowHookURLGenerator().") } - params := []pegomock.Param{hookID} - result := pegomock.GetGenericMockFrom(mock).Invoke("GenerateProjectWorkflowHookURL", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{hookID} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GenerateProjectWorkflowHookURL", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockPreWorkflowHookURLGenerator) VerifyWasCalledOnce() *VerifierMockPreWorkflowHookURLGenerator { @@ -81,8 +81,8 @@ type VerifierMockPreWorkflowHookURLGenerator struct { } func (verifier *VerifierMockPreWorkflowHookURLGenerator) GenerateProjectWorkflowHookURL(hookID string) *MockPreWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification { - params := []pegomock.Param{hookID} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GenerateProjectWorkflowHookURL", params, verifier.timeout) + _params := []pegomock.Param{hookID} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GenerateProjectWorkflowHookURL", _params, verifier.timeout) return &MockPreWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -97,11 +97,13 @@ func (c *MockPreWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingV } func (c *MockPreWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } } return diff --git a/server/events/mocks/mock_pre_workflows_hooks_command_runner.go b/server/events/mocks/mock_pre_workflows_hooks_command_runner.go index da4c7b289e..730ef8799e 100644 --- a/server/events/mocks/mock_pre_workflows_hooks_command_runner.go +++ b/server/events/mocks/mock_pre_workflows_hooks_command_runner.go @@ -32,15 +32,15 @@ func (mock *MockPreWorkflowHooksCommandRunner) RunPreHooks(ctx *command.Context, if mock == nil { panic("mock must not be nil. Use myMock := NewMockPreWorkflowHooksCommandRunner().") } - params := []pegomock.Param{ctx, cmd} - result := pegomock.GetGenericMockFrom(mock).Invoke("RunPreHooks", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{ctx, cmd} + _result := pegomock.GetGenericMockFrom(mock).Invoke("RunPreHooks", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockPreWorkflowHooksCommandRunner) VerifyWasCalledOnce() *VerifierMockPreWorkflowHooksCommandRunner { @@ -81,8 +81,8 @@ type VerifierMockPreWorkflowHooksCommandRunner struct { } func (verifier *VerifierMockPreWorkflowHooksCommandRunner) RunPreHooks(ctx *command.Context, cmd *events.CommentCommand) *MockPreWorkflowHooksCommandRunner_RunPreHooks_OngoingVerification { - params := []pegomock.Param{ctx, cmd} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunPreHooks", params, verifier.timeout) + _params := []pegomock.Param{ctx, cmd} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunPreHooks", _params, verifier.timeout) return &MockPreWorkflowHooksCommandRunner_RunPreHooks_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -97,15 +97,19 @@ func (c *MockPreWorkflowHooksCommandRunner_RunPreHooks_OngoingVerification) GetC } func (c *MockPreWorkflowHooksCommandRunner_RunPreHooks_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*command.Context, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*command.Context) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*command.Context, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*command.Context) + } } - _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*events.CommentCommand) + if len(_params) > 1 { + _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*events.CommentCommand) + } } } return diff --git a/server/events/mocks/mock_project_command_builder.go b/server/events/mocks/mock_project_command_builder.go index 6a68f048b6..4395759917 100644 --- a/server/events/mocks/mock_project_command_builder.go +++ b/server/events/mocks/mock_project_command_builder.go @@ -30,133 +30,133 @@ func (mock *MockProjectCommandBuilder) BuildApplyCommands(ctx *command.Context, if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().") } - params := []pegomock.Param{ctx, comment} - result := pegomock.GetGenericMockFrom(mock).Invoke("BuildApplyCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []command.ProjectContext - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]command.ProjectContext) + _params := []pegomock.Param{ctx, comment} + _result := pegomock.GetGenericMockFrom(mock).Invoke("BuildApplyCommands", _params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []command.ProjectContext + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]command.ProjectContext) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockProjectCommandBuilder) BuildApprovePoliciesCommands(ctx *command.Context, comment *events.CommentCommand) ([]command.ProjectContext, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().") } - params := []pegomock.Param{ctx, comment} - result := pegomock.GetGenericMockFrom(mock).Invoke("BuildApprovePoliciesCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []command.ProjectContext - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]command.ProjectContext) + _params := []pegomock.Param{ctx, comment} + _result := pegomock.GetGenericMockFrom(mock).Invoke("BuildApprovePoliciesCommands", _params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []command.ProjectContext + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]command.ProjectContext) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockProjectCommandBuilder) BuildAutoplanCommands(ctx *command.Context) ([]command.ProjectContext, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().") } - params := []pegomock.Param{ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("BuildAutoplanCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []command.ProjectContext - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]command.ProjectContext) + _params := []pegomock.Param{ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("BuildAutoplanCommands", _params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []command.ProjectContext + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]command.ProjectContext) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockProjectCommandBuilder) BuildImportCommands(ctx *command.Context, comment *events.CommentCommand) ([]command.ProjectContext, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().") } - params := []pegomock.Param{ctx, comment} - result := pegomock.GetGenericMockFrom(mock).Invoke("BuildImportCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []command.ProjectContext - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]command.ProjectContext) + _params := []pegomock.Param{ctx, comment} + _result := pegomock.GetGenericMockFrom(mock).Invoke("BuildImportCommands", _params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []command.ProjectContext + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]command.ProjectContext) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockProjectCommandBuilder) BuildPlanCommands(ctx *command.Context, comment *events.CommentCommand) ([]command.ProjectContext, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().") } - params := []pegomock.Param{ctx, comment} - result := pegomock.GetGenericMockFrom(mock).Invoke("BuildPlanCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []command.ProjectContext - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]command.ProjectContext) + _params := []pegomock.Param{ctx, comment} + _result := pegomock.GetGenericMockFrom(mock).Invoke("BuildPlanCommands", _params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []command.ProjectContext + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]command.ProjectContext) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockProjectCommandBuilder) BuildStateRmCommands(ctx *command.Context, comment *events.CommentCommand) ([]command.ProjectContext, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().") } - params := []pegomock.Param{ctx, comment} - result := pegomock.GetGenericMockFrom(mock).Invoke("BuildStateRmCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []command.ProjectContext - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]command.ProjectContext) + _params := []pegomock.Param{ctx, comment} + _result := pegomock.GetGenericMockFrom(mock).Invoke("BuildStateRmCommands", _params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []command.ProjectContext + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]command.ProjectContext) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockProjectCommandBuilder) BuildVersionCommands(ctx *command.Context, comment *events.CommentCommand) ([]command.ProjectContext, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().") } - params := []pegomock.Param{ctx, comment} - result := pegomock.GetGenericMockFrom(mock).Invoke("BuildVersionCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []command.ProjectContext - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]command.ProjectContext) + _params := []pegomock.Param{ctx, comment} + _result := pegomock.GetGenericMockFrom(mock).Invoke("BuildVersionCommands", _params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []command.ProjectContext + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]command.ProjectContext) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockProjectCommandBuilder) VerifyWasCalledOnce() *VerifierMockProjectCommandBuilder { @@ -197,8 +197,8 @@ type VerifierMockProjectCommandBuilder struct { } func (verifier *VerifierMockProjectCommandBuilder) BuildApplyCommands(ctx *command.Context, 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) + _params := []pegomock.Param{ctx, comment} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildApplyCommands", _params, verifier.timeout) return &MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -213,23 +213,27 @@ func (c *MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification) GetCa } func (c *MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*command.Context, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*command.Context) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*command.Context, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*command.Context) + } } - _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*events.CommentCommand) + if len(_params) > 1 { + _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*events.CommentCommand) + } } } return } func (verifier *VerifierMockProjectCommandBuilder) BuildApprovePoliciesCommands(ctx *command.Context, comment *events.CommentCommand) *MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerification { - params := []pegomock.Param{ctx, comment} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildApprovePoliciesCommands", params, verifier.timeout) + _params := []pegomock.Param{ctx, comment} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildApprovePoliciesCommands", _params, verifier.timeout) return &MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -244,23 +248,27 @@ func (c *MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerificat } func (c *MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*command.Context, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*command.Context) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*command.Context, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*command.Context) + } } - _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*events.CommentCommand) + if len(_params) > 1 { + _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*events.CommentCommand) + } } } return } func (verifier *VerifierMockProjectCommandBuilder) BuildAutoplanCommands(ctx *command.Context) *MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification { - params := []pegomock.Param{ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildAutoplanCommands", params, verifier.timeout) + _params := []pegomock.Param{ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildAutoplanCommands", _params, verifier.timeout) return &MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -275,19 +283,21 @@ func (c *MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification) Ge } func (c *MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*command.Context, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*command.Context) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*command.Context, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*command.Context) + } } } return } func (verifier *VerifierMockProjectCommandBuilder) BuildImportCommands(ctx *command.Context, comment *events.CommentCommand) *MockProjectCommandBuilder_BuildImportCommands_OngoingVerification { - params := []pegomock.Param{ctx, comment} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildImportCommands", params, verifier.timeout) + _params := []pegomock.Param{ctx, comment} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildImportCommands", _params, verifier.timeout) return &MockProjectCommandBuilder_BuildImportCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -302,23 +312,27 @@ func (c *MockProjectCommandBuilder_BuildImportCommands_OngoingVerification) GetC } func (c *MockProjectCommandBuilder_BuildImportCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*command.Context, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*command.Context) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*command.Context, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*command.Context) + } } - _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*events.CommentCommand) + if len(_params) > 1 { + _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*events.CommentCommand) + } } } return } func (verifier *VerifierMockProjectCommandBuilder) BuildPlanCommands(ctx *command.Context, 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) + _params := []pegomock.Param{ctx, comment} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildPlanCommands", _params, verifier.timeout) return &MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -333,23 +347,27 @@ func (c *MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification) GetCap } func (c *MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*command.Context, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*command.Context) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*command.Context, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*command.Context) + } } - _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*events.CommentCommand) + if len(_params) > 1 { + _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*events.CommentCommand) + } } } return } func (verifier *VerifierMockProjectCommandBuilder) BuildStateRmCommands(ctx *command.Context, comment *events.CommentCommand) *MockProjectCommandBuilder_BuildStateRmCommands_OngoingVerification { - params := []pegomock.Param{ctx, comment} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildStateRmCommands", params, verifier.timeout) + _params := []pegomock.Param{ctx, comment} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildStateRmCommands", _params, verifier.timeout) return &MockProjectCommandBuilder_BuildStateRmCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -364,23 +382,27 @@ func (c *MockProjectCommandBuilder_BuildStateRmCommands_OngoingVerification) Get } func (c *MockProjectCommandBuilder_BuildStateRmCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*command.Context, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*command.Context) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*command.Context, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*command.Context) + } } - _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*events.CommentCommand) + if len(_params) > 1 { + _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*events.CommentCommand) + } } } return } func (verifier *VerifierMockProjectCommandBuilder) BuildVersionCommands(ctx *command.Context, comment *events.CommentCommand) *MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification { - params := []pegomock.Param{ctx, comment} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildVersionCommands", params, verifier.timeout) + _params := []pegomock.Param{ctx, comment} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildVersionCommands", _params, verifier.timeout) return &MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -395,15 +417,19 @@ func (c *MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification) Get } func (c *MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*command.Context, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*command.Context) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*command.Context, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*command.Context) + } } - _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*events.CommentCommand) + if len(_params) > 1 { + _param1 = make([]*events.CommentCommand, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(*events.CommentCommand) + } } } return diff --git a/server/events/mocks/mock_project_command_runner.go b/server/events/mocks/mock_project_command_runner.go index be42228cd1..dc30989b45 100644 --- a/server/events/mocks/mock_project_command_runner.go +++ b/server/events/mocks/mock_project_command_runner.go @@ -29,105 +29,105 @@ func (mock *MockProjectCommandRunner) Apply(ctx command.ProjectContext) command. if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandRunner().") } - params := []pegomock.Param{ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("Apply", params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) - var ret0 command.ProjectResult - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(command.ProjectResult) + _params := []pegomock.Param{ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Apply", _params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) + var _ret0 command.ProjectResult + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(command.ProjectResult) } } - return ret0 + return _ret0 } func (mock *MockProjectCommandRunner) ApprovePolicies(ctx command.ProjectContext) command.ProjectResult { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandRunner().") } - params := []pegomock.Param{ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("ApprovePolicies", params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) - var ret0 command.ProjectResult - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(command.ProjectResult) + _params := []pegomock.Param{ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ApprovePolicies", _params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) + var _ret0 command.ProjectResult + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(command.ProjectResult) } } - return ret0 + return _ret0 } func (mock *MockProjectCommandRunner) Import(ctx command.ProjectContext) command.ProjectResult { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandRunner().") } - params := []pegomock.Param{ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("Import", params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) - var ret0 command.ProjectResult - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(command.ProjectResult) + _params := []pegomock.Param{ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Import", _params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) + var _ret0 command.ProjectResult + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(command.ProjectResult) } } - return ret0 + return _ret0 } func (mock *MockProjectCommandRunner) Plan(ctx command.ProjectContext) command.ProjectResult { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandRunner().") } - params := []pegomock.Param{ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("Plan", params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) - var ret0 command.ProjectResult - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(command.ProjectResult) + _params := []pegomock.Param{ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Plan", _params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) + var _ret0 command.ProjectResult + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(command.ProjectResult) } } - return ret0 + return _ret0 } func (mock *MockProjectCommandRunner) PolicyCheck(ctx command.ProjectContext) command.ProjectResult { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandRunner().") } - params := []pegomock.Param{ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("PolicyCheck", params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) - var ret0 command.ProjectResult - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(command.ProjectResult) + _params := []pegomock.Param{ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("PolicyCheck", _params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) + var _ret0 command.ProjectResult + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(command.ProjectResult) } } - return ret0 + return _ret0 } func (mock *MockProjectCommandRunner) StateRm(ctx command.ProjectContext) command.ProjectResult { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandRunner().") } - params := []pegomock.Param{ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("StateRm", params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) - var ret0 command.ProjectResult - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(command.ProjectResult) + _params := []pegomock.Param{ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("StateRm", _params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) + var _ret0 command.ProjectResult + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(command.ProjectResult) } } - return ret0 + return _ret0 } func (mock *MockProjectCommandRunner) Version(ctx command.ProjectContext) command.ProjectResult { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandRunner().") } - params := []pegomock.Param{ctx} - result := pegomock.GetGenericMockFrom(mock).Invoke("Version", params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) - var ret0 command.ProjectResult - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(command.ProjectResult) + _params := []pegomock.Param{ctx} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Version", _params, []reflect.Type{reflect.TypeOf((*command.ProjectResult)(nil)).Elem()}) + var _ret0 command.ProjectResult + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(command.ProjectResult) } } - return ret0 + return _ret0 } func (mock *MockProjectCommandRunner) VerifyWasCalledOnce() *VerifierMockProjectCommandRunner { @@ -168,8 +168,8 @@ type VerifierMockProjectCommandRunner struct { } func (verifier *VerifierMockProjectCommandRunner) Apply(ctx command.ProjectContext) *MockProjectCommandRunner_Apply_OngoingVerification { - params := []pegomock.Param{ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Apply", params, verifier.timeout) + _params := []pegomock.Param{ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Apply", _params, verifier.timeout) return &MockProjectCommandRunner_Apply_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -184,19 +184,21 @@ func (c *MockProjectCommandRunner_Apply_OngoingVerification) GetCapturedArgument } func (c *MockProjectCommandRunner_Apply_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } } return } func (verifier *VerifierMockProjectCommandRunner) ApprovePolicies(ctx command.ProjectContext) *MockProjectCommandRunner_ApprovePolicies_OngoingVerification { - params := []pegomock.Param{ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ApprovePolicies", params, verifier.timeout) + _params := []pegomock.Param{ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ApprovePolicies", _params, verifier.timeout) return &MockProjectCommandRunner_ApprovePolicies_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -211,19 +213,21 @@ func (c *MockProjectCommandRunner_ApprovePolicies_OngoingVerification) GetCaptur } func (c *MockProjectCommandRunner_ApprovePolicies_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } } return } func (verifier *VerifierMockProjectCommandRunner) Import(ctx command.ProjectContext) *MockProjectCommandRunner_Import_OngoingVerification { - params := []pegomock.Param{ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Import", params, verifier.timeout) + _params := []pegomock.Param{ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Import", _params, verifier.timeout) return &MockProjectCommandRunner_Import_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -238,19 +242,21 @@ func (c *MockProjectCommandRunner_Import_OngoingVerification) GetCapturedArgumen } func (c *MockProjectCommandRunner_Import_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } } return } func (verifier *VerifierMockProjectCommandRunner) Plan(ctx command.ProjectContext) *MockProjectCommandRunner_Plan_OngoingVerification { - params := []pegomock.Param{ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Plan", params, verifier.timeout) + _params := []pegomock.Param{ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Plan", _params, verifier.timeout) return &MockProjectCommandRunner_Plan_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -265,19 +271,21 @@ func (c *MockProjectCommandRunner_Plan_OngoingVerification) GetCapturedArguments } func (c *MockProjectCommandRunner_Plan_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } } return } func (verifier *VerifierMockProjectCommandRunner) PolicyCheck(ctx command.ProjectContext) *MockProjectCommandRunner_PolicyCheck_OngoingVerification { - params := []pegomock.Param{ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PolicyCheck", params, verifier.timeout) + _params := []pegomock.Param{ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PolicyCheck", _params, verifier.timeout) return &MockProjectCommandRunner_PolicyCheck_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -292,19 +300,21 @@ func (c *MockProjectCommandRunner_PolicyCheck_OngoingVerification) GetCapturedAr } func (c *MockProjectCommandRunner_PolicyCheck_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } } return } func (verifier *VerifierMockProjectCommandRunner) StateRm(ctx command.ProjectContext) *MockProjectCommandRunner_StateRm_OngoingVerification { - params := []pegomock.Param{ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "StateRm", params, verifier.timeout) + _params := []pegomock.Param{ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "StateRm", _params, verifier.timeout) return &MockProjectCommandRunner_StateRm_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -319,19 +329,21 @@ func (c *MockProjectCommandRunner_StateRm_OngoingVerification) GetCapturedArgume } func (c *MockProjectCommandRunner_StateRm_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } } return } func (verifier *VerifierMockProjectCommandRunner) Version(ctx command.ProjectContext) *MockProjectCommandRunner_Version_OngoingVerification { - params := []pegomock.Param{ctx} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Version", params, verifier.timeout) + _params := []pegomock.Param{ctx} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Version", _params, verifier.timeout) return &MockProjectCommandRunner_Version_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -346,11 +358,13 @@ func (c *MockProjectCommandRunner_Version_OngoingVerification) GetCapturedArgume } func (c *MockProjectCommandRunner_Version_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } } return diff --git a/server/events/mocks/mock_project_lock.go b/server/events/mocks/mock_project_lock.go index ab54c2487a..90a5fd50ad 100644 --- a/server/events/mocks/mock_project_lock.go +++ b/server/events/mocks/mock_project_lock.go @@ -31,19 +31,19 @@ func (mock *MockProjectLocker) TryLock(log logging.SimpleLogging, pull models.Pu if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectLocker().") } - params := []pegomock.Param{log, pull, user, workspace, project, repoLocking} - result := pegomock.GetGenericMockFrom(mock).Invoke("TryLock", params, []reflect.Type{reflect.TypeOf((**events.TryLockResponse)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *events.TryLockResponse - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*events.TryLockResponse) + _params := []pegomock.Param{log, pull, user, workspace, project, repoLocking} + _result := pegomock.GetGenericMockFrom(mock).Invoke("TryLock", _params, []reflect.Type{reflect.TypeOf((**events.TryLockResponse)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *events.TryLockResponse + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*events.TryLockResponse) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockProjectLocker) VerifyWasCalledOnce() *VerifierMockProjectLocker { @@ -84,8 +84,8 @@ type VerifierMockProjectLocker struct { } func (verifier *VerifierMockProjectLocker) TryLock(log logging.SimpleLogging, pull models.PullRequest, user models.User, workspace string, project models.Project, repoLocking bool) *MockProjectLocker_TryLock_OngoingVerification { - params := []pegomock.Param{log, pull, user, workspace, project, repoLocking} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLock", params, verifier.timeout) + _params := []pegomock.Param{log, pull, user, workspace, project, repoLocking} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLock", _params, verifier.timeout) return &MockProjectLocker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -100,31 +100,43 @@ func (c *MockProjectLocker_TryLock_OngoingVerification) GetCapturedArguments() ( } func (c *MockProjectLocker_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.PullRequest, _param2 []models.User, _param3 []string, _param4 []models.Project, _param5 []bool) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.PullRequest) + if len(_params) > 1 { + _param1 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.PullRequest) + } } - _param2 = make([]models.User, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.User) + if len(_params) > 2 { + _param2 = make([]models.User, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.User) + } } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } - _param4 = make([]models.Project, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(models.Project) + if len(_params) > 4 { + _param4 = make([]models.Project, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(models.Project) + } } - _param5 = make([]bool, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[u] = param.(bool) + if len(_params) > 5 { + _param5 = make([]bool, len(c.methodInvocations)) + for u, param := range _params[5] { + _param5[u] = param.(bool) + } } } return diff --git a/server/events/mocks/mock_pull_cleaner.go b/server/events/mocks/mock_pull_cleaner.go index 53fd1877fe..9f5e89242d 100644 --- a/server/events/mocks/mock_pull_cleaner.go +++ b/server/events/mocks/mock_pull_cleaner.go @@ -30,15 +30,15 @@ func (mock *MockPullCleaner) CleanUpPull(logger logging.SimpleLogging, repo mode if mock == nil { panic("mock must not be nil. Use myMock := NewMockPullCleaner().") } - params := []pegomock.Param{logger, repo, pull} - result := pegomock.GetGenericMockFrom(mock).Invoke("CleanUpPull", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, repo, pull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("CleanUpPull", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockPullCleaner) VerifyWasCalledOnce() *VerifierMockPullCleaner { @@ -79,8 +79,8 @@ type VerifierMockPullCleaner struct { } func (verifier *VerifierMockPullCleaner) CleanUpPull(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) *MockPullCleaner_CleanUpPull_OngoingVerification { - params := []pegomock.Param{logger, repo, pull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CleanUpPull", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CleanUpPull", _params, verifier.timeout) return &MockPullCleaner_CleanUpPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -95,19 +95,25 @@ func (c *MockPullCleaner_CleanUpPull_OngoingVerification) GetCapturedArguments() } func (c *MockPullCleaner_CleanUpPull_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } } return diff --git a/server/events/mocks/mock_resource_cleaner.go b/server/events/mocks/mock_resource_cleaner.go index a09a8ee7b4..5e07b3aa81 100644 --- a/server/events/mocks/mock_resource_cleaner.go +++ b/server/events/mocks/mock_resource_cleaner.go @@ -29,8 +29,8 @@ func (mock *MockResourceCleaner) CleanUp(pullInfo jobs.PullInfo) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockResourceCleaner().") } - params := []pegomock.Param{pullInfo} - pegomock.GetGenericMockFrom(mock).Invoke("CleanUp", params, []reflect.Type{}) + _params := []pegomock.Param{pullInfo} + pegomock.GetGenericMockFrom(mock).Invoke("CleanUp", _params, []reflect.Type{}) } func (mock *MockResourceCleaner) VerifyWasCalledOnce() *VerifierMockResourceCleaner { @@ -71,8 +71,8 @@ type VerifierMockResourceCleaner struct { } func (verifier *VerifierMockResourceCleaner) CleanUp(pullInfo jobs.PullInfo) *MockResourceCleaner_CleanUp_OngoingVerification { - params := []pegomock.Param{pullInfo} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CleanUp", params, verifier.timeout) + _params := []pegomock.Param{pullInfo} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CleanUp", _params, verifier.timeout) return &MockResourceCleaner_CleanUp_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -87,11 +87,13 @@ func (c *MockResourceCleaner_CleanUp_OngoingVerification) GetCapturedArguments() } func (c *MockResourceCleaner_CleanUp_OngoingVerification) GetAllCapturedArguments() (_param0 []jobs.PullInfo) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]jobs.PullInfo, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(jobs.PullInfo) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]jobs.PullInfo, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(jobs.PullInfo) + } } } return diff --git a/server/events/mocks/mock_step_runner.go b/server/events/mocks/mock_step_runner.go index fdfd95aa7c..92c1510d65 100644 --- a/server/events/mocks/mock_step_runner.go +++ b/server/events/mocks/mock_step_runner.go @@ -29,19 +29,19 @@ func (mock *MockStepRunner) Run(ctx command.ProjectContext, extraArgs []string, if mock == nil { panic("mock must not be nil. Use myMock := NewMockStepRunner().") } - params := []pegomock.Param{ctx, extraArgs, path, envs} - result := pegomock.GetGenericMockFrom(mock).Invoke("Run", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{ctx, extraArgs, path, envs} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Run", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockStepRunner) VerifyWasCalledOnce() *VerifierMockStepRunner { @@ -82,8 +82,8 @@ type VerifierMockStepRunner struct { } func (verifier *VerifierMockStepRunner) Run(ctx command.ProjectContext, extraArgs []string, path string, envs map[string]string) *MockStepRunner_Run_OngoingVerification { - params := []pegomock.Param{ctx, extraArgs, path, envs} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", params, verifier.timeout) + _params := []pegomock.Param{ctx, extraArgs, path, envs} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", _params, verifier.timeout) return &MockStepRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -98,23 +98,31 @@ func (c *MockStepRunner_Run_OngoingVerification) GetCapturedArguments() (command } func (c *MockStepRunner_Run_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 [][]string, _param2 []string, _param3 []map[string]string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } - _param1 = make([][]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.([]string) + if len(_params) > 1 { + _param1 = make([][]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.([]string) + } } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } - _param3 = make([]map[string]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(map[string]string) + if len(_params) > 3 { + _param3 = make([]map[string]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(map[string]string) + } } } return diff --git a/server/events/mocks/mock_webhooks_sender.go b/server/events/mocks/mock_webhooks_sender.go index 48a3dcd576..b0f9d368e3 100644 --- a/server/events/mocks/mock_webhooks_sender.go +++ b/server/events/mocks/mock_webhooks_sender.go @@ -30,15 +30,15 @@ func (mock *MockWebhooksSender) Send(log logging.SimpleLogging, res webhooks.App if mock == nil { panic("mock must not be nil. Use myMock := NewMockWebhooksSender().") } - params := []pegomock.Param{log, res} - result := pegomock.GetGenericMockFrom(mock).Invoke("Send", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{log, res} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Send", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockWebhooksSender) VerifyWasCalledOnce() *VerifierMockWebhooksSender { @@ -79,8 +79,8 @@ type VerifierMockWebhooksSender struct { } func (verifier *VerifierMockWebhooksSender) Send(log logging.SimpleLogging, 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) + _params := []pegomock.Param{log, res} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Send", _params, verifier.timeout) return &MockWebhooksSender_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -95,15 +95,19 @@ func (c *MockWebhooksSender_Send_OngoingVerification) GetCapturedArguments() (lo } func (c *MockWebhooksSender_Send_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []webhooks.ApplyResult) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]webhooks.ApplyResult, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(webhooks.ApplyResult) + if len(_params) > 1 { + _param1 = make([]webhooks.ApplyResult, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(webhooks.ApplyResult) + } } } return diff --git a/server/events/mocks/mock_working_dir.go b/server/events/mocks/mock_working_dir.go index 9c162fc4a2..c4b410c1ab 100644 --- a/server/events/mocks/mock_working_dir.go +++ b/server/events/mocks/mock_working_dir.go @@ -30,148 +30,148 @@ func (mock *MockWorkingDir) Clone(logger logging.SimpleLogging, headRepo models. if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, headRepo, p, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("Clone", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 bool - var ret2 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{logger, headRepo, p, workspace} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Clone", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 bool + var _ret2 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(bool) + if _result[1] != nil { + _ret1 = _result[1].(bool) } - if result[2] != nil { - ret2 = result[2].(error) + if _result[2] != nil { + _ret2 = _result[2].(error) } } - return ret0, ret1, ret2 + return _ret0, _ret1, _ret2 } func (mock *MockWorkingDir) Delete(logger logging.SimpleLogging, r models.Repo, p models.PullRequest) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, r, p} - result := pegomock.GetGenericMockFrom(mock).Invoke("Delete", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, r, p} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Delete", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockWorkingDir) DeleteForWorkspace(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, r, p, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteForWorkspace", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, r, p, workspace} + _result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteForWorkspace", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockWorkingDir) DeletePlan(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string, path string, projectName string) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, r, p, workspace, path, projectName} - result := pegomock.GetGenericMockFrom(mock).Invoke("DeletePlan", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, r, p, workspace, path, projectName} + _result := pegomock.GetGenericMockFrom(mock).Invoke("DeletePlan", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockWorkingDir) GetGitUntrackedFiles(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string) ([]string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, r, p, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetGitUntrackedFiles", params, []reflect.Type{reflect.TypeOf((*[]string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]string) + _params := []pegomock.Param{logger, r, p, workspace} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetGitUntrackedFiles", _params, []reflect.Type{reflect.TypeOf((*[]string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockWorkingDir) GetPullDir(r models.Repo, p models.PullRequest) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{r, p} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullDir", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{r, p} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullDir", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockWorkingDir) GetWorkingDir(r models.Repo, p models.PullRequest, workspace string) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{r, p, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetWorkingDir", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{r, p, workspace} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetWorkingDir", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockWorkingDir) HasDiverged(logger logging.SimpleLogging, cloneDir string) bool { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{logger, cloneDir} - result := pegomock.GetGenericMockFrom(mock).Invoke("HasDiverged", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) - var ret0 bool - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(bool) + _params := []pegomock.Param{logger, cloneDir} + _result := pegomock.GetGenericMockFrom(mock).Invoke("HasDiverged", _params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) + var _ret0 bool + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(bool) } } - return ret0 + return _ret0 } func (mock *MockWorkingDir) SetCheckForUpstreamChanges() { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDir().") } - params := []pegomock.Param{} - pegomock.GetGenericMockFrom(mock).Invoke("SetCheckForUpstreamChanges", params, []reflect.Type{}) + _params := []pegomock.Param{} + pegomock.GetGenericMockFrom(mock).Invoke("SetCheckForUpstreamChanges", _params, []reflect.Type{}) } func (mock *MockWorkingDir) VerifyWasCalledOnce() *VerifierMockWorkingDir { @@ -212,8 +212,8 @@ type VerifierMockWorkingDir struct { } func (verifier *VerifierMockWorkingDir) Clone(logger logging.SimpleLogging, headRepo models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_Clone_OngoingVerification { - params := []pegomock.Param{logger, headRepo, p, workspace} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Clone", params, verifier.timeout) + _params := []pegomock.Param{logger, headRepo, p, workspace} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Clone", _params, verifier.timeout) return &MockWorkingDir_Clone_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -228,31 +228,39 @@ func (c *MockWorkingDir_Clone_OngoingVerification) GetCapturedArguments() (loggi } func (c *MockWorkingDir_Clone_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) - } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } + } + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } } return } func (verifier *VerifierMockWorkingDir) Delete(logger logging.SimpleLogging, r models.Repo, p models.PullRequest) *MockWorkingDir_Delete_OngoingVerification { - params := []pegomock.Param{logger, r, p} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Delete", params, verifier.timeout) + _params := []pegomock.Param{logger, r, p} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Delete", _params, verifier.timeout) return &MockWorkingDir_Delete_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -267,27 +275,33 @@ func (c *MockWorkingDir_Delete_OngoingVerification) GetCapturedArguments() (logg } func (c *MockWorkingDir_Delete_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } } return } func (verifier *VerifierMockWorkingDir) DeleteForWorkspace(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_DeleteForWorkspace_OngoingVerification { - params := []pegomock.Param{logger, r, p, workspace} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteForWorkspace", params, verifier.timeout) + _params := []pegomock.Param{logger, r, p, workspace} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteForWorkspace", _params, verifier.timeout) return &MockWorkingDir_DeleteForWorkspace_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -302,31 +316,39 @@ func (c *MockWorkingDir_DeleteForWorkspace_OngoingVerification) GetCapturedArgum } func (c *MockWorkingDir_DeleteForWorkspace_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) - } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } + } + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } } return } func (verifier *VerifierMockWorkingDir) DeletePlan(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string, path string, projectName string) *MockWorkingDir_DeletePlan_OngoingVerification { - params := []pegomock.Param{logger, r, p, workspace, path, projectName} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeletePlan", params, verifier.timeout) + _params := []pegomock.Param{logger, r, p, workspace, path, projectName} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeletePlan", _params, verifier.timeout) return &MockWorkingDir_DeletePlan_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -341,39 +363,51 @@ func (c *MockWorkingDir_DeletePlan_OngoingVerification) GetCapturedArguments() ( } func (c *MockWorkingDir_DeletePlan_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []string, _param4 []string, _param5 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) - } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) - } - _param4 = make([]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(string) - } - _param5 = make([]string, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } + } + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } + } + if len(_params) > 4 { + _param4 = make([]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(string) + } + } + if len(_params) > 5 { + _param5 = make([]string, len(c.methodInvocations)) + for u, param := range _params[5] { + _param5[u] = param.(string) + } } } return } func (verifier *VerifierMockWorkingDir) GetGitUntrackedFiles(logger logging.SimpleLogging, r models.Repo, p models.PullRequest, workspace string) *MockWorkingDir_GetGitUntrackedFiles_OngoingVerification { - params := []pegomock.Param{logger, r, p, workspace} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetGitUntrackedFiles", params, verifier.timeout) + _params := []pegomock.Param{logger, r, p, workspace} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetGitUntrackedFiles", _params, verifier.timeout) return &MockWorkingDir_GetGitUntrackedFiles_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -388,31 +422,39 @@ func (c *MockWorkingDir_GetGitUntrackedFiles_OngoingVerification) GetCapturedArg } func (c *MockWorkingDir_GetGitUntrackedFiles_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) - } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } + } + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } } return } 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) + _params := []pegomock.Param{r, p} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullDir", _params, verifier.timeout) return &MockWorkingDir_GetPullDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -427,23 +469,27 @@ func (c *MockWorkingDir_GetPullDir_OngoingVerification) GetCapturedArguments() ( } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Repo) - } - _param1 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Repo) + } + } + if len(_params) > 1 { + _param1 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.PullRequest) + } } } return } 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) + _params := []pegomock.Param{r, p, workspace} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetWorkingDir", _params, verifier.timeout) return &MockWorkingDir_GetWorkingDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -458,27 +504,33 @@ func (c *MockWorkingDir_GetWorkingDir_OngoingVerification) GetCapturedArguments( } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Repo) - } - _param1 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.PullRequest) - } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Repo) + } + } + if len(_params) > 1 { + _param1 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.PullRequest) + } + } + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } } return } func (verifier *VerifierMockWorkingDir) HasDiverged(logger logging.SimpleLogging, cloneDir string) *MockWorkingDir_HasDiverged_OngoingVerification { - params := []pegomock.Param{logger, cloneDir} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "HasDiverged", params, verifier.timeout) + _params := []pegomock.Param{logger, cloneDir} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "HasDiverged", _params, verifier.timeout) return &MockWorkingDir_HasDiverged_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -493,23 +545,27 @@ func (c *MockWorkingDir_HasDiverged_OngoingVerification) GetCapturedArguments() } func (c *MockWorkingDir_HasDiverged_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } } return } func (verifier *VerifierMockWorkingDir) SetCheckForUpstreamChanges() *MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SetCheckForUpstreamChanges", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SetCheckForUpstreamChanges", _params, verifier.timeout) return &MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } diff --git a/server/events/mocks/mock_working_dir_locker.go b/server/events/mocks/mock_working_dir_locker.go index 6bb1cde91f..af5de92cfb 100644 --- a/server/events/mocks/mock_working_dir_locker.go +++ b/server/events/mocks/mock_working_dir_locker.go @@ -28,38 +28,38 @@ func (mock *MockWorkingDirLocker) TryLock(repoFullName string, pullNum int, work if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDirLocker().") } - params := []pegomock.Param{repoFullName, pullNum, workspace, path} - result := pegomock.GetGenericMockFrom(mock).Invoke("TryLock", params, []reflect.Type{reflect.TypeOf((*func())(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 func() - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(func()) + _params := []pegomock.Param{repoFullName, pullNum, workspace, path} + _result := pegomock.GetGenericMockFrom(mock).Invoke("TryLock", _params, []reflect.Type{reflect.TypeOf((*func())(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 func() + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(func()) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockWorkingDirLocker) TryLockPull(repoFullName string, pullNum int) (func(), error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockWorkingDirLocker().") } - params := []pegomock.Param{repoFullName, pullNum} - result := pegomock.GetGenericMockFrom(mock).Invoke("TryLockPull", params, []reflect.Type{reflect.TypeOf((*func())(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 func() - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(func()) + _params := []pegomock.Param{repoFullName, pullNum} + _result := pegomock.GetGenericMockFrom(mock).Invoke("TryLockPull", _params, []reflect.Type{reflect.TypeOf((*func())(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 func() + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(func()) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockWorkingDirLocker) VerifyWasCalledOnce() *VerifierMockWorkingDirLocker { @@ -100,8 +100,8 @@ type VerifierMockWorkingDirLocker struct { } func (verifier *VerifierMockWorkingDirLocker) TryLock(repoFullName string, pullNum int, workspace string, path string) *MockWorkingDirLocker_TryLock_OngoingVerification { - params := []pegomock.Param{repoFullName, pullNum, workspace, path} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLock", params, verifier.timeout) + _params := []pegomock.Param{repoFullName, pullNum, workspace, path} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLock", _params, verifier.timeout) return &MockWorkingDirLocker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -116,31 +116,39 @@ func (c *MockWorkingDirLocker_TryLock_OngoingVerification) GetCapturedArguments( } func (c *MockWorkingDirLocker_TryLock_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []int, _param2 []string, _param3 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } - _param1 = make([]int, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(int) + if len(_params) > 1 { + _param1 = make([]int, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(int) + } } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } } return } 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) + _params := []pegomock.Param{repoFullName, pullNum} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TryLockPull", _params, verifier.timeout) return &MockWorkingDirLocker_TryLockPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -155,15 +163,19 @@ func (c *MockWorkingDirLocker_TryLockPull_OngoingVerification) GetCapturedArgume } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } - _param1 = make([]int, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(int) + if len(_params) > 1 { + _param1 = make([]int, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(int) + } } } return diff --git a/server/events/vcs/mocks/mock_client.go b/server/events/vcs/mocks/mock_client.go index f51036b87a..e798b8b79a 100644 --- a/server/events/vcs/mocks/mock_client.go +++ b/server/events/vcs/mocks/mock_client.go @@ -30,261 +30,261 @@ func (mock *MockClient) CreateComment(logger logging.SimpleLogging, repo models. if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{logger, repo, pullNum, comment, command} - result := pegomock.GetGenericMockFrom(mock).Invoke("CreateComment", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, repo, pullNum, comment, command} + _result := pegomock.GetGenericMockFrom(mock).Invoke("CreateComment", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockClient) DiscardReviews(repo models.Repo, pull models.PullRequest) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{repo, pull} - result := pegomock.GetGenericMockFrom(mock).Invoke("DiscardReviews", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{repo, pull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("DiscardReviews", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockClient) GetCloneURL(logger logging.SimpleLogging, VCSHostType models.VCSHostType, repo string) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{logger, VCSHostType, repo} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetCloneURL", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{logger, VCSHostType, repo} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetCloneURL", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockClient) GetFileContent(logger logging.SimpleLogging, pull models.PullRequest, fileName string) (bool, []byte, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{logger, pull, fileName} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetFileContent", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*[]byte)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 bool - var ret1 []byte - var ret2 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(bool) + _params := []pegomock.Param{logger, pull, fileName} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetFileContent", _params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*[]byte)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 bool + var _ret1 []byte + var _ret2 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(bool) } - if result[1] != nil { - ret1 = result[1].([]byte) + if _result[1] != nil { + _ret1 = _result[1].([]byte) } - if result[2] != nil { - ret2 = result[2].(error) + if _result[2] != nil { + _ret2 = _result[2].(error) } } - return ret0, ret1, ret2 + return _ret0, _ret1, _ret2 } func (mock *MockClient) GetModifiedFiles(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) ([]string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{logger, repo, pull} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetModifiedFiles", params, []reflect.Type{reflect.TypeOf((*[]string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]string) + _params := []pegomock.Param{logger, repo, pull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetModifiedFiles", _params, []reflect.Type{reflect.TypeOf((*[]string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockClient) GetPullLabels(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) ([]string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{logger, repo, pull} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullLabels", params, []reflect.Type{reflect.TypeOf((*[]string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]string) + _params := []pegomock.Param{logger, repo, pull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullLabels", _params, []reflect.Type{reflect.TypeOf((*[]string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockClient) GetTeamNamesForUser(repo models.Repo, user models.User) ([]string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{repo, user} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetTeamNamesForUser", params, []reflect.Type{reflect.TypeOf((*[]string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]string) + _params := []pegomock.Param{repo, user} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetTeamNamesForUser", _params, []reflect.Type{reflect.TypeOf((*[]string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockClient) HidePrevCommandComments(logger logging.SimpleLogging, repo models.Repo, pullNum int, command string, dir string) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{logger, repo, pullNum, command, dir} - result := pegomock.GetGenericMockFrom(mock).Invoke("HidePrevCommandComments", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, repo, pullNum, command, dir} + _result := pegomock.GetGenericMockFrom(mock).Invoke("HidePrevCommandComments", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockClient) MarkdownPullLink(pull models.PullRequest) (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{pull} - result := pegomock.GetGenericMockFrom(mock).Invoke("MarkdownPullLink", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{pull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("MarkdownPullLink", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockClient) MergePull(logger logging.SimpleLogging, pull models.PullRequest, pullOptions models.PullRequestOptions) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{logger, pull, pullOptions} - result := pegomock.GetGenericMockFrom(mock).Invoke("MergePull", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, pull, pullOptions} + _result := pegomock.GetGenericMockFrom(mock).Invoke("MergePull", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockClient) PullIsApproved(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) (models.ApprovalStatus, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{logger, repo, pull} - result := pegomock.GetGenericMockFrom(mock).Invoke("PullIsApproved", params, []reflect.Type{reflect.TypeOf((*models.ApprovalStatus)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.ApprovalStatus - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.ApprovalStatus) + _params := []pegomock.Param{logger, repo, pull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("PullIsApproved", _params, []reflect.Type{reflect.TypeOf((*models.ApprovalStatus)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.ApprovalStatus + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.ApprovalStatus) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockClient) PullIsMergeable(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, vcsstatusname string, ignoreVCSStatusNames []string) (bool, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{logger, repo, pull, vcsstatusname, ignoreVCSStatusNames} - result := pegomock.GetGenericMockFrom(mock).Invoke("PullIsMergeable", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 bool - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(bool) + _params := []pegomock.Param{logger, repo, pull, vcsstatusname, ignoreVCSStatusNames} + _result := pegomock.GetGenericMockFrom(mock).Invoke("PullIsMergeable", _params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 bool + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(bool) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockClient) ReactToComment(logger logging.SimpleLogging, repo models.Repo, pullNum int, commentID int64, reaction string) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{logger, repo, pullNum, commentID, reaction} - result := pegomock.GetGenericMockFrom(mock).Invoke("ReactToComment", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, repo, pullNum, commentID, reaction} + _result := pegomock.GetGenericMockFrom(mock).Invoke("ReactToComment", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockClient) SupportsSingleFileDownload(repo models.Repo) bool { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{repo} - result := pegomock.GetGenericMockFrom(mock).Invoke("SupportsSingleFileDownload", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) - var ret0 bool - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(bool) + _params := []pegomock.Param{repo} + _result := pegomock.GetGenericMockFrom(mock).Invoke("SupportsSingleFileDownload", _params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) + var _ret0 bool + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(bool) } } - return ret0 + return _ret0 } func (mock *MockClient) UpdateStatus(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, state models.CommitStatus, src string, description string, url string) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockClient().") } - params := []pegomock.Param{logger, repo, pull, state, src, description, url} - result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateStatus", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{logger, repo, pull, state, src, description, url} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateStatus", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockClient) VerifyWasCalledOnce() *VerifierMockClient { @@ -325,8 +325,8 @@ type VerifierMockClient struct { } func (verifier *VerifierMockClient) CreateComment(logger logging.SimpleLogging, repo models.Repo, pullNum int, comment string, command string) *MockClient_CreateComment_OngoingVerification { - params := []pegomock.Param{logger, repo, pullNum, comment, command} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CreateComment", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pullNum, comment, command} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CreateComment", _params, verifier.timeout) return &MockClient_CreateComment_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -341,35 +341,45 @@ func (c *MockClient_CreateComment_OngoingVerification) GetCapturedArguments() (l } func (c *MockClient_CreateComment_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []int, _param3 []string, _param4 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]int, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(int) - } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) - } - _param4 = make([]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]int, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(int) + } + } + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } + } + if len(_params) > 4 { + _param4 = make([]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(string) + } } } return } func (verifier *VerifierMockClient) DiscardReviews(repo models.Repo, pull models.PullRequest) *MockClient_DiscardReviews_OngoingVerification { - params := []pegomock.Param{repo, pull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DiscardReviews", params, verifier.timeout) + _params := []pegomock.Param{repo, pull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DiscardReviews", _params, verifier.timeout) return &MockClient_DiscardReviews_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -384,23 +394,27 @@ func (c *MockClient_DiscardReviews_OngoingVerification) GetCapturedArguments() ( } func (c *MockClient_DiscardReviews_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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Repo) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Repo) + } } - _param1 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.PullRequest) + if len(_params) > 1 { + _param1 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.PullRequest) + } } } return } func (verifier *VerifierMockClient) GetCloneURL(logger logging.SimpleLogging, VCSHostType models.VCSHostType, repo string) *MockClient_GetCloneURL_OngoingVerification { - params := []pegomock.Param{logger, VCSHostType, repo} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetCloneURL", params, verifier.timeout) + _params := []pegomock.Param{logger, VCSHostType, repo} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetCloneURL", _params, verifier.timeout) return &MockClient_GetCloneURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -415,27 +429,33 @@ func (c *MockClient_GetCloneURL_OngoingVerification) GetCapturedArguments() (log } func (c *MockClient_GetCloneURL_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.VCSHostType, _param2 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.VCSHostType, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.VCSHostType) - } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.VCSHostType, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.VCSHostType) + } + } + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } } return } func (verifier *VerifierMockClient) GetFileContent(logger logging.SimpleLogging, pull models.PullRequest, fileName string) *MockClient_GetFileContent_OngoingVerification { - params := []pegomock.Param{logger, pull, fileName} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetFileContent", params, verifier.timeout) + _params := []pegomock.Param{logger, pull, fileName} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetFileContent", _params, verifier.timeout) return &MockClient_GetFileContent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -450,27 +470,33 @@ func (c *MockClient_GetFileContent_OngoingVerification) GetCapturedArguments() ( } func (c *MockClient_GetFileContent_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.PullRequest, _param2 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.PullRequest) - } - _param2 = make([]string, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.PullRequest) + } + } + if len(_params) > 2 { + _param2 = make([]string, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(string) + } } } return } func (verifier *VerifierMockClient) GetModifiedFiles(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) *MockClient_GetModifiedFiles_OngoingVerification { - params := []pegomock.Param{logger, repo, pull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetModifiedFiles", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetModifiedFiles", _params, verifier.timeout) return &MockClient_GetModifiedFiles_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -485,27 +511,33 @@ func (c *MockClient_GetModifiedFiles_OngoingVerification) GetCapturedArguments() } func (c *MockClient_GetModifiedFiles_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } } return } func (verifier *VerifierMockClient) GetPullLabels(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) *MockClient_GetPullLabels_OngoingVerification { - params := []pegomock.Param{logger, repo, pull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullLabels", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullLabels", _params, verifier.timeout) return &MockClient_GetPullLabels_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -520,27 +552,33 @@ func (c *MockClient_GetPullLabels_OngoingVerification) GetCapturedArguments() (l } func (c *MockClient_GetPullLabels_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } } return } func (verifier *VerifierMockClient) GetTeamNamesForUser(repo models.Repo, user models.User) *MockClient_GetTeamNamesForUser_OngoingVerification { - params := []pegomock.Param{repo, user} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetTeamNamesForUser", params, verifier.timeout) + _params := []pegomock.Param{repo, user} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetTeamNamesForUser", _params, verifier.timeout) return &MockClient_GetTeamNamesForUser_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -555,23 +593,27 @@ func (c *MockClient_GetTeamNamesForUser_OngoingVerification) GetCapturedArgument } func (c *MockClient_GetTeamNamesForUser_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.User) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Repo) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Repo) + } } - _param1 = make([]models.User, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.User) + if len(_params) > 1 { + _param1 = make([]models.User, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.User) + } } } return } func (verifier *VerifierMockClient) HidePrevCommandComments(logger logging.SimpleLogging, repo models.Repo, pullNum int, command string, dir string) *MockClient_HidePrevCommandComments_OngoingVerification { - params := []pegomock.Param{logger, repo, pullNum, command, dir} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "HidePrevCommandComments", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pullNum, command, dir} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "HidePrevCommandComments", _params, verifier.timeout) return &MockClient_HidePrevCommandComments_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -586,35 +628,45 @@ func (c *MockClient_HidePrevCommandComments_OngoingVerification) GetCapturedArgu } func (c *MockClient_HidePrevCommandComments_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []int, _param3 []string, _param4 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]int, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(int) - } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) - } - _param4 = make([]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]int, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(int) + } + } + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } + } + if len(_params) > 4 { + _param4 = make([]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(string) + } } } return } func (verifier *VerifierMockClient) MarkdownPullLink(pull models.PullRequest) *MockClient_MarkdownPullLink_OngoingVerification { - params := []pegomock.Param{pull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "MarkdownPullLink", params, verifier.timeout) + _params := []pegomock.Param{pull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "MarkdownPullLink", _params, verifier.timeout) return &MockClient_MarkdownPullLink_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -629,19 +681,21 @@ func (c *MockClient_MarkdownPullLink_OngoingVerification) GetCapturedArguments() } func (c *MockClient_MarkdownPullLink_OngoingVerification) GetAllCapturedArguments() (_param0 []models.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.PullRequest) + } } } return } func (verifier *VerifierMockClient) MergePull(logger logging.SimpleLogging, pull models.PullRequest, pullOptions models.PullRequestOptions) *MockClient_MergePull_OngoingVerification { - params := []pegomock.Param{logger, pull, pullOptions} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "MergePull", params, verifier.timeout) + _params := []pegomock.Param{logger, pull, pullOptions} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "MergePull", _params, verifier.timeout) return &MockClient_MergePull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -656,27 +710,33 @@ func (c *MockClient_MergePull_OngoingVerification) GetCapturedArguments() (loggi } func (c *MockClient_MergePull_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.PullRequest, _param2 []models.PullRequestOptions) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.PullRequest) - } - _param2 = make([]models.PullRequestOptions, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequestOptions) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.PullRequest) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequestOptions, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequestOptions) + } } } return } func (verifier *VerifierMockClient) PullIsApproved(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) *MockClient_PullIsApproved_OngoingVerification { - params := []pegomock.Param{logger, repo, pull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PullIsApproved", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PullIsApproved", _params, verifier.timeout) return &MockClient_PullIsApproved_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -691,27 +751,33 @@ func (c *MockClient_PullIsApproved_OngoingVerification) GetCapturedArguments() ( } func (c *MockClient_PullIsApproved_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } } return } -func (verifier *VerifierMockClient) PullIsMergeable(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, vcsstatusname string) *MockClient_PullIsMergeable_OngoingVerification { - params := []pegomock.Param{logger, repo, pull, vcsstatusname} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PullIsMergeable", params, verifier.timeout) +func (verifier *VerifierMockClient) PullIsMergeable(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, vcsstatusname string, ignoreVCSStatusNames []string) *MockClient_PullIsMergeable_OngoingVerification { + _params := []pegomock.Param{logger, repo, pull, vcsstatusname, ignoreVCSStatusNames} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PullIsMergeable", _params, verifier.timeout) return &MockClient_PullIsMergeable_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -720,37 +786,51 @@ type MockClient_PullIsMergeable_OngoingVerification struct { methodInvocations []pegomock.MethodInvocation } -func (c *MockClient_PullIsMergeable_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, string) { - logger, repo, pull, vcsstatusname := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pull[len(pull)-1], vcsstatusname[len(vcsstatusname)-1] +func (c *MockClient_PullIsMergeable_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, string, []string) { + logger, repo, pull, vcsstatusname, ignoreVCSStatusNames := c.GetAllCapturedArguments() + return logger[len(logger)-1], repo[len(repo)-1], pull[len(pull)-1], vcsstatusname[len(vcsstatusname)-1], ignoreVCSStatusNames[len(ignoreVCSStatusNames)-1] } -func (c *MockClient_PullIsMergeable_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) +func (c *MockClient_PullIsMergeable_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []string, _param4 [][]string) { + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + if len(_params) > 4 { + _param4 = make([][]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.([]string) + } } } return } func (verifier *VerifierMockClient) ReactToComment(logger logging.SimpleLogging, repo models.Repo, pullNum int, commentID int64, reaction string) *MockClient_ReactToComment_OngoingVerification { - params := []pegomock.Param{logger, repo, pullNum, commentID, reaction} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ReactToComment", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pullNum, commentID, reaction} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ReactToComment", _params, verifier.timeout) return &MockClient_ReactToComment_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -765,35 +845,45 @@ func (c *MockClient_ReactToComment_OngoingVerification) GetCapturedArguments() ( } func (c *MockClient_ReactToComment_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []int, _param3 []int64, _param4 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]int, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(int) - } - _param3 = make([]int64, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(int64) - } - _param4 = make([]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]int, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(int) + } + } + if len(_params) > 3 { + _param3 = make([]int64, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(int64) + } + } + if len(_params) > 4 { + _param4 = make([]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(string) + } } } return } func (verifier *VerifierMockClient) SupportsSingleFileDownload(repo models.Repo) *MockClient_SupportsSingleFileDownload_OngoingVerification { - params := []pegomock.Param{repo} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SupportsSingleFileDownload", params, verifier.timeout) + _params := []pegomock.Param{repo} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SupportsSingleFileDownload", _params, verifier.timeout) return &MockClient_SupportsSingleFileDownload_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -808,19 +898,21 @@ func (c *MockClient_SupportsSingleFileDownload_OngoingVerification) GetCapturedA } func (c *MockClient_SupportsSingleFileDownload_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.Repo) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.Repo) + } } } return } func (verifier *VerifierMockClient) UpdateStatus(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, state models.CommitStatus, src string, description string, url string) *MockClient_UpdateStatus_OngoingVerification { - params := []pegomock.Param{logger, repo, pull, state, src, description, url} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateStatus", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pull, state, src, description, url} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateStatus", _params, verifier.timeout) return &MockClient_UpdateStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -835,35 +927,49 @@ func (c *MockClient_UpdateStatus_OngoingVerification) GetCapturedArguments() (lo } func (c *MockClient_UpdateStatus_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []models.CommitStatus, _param4 []string, _param5 []string, _param6 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) - } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) - } - _param2 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.PullRequest) - } - _param3 = make([]models.CommitStatus, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(models.CommitStatus) - } - _param4 = make([]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(string) - } - _param5 = make([]string, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[u] = param.(string) - } - _param6 = make([]string, len(c.methodInvocations)) - for u, param := range params[6] { - _param6[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } + } + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } + } + if len(_params) > 2 { + _param2 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.PullRequest) + } + } + if len(_params) > 3 { + _param3 = make([]models.CommitStatus, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(models.CommitStatus) + } + } + if len(_params) > 4 { + _param4 = make([]string, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(string) + } + } + if len(_params) > 5 { + _param5 = make([]string, len(c.methodInvocations)) + for u, param := range _params[5] { + _param5[u] = param.(string) + } + } + if len(_params) > 6 { + _param6 = make([]string, len(c.methodInvocations)) + for u, param := range _params[6] { + _param6[u] = param.(string) + } } } return diff --git a/server/events/vcs/mocks/mock_github_credentials.go b/server/events/vcs/mocks/mock_github_credentials.go index 2c6359c077..e737b10b3e 100644 --- a/server/events/vcs/mocks/mock_github_credentials.go +++ b/server/events/vcs/mocks/mock_github_credentials.go @@ -29,57 +29,57 @@ func (mock *MockGithubCredentials) Client() (*http.Client, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockGithubCredentials().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("Client", params, []reflect.Type{reflect.TypeOf((**http.Client)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *http.Client - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*http.Client) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Client", _params, []reflect.Type{reflect.TypeOf((**http.Client)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *http.Client + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*http.Client) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockGithubCredentials) GetToken() (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockGithubCredentials().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetToken", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetToken", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockGithubCredentials) GetUser() (string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockGithubCredentials().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetUser", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetUser", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockGithubCredentials) VerifyWasCalledOnce() *VerifierMockGithubCredentials { @@ -120,8 +120,8 @@ type VerifierMockGithubCredentials struct { } func (verifier *VerifierMockGithubCredentials) Client() *MockGithubCredentials_Client_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Client", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Client", _params, verifier.timeout) return &MockGithubCredentials_Client_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -137,8 +137,8 @@ func (c *MockGithubCredentials_Client_OngoingVerification) GetAllCapturedArgumen } func (verifier *VerifierMockGithubCredentials) GetToken() *MockGithubCredentials_GetToken_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetToken", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetToken", _params, verifier.timeout) return &MockGithubCredentials_GetToken_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -154,8 +154,8 @@ func (c *MockGithubCredentials_GetToken_OngoingVerification) GetAllCapturedArgum } func (verifier *VerifierMockGithubCredentials) GetUser() *MockGithubCredentials_GetUser_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetUser", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetUser", _params, verifier.timeout) return &MockGithubCredentials_GetUser_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } diff --git a/server/events/vcs/mocks/mock_github_pull_request_getter.go b/server/events/vcs/mocks/mock_github_pull_request_getter.go index 7ff2d0e1d3..f8a809e44f 100644 --- a/server/events/vcs/mocks/mock_github_pull_request_getter.go +++ b/server/events/vcs/mocks/mock_github_pull_request_getter.go @@ -31,19 +31,19 @@ func (mock *MockGithubPullRequestGetter) GetPullRequest(logger logging.SimpleLog if mock == nil { panic("mock must not be nil. Use myMock := NewMockGithubPullRequestGetter().") } - params := []pegomock.Param{logger, repo, pullNum} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullRequest", params, []reflect.Type{reflect.TypeOf((**github.PullRequest)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *github.PullRequest - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*github.PullRequest) + _params := []pegomock.Param{logger, repo, pullNum} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullRequest", _params, []reflect.Type{reflect.TypeOf((**github.PullRequest)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *github.PullRequest + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*github.PullRequest) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockGithubPullRequestGetter) VerifyWasCalledOnce() *VerifierMockGithubPullRequestGetter { @@ -84,8 +84,8 @@ type VerifierMockGithubPullRequestGetter struct { } func (verifier *VerifierMockGithubPullRequestGetter) GetPullRequest(logger logging.SimpleLogging, repo models.Repo, pullNum int) *MockGithubPullRequestGetter_GetPullRequest_OngoingVerification { - params := []pegomock.Param{logger, repo, pullNum} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullRequest", params, verifier.timeout) + _params := []pegomock.Param{logger, repo, pullNum} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullRequest", _params, verifier.timeout) return &MockGithubPullRequestGetter_GetPullRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -100,19 +100,25 @@ func (c *MockGithubPullRequestGetter_GetPullRequest_OngoingVerification) GetCapt } func (c *MockGithubPullRequestGetter_GetPullRequest_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []int) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]models.Repo, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.Repo) + if len(_params) > 1 { + _param1 = make([]models.Repo, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.Repo) + } } - _param2 = make([]int, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(int) + if len(_params) > 2 { + _param2 = make([]int, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(int) + } } } return diff --git a/server/events/vcs/mocks/mock_pull_req_status_fetcher.go b/server/events/vcs/mocks/mock_pull_req_status_fetcher.go index d9e6494d9a..07e3092379 100644 --- a/server/events/vcs/mocks/mock_pull_req_status_fetcher.go +++ b/server/events/vcs/mocks/mock_pull_req_status_fetcher.go @@ -30,19 +30,19 @@ func (mock *MockPullReqStatusFetcher) FetchPullStatus(logger logging.SimpleLoggi if mock == nil { panic("mock must not be nil. Use myMock := NewMockPullReqStatusFetcher().") } - params := []pegomock.Param{logger, pull} - result := pegomock.GetGenericMockFrom(mock).Invoke("FetchPullStatus", params, []reflect.Type{reflect.TypeOf((*models.PullReqStatus)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 models.PullReqStatus - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(models.PullReqStatus) + _params := []pegomock.Param{logger, pull} + _result := pegomock.GetGenericMockFrom(mock).Invoke("FetchPullStatus", _params, []reflect.Type{reflect.TypeOf((*models.PullReqStatus)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 models.PullReqStatus + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(models.PullReqStatus) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockPullReqStatusFetcher) VerifyWasCalledOnce() *VerifierMockPullReqStatusFetcher { @@ -83,8 +83,8 @@ type VerifierMockPullReqStatusFetcher struct { } func (verifier *VerifierMockPullReqStatusFetcher) FetchPullStatus(logger logging.SimpleLogging, pull models.PullRequest) *MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification { - params := []pegomock.Param{logger, pull} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "FetchPullStatus", params, verifier.timeout) + _params := []pegomock.Param{logger, pull} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "FetchPullStatus", _params, verifier.timeout) return &MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -99,15 +99,19 @@ func (c *MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification) GetCaptur } func (c *MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.PullRequest) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]models.PullRequest, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(models.PullRequest) + if len(_params) > 1 { + _param1 = make([]models.PullRequest, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(models.PullRequest) + } } } return diff --git a/server/events/webhooks/mocks/mock_sender.go b/server/events/webhooks/mocks/mock_sender.go index 90b7a51b02..c60043fe65 100644 --- a/server/events/webhooks/mocks/mock_sender.go +++ b/server/events/webhooks/mocks/mock_sender.go @@ -30,15 +30,15 @@ func (mock *MockSender) Send(log logging.SimpleLogging, applyResult webhooks.App if mock == nil { panic("mock must not be nil. Use myMock := NewMockSender().") } - params := []pegomock.Param{log, applyResult} - result := pegomock.GetGenericMockFrom(mock).Invoke("Send", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{log, applyResult} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Send", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockSender) VerifyWasCalledOnce() *VerifierMockSender { @@ -79,8 +79,8 @@ type VerifierMockSender struct { } func (verifier *VerifierMockSender) Send(log logging.SimpleLogging, 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) + _params := []pegomock.Param{log, applyResult} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Send", _params, verifier.timeout) return &MockSender_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -95,15 +95,19 @@ func (c *MockSender_Send_OngoingVerification) GetCapturedArguments() (logging.Si } func (c *MockSender_Send_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []webhooks.ApplyResult) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.SimpleLogging) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.SimpleLogging, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.SimpleLogging) + } } - _param1 = make([]webhooks.ApplyResult, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(webhooks.ApplyResult) + if len(_params) > 1 { + _param1 = make([]webhooks.ApplyResult, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(webhooks.ApplyResult) + } } } return diff --git a/server/events/webhooks/mocks/mock_slack_client.go b/server/events/webhooks/mocks/mock_slack_client.go index 7c65efd49a..f763938fe4 100644 --- a/server/events/webhooks/mocks/mock_slack_client.go +++ b/server/events/webhooks/mocks/mock_slack_client.go @@ -29,45 +29,45 @@ func (mock *MockSlackClient) AuthTest() error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSlackClient().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("AuthTest", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("AuthTest", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockSlackClient) PostMessage(channel string, applyResult webhooks.ApplyResult) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSlackClient().") } - params := []pegomock.Param{channel, applyResult} - result := pegomock.GetGenericMockFrom(mock).Invoke("PostMessage", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{channel, applyResult} + _result := pegomock.GetGenericMockFrom(mock).Invoke("PostMessage", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockSlackClient) TokenIsSet() bool { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSlackClient().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("TokenIsSet", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) - var ret0 bool - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(bool) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("TokenIsSet", _params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) + var _ret0 bool + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(bool) } } - return ret0 + return _ret0 } func (mock *MockSlackClient) VerifyWasCalledOnce() *VerifierMockSlackClient { @@ -108,8 +108,8 @@ type VerifierMockSlackClient struct { } func (verifier *VerifierMockSlackClient) AuthTest() *MockSlackClient_AuthTest_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "AuthTest", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "AuthTest", _params, verifier.timeout) return &MockSlackClient_AuthTest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -125,8 +125,8 @@ func (c *MockSlackClient_AuthTest_OngoingVerification) GetAllCapturedArguments() } 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) + _params := []pegomock.Param{channel, applyResult} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PostMessage", _params, verifier.timeout) return &MockSlackClient_PostMessage_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -141,23 +141,27 @@ func (c *MockSlackClient_PostMessage_OngoingVerification) GetCapturedArguments() } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } - _param1 = make([]webhooks.ApplyResult, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(webhooks.ApplyResult) + if len(_params) > 1 { + _param1 = make([]webhooks.ApplyResult, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(webhooks.ApplyResult) + } } } return } func (verifier *VerifierMockSlackClient) TokenIsSet() *MockSlackClient_TokenIsSet_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TokenIsSet", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "TokenIsSet", _params, verifier.timeout) return &MockSlackClient_TokenIsSet_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } diff --git a/server/events/webhooks/mocks/mock_underlying_slack_client.go b/server/events/webhooks/mocks/mock_underlying_slack_client.go index 4d68cec665..4a4bcfbbe3 100644 --- a/server/events/webhooks/mocks/mock_underlying_slack_client.go +++ b/server/events/webhooks/mocks/mock_underlying_slack_client.go @@ -29,68 +29,68 @@ func (mock *MockUnderlyingSlackClient) AuthTest() (*slack.AuthTestResponse, erro if mock == nil { panic("mock must not be nil. Use myMock := NewMockUnderlyingSlackClient().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("AuthTest", params, []reflect.Type{reflect.TypeOf((**slack.AuthTestResponse)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 *slack.AuthTestResponse - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*slack.AuthTestResponse) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("AuthTest", _params, []reflect.Type{reflect.TypeOf((**slack.AuthTestResponse)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 *slack.AuthTestResponse + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(*slack.AuthTestResponse) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockUnderlyingSlackClient) GetConversations(conversationParams *slack.GetConversationsParameters) ([]slack.Channel, string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockUnderlyingSlackClient().") } - params := []pegomock.Param{conversationParams} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetConversations", params, []reflect.Type{reflect.TypeOf((*[]slack.Channel)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 []slack.Channel - var ret1 string - var ret2 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]slack.Channel) + _params := []pegomock.Param{conversationParams} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetConversations", _params, []reflect.Type{reflect.TypeOf((*[]slack.Channel)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 []slack.Channel + var _ret1 string + var _ret2 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]slack.Channel) } - if result[1] != nil { - ret1 = result[1].(string) + if _result[1] != nil { + _ret1 = _result[1].(string) } - if result[2] != nil { - ret2 = result[2].(error) + if _result[2] != nil { + _ret2 = _result[2].(error) } } - return ret0, ret1, ret2 + return _ret0, _ret1, _ret2 } func (mock *MockUnderlyingSlackClient) PostMessage(channelID string, options ...slack.MsgOption) (string, string, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockUnderlyingSlackClient().") } - params := []pegomock.Param{channelID} + _params := []pegomock.Param{channelID} for _, param := range options { - params = append(params, param) + _params = append(_params, param) } - result := pegomock.GetGenericMockFrom(mock).Invoke("PostMessage", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 string - var ret2 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _result := pegomock.GetGenericMockFrom(mock).Invoke("PostMessage", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 string + var _ret2 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(string) + if _result[1] != nil { + _ret1 = _result[1].(string) } - if result[2] != nil { - ret2 = result[2].(error) + if _result[2] != nil { + _ret2 = _result[2].(error) } } - return ret0, ret1, ret2 + return _ret0, _ret1, _ret2 } func (mock *MockUnderlyingSlackClient) VerifyWasCalledOnce() *VerifierMockUnderlyingSlackClient { @@ -131,8 +131,8 @@ type VerifierMockUnderlyingSlackClient struct { } func (verifier *VerifierMockUnderlyingSlackClient) AuthTest() *MockUnderlyingSlackClient_AuthTest_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "AuthTest", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "AuthTest", _params, verifier.timeout) return &MockUnderlyingSlackClient_AuthTest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -148,8 +148,8 @@ func (c *MockUnderlyingSlackClient_AuthTest_OngoingVerification) GetAllCapturedA } func (verifier *VerifierMockUnderlyingSlackClient) GetConversations(conversationParams *slack.GetConversationsParameters) *MockUnderlyingSlackClient_GetConversations_OngoingVerification { - params := []pegomock.Param{conversationParams} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetConversations", params, verifier.timeout) + _params := []pegomock.Param{conversationParams} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetConversations", _params, verifier.timeout) return &MockUnderlyingSlackClient_GetConversations_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -164,22 +164,24 @@ func (c *MockUnderlyingSlackClient_GetConversations_OngoingVerification) GetCapt } func (c *MockUnderlyingSlackClient_GetConversations_OngoingVerification) GetAllCapturedArguments() (_param0 []*slack.GetConversationsParameters) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]*slack.GetConversationsParameters, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(*slack.GetConversationsParameters) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]*slack.GetConversationsParameters, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(*slack.GetConversationsParameters) + } } } return } func (verifier *VerifierMockUnderlyingSlackClient) PostMessage(channelID string, options ...slack.MsgOption) *MockUnderlyingSlackClient_PostMessage_OngoingVerification { - params := []pegomock.Param{channelID} + _params := []pegomock.Param{channelID} for _, param := range options { - params = append(params, param) + _params = append(_params, param) } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PostMessage", params, verifier.timeout) + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PostMessage", _params, verifier.timeout) return &MockUnderlyingSlackClient_PostMessage_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -194,18 +196,20 @@ func (c *MockUnderlyingSlackClient_PostMessage_OngoingVerification) GetCapturedA } func (c *MockUnderlyingSlackClient_PostMessage_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 [][]slack.MsgOption) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } _param1 = make([][]slack.MsgOption, len(c.methodInvocations)) for u := 0; u < len(c.methodInvocations); u++ { - _param1[u] = make([]slack.MsgOption, len(params)-1) - for x := 1; x < len(params); x++ { - if params[x][u] != nil { - _param1[u][x-1] = params[x][u].(slack.MsgOption) + _param1[u] = make([]slack.MsgOption, len(_params)-1) + for x := 1; x < len(_params); x++ { + if _params[x][u] != nil { + _param1[u][x-1] = _params[x][u].(slack.MsgOption) } } } diff --git a/server/jobs/mocks/mock_project_command_output_handler.go b/server/jobs/mocks/mock_project_command_output_handler.go index 00d7ae8548..6367aed6ce 100644 --- a/server/jobs/mocks/mock_project_command_output_handler.go +++ b/server/jobs/mocks/mock_project_command_output_handler.go @@ -31,78 +31,78 @@ func (mock *MockProjectCommandOutputHandler) CleanUp(pullInfo jobs.PullInfo) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandOutputHandler().") } - params := []pegomock.Param{pullInfo} - pegomock.GetGenericMockFrom(mock).Invoke("CleanUp", params, []reflect.Type{}) + _params := []pegomock.Param{pullInfo} + pegomock.GetGenericMockFrom(mock).Invoke("CleanUp", _params, []reflect.Type{}) } func (mock *MockProjectCommandOutputHandler) Deregister(jobID string, receiver chan string) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandOutputHandler().") } - params := []pegomock.Param{jobID, receiver} - pegomock.GetGenericMockFrom(mock).Invoke("Deregister", params, []reflect.Type{}) + _params := []pegomock.Param{jobID, receiver} + pegomock.GetGenericMockFrom(mock).Invoke("Deregister", _params, []reflect.Type{}) } func (mock *MockProjectCommandOutputHandler) GetPullToJobMapping() []jobs.PullInfoWithJobIDs { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandOutputHandler().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullToJobMapping", params, []reflect.Type{reflect.TypeOf((*[]jobs.PullInfoWithJobIDs)(nil)).Elem()}) - var ret0 []jobs.PullInfoWithJobIDs - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].([]jobs.PullInfoWithJobIDs) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetPullToJobMapping", _params, []reflect.Type{reflect.TypeOf((*[]jobs.PullInfoWithJobIDs)(nil)).Elem()}) + var _ret0 []jobs.PullInfoWithJobIDs + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].([]jobs.PullInfoWithJobIDs) } } - return ret0 + return _ret0 } func (mock *MockProjectCommandOutputHandler) Handle() { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandOutputHandler().") } - params := []pegomock.Param{} - pegomock.GetGenericMockFrom(mock).Invoke("Handle", params, []reflect.Type{}) + _params := []pegomock.Param{} + pegomock.GetGenericMockFrom(mock).Invoke("Handle", _params, []reflect.Type{}) } func (mock *MockProjectCommandOutputHandler) IsKeyExists(key string) bool { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandOutputHandler().") } - params := []pegomock.Param{key} - result := pegomock.GetGenericMockFrom(mock).Invoke("IsKeyExists", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) - var ret0 bool - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(bool) + _params := []pegomock.Param{key} + _result := pegomock.GetGenericMockFrom(mock).Invoke("IsKeyExists", _params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()}) + var _ret0 bool + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(bool) } } - return ret0 + return _ret0 } func (mock *MockProjectCommandOutputHandler) Register(jobID string, receiver chan string) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandOutputHandler().") } - params := []pegomock.Param{jobID, receiver} - pegomock.GetGenericMockFrom(mock).Invoke("Register", params, []reflect.Type{}) + _params := []pegomock.Param{jobID, receiver} + pegomock.GetGenericMockFrom(mock).Invoke("Register", _params, []reflect.Type{}) } func (mock *MockProjectCommandOutputHandler) Send(ctx command.ProjectContext, msg string, operationComplete bool) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandOutputHandler().") } - params := []pegomock.Param{ctx, msg, operationComplete} - pegomock.GetGenericMockFrom(mock).Invoke("Send", params, []reflect.Type{}) + _params := []pegomock.Param{ctx, msg, operationComplete} + pegomock.GetGenericMockFrom(mock).Invoke("Send", _params, []reflect.Type{}) } func (mock *MockProjectCommandOutputHandler) SendWorkflowHook(ctx models.WorkflowHookCommandContext, msg string, operationComplete bool) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectCommandOutputHandler().") } - params := []pegomock.Param{ctx, msg, operationComplete} - pegomock.GetGenericMockFrom(mock).Invoke("SendWorkflowHook", params, []reflect.Type{}) + _params := []pegomock.Param{ctx, msg, operationComplete} + pegomock.GetGenericMockFrom(mock).Invoke("SendWorkflowHook", _params, []reflect.Type{}) } func (mock *MockProjectCommandOutputHandler) VerifyWasCalledOnce() *VerifierMockProjectCommandOutputHandler { @@ -143,8 +143,8 @@ type VerifierMockProjectCommandOutputHandler struct { } func (verifier *VerifierMockProjectCommandOutputHandler) CleanUp(pullInfo jobs.PullInfo) *MockProjectCommandOutputHandler_CleanUp_OngoingVerification { - params := []pegomock.Param{pullInfo} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CleanUp", params, verifier.timeout) + _params := []pegomock.Param{pullInfo} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CleanUp", _params, verifier.timeout) return &MockProjectCommandOutputHandler_CleanUp_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -159,19 +159,21 @@ func (c *MockProjectCommandOutputHandler_CleanUp_OngoingVerification) GetCapture } func (c *MockProjectCommandOutputHandler_CleanUp_OngoingVerification) GetAllCapturedArguments() (_param0 []jobs.PullInfo) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]jobs.PullInfo, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(jobs.PullInfo) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]jobs.PullInfo, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(jobs.PullInfo) + } } } return } func (verifier *VerifierMockProjectCommandOutputHandler) Deregister(jobID string, receiver chan string) *MockProjectCommandOutputHandler_Deregister_OngoingVerification { - params := []pegomock.Param{jobID, receiver} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Deregister", params, verifier.timeout) + _params := []pegomock.Param{jobID, receiver} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Deregister", _params, verifier.timeout) return &MockProjectCommandOutputHandler_Deregister_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -186,23 +188,27 @@ func (c *MockProjectCommandOutputHandler_Deregister_OngoingVerification) GetCapt } func (c *MockProjectCommandOutputHandler_Deregister_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []chan string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } - _param1 = make([]chan string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(chan string) + if len(_params) > 1 { + _param1 = make([]chan string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(chan string) + } } } return } func (verifier *VerifierMockProjectCommandOutputHandler) GetPullToJobMapping() *MockProjectCommandOutputHandler_GetPullToJobMapping_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullToJobMapping", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetPullToJobMapping", _params, verifier.timeout) return &MockProjectCommandOutputHandler_GetPullToJobMapping_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -218,8 +224,8 @@ func (c *MockProjectCommandOutputHandler_GetPullToJobMapping_OngoingVerification } func (verifier *VerifierMockProjectCommandOutputHandler) Handle() *MockProjectCommandOutputHandler_Handle_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Handle", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Handle", _params, verifier.timeout) return &MockProjectCommandOutputHandler_Handle_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -235,8 +241,8 @@ func (c *MockProjectCommandOutputHandler_Handle_OngoingVerification) GetAllCaptu } func (verifier *VerifierMockProjectCommandOutputHandler) IsKeyExists(key string) *MockProjectCommandOutputHandler_IsKeyExists_OngoingVerification { - params := []pegomock.Param{key} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "IsKeyExists", params, verifier.timeout) + _params := []pegomock.Param{key} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "IsKeyExists", _params, verifier.timeout) return &MockProjectCommandOutputHandler_IsKeyExists_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -251,19 +257,21 @@ func (c *MockProjectCommandOutputHandler_IsKeyExists_OngoingVerification) GetCap } func (c *MockProjectCommandOutputHandler_IsKeyExists_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } } return } func (verifier *VerifierMockProjectCommandOutputHandler) Register(jobID string, receiver chan string) *MockProjectCommandOutputHandler_Register_OngoingVerification { - params := []pegomock.Param{jobID, receiver} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Register", params, verifier.timeout) + _params := []pegomock.Param{jobID, receiver} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Register", _params, verifier.timeout) return &MockProjectCommandOutputHandler_Register_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -278,23 +286,27 @@ func (c *MockProjectCommandOutputHandler_Register_OngoingVerification) GetCaptur } func (c *MockProjectCommandOutputHandler_Register_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []chan string) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]string, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } - _param1 = make([]chan string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(chan string) + if len(_params) > 1 { + _param1 = make([]chan string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(chan string) + } } } return } func (verifier *VerifierMockProjectCommandOutputHandler) Send(ctx command.ProjectContext, msg string, operationComplete bool) *MockProjectCommandOutputHandler_Send_OngoingVerification { - params := []pegomock.Param{ctx, msg, operationComplete} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Send", params, verifier.timeout) + _params := []pegomock.Param{ctx, msg, operationComplete} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Send", _params, verifier.timeout) return &MockProjectCommandOutputHandler_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -309,27 +321,33 @@ func (c *MockProjectCommandOutputHandler_Send_OngoingVerification) GetCapturedAr } func (c *MockProjectCommandOutputHandler_Send_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []string, _param2 []bool) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } - _param2 = make([]bool, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(bool) + if len(_params) > 2 { + _param2 = make([]bool, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(bool) + } } } return } func (verifier *VerifierMockProjectCommandOutputHandler) SendWorkflowHook(ctx models.WorkflowHookCommandContext, msg string, operationComplete bool) *MockProjectCommandOutputHandler_SendWorkflowHook_OngoingVerification { - params := []pegomock.Param{ctx, msg, operationComplete} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SendWorkflowHook", params, verifier.timeout) + _params := []pegomock.Param{ctx, msg, operationComplete} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SendWorkflowHook", _params, verifier.timeout) return &MockProjectCommandOutputHandler_SendWorkflowHook_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -344,19 +362,25 @@ func (c *MockProjectCommandOutputHandler_SendWorkflowHook_OngoingVerification) G } func (c *MockProjectCommandOutputHandler_SendWorkflowHook_OngoingVerification) GetAllCapturedArguments() (_param0 []models.WorkflowHookCommandContext, _param1 []string, _param2 []bool) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]models.WorkflowHookCommandContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(models.WorkflowHookCommandContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]models.WorkflowHookCommandContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(models.WorkflowHookCommandContext) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } - _param2 = make([]bool, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(bool) + if len(_params) > 2 { + _param2 = make([]bool, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(bool) + } } } return diff --git a/server/jobs/mocks/mock_project_job_url_generator.go b/server/jobs/mocks/mock_project_job_url_generator.go index 5f37982af5..8de1122910 100644 --- a/server/jobs/mocks/mock_project_job_url_generator.go +++ b/server/jobs/mocks/mock_project_job_url_generator.go @@ -29,19 +29,19 @@ func (mock *MockProjectJobURLGenerator) GenerateProjectJobURL(p command.ProjectC if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectJobURLGenerator().") } - params := []pegomock.Param{p} - result := pegomock.GetGenericMockFrom(mock).Invoke("GenerateProjectJobURL", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 string - var ret1 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{p} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GenerateProjectJobURL", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 string + var _ret1 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } - if result[1] != nil { - ret1 = result[1].(error) + if _result[1] != nil { + _ret1 = _result[1].(error) } } - return ret0, ret1 + return _ret0, _ret1 } func (mock *MockProjectJobURLGenerator) VerifyWasCalledOnce() *VerifierMockProjectJobURLGenerator { @@ -82,8 +82,8 @@ type VerifierMockProjectJobURLGenerator struct { } func (verifier *VerifierMockProjectJobURLGenerator) GenerateProjectJobURL(p command.ProjectContext) *MockProjectJobURLGenerator_GenerateProjectJobURL_OngoingVerification { - params := []pegomock.Param{p} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GenerateProjectJobURL", params, verifier.timeout) + _params := []pegomock.Param{p} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GenerateProjectJobURL", _params, verifier.timeout) return &MockProjectJobURLGenerator_GenerateProjectJobURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -98,11 +98,13 @@ func (c *MockProjectJobURLGenerator_GenerateProjectJobURL_OngoingVerification) G } func (c *MockProjectJobURLGenerator_GenerateProjectJobURL_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } } return diff --git a/server/jobs/mocks/mock_project_status_updater.go b/server/jobs/mocks/mock_project_status_updater.go index 9f0a18f037..e28a64ee89 100644 --- a/server/jobs/mocks/mock_project_status_updater.go +++ b/server/jobs/mocks/mock_project_status_updater.go @@ -30,15 +30,15 @@ func (mock *MockProjectStatusUpdater) UpdateProject(ctx command.ProjectContext, if mock == nil { panic("mock must not be nil. Use myMock := NewMockProjectStatusUpdater().") } - params := []pegomock.Param{ctx, cmdName, status, url, res} - result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateProject", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{ctx, cmdName, status, url, res} + _result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateProject", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockProjectStatusUpdater) VerifyWasCalledOnce() *VerifierMockProjectStatusUpdater { @@ -79,8 +79,8 @@ type VerifierMockProjectStatusUpdater struct { } func (verifier *VerifierMockProjectStatusUpdater) UpdateProject(ctx command.ProjectContext, cmdName command.Name, status models.CommitStatus, url string, res *command.ProjectResult) *MockProjectStatusUpdater_UpdateProject_OngoingVerification { - params := []pegomock.Param{ctx, cmdName, status, url, res} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateProject", params, verifier.timeout) + _params := []pegomock.Param{ctx, cmdName, status, url, res} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateProject", _params, verifier.timeout) return &MockProjectStatusUpdater_UpdateProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -95,27 +95,37 @@ func (c *MockProjectStatusUpdater_UpdateProject_OngoingVerification) GetCaptured } func (c *MockProjectStatusUpdater_UpdateProject_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext, _param1 []command.Name, _param2 []models.CommitStatus, _param3 []string, _param4 []*command.ProjectResult) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]command.ProjectContext, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(command.ProjectContext) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]command.ProjectContext, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(command.ProjectContext) + } } - _param1 = make([]command.Name, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(command.Name) + if len(_params) > 1 { + _param1 = make([]command.Name, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(command.Name) + } } - _param2 = make([]models.CommitStatus, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(models.CommitStatus) + if len(_params) > 2 { + _param2 = make([]models.CommitStatus, len(c.methodInvocations)) + for u, param := range _params[2] { + _param2[u] = param.(models.CommitStatus) + } } - _param3 = make([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) + if len(_params) > 3 { + _param3 = make([]string, len(c.methodInvocations)) + for u, param := range _params[3] { + _param3[u] = param.(string) + } } - _param4 = make([]*command.ProjectResult, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(*command.ProjectResult) + if len(_params) > 4 { + _param4 = make([]*command.ProjectResult, len(c.methodInvocations)) + for u, param := range _params[4] { + _param4[u] = param.(*command.ProjectResult) + } } } return diff --git a/server/logging/mocks/mock_simple_logging.go b/server/logging/mocks/mock_simple_logging.go index 2afa845c4a..165fd99a37 100644 --- a/server/logging/mocks/mock_simple_logging.go +++ b/server/logging/mocks/mock_simple_logging.go @@ -29,129 +29,129 @@ func (mock *MockSimpleLogging) Debug(format string, a ...interface{}) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") } - params := []pegomock.Param{format} + _params := []pegomock.Param{format} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - pegomock.GetGenericMockFrom(mock).Invoke("Debug", params, []reflect.Type{}) + pegomock.GetGenericMockFrom(mock).Invoke("Debug", _params, []reflect.Type{}) } func (mock *MockSimpleLogging) Err(format string, a ...interface{}) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") } - params := []pegomock.Param{format} + _params := []pegomock.Param{format} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - pegomock.GetGenericMockFrom(mock).Invoke("Err", params, []reflect.Type{}) + pegomock.GetGenericMockFrom(mock).Invoke("Err", _params, []reflect.Type{}) } func (mock *MockSimpleLogging) Flush() error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("Flush", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) - var ret0 error - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(error) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("Flush", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) + var _ret0 error + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(error) } } - return ret0 + return _ret0 } func (mock *MockSimpleLogging) GetHistory() string { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") } - params := []pegomock.Param{} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetHistory", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem()}) - var ret0 string - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(string) + _params := []pegomock.Param{} + _result := pegomock.GetGenericMockFrom(mock).Invoke("GetHistory", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem()}) + var _ret0 string + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(string) } } - return ret0 + return _ret0 } func (mock *MockSimpleLogging) Info(format string, a ...interface{}) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") } - params := []pegomock.Param{format} + _params := []pegomock.Param{format} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - pegomock.GetGenericMockFrom(mock).Invoke("Info", params, []reflect.Type{}) + pegomock.GetGenericMockFrom(mock).Invoke("Info", _params, []reflect.Type{}) } func (mock *MockSimpleLogging) Log(level logging.LogLevel, format string, a ...interface{}) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") } - params := []pegomock.Param{level, format} + _params := []pegomock.Param{level, format} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - pegomock.GetGenericMockFrom(mock).Invoke("Log", params, []reflect.Type{}) + pegomock.GetGenericMockFrom(mock).Invoke("Log", _params, []reflect.Type{}) } func (mock *MockSimpleLogging) SetLevel(lvl logging.LogLevel) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") } - params := []pegomock.Param{lvl} - pegomock.GetGenericMockFrom(mock).Invoke("SetLevel", params, []reflect.Type{}) + _params := []pegomock.Param{lvl} + pegomock.GetGenericMockFrom(mock).Invoke("SetLevel", _params, []reflect.Type{}) } func (mock *MockSimpleLogging) Warn(format string, a ...interface{}) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") } - params := []pegomock.Param{format} + _params := []pegomock.Param{format} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - pegomock.GetGenericMockFrom(mock).Invoke("Warn", params, []reflect.Type{}) + pegomock.GetGenericMockFrom(mock).Invoke("Warn", _params, []reflect.Type{}) } func (mock *MockSimpleLogging) With(a ...interface{}) logging.SimpleLogging { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") } - params := []pegomock.Param{} + _params := []pegomock.Param{} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - result := pegomock.GetGenericMockFrom(mock).Invoke("With", params, []reflect.Type{reflect.TypeOf((*logging.SimpleLogging)(nil)).Elem()}) - var ret0 logging.SimpleLogging - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(logging.SimpleLogging) + _result := pegomock.GetGenericMockFrom(mock).Invoke("With", _params, []reflect.Type{reflect.TypeOf((*logging.SimpleLogging)(nil)).Elem()}) + var _ret0 logging.SimpleLogging + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(logging.SimpleLogging) } } - return ret0 + return _ret0 } func (mock *MockSimpleLogging) WithHistory(a ...interface{}) logging.SimpleLogging { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") } - params := []pegomock.Param{} + _params := []pegomock.Param{} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - result := pegomock.GetGenericMockFrom(mock).Invoke("WithHistory", params, []reflect.Type{reflect.TypeOf((*logging.SimpleLogging)(nil)).Elem()}) - var ret0 logging.SimpleLogging - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(logging.SimpleLogging) + _result := pegomock.GetGenericMockFrom(mock).Invoke("WithHistory", _params, []reflect.Type{reflect.TypeOf((*logging.SimpleLogging)(nil)).Elem()}) + var _ret0 logging.SimpleLogging + if len(_result) != 0 { + if _result[0] != nil { + _ret0 = _result[0].(logging.SimpleLogging) } } - return ret0 + return _ret0 } func (mock *MockSimpleLogging) VerifyWasCalledOnce() *VerifierMockSimpleLogging { @@ -192,11 +192,11 @@ type VerifierMockSimpleLogging struct { } func (verifier *VerifierMockSimpleLogging) Debug(format string, a ...interface{}) *MockSimpleLogging_Debug_OngoingVerification { - params := []pegomock.Param{format} + _params := []pegomock.Param{format} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Debug", params, verifier.timeout) + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Debug", _params, verifier.timeout) return &MockSimpleLogging_Debug_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -211,18 +211,20 @@ func (c *MockSimpleLogging_Debug_OngoingVerification) GetCapturedArguments() (st } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } _param1 = make([][]interface{}, len(c.methodInvocations)) for u := 0; u < len(c.methodInvocations); u++ { - _param1[u] = make([]interface{}, len(params)-1) - for x := 1; x < len(params); x++ { - if params[x][u] != nil { - _param1[u][x-1] = params[x][u].(interface{}) + _param1[u] = make([]interface{}, len(_params)-1) + for x := 1; x < len(_params); x++ { + if _params[x][u] != nil { + _param1[u][x-1] = _params[x][u].(interface{}) } } } @@ -231,11 +233,11 @@ func (c *MockSimpleLogging_Debug_OngoingVerification) GetAllCapturedArguments() } func (verifier *VerifierMockSimpleLogging) Err(format string, a ...interface{}) *MockSimpleLogging_Err_OngoingVerification { - params := []pegomock.Param{format} + _params := []pegomock.Param{format} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Err", params, verifier.timeout) + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Err", _params, verifier.timeout) return &MockSimpleLogging_Err_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -250,18 +252,20 @@ func (c *MockSimpleLogging_Err_OngoingVerification) GetCapturedArguments() (stri } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } _param1 = make([][]interface{}, len(c.methodInvocations)) for u := 0; u < len(c.methodInvocations); u++ { - _param1[u] = make([]interface{}, len(params)-1) - for x := 1; x < len(params); x++ { - if params[x][u] != nil { - _param1[u][x-1] = params[x][u].(interface{}) + _param1[u] = make([]interface{}, len(_params)-1) + for x := 1; x < len(_params); x++ { + if _params[x][u] != nil { + _param1[u][x-1] = _params[x][u].(interface{}) } } } @@ -270,8 +274,8 @@ func (c *MockSimpleLogging_Err_OngoingVerification) GetAllCapturedArguments() (_ } func (verifier *VerifierMockSimpleLogging) Flush() *MockSimpleLogging_Flush_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Flush", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Flush", _params, verifier.timeout) return &MockSimpleLogging_Flush_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -287,8 +291,8 @@ func (c *MockSimpleLogging_Flush_OngoingVerification) GetAllCapturedArguments() } func (verifier *VerifierMockSimpleLogging) GetHistory() *MockSimpleLogging_GetHistory_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetHistory", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetHistory", _params, verifier.timeout) return &MockSimpleLogging_GetHistory_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -304,11 +308,11 @@ func (c *MockSimpleLogging_GetHistory_OngoingVerification) GetAllCapturedArgumen } func (verifier *VerifierMockSimpleLogging) Info(format string, a ...interface{}) *MockSimpleLogging_Info_OngoingVerification { - params := []pegomock.Param{format} + _params := []pegomock.Param{format} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Info", params, verifier.timeout) + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Info", _params, verifier.timeout) return &MockSimpleLogging_Info_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -323,18 +327,20 @@ func (c *MockSimpleLogging_Info_OngoingVerification) GetCapturedArguments() (str } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } _param1 = make([][]interface{}, len(c.methodInvocations)) for u := 0; u < len(c.methodInvocations); u++ { - _param1[u] = make([]interface{}, len(params)-1) - for x := 1; x < len(params); x++ { - if params[x][u] != nil { - _param1[u][x-1] = params[x][u].(interface{}) + _param1[u] = make([]interface{}, len(_params)-1) + for x := 1; x < len(_params); x++ { + if _params[x][u] != nil { + _param1[u][x-1] = _params[x][u].(interface{}) } } } @@ -343,11 +349,11 @@ func (c *MockSimpleLogging_Info_OngoingVerification) GetAllCapturedArguments() ( } func (verifier *VerifierMockSimpleLogging) Log(level logging.LogLevel, format string, a ...interface{}) *MockSimpleLogging_Log_OngoingVerification { - params := []pegomock.Param{level, format} + _params := []pegomock.Param{level, format} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Log", params, verifier.timeout) + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Log", _params, verifier.timeout) return &MockSimpleLogging_Log_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -362,22 +368,26 @@ func (c *MockSimpleLogging_Log_OngoingVerification) GetCapturedArguments() (logg } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.LogLevel) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.LogLevel, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.LogLevel) + } } - _param1 = make([]string, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(string) + if len(_params) > 1 { + _param1 = make([]string, len(c.methodInvocations)) + for u, param := range _params[1] { + _param1[u] = param.(string) + } } _param2 = make([][]interface{}, len(c.methodInvocations)) for u := 0; u < len(c.methodInvocations); u++ { - _param2[u] = make([]interface{}, len(params)-2) - for x := 2; x < len(params); x++ { - if params[x][u] != nil { - _param2[u][x-2] = params[x][u].(interface{}) + _param2[u] = make([]interface{}, len(_params)-2) + for x := 2; x < len(_params); x++ { + if _params[x][u] != nil { + _param2[u][x-2] = _params[x][u].(interface{}) } } } @@ -386,8 +396,8 @@ func (c *MockSimpleLogging_Log_OngoingVerification) GetAllCapturedArguments() (_ } func (verifier *VerifierMockSimpleLogging) SetLevel(lvl logging.LogLevel) *MockSimpleLogging_SetLevel_OngoingVerification { - params := []pegomock.Param{lvl} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SetLevel", params, verifier.timeout) + _params := []pegomock.Param{lvl} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "SetLevel", _params, verifier.timeout) return &MockSimpleLogging_SetLevel_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -402,22 +412,24 @@ func (c *MockSimpleLogging_SetLevel_OngoingVerification) GetCapturedArguments() } func (c *MockSimpleLogging_SetLevel_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.LogLevel) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { - _param0 = make([]logging.LogLevel, len(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(logging.LogLevel) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]logging.LogLevel, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(logging.LogLevel) + } } } return } func (verifier *VerifierMockSimpleLogging) Warn(format string, a ...interface{}) *MockSimpleLogging_Warn_OngoingVerification { - params := []pegomock.Param{format} + _params := []pegomock.Param{format} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Warn", params, verifier.timeout) + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Warn", _params, verifier.timeout) return &MockSimpleLogging_Warn_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -432,18 +444,20 @@ func (c *MockSimpleLogging_Warn_OngoingVerification) GetCapturedArguments() (str } 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(c.methodInvocations)) - for u, param := range params[0] { - _param0[u] = param.(string) + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { + if len(_params) > 0 { + _param0 = make([]string, len(c.methodInvocations)) + for u, param := range _params[0] { + _param0[u] = param.(string) + } } _param1 = make([][]interface{}, len(c.methodInvocations)) for u := 0; u < len(c.methodInvocations); u++ { - _param1[u] = make([]interface{}, len(params)-1) - for x := 1; x < len(params); x++ { - if params[x][u] != nil { - _param1[u][x-1] = params[x][u].(interface{}) + _param1[u] = make([]interface{}, len(_params)-1) + for x := 1; x < len(_params); x++ { + if _params[x][u] != nil { + _param1[u][x-1] = _params[x][u].(interface{}) } } } @@ -452,11 +466,11 @@ func (c *MockSimpleLogging_Warn_OngoingVerification) GetAllCapturedArguments() ( } func (verifier *VerifierMockSimpleLogging) With(a ...interface{}) *MockSimpleLogging_With_OngoingVerification { - params := []pegomock.Param{} + _params := []pegomock.Param{} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "With", params, verifier.timeout) + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "With", _params, verifier.timeout) return &MockSimpleLogging_With_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -471,14 +485,14 @@ func (c *MockSimpleLogging_With_OngoingVerification) GetCapturedArguments() []in } func (c *MockSimpleLogging_With_OngoingVerification) GetAllCapturedArguments() (_param0 [][]interface{}) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { _param0 = make([][]interface{}, len(c.methodInvocations)) for u := 0; u < len(c.methodInvocations); u++ { - _param0[u] = make([]interface{}, len(params)-0) - for x := 0; x < len(params); x++ { - if params[x][u] != nil { - _param0[u][x-0] = params[x][u].(interface{}) + _param0[u] = make([]interface{}, len(_params)-0) + for x := 0; x < len(_params); x++ { + if _params[x][u] != nil { + _param0[u][x-0] = _params[x][u].(interface{}) } } } @@ -487,11 +501,11 @@ func (c *MockSimpleLogging_With_OngoingVerification) GetAllCapturedArguments() ( } func (verifier *VerifierMockSimpleLogging) WithHistory(a ...interface{}) *MockSimpleLogging_WithHistory_OngoingVerification { - params := []pegomock.Param{} + _params := []pegomock.Param{} for _, param := range a { - params = append(params, param) + _params = append(_params, param) } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "WithHistory", params, verifier.timeout) + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "WithHistory", _params, verifier.timeout) return &MockSimpleLogging_WithHistory_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } @@ -506,14 +520,14 @@ func (c *MockSimpleLogging_WithHistory_OngoingVerification) GetCapturedArguments } func (c *MockSimpleLogging_WithHistory_OngoingVerification) GetAllCapturedArguments() (_param0 [][]interface{}) { - params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) - if len(params) > 0 { + _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) + if len(_params) > 0 { _param0 = make([][]interface{}, len(c.methodInvocations)) for u := 0; u < len(c.methodInvocations); u++ { - _param0[u] = make([]interface{}, len(params)-0) - for x := 0; x < len(params); x++ { - if params[x][u] != nil { - _param0[u][x-0] = params[x][u].(interface{}) + _param0[u] = make([]interface{}, len(_params)-0) + for x := 0; x < len(_params); x++ { + if _params[x][u] != nil { + _param0[u][x-0] = _params[x][u].(interface{}) } } } diff --git a/server/scheduled/mocks/mock_executor_service_job.go b/server/scheduled/mocks/mock_executor_service_job.go index 404e91440d..4bfaf2f666 100644 --- a/server/scheduled/mocks/mock_executor_service_job.go +++ b/server/scheduled/mocks/mock_executor_service_job.go @@ -28,8 +28,8 @@ func (mock *MockJob) Run() { if mock == nil { panic("mock must not be nil. Use myMock := NewMockJob().") } - params := []pegomock.Param{} - pegomock.GetGenericMockFrom(mock).Invoke("Run", params, []reflect.Type{}) + _params := []pegomock.Param{} + pegomock.GetGenericMockFrom(mock).Invoke("Run", _params, []reflect.Type{}) } func (mock *MockJob) VerifyWasCalledOnce() *VerifierMockJob { @@ -70,8 +70,8 @@ type VerifierMockJob struct { } func (verifier *VerifierMockJob) Run() *MockJob_Run_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", params, verifier.timeout) + _params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Run", _params, verifier.timeout) return &MockJob_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} }