From f187591ffd2fe55c7305b642d0c72f2baad9a6c5 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 18 Jun 2024 23:43:35 -0400 Subject: [PATCH 1/6] remove all generated mocks Signed-off-by: Rui Chen --- .../mock_azuredevops_request_validator.go | 117 -- .../mocks/mock_github_request_validator.go | 113 -- .../mock_gitlab_request_parser_validator.go | 113 -- .../mocks/mock_template_writer.go | 109 -- .../locking/mocks/mock_apply_lock_checker.go | 99 -- .../core/locking/mocks/mock_apply_locker.go | 167 --- server/core/locking/mocks/mock_backend.go | 630 --------- server/core/locking/mocks/mock_locker.go | 300 ---- .../cache/mocks/mock_key_serializer.go | 109 -- .../runtime/cache/mocks/mock_version_path.go | 109 -- .../core/runtime/mocks/mock_async_tfexec.go | 139 -- .../mocks/mock_post_workflows_hook_runner.go | 129 -- .../mocks/mock_pre_workflows_hook_runner.go | 129 -- .../mocks/mock_pull_approved_checker.go | 118 -- server/core/runtime/mocks/mock_runner.go | 121 -- .../core/runtime/mocks/mock_status_updater.go | 122 -- .../mocks/mock_versionedexecutorworkflow.go | 177 --- server/core/runtime/models/mocks/mock_exec.go | 162 --- .../runtime/models/mocks/mock_filepath.go | 226 --- .../policy/mocks/mock_conftest_client.go | 109 -- .../core/terraform/mocks/mock_downloader.go | 163 --- .../terraform/mocks/mock_terraform_client.go | 223 --- .../mocks/mock_azuredevops_pull_getter.go | 119 -- .../mocks/mock_command_requirement_handler.go | 259 ---- server/events/mocks/mock_command_runner.go | 166 --- server/events/mocks/mock_comment_building.go | 220 --- server/events/mocks/mock_comment_parsing.go | 110 -- .../mocks/mock_commit_status_updater.go | 313 ----- .../events/mocks/mock_custom_step_runner.go | 130 -- .../events/mocks/mock_delete_lock_command.go | 168 --- server/events/mocks/mock_env_step_runner.go | 125 -- server/events/mocks/mock_event_parsing.go | 1223 ----------------- .../events/mocks/mock_github_pull_getter.go | 119 -- .../mocks/mock_gitlab_merge_request_getter.go | 118 -- .../events/mocks/mock_job_message_sender.go | 106 -- server/events/mocks/mock_job_url_setter.go | 118 -- .../events/mocks/mock_lock_url_generator.go | 104 -- .../events/mocks/mock_pending_plan_finder.go | 151 -- .../mock_post_workflow_hook_url_generator.go | 108 -- ...ock_post_workflows_hooks_command_runner.go | 112 -- .../mock_pre_workflow_hook_url_generator.go | 108 -- ...mock_pre_workflows_hooks_command_runner.go | 112 -- .../mocks/mock_project_command_builder.go | 410 ------ .../mocks/mock_project_command_runner.go | 357 ----- server/events/mocks/mock_project_lock.go | 131 -- server/events/mocks/mock_pull_cleaner.go | 114 -- server/events/mocks/mock_resource_cleaner.go | 98 -- server/events/mocks/mock_step_runner.go | 121 -- server/events/mocks/mock_webhooks_sender.go | 110 -- server/events/mocks/mock_working_dir.go | 525 ------- .../events/mocks/mock_working_dir_locker.go | 170 --- server/events/vcs/mocks/mock_client.go | 870 ------------ .../vcs/mocks/mock_github_credentials.go | 171 --- .../mocks/mock_github_pull_request_getter.go | 119 -- .../vcs/mocks/mock_pull_req_status_fetcher.go | 114 -- server/events/webhooks/mocks/mock_sender.go | 110 -- .../webhooks/mocks/mock_slack_client.go | 173 --- .../mocks/mock_underlying_slack_client.go | 214 --- .../mock_project_command_output_handler.go | 363 ----- .../mocks/mock_project_job_url_generator.go | 109 -- .../jobs/mocks/mock_project_status_updater.go | 122 -- server/logging/mocks/mock_simple_logging.go | 522 ------- .../mocks/mock_executor_service_job.go | 87 -- 63 files changed, 12683 deletions(-) delete mode 100644 server/controllers/events/mocks/mock_azuredevops_request_validator.go delete mode 100644 server/controllers/events/mocks/mock_github_request_validator.go delete mode 100644 server/controllers/events/mocks/mock_gitlab_request_parser_validator.go delete mode 100644 server/controllers/web_templates/mocks/mock_template_writer.go delete mode 100644 server/core/locking/mocks/mock_apply_lock_checker.go delete mode 100644 server/core/locking/mocks/mock_apply_locker.go delete mode 100644 server/core/locking/mocks/mock_backend.go delete mode 100644 server/core/locking/mocks/mock_locker.go delete mode 100644 server/core/runtime/cache/mocks/mock_key_serializer.go delete mode 100644 server/core/runtime/cache/mocks/mock_version_path.go delete mode 100644 server/core/runtime/mocks/mock_async_tfexec.go delete mode 100644 server/core/runtime/mocks/mock_post_workflows_hook_runner.go delete mode 100644 server/core/runtime/mocks/mock_pre_workflows_hook_runner.go delete mode 100644 server/core/runtime/mocks/mock_pull_approved_checker.go delete mode 100644 server/core/runtime/mocks/mock_runner.go delete mode 100644 server/core/runtime/mocks/mock_status_updater.go delete mode 100644 server/core/runtime/mocks/mock_versionedexecutorworkflow.go delete mode 100644 server/core/runtime/models/mocks/mock_exec.go delete mode 100644 server/core/runtime/models/mocks/mock_filepath.go delete mode 100644 server/core/runtime/policy/mocks/mock_conftest_client.go delete mode 100644 server/core/terraform/mocks/mock_downloader.go delete mode 100644 server/core/terraform/mocks/mock_terraform_client.go delete mode 100644 server/events/mocks/mock_azuredevops_pull_getter.go delete mode 100644 server/events/mocks/mock_command_requirement_handler.go delete mode 100644 server/events/mocks/mock_command_runner.go delete mode 100644 server/events/mocks/mock_comment_building.go delete mode 100644 server/events/mocks/mock_comment_parsing.go delete mode 100644 server/events/mocks/mock_commit_status_updater.go delete mode 100644 server/events/mocks/mock_custom_step_runner.go delete mode 100644 server/events/mocks/mock_delete_lock_command.go delete mode 100644 server/events/mocks/mock_env_step_runner.go delete mode 100644 server/events/mocks/mock_event_parsing.go delete mode 100644 server/events/mocks/mock_github_pull_getter.go delete mode 100644 server/events/mocks/mock_gitlab_merge_request_getter.go delete mode 100644 server/events/mocks/mock_job_message_sender.go delete mode 100644 server/events/mocks/mock_job_url_setter.go delete mode 100644 server/events/mocks/mock_lock_url_generator.go delete mode 100644 server/events/mocks/mock_pending_plan_finder.go delete mode 100644 server/events/mocks/mock_post_workflow_hook_url_generator.go delete mode 100644 server/events/mocks/mock_post_workflows_hooks_command_runner.go delete mode 100644 server/events/mocks/mock_pre_workflow_hook_url_generator.go delete mode 100644 server/events/mocks/mock_pre_workflows_hooks_command_runner.go delete mode 100644 server/events/mocks/mock_project_command_builder.go delete mode 100644 server/events/mocks/mock_project_command_runner.go delete mode 100644 server/events/mocks/mock_project_lock.go delete mode 100644 server/events/mocks/mock_pull_cleaner.go delete mode 100644 server/events/mocks/mock_resource_cleaner.go delete mode 100644 server/events/mocks/mock_step_runner.go delete mode 100644 server/events/mocks/mock_webhooks_sender.go delete mode 100644 server/events/mocks/mock_working_dir.go delete mode 100644 server/events/mocks/mock_working_dir_locker.go delete mode 100644 server/events/vcs/mocks/mock_client.go delete mode 100644 server/events/vcs/mocks/mock_github_credentials.go delete mode 100644 server/events/vcs/mocks/mock_github_pull_request_getter.go delete mode 100644 server/events/vcs/mocks/mock_pull_req_status_fetcher.go delete mode 100644 server/events/webhooks/mocks/mock_sender.go delete mode 100644 server/events/webhooks/mocks/mock_slack_client.go delete mode 100644 server/events/webhooks/mocks/mock_underlying_slack_client.go delete mode 100644 server/jobs/mocks/mock_project_command_output_handler.go delete mode 100644 server/jobs/mocks/mock_project_job_url_generator.go delete mode 100644 server/jobs/mocks/mock_project_status_updater.go delete mode 100644 server/logging/mocks/mock_simple_logging.go delete mode 100644 server/scheduled/mocks/mock_executor_service_job.go diff --git a/server/controllers/events/mocks/mock_azuredevops_request_validator.go b/server/controllers/events/mocks/mock_azuredevops_request_validator.go deleted file mode 100644 index 3f10953352..0000000000 --- a/server/controllers/events/mocks/mock_azuredevops_request_validator.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/controllers/events (interfaces: AzureDevopsRequestValidator) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - http "net/http" - "reflect" - "time" -) - -type MockAzureDevopsRequestValidator struct { - fail func(message string, callerSkip ...int) -} - -func NewMockAzureDevopsRequestValidator(options ...pegomock.Option) *MockAzureDevopsRequestValidator { - mock := &MockAzureDevopsRequestValidator{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockAzureDevopsRequestValidator) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockAzureDevopsRequestValidator) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockAzureDevopsRequestValidator) Validate(r *http.Request, user []byte, pass []byte) ([]byte, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockAzureDevopsRequestValidator) VerifyWasCalledOnce() *VerifierMockAzureDevopsRequestValidator { - return &VerifierMockAzureDevopsRequestValidator{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockAzureDevopsRequestValidator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockAzureDevopsRequestValidator { - return &VerifierMockAzureDevopsRequestValidator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockAzureDevopsRequestValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockAzureDevopsRequestValidator { - return &VerifierMockAzureDevopsRequestValidator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockAzureDevopsRequestValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockAzureDevopsRequestValidator { - return &VerifierMockAzureDevopsRequestValidator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockAzureDevopsRequestValidator struct { - mock *MockAzureDevopsRequestValidator - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockAzureDevopsRequestValidator_Validate_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockAzureDevopsRequestValidator_Validate_OngoingVerification struct { - mock *MockAzureDevopsRequestValidator - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockAzureDevopsRequestValidator_Validate_OngoingVerification) GetCapturedArguments() (*http.Request, []byte, []byte) { - r, user, pass := c.GetAllCapturedArguments() - return r[len(r)-1], user[len(user)-1], pass[len(pass)-1] -} - -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) - } - _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) - } - } - return -} diff --git a/server/controllers/events/mocks/mock_github_request_validator.go b/server/controllers/events/mocks/mock_github_request_validator.go deleted file mode 100644 index d3f0d0d21e..0000000000 --- a/server/controllers/events/mocks/mock_github_request_validator.go +++ /dev/null @@ -1,113 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/controllers/events (interfaces: GithubRequestValidator) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - http "net/http" - "reflect" - "time" -) - -type MockGithubRequestValidator struct { - fail func(message string, callerSkip ...int) -} - -func NewMockGithubRequestValidator(options ...pegomock.Option) *MockGithubRequestValidator { - mock := &MockGithubRequestValidator{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockGithubRequestValidator) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockGithubRequestValidator) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockGithubRequestValidator) Validate(r *http.Request, secret []byte) ([]byte, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockGithubRequestValidator) VerifyWasCalledOnce() *VerifierMockGithubRequestValidator { - return &VerifierMockGithubRequestValidator{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockGithubRequestValidator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockGithubRequestValidator { - return &VerifierMockGithubRequestValidator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockGithubRequestValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGithubRequestValidator { - return &VerifierMockGithubRequestValidator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockGithubRequestValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockGithubRequestValidator { - return &VerifierMockGithubRequestValidator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockGithubRequestValidator struct { - mock *MockGithubRequestValidator - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockGithubRequestValidator) Validate(r *http.Request, secret []byte) *MockGithubRequestValidator_Validate_OngoingVerification { - params := []pegomock.Param{r, secret} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Validate", params, verifier.timeout) - return &MockGithubRequestValidator_Validate_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockGithubRequestValidator_Validate_OngoingVerification struct { - mock *MockGithubRequestValidator - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockGithubRequestValidator_Validate_OngoingVerification) GetCapturedArguments() (*http.Request, []byte) { - r, secret := c.GetAllCapturedArguments() - return r[len(r)-1], secret[len(secret)-1] -} - -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) - } - _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 deleted file mode 100644 index 671fd8127d..0000000000 --- a/server/controllers/events/mocks/mock_gitlab_request_parser_validator.go +++ /dev/null @@ -1,113 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/controllers/events (interfaces: GitlabRequestParserValidator) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - http "net/http" - "reflect" - "time" -) - -type MockGitlabRequestParserValidator struct { - fail func(message string, callerSkip ...int) -} - -func NewMockGitlabRequestParserValidator(options ...pegomock.Option) *MockGitlabRequestParserValidator { - mock := &MockGitlabRequestParserValidator{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockGitlabRequestParserValidator) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockGitlabRequestParserValidator) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockGitlabRequestParserValidator) ParseAndValidate(r *http.Request, secret []byte) (interface{}, error) { - 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{}) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockGitlabRequestParserValidator) VerifyWasCalledOnce() *VerifierMockGitlabRequestParserValidator { - return &VerifierMockGitlabRequestParserValidator{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockGitlabRequestParserValidator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockGitlabRequestParserValidator { - return &VerifierMockGitlabRequestParserValidator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockGitlabRequestParserValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGitlabRequestParserValidator { - return &VerifierMockGitlabRequestParserValidator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockGitlabRequestParserValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockGitlabRequestParserValidator { - return &VerifierMockGitlabRequestParserValidator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockGitlabRequestParserValidator struct { - mock *MockGitlabRequestParserValidator - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockGitlabRequestParserValidator) ParseAndValidate(r *http.Request, secret []byte) *MockGitlabRequestParserValidator_ParseAndValidate_OngoingVerification { - params := []pegomock.Param{r, secret} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ParseAndValidate", params, verifier.timeout) - return &MockGitlabRequestParserValidator_ParseAndValidate_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockGitlabRequestParserValidator_ParseAndValidate_OngoingVerification struct { - mock *MockGitlabRequestParserValidator - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockGitlabRequestParserValidator_ParseAndValidate_OngoingVerification) GetCapturedArguments() (*http.Request, []byte) { - r, secret := c.GetAllCapturedArguments() - return r[len(r)-1], secret[len(secret)-1] -} - -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) - } - _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 deleted file mode 100644 index 5d3e33a2ef..0000000000 --- a/server/controllers/web_templates/mocks/mock_template_writer.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/controllers/web_templates (interfaces: TemplateWriter) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - io "io" - "reflect" - "time" -) - -type MockTemplateWriter struct { - fail func(message string, callerSkip ...int) -} - -func NewMockTemplateWriter(options ...pegomock.Option) *MockTemplateWriter { - mock := &MockTemplateWriter{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockTemplateWriter) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockTemplateWriter) FailHandler() pegomock.FailHandler { return mock.fail } - -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) - } - } - return ret0 -} - -func (mock *MockTemplateWriter) VerifyWasCalledOnce() *VerifierMockTemplateWriter { - return &VerifierMockTemplateWriter{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockTemplateWriter) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockTemplateWriter { - return &VerifierMockTemplateWriter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockTemplateWriter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockTemplateWriter { - return &VerifierMockTemplateWriter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockTemplateWriter) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockTemplateWriter { - return &VerifierMockTemplateWriter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockTemplateWriter struct { - mock *MockTemplateWriter - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockTemplateWriter) Execute(wr io.Writer, data interface{}) *MockTemplateWriter_Execute_OngoingVerification { - params := []pegomock.Param{wr, data} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Execute", params, verifier.timeout) - return &MockTemplateWriter_Execute_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockTemplateWriter_Execute_OngoingVerification struct { - mock *MockTemplateWriter - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockTemplateWriter_Execute_OngoingVerification) GetCapturedArguments() (io.Writer, interface{}) { - wr, data := c.GetAllCapturedArguments() - return wr[len(wr)-1], data[len(data)-1] -} - -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) - } - _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 deleted file mode 100644 index cfe777fa3b..0000000000 --- a/server/core/locking/mocks/mock_apply_lock_checker.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/locking (interfaces: ApplyLockChecker) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - locking "github.com/runatlantis/atlantis/server/core/locking" - "reflect" - "time" -) - -type MockApplyLockChecker struct { - fail func(message string, callerSkip ...int) -} - -func NewMockApplyLockChecker(options ...pegomock.Option) *MockApplyLockChecker { - mock := &MockApplyLockChecker{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockApplyLockChecker) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockApplyLockChecker) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockApplyLockChecker) CheckApplyLock() (locking.ApplyCommandLock, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockApplyLockChecker) VerifyWasCalledOnce() *VerifierMockApplyLockChecker { - return &VerifierMockApplyLockChecker{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockApplyLockChecker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockApplyLockChecker { - return &VerifierMockApplyLockChecker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockApplyLockChecker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockApplyLockChecker { - return &VerifierMockApplyLockChecker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockApplyLockChecker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockApplyLockChecker { - return &VerifierMockApplyLockChecker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockApplyLockChecker struct { - mock *MockApplyLockChecker - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockApplyLockChecker) CheckApplyLock() *MockApplyLockChecker_CheckApplyLock_OngoingVerification { - 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} -} - -type MockApplyLockChecker_CheckApplyLock_OngoingVerification struct { - mock *MockApplyLockChecker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockApplyLockChecker_CheckApplyLock_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockApplyLockChecker_CheckApplyLock_OngoingVerification) GetAllCapturedArguments() { -} diff --git a/server/core/locking/mocks/mock_apply_locker.go b/server/core/locking/mocks/mock_apply_locker.go deleted file mode 100644 index 691d1b268b..0000000000 --- a/server/core/locking/mocks/mock_apply_locker.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/locking (interfaces: ApplyLocker) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - locking "github.com/runatlantis/atlantis/server/core/locking" - "reflect" - "time" -) - -type MockApplyLocker struct { - fail func(message string, callerSkip ...int) -} - -func NewMockApplyLocker(options ...pegomock.Option) *MockApplyLocker { - mock := &MockApplyLocker{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockApplyLocker) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockApplyLocker) FailHandler() pegomock.FailHandler { return mock.fail } - -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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - } - return ret0 -} - -func (mock *MockApplyLocker) VerifyWasCalledOnce() *VerifierMockApplyLocker { - return &VerifierMockApplyLocker{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockApplyLocker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockApplyLocker { - return &VerifierMockApplyLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockApplyLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockApplyLocker { - return &VerifierMockApplyLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockApplyLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockApplyLocker { - return &VerifierMockApplyLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockApplyLocker struct { - mock *MockApplyLocker - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockApplyLocker) CheckApplyLock() *MockApplyLocker_CheckApplyLock_OngoingVerification { - 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} -} - -type MockApplyLocker_CheckApplyLock_OngoingVerification struct { - mock *MockApplyLocker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockApplyLocker_CheckApplyLock_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockApplyLocker_CheckApplyLock_OngoingVerification) GetAllCapturedArguments() { -} - -func (verifier *VerifierMockApplyLocker) LockApply() *MockApplyLocker_LockApply_OngoingVerification { - 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} -} - -type MockApplyLocker_LockApply_OngoingVerification struct { - mock *MockApplyLocker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockApplyLocker_LockApply_OngoingVerification) GetCapturedArguments() { -} - -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) - return &MockApplyLocker_UnlockApply_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockApplyLocker_UnlockApply_OngoingVerification struct { - mock *MockApplyLocker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockApplyLocker_UnlockApply_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockApplyLocker_UnlockApply_OngoingVerification) GetAllCapturedArguments() { -} diff --git a/server/core/locking/mocks/mock_backend.go b/server/core/locking/mocks/mock_backend.go deleted file mode 100644 index f2174476a1..0000000000 --- a/server/core/locking/mocks/mock_backend.go +++ /dev/null @@ -1,630 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/locking (interfaces: Backend) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - models "github.com/runatlantis/atlantis/server/events/models" - "reflect" - "time" -) - -type MockBackend struct { - fail func(message string, callerSkip ...int) -} - -func NewMockBackend(options ...pegomock.Option) *MockBackend { - mock := &MockBackend{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockBackend) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockBackend) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockBackend) CheckCommandLock(cmdName command.Name) (*command.Lock, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.ProjectLock) - } - if result[2] != nil { - ret2 = result[2].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - } - 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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockBackend) VerifyWasCalledOnce() *VerifierMockBackend { - return &VerifierMockBackend{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockBackend) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockBackend { - return &VerifierMockBackend{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockBackend) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockBackend { - return &VerifierMockBackend{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockBackend) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockBackend { - return &VerifierMockBackend{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockBackend struct { - mock *MockBackend - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockBackend_CheckCommandLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_CheckCommandLock_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_CheckCommandLock_OngoingVerification) GetCapturedArguments() command.Name { - cmdName := c.GetAllCapturedArguments() - return cmdName[len(cmdName)-1] -} - -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) - } - } - 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) - return &MockBackend_DeletePullStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_DeletePullStatus_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_DeletePullStatus_OngoingVerification) GetCapturedArguments() models.PullRequest { - pull := c.GetAllCapturedArguments() - return pull[len(pull)-1] -} - -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) - } - } - 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) - return &MockBackend_GetLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_GetLock_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_GetLock_OngoingVerification) GetCapturedArguments() (models.Project, string) { - project, workspace := c.GetAllCapturedArguments() - return project[len(project)-1], workspace[len(workspace)-1] -} - -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) - } - _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) - return &MockBackend_GetPullStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_GetPullStatus_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_GetPullStatus_OngoingVerification) GetCapturedArguments() models.PullRequest { - pull := c.GetAllCapturedArguments() - return pull[len(pull)-1] -} - -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) - } - } - 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) - return &MockBackend_List_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_List_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_List_OngoingVerification) GetCapturedArguments() { -} - -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) - return &MockBackend_LockCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_LockCommand_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_LockCommand_OngoingVerification) GetCapturedArguments() (command.Name, time.Time) { - cmdName, lockTime := c.GetAllCapturedArguments() - return cmdName[len(cmdName)-1], lockTime[len(lockTime)-1] -} - -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) - } - _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) - return &MockBackend_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_TryLock_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_TryLock_OngoingVerification) GetCapturedArguments() models.ProjectLock { - lock := c.GetAllCapturedArguments() - return lock[len(lock)-1] -} - -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) - } - } - 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) - return &MockBackend_Unlock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_Unlock_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_Unlock_OngoingVerification) GetCapturedArguments() (models.Project, string) { - project, workspace := c.GetAllCapturedArguments() - return project[len(project)-1], workspace[len(workspace)-1] -} - -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) - } - _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) - return &MockBackend_UnlockByPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_UnlockByPull_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_UnlockByPull_OngoingVerification) GetCapturedArguments() (string, int) { - repoFullName, pullNum := c.GetAllCapturedArguments() - return repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1] -} - -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) - } - _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) - return &MockBackend_UnlockCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_UnlockCommand_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_UnlockCommand_OngoingVerification) GetCapturedArguments() command.Name { - cmdName := c.GetAllCapturedArguments() - return cmdName[len(cmdName)-1] -} - -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) - } - } - 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) - return &MockBackend_UpdateProjectStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_UpdateProjectStatus_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_UpdateProjectStatus_OngoingVerification) GetCapturedArguments() (models.PullRequest, string, string, models.ProjectPlanStatus) { - pull, workspace, repoRelDir, newStatus := c.GetAllCapturedArguments() - return pull[len(pull)-1], workspace[len(workspace)-1], repoRelDir[len(repoRelDir)-1], newStatus[len(newStatus)-1] -} - -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) - } - } - 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) - return &MockBackend_UpdatePullWithResults_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockBackend_UpdatePullWithResults_OngoingVerification struct { - mock *MockBackend - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockBackend_UpdatePullWithResults_OngoingVerification) GetCapturedArguments() (models.PullRequest, []command.ProjectResult) { - pull, newResults := c.GetAllCapturedArguments() - return pull[len(pull)-1], newResults[len(newResults)-1] -} - -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) - } - } - return -} diff --git a/server/core/locking/mocks/mock_locker.go b/server/core/locking/mocks/mock_locker.go deleted file mode 100644 index 1efcb2c64b..0000000000 --- a/server/core/locking/mocks/mock_locker.go +++ /dev/null @@ -1,300 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/locking (interfaces: Locker) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - locking "github.com/runatlantis/atlantis/server/core/locking" - models "github.com/runatlantis/atlantis/server/events/models" - "reflect" - "time" -) - -type MockLocker struct { - fail func(message string, callerSkip ...int) -} - -func NewMockLocker(options ...pegomock.Option) *MockLocker { - mock := &MockLocker{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockLocker) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockLocker) FailHandler() pegomock.FailHandler { return mock.fail } - -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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockLocker) VerifyWasCalledOnce() *VerifierMockLocker { - return &VerifierMockLocker{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockLocker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockLocker { - return &VerifierMockLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockLocker { - return &VerifierMockLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockLocker { - return &VerifierMockLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockLocker struct { - mock *MockLocker - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockLocker) GetLock(key string) *MockLocker_GetLock_OngoingVerification { - params := []pegomock.Param{key} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetLock", params, verifier.timeout) - return &MockLocker_GetLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockLocker_GetLock_OngoingVerification struct { - mock *MockLocker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockLocker_GetLock_OngoingVerification) GetCapturedArguments() string { - key := c.GetAllCapturedArguments() - return key[len(key)-1] -} - -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) - } - } - 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) - return &MockLocker_List_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockLocker_List_OngoingVerification struct { - mock *MockLocker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockLocker_List_OngoingVerification) GetCapturedArguments() { -} - -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) - return &MockLocker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockLocker_TryLock_OngoingVerification struct { - mock *MockLocker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockLocker_TryLock_OngoingVerification) GetCapturedArguments() (models.Project, string, models.PullRequest, models.User) { - p, workspace, pull, user := c.GetAllCapturedArguments() - return p[len(p)-1], workspace[len(workspace)-1], pull[len(pull)-1], user[len(user)-1] -} - -func (c *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) - } - _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) - } - _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) - return &MockLocker_Unlock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockLocker_Unlock_OngoingVerification struct { - mock *MockLocker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockLocker_Unlock_OngoingVerification) GetCapturedArguments() string { - key := c.GetAllCapturedArguments() - return key[len(key)-1] -} - -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) - } - } - 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) - return &MockLocker_UnlockByPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockLocker_UnlockByPull_OngoingVerification struct { - mock *MockLocker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockLocker_UnlockByPull_OngoingVerification) GetCapturedArguments() (string, int) { - repoFullName, pullNum := c.GetAllCapturedArguments() - return repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1] -} - -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) - } - _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 deleted file mode 100644 index 043ece8054..0000000000 --- a/server/core/runtime/cache/mocks/mock_key_serializer.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime/cache (interfaces: KeySerializer) - -package mocks - -import ( - go_version "github.com/hashicorp/go-version" - pegomock "github.com/petergtz/pegomock/v4" - "reflect" - "time" -) - -type MockKeySerializer struct { - fail func(message string, callerSkip ...int) -} - -func NewMockKeySerializer(options ...pegomock.Option) *MockKeySerializer { - mock := &MockKeySerializer{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockKeySerializer) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockKeySerializer) FailHandler() pegomock.FailHandler { return mock.fail } - -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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockKeySerializer) VerifyWasCalledOnce() *VerifierMockKeySerializer { - return &VerifierMockKeySerializer{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockKeySerializer) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockKeySerializer { - return &VerifierMockKeySerializer{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockKeySerializer) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockKeySerializer { - return &VerifierMockKeySerializer{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockKeySerializer) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockKeySerializer { - return &VerifierMockKeySerializer{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockKeySerializer struct { - mock *MockKeySerializer - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockKeySerializer_Serialize_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockKeySerializer_Serialize_OngoingVerification struct { - mock *MockKeySerializer - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockKeySerializer_Serialize_OngoingVerification) GetCapturedArguments() *go_version.Version { - key := c.GetAllCapturedArguments() - return key[len(key)-1] -} - -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) - } - } - return -} diff --git a/server/core/runtime/cache/mocks/mock_version_path.go b/server/core/runtime/cache/mocks/mock_version_path.go deleted file mode 100644 index 84c2bd5f76..0000000000 --- a/server/core/runtime/cache/mocks/mock_version_path.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime/cache (interfaces: ExecutionVersionCache) - -package mocks - -import ( - go_version "github.com/hashicorp/go-version" - pegomock "github.com/petergtz/pegomock/v4" - "reflect" - "time" -) - -type MockExecutionVersionCache struct { - fail func(message string, callerSkip ...int) -} - -func NewMockExecutionVersionCache(options ...pegomock.Option) *MockExecutionVersionCache { - mock := &MockExecutionVersionCache{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockExecutionVersionCache) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockExecutionVersionCache) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockExecutionVersionCache) Get(key *go_version.Version) (string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockExecutionVersionCache) VerifyWasCalledOnce() *VerifierMockExecutionVersionCache { - return &VerifierMockExecutionVersionCache{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockExecutionVersionCache) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockExecutionVersionCache { - return &VerifierMockExecutionVersionCache{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockExecutionVersionCache) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockExecutionVersionCache { - return &VerifierMockExecutionVersionCache{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockExecutionVersionCache) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockExecutionVersionCache { - return &VerifierMockExecutionVersionCache{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockExecutionVersionCache struct { - mock *MockExecutionVersionCache - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockExecutionVersionCache_Get_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockExecutionVersionCache_Get_OngoingVerification struct { - mock *MockExecutionVersionCache - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockExecutionVersionCache_Get_OngoingVerification) GetCapturedArguments() *go_version.Version { - key := c.GetAllCapturedArguments() - return key[len(key)-1] -} - -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) - } - } - return -} diff --git a/server/core/runtime/mocks/mock_async_tfexec.go b/server/core/runtime/mocks/mock_async_tfexec.go deleted file mode 100644 index fc93fde915..0000000000 --- a/server/core/runtime/mocks/mock_async_tfexec.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime (interfaces: AsyncTFExec) - -package mocks - -import ( - go_version "github.com/hashicorp/go-version" - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/core/runtime/models" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockAsyncTFExec struct { - fail func(message string, callerSkip ...int) -} - -func NewMockAsyncTFExec(options ...pegomock.Option) *MockAsyncTFExec { - mock := &MockAsyncTFExec{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockAsyncTFExec) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockAsyncTFExec) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockAsyncTFExec) RunCommandAsync(ctx command.ProjectContext, path string, args []string, envs map[string]string, v *go_version.Version, workspace string) (chan<- string, <-chan models.Line) { - 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 { - var ok bool - ret0, ok = result[0].(chan string) - if !ok { - ret0 = result[0].(chan<- string) - } - } - if result[1] != nil { - var ok bool - ret1, ok = result[1].(chan models.Line) - if !ok { - ret1 = result[1].(<-chan models.Line) - } - } - } - return ret0, ret1 -} - -func (mock *MockAsyncTFExec) VerifyWasCalledOnce() *VerifierMockAsyncTFExec { - return &VerifierMockAsyncTFExec{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockAsyncTFExec) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockAsyncTFExec { - return &VerifierMockAsyncTFExec{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockAsyncTFExec) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockAsyncTFExec { - return &VerifierMockAsyncTFExec{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockAsyncTFExec) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockAsyncTFExec { - return &VerifierMockAsyncTFExec{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockAsyncTFExec struct { - mock *MockAsyncTFExec - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockAsyncTFExec_RunCommandAsync_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockAsyncTFExec_RunCommandAsync_OngoingVerification struct { - mock *MockAsyncTFExec - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockAsyncTFExec_RunCommandAsync_OngoingVerification) GetCapturedArguments() (command.ProjectContext, string, []string, map[string]string, *go_version.Version, string) { - ctx, path, args, envs, v, workspace := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], path[len(path)-1], args[len(args)-1], envs[len(envs)-1], v[len(v)-1], workspace[len(workspace)-1] -} - -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) - } - _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([]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) - } - _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 deleted file mode 100644 index 2674bf3e0e..0000000000 --- a/server/core/runtime/mocks/mock_post_workflows_hook_runner.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime (interfaces: PostWorkflowHookRunner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - "reflect" - "time" -) - -type MockPostWorkflowHookRunner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockPostWorkflowHookRunner(options ...pegomock.Option) *MockPostWorkflowHookRunner { - mock := &MockPostWorkflowHookRunner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockPostWorkflowHookRunner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockPostWorkflowHookRunner) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockPostWorkflowHookRunner) Run(ctx models.WorkflowHookCommandContext, command string, shell string, shellArgs string, path string) (string, string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(string) - } - if result[2] != nil { - ret2 = result[2].(error) - } - } - return ret0, ret1, ret2 -} - -func (mock *MockPostWorkflowHookRunner) VerifyWasCalledOnce() *VerifierMockPostWorkflowHookRunner { - return &VerifierMockPostWorkflowHookRunner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockPostWorkflowHookRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPostWorkflowHookRunner { - return &VerifierMockPostWorkflowHookRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockPostWorkflowHookRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPostWorkflowHookRunner { - return &VerifierMockPostWorkflowHookRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockPostWorkflowHookRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPostWorkflowHookRunner { - return &VerifierMockPostWorkflowHookRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockPostWorkflowHookRunner struct { - mock *MockPostWorkflowHookRunner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockPostWorkflowHookRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockPostWorkflowHookRunner_Run_OngoingVerification struct { - mock *MockPostWorkflowHookRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockPostWorkflowHookRunner_Run_OngoingVerification) GetCapturedArguments() (models.WorkflowHookCommandContext, string, string, string, string) { - ctx, command, shell, shellArgs, path := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], command[len(command)-1], shell[len(shell)-1], shellArgs[len(shellArgs)-1], path[len(path)-1] -} - -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) - } - _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([]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) - } - } - 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 deleted file mode 100644 index c9894c5cdd..0000000000 --- a/server/core/runtime/mocks/mock_pre_workflows_hook_runner.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime (interfaces: PreWorkflowHookRunner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - "reflect" - "time" -) - -type MockPreWorkflowHookRunner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockPreWorkflowHookRunner(options ...pegomock.Option) *MockPreWorkflowHookRunner { - mock := &MockPreWorkflowHookRunner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockPreWorkflowHookRunner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockPreWorkflowHookRunner) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockPreWorkflowHookRunner) Run(ctx models.WorkflowHookCommandContext, command string, shell string, shellArgs string, path string) (string, string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(string) - } - if result[2] != nil { - ret2 = result[2].(error) - } - } - return ret0, ret1, ret2 -} - -func (mock *MockPreWorkflowHookRunner) VerifyWasCalledOnce() *VerifierMockPreWorkflowHookRunner { - return &VerifierMockPreWorkflowHookRunner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockPreWorkflowHookRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPreWorkflowHookRunner { - return &VerifierMockPreWorkflowHookRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockPreWorkflowHookRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPreWorkflowHookRunner { - return &VerifierMockPreWorkflowHookRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockPreWorkflowHookRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPreWorkflowHookRunner { - return &VerifierMockPreWorkflowHookRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockPreWorkflowHookRunner struct { - mock *MockPreWorkflowHookRunner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockPreWorkflowHookRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockPreWorkflowHookRunner_Run_OngoingVerification struct { - mock *MockPreWorkflowHookRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockPreWorkflowHookRunner_Run_OngoingVerification) GetCapturedArguments() (models.WorkflowHookCommandContext, string, string, string, string) { - ctx, command, shell, shellArgs, path := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], command[len(command)-1], shell[len(shell)-1], shellArgs[len(shellArgs)-1], path[len(path)-1] -} - -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) - } - _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([]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) - } - } - return -} diff --git a/server/core/runtime/mocks/mock_pull_approved_checker.go b/server/core/runtime/mocks/mock_pull_approved_checker.go deleted file mode 100644 index fc43172cee..0000000000 --- a/server/core/runtime/mocks/mock_pull_approved_checker.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime (interfaces: PullApprovedChecker) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockPullApprovedChecker struct { - fail func(message string, callerSkip ...int) -} - -func NewMockPullApprovedChecker(options ...pegomock.Option) *MockPullApprovedChecker { - mock := &MockPullApprovedChecker{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockPullApprovedChecker) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockPullApprovedChecker) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockPullApprovedChecker) PullIsApproved(logger logging.SimpleLogging, baseRepo models.Repo, pull models.PullRequest) (models.ApprovalStatus, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockPullApprovedChecker) VerifyWasCalledOnce() *VerifierMockPullApprovedChecker { - return &VerifierMockPullApprovedChecker{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockPullApprovedChecker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPullApprovedChecker { - return &VerifierMockPullApprovedChecker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockPullApprovedChecker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPullApprovedChecker { - return &VerifierMockPullApprovedChecker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockPullApprovedChecker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPullApprovedChecker { - return &VerifierMockPullApprovedChecker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockPullApprovedChecker struct { - mock *MockPullApprovedChecker - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockPullApprovedChecker_PullIsApproved_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockPullApprovedChecker_PullIsApproved_OngoingVerification struct { - mock *MockPullApprovedChecker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockPullApprovedChecker_PullIsApproved_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest) { - logger, baseRepo, pull := c.GetAllCapturedArguments() - return logger[len(logger)-1], baseRepo[len(baseRepo)-1], pull[len(pull)-1] -} - -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) - } - _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) - } - } - return -} diff --git a/server/core/runtime/mocks/mock_runner.go b/server/core/runtime/mocks/mock_runner.go deleted file mode 100644 index d29757facf..0000000000 --- a/server/core/runtime/mocks/mock_runner.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime (interfaces: Runner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockRunner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockRunner(options ...pegomock.Option) *MockRunner { - mock := &MockRunner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockRunner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockRunner) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockRunner) Run(ctx command.ProjectContext, extraArgs []string, path string, envs map[string]string) (string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockRunner) VerifyWasCalledOnce() *VerifierMockRunner { - return &VerifierMockRunner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockRunner { - return &VerifierMockRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockRunner { - return &VerifierMockRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockRunner { - return &VerifierMockRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockRunner struct { - mock *MockRunner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockRunner_Run_OngoingVerification struct { - mock *MockRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockRunner_Run_OngoingVerification) GetCapturedArguments() (command.ProjectContext, []string, string, map[string]string) { - ctx, extraArgs, path, envs := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], extraArgs[len(extraArgs)-1], path[len(path)-1], envs[len(envs)-1] -} - -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) - } - _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([]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 deleted file mode 100644 index 70f8edf1d3..0000000000 --- a/server/core/runtime/mocks/mock_status_updater.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime (interfaces: StatusUpdater) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - models "github.com/runatlantis/atlantis/server/events/models" - "reflect" - "time" -) - -type MockStatusUpdater struct { - fail func(message string, callerSkip ...int) -} - -func NewMockStatusUpdater(options ...pegomock.Option) *MockStatusUpdater { - mock := &MockStatusUpdater{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockStatusUpdater) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockStatusUpdater) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockStatusUpdater) UpdateProject(ctx command.ProjectContext, cmdName command.Name, status models.CommitStatus, url string, res *command.ProjectResult) error { - 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) - } - } - return ret0 -} - -func (mock *MockStatusUpdater) VerifyWasCalledOnce() *VerifierMockStatusUpdater { - return &VerifierMockStatusUpdater{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockStatusUpdater) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockStatusUpdater { - return &VerifierMockStatusUpdater{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockStatusUpdater) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockStatusUpdater { - return &VerifierMockStatusUpdater{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockStatusUpdater) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockStatusUpdater { - return &VerifierMockStatusUpdater{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockStatusUpdater struct { - mock *MockStatusUpdater - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockStatusUpdater_UpdateProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockStatusUpdater_UpdateProject_OngoingVerification struct { - mock *MockStatusUpdater - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockStatusUpdater_UpdateProject_OngoingVerification) GetCapturedArguments() (command.ProjectContext, command.Name, models.CommitStatus, string, *command.ProjectResult) { - ctx, cmdName, status, url, res := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], cmdName[len(cmdName)-1], status[len(status)-1], url[len(url)-1], res[len(res)-1] -} - -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) - } - _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) - } - _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) - } - } - return -} diff --git a/server/core/runtime/mocks/mock_versionedexecutorworkflow.go b/server/core/runtime/mocks/mock_versionedexecutorworkflow.go deleted file mode 100644 index ca6686fe5c..0000000000 --- a/server/core/runtime/mocks/mock_versionedexecutorworkflow.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime (interfaces: VersionedExecutorWorkflow) - -package mocks - -import ( - go_version "github.com/hashicorp/go-version" - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockVersionedExecutorWorkflow struct { - fail func(message string, callerSkip ...int) -} - -func NewMockVersionedExecutorWorkflow(options ...pegomock.Option) *MockVersionedExecutorWorkflow { - mock := &MockVersionedExecutorWorkflow{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockVersionedExecutorWorkflow) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockVersionedExecutorWorkflow) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockVersionedExecutorWorkflow) EnsureExecutorVersion(log logging.SimpleLogging, v *go_version.Version) (string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockVersionedExecutorWorkflow) VerifyWasCalledOnce() *VerifierMockVersionedExecutorWorkflow { - return &VerifierMockVersionedExecutorWorkflow{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockVersionedExecutorWorkflow) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockVersionedExecutorWorkflow { - return &VerifierMockVersionedExecutorWorkflow{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockVersionedExecutorWorkflow) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockVersionedExecutorWorkflow { - return &VerifierMockVersionedExecutorWorkflow{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockVersionedExecutorWorkflow) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockVersionedExecutorWorkflow { - return &VerifierMockVersionedExecutorWorkflow{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockVersionedExecutorWorkflow struct { - mock *MockVersionedExecutorWorkflow - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockVersionedExecutorWorkflow_EnsureExecutorVersion_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockVersionedExecutorWorkflow_EnsureExecutorVersion_OngoingVerification struct { - mock *MockVersionedExecutorWorkflow - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockVersionedExecutorWorkflow_EnsureExecutorVersion_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, *go_version.Version) { - log, v := c.GetAllCapturedArguments() - return log[len(log)-1], v[len(v)-1] -} - -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) - } - _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) - return &MockVersionedExecutorWorkflow_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockVersionedExecutorWorkflow_Run_OngoingVerification struct { - mock *MockVersionedExecutorWorkflow - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockVersionedExecutorWorkflow_Run_OngoingVerification) GetCapturedArguments() (command.ProjectContext, string, map[string]string, string, []string) { - ctx, executablePath, envs, workdir, extraArgs := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], executablePath[len(executablePath)-1], envs[len(envs)-1], workdir[len(workdir)-1], extraArgs[len(extraArgs)-1] -} - -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) - } - _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) - } - _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) - } - } - return -} diff --git a/server/core/runtime/models/mocks/mock_exec.go b/server/core/runtime/models/mocks/mock_exec.go deleted file mode 100644 index 35386315c9..0000000000 --- a/server/core/runtime/models/mocks/mock_exec.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime/models (interfaces: Exec) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - "reflect" - "time" -) - -type MockExec struct { - fail func(message string, callerSkip ...int) -} - -func NewMockExec(options ...pegomock.Option) *MockExec { - mock := &MockExec{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockExec) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockExec) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockExec) CombinedOutput(args []string, envs map[string]string, workdir string) (string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockExec) VerifyWasCalledOnce() *VerifierMockExec { - return &VerifierMockExec{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockExec) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockExec { - return &VerifierMockExec{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockExec) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockExec { - return &VerifierMockExec{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockExec) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockExec { - return &VerifierMockExec{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockExec struct { - mock *MockExec - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockExec_CombinedOutput_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockExec_CombinedOutput_OngoingVerification struct { - mock *MockExec - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockExec_CombinedOutput_OngoingVerification) GetCapturedArguments() ([]string, map[string]string, string) { - args, envs, workdir := c.GetAllCapturedArguments() - return args[len(args)-1], envs[len(envs)-1], workdir[len(workdir)-1] -} - -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) - } - _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) - } - } - 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) - return &MockExec_LookPath_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockExec_LookPath_OngoingVerification struct { - mock *MockExec - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockExec_LookPath_OngoingVerification) GetCapturedArguments() string { - file := c.GetAllCapturedArguments() - return file[len(file)-1] -} - -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) - } - } - return -} diff --git a/server/core/runtime/models/mocks/mock_filepath.go b/server/core/runtime/models/mocks/mock_filepath.go deleted file mode 100644 index cdfd8995f0..0000000000 --- a/server/core/runtime/models/mocks/mock_filepath.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime/models (interfaces: FilePath) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/core/runtime/models" - "reflect" - "time" -) - -type MockFilePath struct { - fail func(message string, callerSkip ...int) -} - -func NewMockFilePath(options ...pegomock.Option) *MockFilePath { - mock := &MockFilePath{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockFilePath) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockFilePath) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockFilePath) Join(elem ...string) models.FilePath { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockFilePath().") - } - params := []pegomock.Param{} - for _, param := range elem { - 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) - } - } - 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) - } - } - 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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockFilePath) VerifyWasCalledOnce() *VerifierMockFilePath { - return &VerifierMockFilePath{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockFilePath) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockFilePath { - return &VerifierMockFilePath{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockFilePath) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockFilePath { - return &VerifierMockFilePath{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockFilePath) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockFilePath { - return &VerifierMockFilePath{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockFilePath struct { - mock *MockFilePath - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockFilePath) Join(elem ...string) *MockFilePath_Join_OngoingVerification { - params := []pegomock.Param{} - for _, param := range elem { - params = append(params, param) - } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Join", params, verifier.timeout) - return &MockFilePath_Join_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockFilePath_Join_OngoingVerification struct { - mock *MockFilePath - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockFilePath_Join_OngoingVerification) GetCapturedArguments() []string { - elem := c.GetAllCapturedArguments() - return elem[len(elem)-1] -} - -func (c *MockFilePath_Join_OngoingVerification) GetAllCapturedArguments() (_param0 [][]string) { - 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) - } - } - } - } - return -} - -func (verifier *VerifierMockFilePath) NotExists() *MockFilePath_NotExists_OngoingVerification { - 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} -} - -type MockFilePath_NotExists_OngoingVerification struct { - mock *MockFilePath - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockFilePath_NotExists_OngoingVerification) GetCapturedArguments() { -} - -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) - return &MockFilePath_Resolve_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockFilePath_Resolve_OngoingVerification struct { - mock *MockFilePath - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockFilePath_Resolve_OngoingVerification) GetCapturedArguments() { -} - -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) - return &MockFilePath_Symlink_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockFilePath_Symlink_OngoingVerification struct { - mock *MockFilePath - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockFilePath_Symlink_OngoingVerification) GetCapturedArguments() string { - newname := c.GetAllCapturedArguments() - return newname[len(newname)-1] -} - -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) - } - } - return -} diff --git a/server/core/runtime/policy/mocks/mock_conftest_client.go b/server/core/runtime/policy/mocks/mock_conftest_client.go deleted file mode 100644 index 441fc606f4..0000000000 --- a/server/core/runtime/policy/mocks/mock_conftest_client.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/runtime/policy (interfaces: SourceResolver) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - valid "github.com/runatlantis/atlantis/server/core/config/valid" - "reflect" - "time" -) - -type MockSourceResolver struct { - fail func(message string, callerSkip ...int) -} - -func NewMockSourceResolver(options ...pegomock.Option) *MockSourceResolver { - mock := &MockSourceResolver{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockSourceResolver) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockSourceResolver) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockSourceResolver) Resolve(policySet valid.PolicySet) (string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockSourceResolver) VerifyWasCalledOnce() *VerifierMockSourceResolver { - return &VerifierMockSourceResolver{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockSourceResolver) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockSourceResolver { - return &VerifierMockSourceResolver{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockSourceResolver) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockSourceResolver { - return &VerifierMockSourceResolver{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockSourceResolver) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockSourceResolver { - return &VerifierMockSourceResolver{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockSourceResolver struct { - mock *MockSourceResolver - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockSourceResolver_Resolve_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSourceResolver_Resolve_OngoingVerification struct { - mock *MockSourceResolver - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSourceResolver_Resolve_OngoingVerification) GetCapturedArguments() valid.PolicySet { - policySet := c.GetAllCapturedArguments() - return policySet[len(policySet)-1] -} - -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) - } - } - return -} diff --git a/server/core/terraform/mocks/mock_downloader.go b/server/core/terraform/mocks/mock_downloader.go deleted file mode 100644 index 06b82f6706..0000000000 --- a/server/core/terraform/mocks/mock_downloader.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/terraform (interfaces: Downloader) - -package mocks - -import ( - go_version "github.com/hashicorp/go-version" - pegomock "github.com/petergtz/pegomock/v4" - "reflect" - "time" -) - -type MockDownloader struct { - fail func(message string, callerSkip ...int) -} - -func NewMockDownloader(options ...pegomock.Option) *MockDownloader { - mock := &MockDownloader{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockDownloader) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockDownloader) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockDownloader) GetAny(dst string, src string) error { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockDownloader().") - } - params := []pegomock.Param{dst, src} - result := pegomock.GetGenericMockFrom(mock).Invoke("GetAny", 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 -} - -func (mock *MockDownloader) Install(dir string, downloadURL string, v *go_version.Version) (string, error) { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockDownloader().") - } - params := []pegomock.Param{dir, downloadURL, v} - result := pegomock.GetGenericMockFrom(mock).Invoke("Install", 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) - } - } - return ret0, ret1 -} - -func (mock *MockDownloader) VerifyWasCalledOnce() *VerifierMockDownloader { - return &VerifierMockDownloader{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockDownloader) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockDownloader { - return &VerifierMockDownloader{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockDownloader) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockDownloader { - return &VerifierMockDownloader{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockDownloader) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockDownloader { - return &VerifierMockDownloader{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockDownloader struct { - mock *MockDownloader - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockDownloader) GetAny(dst string, src string) *MockDownloader_GetAny_OngoingVerification { - params := []pegomock.Param{dst, src} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetAny", params, verifier.timeout) - return &MockDownloader_GetAny_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockDownloader_GetAny_OngoingVerification struct { - mock *MockDownloader - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockDownloader_GetAny_OngoingVerification) GetCapturedArguments() (string, string) { - dst, src := c.GetAllCapturedArguments() - return dst[len(dst)-1], src[len(src)-1] -} - -func (c *MockDownloader_GetAny_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []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) - } - } - return -} - -func (verifier *VerifierMockDownloader) Install(dir string, downloadURL string, v *go_version.Version) *MockDownloader_Install_OngoingVerification { - params := []pegomock.Param{dir, downloadURL, v} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Install", params, verifier.timeout) - return &MockDownloader_Install_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockDownloader_Install_OngoingVerification struct { - mock *MockDownloader - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockDownloader_Install_OngoingVerification) GetCapturedArguments() (string, string, *go_version.Version) { - dir, downloadURL, v := c.GetAllCapturedArguments() - return dir[len(dir)-1], downloadURL[len(downloadURL)-1], v[len(v)-1] -} - -func (c *MockDownloader_Install_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []*go_version.Version) { - 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([]*go_version.Version, len(c.methodInvocations)) - for u, param := range params[2] { - _param2[u] = param.(*go_version.Version) - } - } - return -} diff --git a/server/core/terraform/mocks/mock_terraform_client.go b/server/core/terraform/mocks/mock_terraform_client.go deleted file mode 100644 index dae620f2e1..0000000000 --- a/server/core/terraform/mocks/mock_terraform_client.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/core/terraform (interfaces: Client) - -package mocks - -import ( - go_version "github.com/hashicorp/go-version" - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockClient struct { - fail func(message string, callerSkip ...int) -} - -func NewMockClient(options ...pegomock.Option) *MockClient { - mock := &MockClient{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockClient) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockClient) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockClient) DetectVersion(log logging.SimpleLogging, projectDirectory string) *go_version.Version { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockClient().") - } - params := []pegomock.Param{log, projectDirectory} - result := pegomock.GetGenericMockFrom(mock).Invoke("DetectVersion", params, []reflect.Type{reflect.TypeOf((**go_version.Version)(nil)).Elem()}) - var ret0 *go_version.Version - if len(result) != 0 { - if result[0] != nil { - ret0 = result[0].(*go_version.Version) - } - } - return ret0 -} - -func (mock *MockClient) EnsureVersion(log logging.SimpleLogging, v *go_version.Version) error { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockClient().") - } - params := []pegomock.Param{log, v} - result := pegomock.GetGenericMockFrom(mock).Invoke("EnsureVersion", 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 -} - -func (mock *MockClient) RunCommandWithVersion(ctx command.ProjectContext, path string, args []string, envs map[string]string, v *go_version.Version, workspace string) (string, error) { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockClient().") - } - params := []pegomock.Param{ctx, path, args, envs, v, workspace} - result := pegomock.GetGenericMockFrom(mock).Invoke("RunCommandWithVersion", 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) - } - } - return ret0, ret1 -} - -func (mock *MockClient) VerifyWasCalledOnce() *VerifierMockClient { - return &VerifierMockClient{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockClient) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockClient { - return &VerifierMockClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockClient { - return &VerifierMockClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockClient { - return &VerifierMockClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockClient struct { - mock *MockClient - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockClient) DetectVersion(log logging.SimpleLogging, projectDirectory string) *MockClient_DetectVersion_OngoingVerification { - params := []pegomock.Param{log, projectDirectory} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DetectVersion", params, verifier.timeout) - return &MockClient_DetectVersion_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_DetectVersion_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_DetectVersion_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, string) { - log, projectDirectory := c.GetAllCapturedArguments() - return log[len(log)-1], projectDirectory[len(projectDirectory)-1] -} - -func (c *MockClient_DetectVersion_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) - } - } - return -} - -func (verifier *VerifierMockClient) EnsureVersion(log logging.SimpleLogging, v *go_version.Version) *MockClient_EnsureVersion_OngoingVerification { - params := []pegomock.Param{log, v} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "EnsureVersion", params, verifier.timeout) - return &MockClient_EnsureVersion_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_EnsureVersion_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_EnsureVersion_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, *go_version.Version) { - log, v := c.GetAllCapturedArguments() - return log[len(log)-1], v[len(v)-1] -} - -func (c *MockClient_EnsureVersion_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) - } - _param1 = make([]*go_version.Version, len(c.methodInvocations)) - for u, param := range params[1] { - _param1[u] = param.(*go_version.Version) - } - } - return -} - -func (verifier *VerifierMockClient) RunCommandWithVersion(ctx command.ProjectContext, path string, args []string, envs map[string]string, v *go_version.Version, workspace string) *MockClient_RunCommandWithVersion_OngoingVerification { - params := []pegomock.Param{ctx, path, args, envs, v, workspace} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunCommandWithVersion", params, verifier.timeout) - return &MockClient_RunCommandWithVersion_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_RunCommandWithVersion_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_RunCommandWithVersion_OngoingVerification) GetCapturedArguments() (command.ProjectContext, string, []string, map[string]string, *go_version.Version, string) { - ctx, path, args, envs, v, workspace := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], path[len(path)-1], args[len(args)-1], envs[len(envs)-1], v[len(v)-1], workspace[len(workspace)-1] -} - -func (c *MockClient_RunCommandWithVersion_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) - } - _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([]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) - } - _param5 = make([]string, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[u] = param.(string) - } - } - return -} diff --git a/server/events/mocks/mock_azuredevops_pull_getter.go b/server/events/mocks/mock_azuredevops_pull_getter.go deleted file mode 100644 index 95c57e0e89..0000000000 --- a/server/events/mocks/mock_azuredevops_pull_getter.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: AzureDevopsPullGetter) - -package mocks - -import ( - azuredevops "github.com/mcdafydd/go-azuredevops/azuredevops" - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockAzureDevopsPullGetter struct { - fail func(message string, callerSkip ...int) -} - -func NewMockAzureDevopsPullGetter(options ...pegomock.Option) *MockAzureDevopsPullGetter { - mock := &MockAzureDevopsPullGetter{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockAzureDevopsPullGetter) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockAzureDevopsPullGetter) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockAzureDevopsPullGetter) GetPullRequest(logger logging.SimpleLogging, repo models.Repo, pullNum int) (*azuredevops.GitPullRequest, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockAzureDevopsPullGetter) VerifyWasCalledOnce() *VerifierMockAzureDevopsPullGetter { - return &VerifierMockAzureDevopsPullGetter{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockAzureDevopsPullGetter) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockAzureDevopsPullGetter { - return &VerifierMockAzureDevopsPullGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockAzureDevopsPullGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockAzureDevopsPullGetter { - return &VerifierMockAzureDevopsPullGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockAzureDevopsPullGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockAzureDevopsPullGetter { - return &VerifierMockAzureDevopsPullGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockAzureDevopsPullGetter struct { - mock *MockAzureDevopsPullGetter - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockAzureDevopsPullGetter_GetPullRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockAzureDevopsPullGetter_GetPullRequest_OngoingVerification struct { - mock *MockAzureDevopsPullGetter - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockAzureDevopsPullGetter_GetPullRequest_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, int) { - logger, repo, pullNum := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pullNum[len(pullNum)-1] -} - -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) - } - _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) - } - } - return -} diff --git a/server/events/mocks/mock_command_requirement_handler.go b/server/events/mocks/mock_command_requirement_handler.go deleted file mode 100644 index d5a36f20eb..0000000000 --- a/server/events/mocks/mock_command_requirement_handler.go +++ /dev/null @@ -1,259 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: CommandRequirementHandler) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockCommandRequirementHandler struct { - fail func(message string, callerSkip ...int) -} - -func NewMockCommandRequirementHandler(options ...pegomock.Option) *MockCommandRequirementHandler { - mock := &MockCommandRequirementHandler{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockCommandRequirementHandler) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockCommandRequirementHandler) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockCommandRequirementHandler) ValidateApplyProject(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("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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockCommandRequirementHandler) VerifyWasCalledOnce() *VerifierMockCommandRequirementHandler { - return &VerifierMockCommandRequirementHandler{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockCommandRequirementHandler) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCommandRequirementHandler { - return &VerifierMockCommandRequirementHandler{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockCommandRequirementHandler) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommandRequirementHandler { - return &VerifierMockCommandRequirementHandler{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockCommandRequirementHandler) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCommandRequirementHandler { - return &VerifierMockCommandRequirementHandler{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockCommandRequirementHandler struct { - mock *MockCommandRequirementHandler - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification struct { - mock *MockCommandRequirementHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification) GetCapturedArguments() (string, command.ProjectContext) { - repoDir, ctx := c.GetAllCapturedArguments() - return repoDir[len(repoDir)-1], ctx[len(ctx)-1] -} - -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) - } - _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) - return &MockCommandRequirementHandler_ValidateImportProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommandRequirementHandler_ValidateImportProject_OngoingVerification struct { - mock *MockCommandRequirementHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommandRequirementHandler_ValidateImportProject_OngoingVerification) GetCapturedArguments() (string, command.ProjectContext) { - repoDir, ctx := c.GetAllCapturedArguments() - return repoDir[len(repoDir)-1], ctx[len(ctx)-1] -} - -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) - } - _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) - return &MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification struct { - mock *MockCommandRequirementHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification) GetCapturedArguments() (string, command.ProjectContext) { - repoDir, ctx := c.GetAllCapturedArguments() - return repoDir[len(repoDir)-1], ctx[len(ctx)-1] -} - -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) - } - _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) - return &MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerification struct { - mock *MockCommandRequirementHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerification) GetCapturedArguments() command.ProjectContext { - ctx := c.GetAllCapturedArguments() - return ctx[len(ctx)-1] -} - -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) - } - } - return -} diff --git a/server/events/mocks/mock_command_runner.go b/server/events/mocks/mock_command_runner.go deleted file mode 100644 index c0267c222a..0000000000 --- a/server/events/mocks/mock_command_runner.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: CommandRunner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - events "github.com/runatlantis/atlantis/server/events" - models "github.com/runatlantis/atlantis/server/events/models" - "reflect" - "time" -) - -type MockCommandRunner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockCommandRunner(options ...pegomock.Option) *MockCommandRunner { - mock := &MockCommandRunner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockCommandRunner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockCommandRunner) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockCommandRunner) RunAutoplanCommand(baseRepo models.Repo, headRepo models.Repo, pull models.PullRequest, user models.User) { - 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{}) -} - -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{}) -} - -func (mock *MockCommandRunner) VerifyWasCalledOnce() *VerifierMockCommandRunner { - return &VerifierMockCommandRunner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCommandRunner { - return &VerifierMockCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommandRunner { - return &VerifierMockCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCommandRunner { - return &VerifierMockCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockCommandRunner struct { - mock *MockCommandRunner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockCommandRunner) RunAutoplanCommand(baseRepo models.Repo, headRepo models.Repo, pull models.PullRequest, user models.User) *MockCommandRunner_RunAutoplanCommand_OngoingVerification { - params := []pegomock.Param{baseRepo, headRepo, pull, user} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunAutoplanCommand", params, verifier.timeout) - return &MockCommandRunner_RunAutoplanCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommandRunner_RunAutoplanCommand_OngoingVerification struct { - mock *MockCommandRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommandRunner_RunAutoplanCommand_OngoingVerification) GetCapturedArguments() (models.Repo, models.Repo, models.PullRequest, models.User) { - baseRepo, headRepo, pull, user := c.GetAllCapturedArguments() - return baseRepo[len(baseRepo)-1], headRepo[len(headRepo)-1], pull[len(pull)-1], user[len(user)-1] -} - -func (c *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) - } - _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.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) - return &MockCommandRunner_RunCommentCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommandRunner_RunCommentCommand_OngoingVerification struct { - mock *MockCommandRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommandRunner_RunCommentCommand_OngoingVerification) GetCapturedArguments() (models.Repo, *models.Repo, *models.PullRequest, models.User, int, *events.CommentCommand) { - baseRepo, maybeHeadRepo, maybePull, user, pullNum, cmd := c.GetAllCapturedArguments() - return baseRepo[len(baseRepo)-1], maybeHeadRepo[len(maybeHeadRepo)-1], maybePull[len(maybePull)-1], user[len(user)-1], pullNum[len(pullNum)-1], cmd[len(cmd)-1] -} - -func (c *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) - } - _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.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) - } - _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 deleted file mode 100644 index 1e461a07ee..0000000000 --- a/server/events/mocks/mock_comment_building.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: CommentBuilder) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - "reflect" - "time" -) - -type MockCommentBuilder struct { - fail func(message string, callerSkip ...int) -} - -func NewMockCommentBuilder(options ...pegomock.Option) *MockCommentBuilder { - mock := &MockCommentBuilder{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -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) string { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockCommentBuilder().") - } - params := []pegomock.Param{repoRelDir, workspace, project, autoMergeDisabled} - result := pegomock.GetGenericMockFrom(mock).Invoke("BuildApplyComment", 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 -} - -func (mock *MockCommentBuilder) BuildApprovePoliciesComment(repoRelDir string, workspace string, project string) string { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockCommentBuilder().") - } - params := []pegomock.Param{repoRelDir, workspace, project} - result := pegomock.GetGenericMockFrom(mock).Invoke("BuildApprovePoliciesComment", 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 -} - -func (mock *MockCommentBuilder) BuildPlanComment(repoRelDir string, workspace string, project string, commentArgs []string) string { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockCommentBuilder().") - } - params := []pegomock.Param{repoRelDir, workspace, project, commentArgs} - result := pegomock.GetGenericMockFrom(mock).Invoke("BuildPlanComment", 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 -} - -func (mock *MockCommentBuilder) VerifyWasCalledOnce() *VerifierMockCommentBuilder { - return &VerifierMockCommentBuilder{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockCommentBuilder) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCommentBuilder { - return &VerifierMockCommentBuilder{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockCommentBuilder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommentBuilder { - return &VerifierMockCommentBuilder{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockCommentBuilder) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCommentBuilder { - return &VerifierMockCommentBuilder{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockCommentBuilder struct { - mock *MockCommentBuilder - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockCommentBuilder) BuildApplyComment(repoRelDir string, workspace string, project string, autoMergeDisabled bool) *MockCommentBuilder_BuildApplyComment_OngoingVerification { - params := []pegomock.Param{repoRelDir, workspace, project, autoMergeDisabled} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildApplyComment", params, verifier.timeout) - return &MockCommentBuilder_BuildApplyComment_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommentBuilder_BuildApplyComment_OngoingVerification struct { - mock *MockCommentBuilder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommentBuilder_BuildApplyComment_OngoingVerification) GetCapturedArguments() (string, string, string, bool) { - repoRelDir, workspace, project, autoMergeDisabled := c.GetAllCapturedArguments() - return repoRelDir[len(repoRelDir)-1], workspace[len(workspace)-1], project[len(project)-1], autoMergeDisabled[len(autoMergeDisabled)-1] -} - -func (c *MockCommentBuilder_BuildApplyComment_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []string, _param3 []bool) { - 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) - } - _param3 = make([]bool, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(bool) - } - } - return -} - -func (verifier *VerifierMockCommentBuilder) BuildApprovePoliciesComment(repoRelDir string, workspace string, project string) *MockCommentBuilder_BuildApprovePoliciesComment_OngoingVerification { - params := []pegomock.Param{repoRelDir, workspace, project} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildApprovePoliciesComment", params, verifier.timeout) - return &MockCommentBuilder_BuildApprovePoliciesComment_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommentBuilder_BuildApprovePoliciesComment_OngoingVerification struct { - mock *MockCommentBuilder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommentBuilder_BuildApprovePoliciesComment_OngoingVerification) GetCapturedArguments() (string, string, string) { - repoRelDir, workspace, project := c.GetAllCapturedArguments() - return repoRelDir[len(repoRelDir)-1], workspace[len(workspace)-1], project[len(project)-1] -} - -func (c *MockCommentBuilder_BuildApprovePoliciesComment_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) - } - } - return -} - -func (verifier *VerifierMockCommentBuilder) BuildPlanComment(repoRelDir string, workspace string, project string, commentArgs []string) *MockCommentBuilder_BuildPlanComment_OngoingVerification { - params := []pegomock.Param{repoRelDir, workspace, project, commentArgs} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildPlanComment", params, verifier.timeout) - return &MockCommentBuilder_BuildPlanComment_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommentBuilder_BuildPlanComment_OngoingVerification struct { - mock *MockCommentBuilder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommentBuilder_BuildPlanComment_OngoingVerification) GetCapturedArguments() (string, string, string, []string) { - repoRelDir, workspace, project, commentArgs := c.GetAllCapturedArguments() - return repoRelDir[len(repoRelDir)-1], workspace[len(workspace)-1], project[len(project)-1], commentArgs[len(commentArgs)-1] -} - -func (c *MockCommentBuilder_BuildPlanComment_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _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) - } - _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([][]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.([]string) - } - } - return -} diff --git a/server/events/mocks/mock_comment_parsing.go b/server/events/mocks/mock_comment_parsing.go deleted file mode 100644 index 73a26e00ae..0000000000 --- a/server/events/mocks/mock_comment_parsing.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: CommentParsing) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - events "github.com/runatlantis/atlantis/server/events" - models "github.com/runatlantis/atlantis/server/events/models" - "reflect" - "time" -) - -type MockCommentParsing struct { - fail func(message string, callerSkip ...int) -} - -func NewMockCommentParsing(options ...pegomock.Option) *MockCommentParsing { - mock := &MockCommentParsing{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockCommentParsing) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockCommentParsing) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockCommentParsing) Parse(comment string, vcsHost models.VCSHostType) events.CommentParseResult { - 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) - } - } - return ret0 -} - -func (mock *MockCommentParsing) VerifyWasCalledOnce() *VerifierMockCommentParsing { - return &VerifierMockCommentParsing{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockCommentParsing) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCommentParsing { - return &VerifierMockCommentParsing{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockCommentParsing) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommentParsing { - return &VerifierMockCommentParsing{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockCommentParsing) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCommentParsing { - return &VerifierMockCommentParsing{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockCommentParsing struct { - mock *MockCommentParsing - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockCommentParsing) Parse(comment string, vcsHost models.VCSHostType) *MockCommentParsing_Parse_OngoingVerification { - params := []pegomock.Param{comment, vcsHost} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Parse", params, verifier.timeout) - return &MockCommentParsing_Parse_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommentParsing_Parse_OngoingVerification struct { - mock *MockCommentParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommentParsing_Parse_OngoingVerification) GetCapturedArguments() (string, models.VCSHostType) { - comment, vcsHost := c.GetAllCapturedArguments() - return comment[len(comment)-1], vcsHost[len(vcsHost)-1] -} - -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) - } - _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 deleted file mode 100644 index b0e5fcea97..0000000000 --- a/server/events/mocks/mock_commit_status_updater.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: CommitStatusUpdater) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockCommitStatusUpdater struct { - fail func(message string, callerSkip ...int) -} - -func NewMockCommitStatusUpdater(options ...pegomock.Option) *MockCommitStatusUpdater { - mock := &MockCommitStatusUpdater{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockCommitStatusUpdater) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockCommitStatusUpdater) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockCommitStatusUpdater) UpdateCombined(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, status models.CommitStatus, cmdName command.Name) error { - 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) - } - } - 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) - } - } - 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) - } - } - 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) - } - } - return ret0 -} - -func (mock *MockCommitStatusUpdater) VerifyWasCalledOnce() *VerifierMockCommitStatusUpdater { - return &VerifierMockCommitStatusUpdater{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockCommitStatusUpdater) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCommitStatusUpdater { - return &VerifierMockCommitStatusUpdater{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockCommitStatusUpdater) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommitStatusUpdater { - return &VerifierMockCommitStatusUpdater{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockCommitStatusUpdater) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCommitStatusUpdater { - return &VerifierMockCommitStatusUpdater{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockCommitStatusUpdater struct { - mock *MockCommitStatusUpdater - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockCommitStatusUpdater_UpdateCombined_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommitStatusUpdater_UpdateCombined_OngoingVerification struct { - mock *MockCommitStatusUpdater - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommitStatusUpdater_UpdateCombined_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, models.CommitStatus, command.Name) { - logger, repo, pull, status, cmdName := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pull[len(pull)-1], status[len(status)-1], cmdName[len(cmdName)-1] -} - -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) - } - _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([]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) - return &MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification struct { - mock *MockCommitStatusUpdater - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, models.CommitStatus, command.Name, int, int) { - logger, repo, pull, status, cmdName, numSuccess, numTotal := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pull[len(pull)-1], status[len(status)-1], cmdName[len(cmdName)-1], numSuccess[len(numSuccess)-1], numTotal[len(numTotal)-1] -} - -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) - } - _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([]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) - } - _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) - return &MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification struct { - mock *MockCommitStatusUpdater - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.PullRequest, models.CommitStatus, string, string, string) { - logger, pull, status, hookDescription, runtimeDescription, url := c.GetAllCapturedArguments() - return logger[len(logger)-1], pull[len(pull)-1], status[len(status)-1], hookDescription[len(hookDescription)-1], runtimeDescription[len(runtimeDescription)-1], url[len(url)-1] -} - -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) - } - _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) - } - _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) - } - } - 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) - return &MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification struct { - mock *MockCommitStatusUpdater - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.PullRequest, models.CommitStatus, string, string, string) { - logger, pull, status, hookDescription, runtimeDescription, url := c.GetAllCapturedArguments() - return logger[len(logger)-1], pull[len(pull)-1], status[len(status)-1], hookDescription[len(hookDescription)-1], runtimeDescription[len(runtimeDescription)-1], url[len(url)-1] -} - -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) - } - _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) - } - _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) - } - } - return -} diff --git a/server/events/mocks/mock_custom_step_runner.go b/server/events/mocks/mock_custom_step_runner.go deleted file mode 100644 index 8805706322..0000000000 --- a/server/events/mocks/mock_custom_step_runner.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: CustomStepRunner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - valid "github.com/runatlantis/atlantis/server/core/config/valid" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockCustomStepRunner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockCustomStepRunner(options ...pegomock.Option) *MockCustomStepRunner { - mock := &MockCustomStepRunner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockCustomStepRunner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockCustomStepRunner) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockCustomStepRunner) Run(ctx command.ProjectContext, cmd string, path string, envs map[string]string, streamOutput bool, postProcessOutput valid.PostProcessRunOutputOption) (string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockCustomStepRunner) VerifyWasCalledOnce() *VerifierMockCustomStepRunner { - return &VerifierMockCustomStepRunner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockCustomStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCustomStepRunner { - return &VerifierMockCustomStepRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockCustomStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCustomStepRunner { - return &VerifierMockCustomStepRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockCustomStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCustomStepRunner { - return &VerifierMockCustomStepRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockCustomStepRunner struct { - mock *MockCustomStepRunner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockCustomStepRunner) Run(ctx command.ProjectContext, 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) - return &MockCustomStepRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockCustomStepRunner_Run_OngoingVerification struct { - mock *MockCustomStepRunner - 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) 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) - } - _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([]map[string]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(map[string]string) - } - _param4 = make([]bool, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(bool) - } - _param5 = make([]valid.PostProcessRunOutputOption, len(c.methodInvocations)) - for u, param := range params[5] { - _param5[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 deleted file mode 100644 index a8511f28c8..0000000000 --- a/server/events/mocks/mock_delete_lock_command.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: DeleteLockCommand) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockDeleteLockCommand struct { - fail func(message string, callerSkip ...int) -} - -func NewMockDeleteLockCommand(options ...pegomock.Option) *MockDeleteLockCommand { - mock := &MockDeleteLockCommand{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockDeleteLockCommand) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockDeleteLockCommand) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockDeleteLockCommand) DeleteLock(logger logging.SimpleLogging, id string) (*models.ProjectLock, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockDeleteLockCommand) VerifyWasCalledOnce() *VerifierMockDeleteLockCommand { - return &VerifierMockDeleteLockCommand{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockDeleteLockCommand) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockDeleteLockCommand { - return &VerifierMockDeleteLockCommand{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockDeleteLockCommand) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockDeleteLockCommand { - return &VerifierMockDeleteLockCommand{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockDeleteLockCommand) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockDeleteLockCommand { - return &VerifierMockDeleteLockCommand{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockDeleteLockCommand struct { - mock *MockDeleteLockCommand - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockDeleteLockCommand_DeleteLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockDeleteLockCommand_DeleteLock_OngoingVerification struct { - mock *MockDeleteLockCommand - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockDeleteLockCommand_DeleteLock_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, string) { - logger, id := c.GetAllCapturedArguments() - return logger[len(logger)-1], id[len(id)-1] -} - -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) - } - _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) - return &MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification struct { - mock *MockDeleteLockCommand - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, string, int) { - logger, repoFullName, pullNum := c.GetAllCapturedArguments() - return logger[len(logger)-1], repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1] -} - -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) - } - _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) - } - } - return -} diff --git a/server/events/mocks/mock_env_step_runner.go b/server/events/mocks/mock_env_step_runner.go deleted file mode 100644 index bfc7f97a57..0000000000 --- a/server/events/mocks/mock_env_step_runner.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: EnvStepRunner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockEnvStepRunner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockEnvStepRunner(options ...pegomock.Option) *MockEnvStepRunner { - mock := &MockEnvStepRunner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockEnvStepRunner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockEnvStepRunner) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockEnvStepRunner) Run(ctx command.ProjectContext, cmd string, value string, path string, envs map[string]string) (string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockEnvStepRunner) VerifyWasCalledOnce() *VerifierMockEnvStepRunner { - return &VerifierMockEnvStepRunner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockEnvStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockEnvStepRunner { - return &VerifierMockEnvStepRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockEnvStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockEnvStepRunner { - return &VerifierMockEnvStepRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockEnvStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockEnvStepRunner { - return &VerifierMockEnvStepRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockEnvStepRunner struct { - mock *MockEnvStepRunner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockEnvStepRunner) Run(ctx command.ProjectContext, 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) - return &MockEnvStepRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEnvStepRunner_Run_OngoingVerification struct { - mock *MockEnvStepRunner - 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) 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) - } - _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([]string, len(c.methodInvocations)) - for u, param := range params[3] { - _param3[u] = param.(string) - } - _param4 = make([]map[string]string, len(c.methodInvocations)) - for u, param := range params[4] { - _param4[u] = param.(map[string]string) - } - } - return -} diff --git a/server/events/mocks/mock_event_parsing.go b/server/events/mocks/mock_event_parsing.go deleted file mode 100644 index 505fadb5fa..0000000000 --- a/server/events/mocks/mock_event_parsing.go +++ /dev/null @@ -1,1223 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: EventParsing) - -package mocks - -import ( - gitea "code.gitea.io/sdk/gitea" - github "github.com/google/go-github/v59/github" - azuredevops "github.com/mcdafydd/go-azuredevops/azuredevops" - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - gitea0 "github.com/runatlantis/atlantis/server/events/vcs/gitea" - logging "github.com/runatlantis/atlantis/server/logging" - go_gitlab "github.com/xanzy/go-gitlab" - "reflect" - "time" -) - -type MockEventParsing struct { - fail func(message string, callerSkip ...int) -} - -func NewMockEventParsing(options ...pegomock.Option) *MockEventParsing { - mock := &MockEventParsing{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockEventParsing) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockEventParsing) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockEventParsing) GetBitbucketCloudPullEventType(eventTypeHeader string, sha string, pr string) models.PullRequestEventType { - 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) - } - } - 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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.Repo) - } - if result[2] != nil { - ret2 = result[2].(models.Repo) - } - if result[3] != nil { - ret3 = result[3].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.PullRequestEventType) - } - if result[2] != nil { - ret2 = result[2].(models.Repo) - } - if result[3] != nil { - ret3 = result[3].(models.Repo) - } - if result[4] != nil { - ret4 = result[4].(models.User) - } - if result[5] != nil { - ret5 = result[5].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.Repo) - } - if result[2] != nil { - ret2 = result[2].(models.Repo) - } - if result[3] != nil { - ret3 = result[3].(models.User) - } - if result[4] != nil { - ret4 = result[4].(string) - } - if result[5] != nil { - ret5 = result[5].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.Repo) - } - if result[2] != nil { - ret2 = result[2].(models.Repo) - } - if result[3] != nil { - ret3 = result[3].(models.User) - } - if result[4] != nil { - ret4 = result[4].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.Repo) - } - if result[2] != nil { - ret2 = result[2].(models.Repo) - } - if result[3] != nil { - ret3 = result[3].(models.User) - } - if result[4] != nil { - ret4 = result[4].(string) - } - if result[5] != nil { - ret5 = result[5].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.Repo) - } - if result[2] != nil { - ret2 = result[2].(models.Repo) - } - if result[3] != nil { - ret3 = result[3].(models.User) - } - if result[4] != nil { - ret4 = result[4].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.User) - } - if result[2] != nil { - ret2 = result[2].(int) - } - if result[3] != nil { - ret3 = result[3].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.Repo) - } - if result[2] != nil { - ret2 = result[2].(models.Repo) - } - if result[3] != nil { - ret3 = result[3].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.PullRequestEventType) - } - if result[2] != nil { - ret2 = result[2].(models.Repo) - } - if result[3] != nil { - ret3 = result[3].(models.Repo) - } - if result[4] != nil { - ret4 = result[4].(models.User) - } - if result[5] != nil { - ret5 = result[5].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.User) - } - if result[2] != nil { - ret2 = result[2].(int) - } - if result[3] != nil { - ret3 = result[3].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.Repo) - } - if result[2] != nil { - ret2 = result[2].(models.Repo) - } - if result[3] != nil { - ret3 = result[3].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.PullRequestEventType) - } - if result[2] != nil { - ret2 = result[2].(models.Repo) - } - if result[3] != nil { - ret3 = result[3].(models.Repo) - } - if result[4] != nil { - ret4 = result[4].(models.User) - } - if result[5] != nil { - ret5 = result[5].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.Repo) - } - if result[2] != nil { - ret2 = result[2].(int) - } - if result[3] != nil { - ret3 = result[3].(models.User) - } - if result[4] != nil { - ret4 = result[4].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(models.PullRequestEventType) - } - if result[2] != nil { - ret2 = result[2].(models.Repo) - } - if result[3] != nil { - ret3 = result[3].(models.Repo) - } - if result[4] != nil { - ret4 = result[4].(models.User) - } - if result[5] != nil { - ret5 = result[5].(error) - } - } - 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) - } - } - return ret0 -} - -func (mock *MockEventParsing) VerifyWasCalledOnce() *VerifierMockEventParsing { - return &VerifierMockEventParsing{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockEventParsing) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockEventParsing { - return &VerifierMockEventParsing{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockEventParsing) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockEventParsing { - return &VerifierMockEventParsing{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockEventParsing) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockEventParsing { - return &VerifierMockEventParsing{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockEventParsing struct { - mock *MockEventParsing - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_GetBitbucketCloudPullEventType_OngoingVerification) GetCapturedArguments() (string, string, string) { - eventTypeHeader, sha, pr := c.GetAllCapturedArguments() - return eventTypeHeader[len(eventTypeHeader)-1], sha[len(sha)-1], pr[len(pr)-1] -} - -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) - } - } - 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) - return &MockEventParsing_GetBitbucketServerPullEventType_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_GetBitbucketServerPullEventType_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_GetBitbucketServerPullEventType_OngoingVerification) GetCapturedArguments() string { - eventTypeHeader := c.GetAllCapturedArguments() - return eventTypeHeader[len(eventTypeHeader)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseAPIPlanRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseAPIPlanRequest_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseAPIPlanRequest_OngoingVerification) GetCapturedArguments() (models.VCSHostType, string, string) { - vcsHostType, path, cloneURL := c.GetAllCapturedArguments() - return vcsHostType[len(vcsHostType)-1], path[len(path)-1], cloneURL[len(cloneURL)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseAzureDevopsPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseAzureDevopsPull_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseAzureDevopsPull_OngoingVerification) GetCapturedArguments() *azuredevops.GitPullRequest { - adPull := c.GetAllCapturedArguments() - return adPull[len(adPull)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseAzureDevopsPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseAzureDevopsPullEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseAzureDevopsPullEvent_OngoingVerification) GetCapturedArguments() azuredevops.Event { - pullEvent := c.GetAllCapturedArguments() - return pullEvent[len(pullEvent)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseAzureDevopsRepo_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseAzureDevopsRepo_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseAzureDevopsRepo_OngoingVerification) GetCapturedArguments() *azuredevops.GitRepository { - adRepo := c.GetAllCapturedArguments() - return adRepo[len(adRepo)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseBitbucketCloudPullCommentEvent_OngoingVerification) GetCapturedArguments() []byte { - body := c.GetAllCapturedArguments() - return body[len(body)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseBitbucketCloudPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseBitbucketCloudPullEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseBitbucketCloudPullEvent_OngoingVerification) GetCapturedArguments() []byte { - body := c.GetAllCapturedArguments() - return body[len(body)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseBitbucketServerPullCommentEvent_OngoingVerification) GetCapturedArguments() []byte { - body := c.GetAllCapturedArguments() - return body[len(body)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseBitbucketServerPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseBitbucketServerPullEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseBitbucketServerPullEvent_OngoingVerification) GetCapturedArguments() []byte { - body := c.GetAllCapturedArguments() - return body[len(body)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseGiteaIssueCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseGiteaIssueCommentEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseGiteaIssueCommentEvent_OngoingVerification) GetCapturedArguments() gitea0.GiteaIssueCommentPayload { - event := c.GetAllCapturedArguments() - return event[len(event)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseGiteaPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseGiteaPull_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseGiteaPull_OngoingVerification) GetCapturedArguments() *gitea.PullRequest { - pull := c.GetAllCapturedArguments() - return pull[len(pull)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseGiteaPullRequestEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseGiteaPullRequestEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseGiteaPullRequestEvent_OngoingVerification) GetCapturedArguments() gitea.PullRequest { - event := c.GetAllCapturedArguments() - return event[len(event)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseGithubIssueCommentEvent_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, *github.IssueCommentEvent) { - logger, comment := c.GetAllCapturedArguments() - return logger[len(logger)-1], comment[len(comment)-1] -} - -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) - } - _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) - return &MockEventParsing_ParseGithubPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseGithubPull_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseGithubPull_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, *github.PullRequest) { - logger, ghPull := c.GetAllCapturedArguments() - return logger[len(logger)-1], ghPull[len(ghPull)-1] -} - -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) - } - _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) - return &MockEventParsing_ParseGithubPullEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseGithubPullEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseGithubPullEvent_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, *github.PullRequestEvent) { - logger, pullEvent := c.GetAllCapturedArguments() - return logger[len(logger)-1], pullEvent[len(pullEvent)-1] -} - -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) - } - _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) - return &MockEventParsing_ParseGithubRepo_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseGithubRepo_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseGithubRepo_OngoingVerification) GetCapturedArguments() *github.Repository { - ghRepo := c.GetAllCapturedArguments() - return ghRepo[len(ghRepo)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseGitlabMergeRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseGitlabMergeRequest_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseGitlabMergeRequest_OngoingVerification) GetCapturedArguments() (*go_gitlab.MergeRequest, models.Repo) { - mr, baseRepo := c.GetAllCapturedArguments() - return mr[len(mr)-1], baseRepo[len(baseRepo)-1] -} - -func (c *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) - } - _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) - return &MockEventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseGitlabMergeRequestCommentEvent_OngoingVerification) GetCapturedArguments() go_gitlab.MergeCommentEvent { - event := c.GetAllCapturedArguments() - return event[len(event)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseGitlabMergeRequestEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseGitlabMergeRequestEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseGitlabMergeRequestEvent_OngoingVerification) GetCapturedArguments() go_gitlab.MergeEvent { - event := c.GetAllCapturedArguments() - return event[len(event)-1] -} - -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) - } - } - 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) - return &MockEventParsing_ParseGitlabMergeRequestUpdateEvent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockEventParsing_ParseGitlabMergeRequestUpdateEvent_OngoingVerification struct { - mock *MockEventParsing - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockEventParsing_ParseGitlabMergeRequestUpdateEvent_OngoingVerification) GetCapturedArguments() go_gitlab.MergeEvent { - event := c.GetAllCapturedArguments() - return event[len(event)-1] -} - -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) - } - } - return -} diff --git a/server/events/mocks/mock_github_pull_getter.go b/server/events/mocks/mock_github_pull_getter.go deleted file mode 100644 index 23af2cd1b0..0000000000 --- a/server/events/mocks/mock_github_pull_getter.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: GithubPullGetter) - -package mocks - -import ( - github "github.com/google/go-github/v59/github" - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockGithubPullGetter struct { - fail func(message string, callerSkip ...int) -} - -func NewMockGithubPullGetter(options ...pegomock.Option) *MockGithubPullGetter { - mock := &MockGithubPullGetter{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockGithubPullGetter) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockGithubPullGetter) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockGithubPullGetter) GetPullRequest(logger logging.SimpleLogging, repo models.Repo, pullNum int) (*github.PullRequest, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockGithubPullGetter) VerifyWasCalledOnce() *VerifierMockGithubPullGetter { - return &VerifierMockGithubPullGetter{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockGithubPullGetter) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockGithubPullGetter { - return &VerifierMockGithubPullGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockGithubPullGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGithubPullGetter { - return &VerifierMockGithubPullGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockGithubPullGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockGithubPullGetter { - return &VerifierMockGithubPullGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockGithubPullGetter struct { - mock *MockGithubPullGetter - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockGithubPullGetter_GetPullRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockGithubPullGetter_GetPullRequest_OngoingVerification struct { - mock *MockGithubPullGetter - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockGithubPullGetter_GetPullRequest_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, int) { - logger, repo, pullNum := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pullNum[len(pullNum)-1] -} - -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) - } - _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) - } - } - return -} diff --git a/server/events/mocks/mock_gitlab_merge_request_getter.go b/server/events/mocks/mock_gitlab_merge_request_getter.go deleted file mode 100644 index cdb481741d..0000000000 --- a/server/events/mocks/mock_gitlab_merge_request_getter.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: GitlabMergeRequestGetter) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - logging "github.com/runatlantis/atlantis/server/logging" - go_gitlab "github.com/xanzy/go-gitlab" - "reflect" - "time" -) - -type MockGitlabMergeRequestGetter struct { - fail func(message string, callerSkip ...int) -} - -func NewMockGitlabMergeRequestGetter(options ...pegomock.Option) *MockGitlabMergeRequestGetter { - mock := &MockGitlabMergeRequestGetter{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockGitlabMergeRequestGetter) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockGitlabMergeRequestGetter) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockGitlabMergeRequestGetter) GetMergeRequest(logger logging.SimpleLogging, repoFullName string, pullNum int) (*go_gitlab.MergeRequest, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledOnce() *VerifierMockGitlabMergeRequestGetter { - return &VerifierMockGitlabMergeRequestGetter{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockGitlabMergeRequestGetter) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockGitlabMergeRequestGetter { - return &VerifierMockGitlabMergeRequestGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGitlabMergeRequestGetter { - return &VerifierMockGitlabMergeRequestGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockGitlabMergeRequestGetter { - return &VerifierMockGitlabMergeRequestGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockGitlabMergeRequestGetter struct { - mock *MockGitlabMergeRequestGetter - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification struct { - mock *MockGitlabMergeRequestGetter - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockGitlabMergeRequestGetter_GetMergeRequest_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, string, int) { - logger, repoFullName, pullNum := c.GetAllCapturedArguments() - return logger[len(logger)-1], repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1] -} - -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) - } - _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) - } - } - return -} diff --git a/server/events/mocks/mock_job_message_sender.go b/server/events/mocks/mock_job_message_sender.go deleted file mode 100644 index 380cd22674..0000000000 --- a/server/events/mocks/mock_job_message_sender.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: JobMessageSender) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockJobMessageSender struct { - fail func(message string, callerSkip ...int) -} - -func NewMockJobMessageSender(options ...pegomock.Option) *MockJobMessageSender { - mock := &MockJobMessageSender{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockJobMessageSender) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockJobMessageSender) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockJobMessageSender) Send(ctx command.ProjectContext, msg string, operationComplete bool) { - 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{}) -} - -func (mock *MockJobMessageSender) VerifyWasCalledOnce() *VerifierMockJobMessageSender { - return &VerifierMockJobMessageSender{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockJobMessageSender) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockJobMessageSender { - return &VerifierMockJobMessageSender{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockJobMessageSender) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockJobMessageSender { - return &VerifierMockJobMessageSender{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockJobMessageSender) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockJobMessageSender { - return &VerifierMockJobMessageSender{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockJobMessageSender struct { - mock *MockJobMessageSender - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockJobMessageSender_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockJobMessageSender_Send_OngoingVerification struct { - mock *MockJobMessageSender - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockJobMessageSender_Send_OngoingVerification) GetCapturedArguments() (command.ProjectContext, string, bool) { - ctx, msg, operationComplete := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], msg[len(msg)-1], operationComplete[len(operationComplete)-1] -} - -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) - } - _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) - } - } - return -} diff --git a/server/events/mocks/mock_job_url_setter.go b/server/events/mocks/mock_job_url_setter.go deleted file mode 100644 index 427e081f27..0000000000 --- a/server/events/mocks/mock_job_url_setter.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: JobURLSetter) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - models "github.com/runatlantis/atlantis/server/events/models" - "reflect" - "time" -) - -type MockJobURLSetter struct { - fail func(message string, callerSkip ...int) -} - -func NewMockJobURLSetter(options ...pegomock.Option) *MockJobURLSetter { - mock := &MockJobURLSetter{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockJobURLSetter) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockJobURLSetter) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockJobURLSetter) SetJobURLWithStatus(ctx command.ProjectContext, cmdName command.Name, status models.CommitStatus, res *command.ProjectResult) error { - 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) - } - } - return ret0 -} - -func (mock *MockJobURLSetter) VerifyWasCalledOnce() *VerifierMockJobURLSetter { - return &VerifierMockJobURLSetter{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockJobURLSetter) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockJobURLSetter { - return &VerifierMockJobURLSetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockJobURLSetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockJobURLSetter { - return &VerifierMockJobURLSetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockJobURLSetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockJobURLSetter { - return &VerifierMockJobURLSetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockJobURLSetter struct { - mock *MockJobURLSetter - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockJobURLSetter_SetJobURLWithStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockJobURLSetter_SetJobURLWithStatus_OngoingVerification struct { - mock *MockJobURLSetter - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockJobURLSetter_SetJobURLWithStatus_OngoingVerification) GetCapturedArguments() (command.ProjectContext, command.Name, models.CommitStatus, *command.ProjectResult) { - ctx, cmdName, status, res := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], cmdName[len(cmdName)-1], status[len(status)-1], res[len(res)-1] -} - -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) - } - _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) - } - _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 deleted file mode 100644 index bb3f40a49a..0000000000 --- a/server/events/mocks/mock_lock_url_generator.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: LockURLGenerator) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - "reflect" - "time" -) - -type MockLockURLGenerator struct { - fail func(message string, callerSkip ...int) -} - -func NewMockLockURLGenerator(options ...pegomock.Option) *MockLockURLGenerator { - mock := &MockLockURLGenerator{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockLockURLGenerator) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockLockURLGenerator) FailHandler() pegomock.FailHandler { return mock.fail } - -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) - } - } - return ret0 -} - -func (mock *MockLockURLGenerator) VerifyWasCalledOnce() *VerifierMockLockURLGenerator { - return &VerifierMockLockURLGenerator{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockLockURLGenerator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockLockURLGenerator { - return &VerifierMockLockURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockLockURLGenerator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockLockURLGenerator { - return &VerifierMockLockURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockLockURLGenerator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockLockURLGenerator { - return &VerifierMockLockURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockLockURLGenerator struct { - mock *MockLockURLGenerator - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockLockURLGenerator) GenerateLockURL(lockID string) *MockLockURLGenerator_GenerateLockURL_OngoingVerification { - params := []pegomock.Param{lockID} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GenerateLockURL", params, verifier.timeout) - return &MockLockURLGenerator_GenerateLockURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockLockURLGenerator_GenerateLockURL_OngoingVerification struct { - mock *MockLockURLGenerator - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockLockURLGenerator_GenerateLockURL_OngoingVerification) GetCapturedArguments() string { - lockID := c.GetAllCapturedArguments() - return lockID[len(lockID)-1] -} - -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) - } - } - return -} diff --git a/server/events/mocks/mock_pending_plan_finder.go b/server/events/mocks/mock_pending_plan_finder.go deleted file mode 100644 index 51cc57f071..0000000000 --- a/server/events/mocks/mock_pending_plan_finder.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: PendingPlanFinder) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - events "github.com/runatlantis/atlantis/server/events" - "reflect" - "time" -) - -type MockPendingPlanFinder struct { - fail func(message string, callerSkip ...int) -} - -func NewMockPendingPlanFinder(options ...pegomock.Option) *MockPendingPlanFinder { - mock := &MockPendingPlanFinder{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockPendingPlanFinder) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockPendingPlanFinder) FailHandler() pegomock.FailHandler { return mock.fail } - -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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockPendingPlanFinder) VerifyWasCalledOnce() *VerifierMockPendingPlanFinder { - return &VerifierMockPendingPlanFinder{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockPendingPlanFinder) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPendingPlanFinder { - return &VerifierMockPendingPlanFinder{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockPendingPlanFinder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPendingPlanFinder { - return &VerifierMockPendingPlanFinder{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockPendingPlanFinder) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPendingPlanFinder { - return &VerifierMockPendingPlanFinder{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockPendingPlanFinder struct { - mock *MockPendingPlanFinder - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockPendingPlanFinder) DeletePlans(pullDir string) *MockPendingPlanFinder_DeletePlans_OngoingVerification { - params := []pegomock.Param{pullDir} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeletePlans", params, verifier.timeout) - return &MockPendingPlanFinder_DeletePlans_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockPendingPlanFinder_DeletePlans_OngoingVerification struct { - mock *MockPendingPlanFinder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockPendingPlanFinder_DeletePlans_OngoingVerification) GetCapturedArguments() string { - pullDir := c.GetAllCapturedArguments() - return pullDir[len(pullDir)-1] -} - -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) - } - } - 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) - return &MockPendingPlanFinder_Find_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockPendingPlanFinder_Find_OngoingVerification struct { - mock *MockPendingPlanFinder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockPendingPlanFinder_Find_OngoingVerification) GetCapturedArguments() string { - pullDir := c.GetAllCapturedArguments() - return pullDir[len(pullDir)-1] -} - -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) - } - } - 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 deleted file mode 100644 index dce0a93560..0000000000 --- a/server/events/mocks/mock_post_workflow_hook_url_generator.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: PostWorkflowHookURLGenerator) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - "reflect" - "time" -) - -type MockPostWorkflowHookURLGenerator struct { - fail func(message string, callerSkip ...int) -} - -func NewMockPostWorkflowHookURLGenerator(options ...pegomock.Option) *MockPostWorkflowHookURLGenerator { - mock := &MockPostWorkflowHookURLGenerator{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockPostWorkflowHookURLGenerator) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockPostWorkflowHookURLGenerator) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockPostWorkflowHookURLGenerator) GenerateProjectWorkflowHookURL(hookID string) (string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockPostWorkflowHookURLGenerator) VerifyWasCalledOnce() *VerifierMockPostWorkflowHookURLGenerator { - return &VerifierMockPostWorkflowHookURLGenerator{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockPostWorkflowHookURLGenerator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPostWorkflowHookURLGenerator { - return &VerifierMockPostWorkflowHookURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockPostWorkflowHookURLGenerator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPostWorkflowHookURLGenerator { - return &VerifierMockPostWorkflowHookURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockPostWorkflowHookURLGenerator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPostWorkflowHookURLGenerator { - return &VerifierMockPostWorkflowHookURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockPostWorkflowHookURLGenerator struct { - mock *MockPostWorkflowHookURLGenerator - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockPostWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockPostWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification struct { - mock *MockPostWorkflowHookURLGenerator - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockPostWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification) GetCapturedArguments() string { - hookID := c.GetAllCapturedArguments() - return hookID[len(hookID)-1] -} - -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) - } - } - 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 deleted file mode 100644 index 3163ccb52a..0000000000 --- a/server/events/mocks/mock_post_workflows_hooks_command_runner.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: PostWorkflowHooksCommandRunner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - events "github.com/runatlantis/atlantis/server/events" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockPostWorkflowHooksCommandRunner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockPostWorkflowHooksCommandRunner(options ...pegomock.Option) *MockPostWorkflowHooksCommandRunner { - mock := &MockPostWorkflowHooksCommandRunner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockPostWorkflowHooksCommandRunner) SetFailHandler(fh pegomock.FailHandler) { - mock.fail = fh -} -func (mock *MockPostWorkflowHooksCommandRunner) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockPostWorkflowHooksCommandRunner) RunPostHooks(ctx *command.Context, cmd *events.CommentCommand) error { - 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) - } - } - return ret0 -} - -func (mock *MockPostWorkflowHooksCommandRunner) VerifyWasCalledOnce() *VerifierMockPostWorkflowHooksCommandRunner { - return &VerifierMockPostWorkflowHooksCommandRunner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockPostWorkflowHooksCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPostWorkflowHooksCommandRunner { - return &VerifierMockPostWorkflowHooksCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockPostWorkflowHooksCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPostWorkflowHooksCommandRunner { - return &VerifierMockPostWorkflowHooksCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockPostWorkflowHooksCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPostWorkflowHooksCommandRunner { - return &VerifierMockPostWorkflowHooksCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockPostWorkflowHooksCommandRunner struct { - mock *MockPostWorkflowHooksCommandRunner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockPostWorkflowHooksCommandRunner_RunPostHooks_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockPostWorkflowHooksCommandRunner_RunPostHooks_OngoingVerification struct { - mock *MockPostWorkflowHooksCommandRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockPostWorkflowHooksCommandRunner_RunPostHooks_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) { - ctx, cmd := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], cmd[len(cmd)-1] -} - -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) - } - _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 deleted file mode 100644 index 389562b40a..0000000000 --- a/server/events/mocks/mock_pre_workflow_hook_url_generator.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: PreWorkflowHookURLGenerator) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - "reflect" - "time" -) - -type MockPreWorkflowHookURLGenerator struct { - fail func(message string, callerSkip ...int) -} - -func NewMockPreWorkflowHookURLGenerator(options ...pegomock.Option) *MockPreWorkflowHookURLGenerator { - mock := &MockPreWorkflowHookURLGenerator{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockPreWorkflowHookURLGenerator) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockPreWorkflowHookURLGenerator) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockPreWorkflowHookURLGenerator) GenerateProjectWorkflowHookURL(hookID string) (string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockPreWorkflowHookURLGenerator) VerifyWasCalledOnce() *VerifierMockPreWorkflowHookURLGenerator { - return &VerifierMockPreWorkflowHookURLGenerator{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockPreWorkflowHookURLGenerator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPreWorkflowHookURLGenerator { - return &VerifierMockPreWorkflowHookURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockPreWorkflowHookURLGenerator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPreWorkflowHookURLGenerator { - return &VerifierMockPreWorkflowHookURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockPreWorkflowHookURLGenerator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPreWorkflowHookURLGenerator { - return &VerifierMockPreWorkflowHookURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockPreWorkflowHookURLGenerator struct { - mock *MockPreWorkflowHookURLGenerator - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockPreWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockPreWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification struct { - mock *MockPreWorkflowHookURLGenerator - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockPreWorkflowHookURLGenerator_GenerateProjectWorkflowHookURL_OngoingVerification) GetCapturedArguments() string { - hookID := c.GetAllCapturedArguments() - return hookID[len(hookID)-1] -} - -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) - } - } - 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 deleted file mode 100644 index da4c7b289e..0000000000 --- a/server/events/mocks/mock_pre_workflows_hooks_command_runner.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: PreWorkflowHooksCommandRunner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - events "github.com/runatlantis/atlantis/server/events" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockPreWorkflowHooksCommandRunner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockPreWorkflowHooksCommandRunner(options ...pegomock.Option) *MockPreWorkflowHooksCommandRunner { - mock := &MockPreWorkflowHooksCommandRunner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockPreWorkflowHooksCommandRunner) SetFailHandler(fh pegomock.FailHandler) { - mock.fail = fh -} -func (mock *MockPreWorkflowHooksCommandRunner) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockPreWorkflowHooksCommandRunner) RunPreHooks(ctx *command.Context, cmd *events.CommentCommand) error { - 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) - } - } - return ret0 -} - -func (mock *MockPreWorkflowHooksCommandRunner) VerifyWasCalledOnce() *VerifierMockPreWorkflowHooksCommandRunner { - return &VerifierMockPreWorkflowHooksCommandRunner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockPreWorkflowHooksCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPreWorkflowHooksCommandRunner { - return &VerifierMockPreWorkflowHooksCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockPreWorkflowHooksCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPreWorkflowHooksCommandRunner { - return &VerifierMockPreWorkflowHooksCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockPreWorkflowHooksCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPreWorkflowHooksCommandRunner { - return &VerifierMockPreWorkflowHooksCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockPreWorkflowHooksCommandRunner struct { - mock *MockPreWorkflowHooksCommandRunner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockPreWorkflowHooksCommandRunner_RunPreHooks_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockPreWorkflowHooksCommandRunner_RunPreHooks_OngoingVerification struct { - mock *MockPreWorkflowHooksCommandRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockPreWorkflowHooksCommandRunner_RunPreHooks_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) { - ctx, cmd := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], cmd[len(cmd)-1] -} - -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) - } - _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 deleted file mode 100644 index 6a68f048b6..0000000000 --- a/server/events/mocks/mock_project_command_builder.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: ProjectCommandBuilder) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - events "github.com/runatlantis/atlantis/server/events" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockProjectCommandBuilder struct { - fail func(message string, callerSkip ...int) -} - -func NewMockProjectCommandBuilder(options ...pegomock.Option) *MockProjectCommandBuilder { - mock := &MockProjectCommandBuilder{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockProjectCommandBuilder) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockProjectCommandBuilder) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockProjectCommandBuilder) BuildApplyCommands(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("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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockProjectCommandBuilder) VerifyWasCalledOnce() *VerifierMockProjectCommandBuilder { - return &VerifierMockProjectCommandBuilder{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockProjectCommandBuilder) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockProjectCommandBuilder { - return &VerifierMockProjectCommandBuilder{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockProjectCommandBuilder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectCommandBuilder { - return &VerifierMockProjectCommandBuilder{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockProjectCommandBuilder) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockProjectCommandBuilder { - return &VerifierMockProjectCommandBuilder{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockProjectCommandBuilder struct { - mock *MockProjectCommandBuilder - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification struct { - mock *MockProjectCommandBuilder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) { - ctx, comment := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], comment[len(comment)-1] -} - -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) - } - _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) - return &MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerification struct { - mock *MockProjectCommandBuilder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) { - ctx, comment := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], comment[len(comment)-1] -} - -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) - } - _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) - return &MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification struct { - mock *MockProjectCommandBuilder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification) GetCapturedArguments() *command.Context { - ctx := c.GetAllCapturedArguments() - return ctx[len(ctx)-1] -} - -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) - } - } - 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) - return &MockProjectCommandBuilder_BuildImportCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandBuilder_BuildImportCommands_OngoingVerification struct { - mock *MockProjectCommandBuilder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandBuilder_BuildImportCommands_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) { - ctx, comment := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], comment[len(comment)-1] -} - -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) - } - _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) - return &MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification struct { - mock *MockProjectCommandBuilder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) { - ctx, comment := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], comment[len(comment)-1] -} - -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) - } - _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) - return &MockProjectCommandBuilder_BuildStateRmCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandBuilder_BuildStateRmCommands_OngoingVerification struct { - mock *MockProjectCommandBuilder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandBuilder_BuildStateRmCommands_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) { - ctx, comment := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], comment[len(comment)-1] -} - -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) - } - _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) - return &MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification struct { - mock *MockProjectCommandBuilder - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) { - ctx, comment := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], comment[len(comment)-1] -} - -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) - } - _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 deleted file mode 100644 index be42228cd1..0000000000 --- a/server/events/mocks/mock_project_command_runner.go +++ /dev/null @@ -1,357 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: ProjectCommandRunner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockProjectCommandRunner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockProjectCommandRunner(options ...pegomock.Option) *MockProjectCommandRunner { - mock := &MockProjectCommandRunner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockProjectCommandRunner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockProjectCommandRunner) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockProjectCommandRunner) Apply(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("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 -} - -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) - } - } - 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) - } - } - 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) - } - } - 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) - } - } - 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) - } - } - 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) - } - } - return ret0 -} - -func (mock *MockProjectCommandRunner) VerifyWasCalledOnce() *VerifierMockProjectCommandRunner { - return &VerifierMockProjectCommandRunner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockProjectCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockProjectCommandRunner { - return &VerifierMockProjectCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockProjectCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectCommandRunner { - return &VerifierMockProjectCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockProjectCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockProjectCommandRunner { - return &VerifierMockProjectCommandRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockProjectCommandRunner struct { - mock *MockProjectCommandRunner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockProjectCommandRunner_Apply_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandRunner_Apply_OngoingVerification struct { - mock *MockProjectCommandRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandRunner_Apply_OngoingVerification) GetCapturedArguments() command.ProjectContext { - ctx := c.GetAllCapturedArguments() - return ctx[len(ctx)-1] -} - -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) - } - } - 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) - return &MockProjectCommandRunner_ApprovePolicies_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandRunner_ApprovePolicies_OngoingVerification struct { - mock *MockProjectCommandRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandRunner_ApprovePolicies_OngoingVerification) GetCapturedArguments() command.ProjectContext { - ctx := c.GetAllCapturedArguments() - return ctx[len(ctx)-1] -} - -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) - } - } - 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) - return &MockProjectCommandRunner_Import_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandRunner_Import_OngoingVerification struct { - mock *MockProjectCommandRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandRunner_Import_OngoingVerification) GetCapturedArguments() command.ProjectContext { - ctx := c.GetAllCapturedArguments() - return ctx[len(ctx)-1] -} - -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) - } - } - 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) - return &MockProjectCommandRunner_Plan_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandRunner_Plan_OngoingVerification struct { - mock *MockProjectCommandRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandRunner_Plan_OngoingVerification) GetCapturedArguments() command.ProjectContext { - ctx := c.GetAllCapturedArguments() - return ctx[len(ctx)-1] -} - -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) - } - } - 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) - return &MockProjectCommandRunner_PolicyCheck_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandRunner_PolicyCheck_OngoingVerification struct { - mock *MockProjectCommandRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandRunner_PolicyCheck_OngoingVerification) GetCapturedArguments() command.ProjectContext { - ctx := c.GetAllCapturedArguments() - return ctx[len(ctx)-1] -} - -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) - } - } - 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) - return &MockProjectCommandRunner_StateRm_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandRunner_StateRm_OngoingVerification struct { - mock *MockProjectCommandRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandRunner_StateRm_OngoingVerification) GetCapturedArguments() command.ProjectContext { - ctx := c.GetAllCapturedArguments() - return ctx[len(ctx)-1] -} - -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) - } - } - 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) - return &MockProjectCommandRunner_Version_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandRunner_Version_OngoingVerification struct { - mock *MockProjectCommandRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandRunner_Version_OngoingVerification) GetCapturedArguments() command.ProjectContext { - ctx := c.GetAllCapturedArguments() - return ctx[len(ctx)-1] -} - -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) - } - } - return -} diff --git a/server/events/mocks/mock_project_lock.go b/server/events/mocks/mock_project_lock.go deleted file mode 100644 index ab54c2487a..0000000000 --- a/server/events/mocks/mock_project_lock.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: ProjectLocker) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - events "github.com/runatlantis/atlantis/server/events" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockProjectLocker struct { - fail func(message string, callerSkip ...int) -} - -func NewMockProjectLocker(options ...pegomock.Option) *MockProjectLocker { - mock := &MockProjectLocker{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockProjectLocker) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockProjectLocker) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockProjectLocker) TryLock(log logging.SimpleLogging, pull models.PullRequest, user models.User, workspace string, project models.Project, repoLocking bool) (*events.TryLockResponse, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockProjectLocker) VerifyWasCalledOnce() *VerifierMockProjectLocker { - return &VerifierMockProjectLocker{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockProjectLocker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockProjectLocker { - return &VerifierMockProjectLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockProjectLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectLocker { - return &VerifierMockProjectLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockProjectLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockProjectLocker { - return &VerifierMockProjectLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockProjectLocker struct { - mock *MockProjectLocker - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockProjectLocker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectLocker_TryLock_OngoingVerification struct { - mock *MockProjectLocker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectLocker_TryLock_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.PullRequest, models.User, string, models.Project, bool) { - log, pull, user, workspace, project, repoLocking := c.GetAllCapturedArguments() - return log[len(log)-1], pull[len(pull)-1], user[len(user)-1], workspace[len(workspace)-1], project[len(project)-1], repoLocking[len(repoLocking)-1] -} - -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) - } - _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) - } - _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) - } - _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 deleted file mode 100644 index 53fd1877fe..0000000000 --- a/server/events/mocks/mock_pull_cleaner.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: PullCleaner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockPullCleaner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockPullCleaner(options ...pegomock.Option) *MockPullCleaner { - mock := &MockPullCleaner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockPullCleaner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockPullCleaner) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockPullCleaner) CleanUpPull(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest) error { - 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) - } - } - return ret0 -} - -func (mock *MockPullCleaner) VerifyWasCalledOnce() *VerifierMockPullCleaner { - return &VerifierMockPullCleaner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockPullCleaner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPullCleaner { - return &VerifierMockPullCleaner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockPullCleaner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPullCleaner { - return &VerifierMockPullCleaner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockPullCleaner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPullCleaner { - return &VerifierMockPullCleaner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockPullCleaner struct { - mock *MockPullCleaner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockPullCleaner_CleanUpPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockPullCleaner_CleanUpPull_OngoingVerification struct { - mock *MockPullCleaner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockPullCleaner_CleanUpPull_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest) { - logger, repo, pull := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pull[len(pull)-1] -} - -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) - } - _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) - } - } - return -} diff --git a/server/events/mocks/mock_resource_cleaner.go b/server/events/mocks/mock_resource_cleaner.go deleted file mode 100644 index a09a8ee7b4..0000000000 --- a/server/events/mocks/mock_resource_cleaner.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: ResourceCleaner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - jobs "github.com/runatlantis/atlantis/server/jobs" - "reflect" - "time" -) - -type MockResourceCleaner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockResourceCleaner(options ...pegomock.Option) *MockResourceCleaner { - mock := &MockResourceCleaner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockResourceCleaner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockResourceCleaner) FailHandler() pegomock.FailHandler { return mock.fail } - -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{}) -} - -func (mock *MockResourceCleaner) VerifyWasCalledOnce() *VerifierMockResourceCleaner { - return &VerifierMockResourceCleaner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockResourceCleaner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockResourceCleaner { - return &VerifierMockResourceCleaner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockResourceCleaner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockResourceCleaner { - return &VerifierMockResourceCleaner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockResourceCleaner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockResourceCleaner { - return &VerifierMockResourceCleaner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockResourceCleaner struct { - mock *MockResourceCleaner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockResourceCleaner_CleanUp_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockResourceCleaner_CleanUp_OngoingVerification struct { - mock *MockResourceCleaner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockResourceCleaner_CleanUp_OngoingVerification) GetCapturedArguments() jobs.PullInfo { - pullInfo := c.GetAllCapturedArguments() - return pullInfo[len(pullInfo)-1] -} - -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) - } - } - return -} diff --git a/server/events/mocks/mock_step_runner.go b/server/events/mocks/mock_step_runner.go deleted file mode 100644 index fdfd95aa7c..0000000000 --- a/server/events/mocks/mock_step_runner.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: StepRunner) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockStepRunner struct { - fail func(message string, callerSkip ...int) -} - -func NewMockStepRunner(options ...pegomock.Option) *MockStepRunner { - mock := &MockStepRunner{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockStepRunner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockStepRunner) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockStepRunner) Run(ctx command.ProjectContext, extraArgs []string, path string, envs map[string]string) (string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockStepRunner) VerifyWasCalledOnce() *VerifierMockStepRunner { - return &VerifierMockStepRunner{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockStepRunner { - return &VerifierMockStepRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockStepRunner { - return &VerifierMockStepRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockStepRunner { - return &VerifierMockStepRunner{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockStepRunner struct { - mock *MockStepRunner - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockStepRunner_Run_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockStepRunner_Run_OngoingVerification struct { - mock *MockStepRunner - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockStepRunner_Run_OngoingVerification) GetCapturedArguments() (command.ProjectContext, []string, string, map[string]string) { - ctx, extraArgs, path, envs := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], extraArgs[len(extraArgs)-1], path[len(path)-1], envs[len(envs)-1] -} - -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) - } - _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([]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 deleted file mode 100644 index 48a3dcd576..0000000000 --- a/server/events/mocks/mock_webhooks_sender.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: WebhooksSender) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - webhooks "github.com/runatlantis/atlantis/server/events/webhooks" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockWebhooksSender struct { - fail func(message string, callerSkip ...int) -} - -func NewMockWebhooksSender(options ...pegomock.Option) *MockWebhooksSender { - mock := &MockWebhooksSender{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockWebhooksSender) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockWebhooksSender) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockWebhooksSender) Send(log logging.SimpleLogging, res webhooks.ApplyResult) error { - 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) - } - } - return ret0 -} - -func (mock *MockWebhooksSender) VerifyWasCalledOnce() *VerifierMockWebhooksSender { - return &VerifierMockWebhooksSender{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockWebhooksSender) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockWebhooksSender { - return &VerifierMockWebhooksSender{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockWebhooksSender) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWebhooksSender { - return &VerifierMockWebhooksSender{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockWebhooksSender) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockWebhooksSender { - return &VerifierMockWebhooksSender{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockWebhooksSender struct { - mock *MockWebhooksSender - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockWebhooksSender_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWebhooksSender_Send_OngoingVerification struct { - mock *MockWebhooksSender - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWebhooksSender_Send_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, webhooks.ApplyResult) { - log, res := c.GetAllCapturedArguments() - return log[len(log)-1], res[len(res)-1] -} - -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) - } - _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 deleted file mode 100644 index 9c162fc4a2..0000000000 --- a/server/events/mocks/mock_working_dir.go +++ /dev/null @@ -1,525 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: WorkingDir) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockWorkingDir struct { - fail func(message string, callerSkip ...int) -} - -func NewMockWorkingDir(options ...pegomock.Option) *MockWorkingDir { - mock := &MockWorkingDir{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockWorkingDir) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockWorkingDir) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockWorkingDir) Clone(logger logging.SimpleLogging, headRepo models.Repo, p models.PullRequest, workspace string) (string, bool, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(bool) - } - if result[2] != nil { - ret2 = result[2].(error) - } - } - 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) - } - } - 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) - } - } - 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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - } - 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{}) -} - -func (mock *MockWorkingDir) VerifyWasCalledOnce() *VerifierMockWorkingDir { - return &VerifierMockWorkingDir{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockWorkingDir) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockWorkingDir { - return &VerifierMockWorkingDir{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDir { - return &VerifierMockWorkingDir{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockWorkingDir { - return &VerifierMockWorkingDir{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockWorkingDir struct { - mock *MockWorkingDir - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockWorkingDir_Clone_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_Clone_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_Clone_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, string) { - logger, headRepo, p, workspace := c.GetAllCapturedArguments() - return logger[len(logger)-1], headRepo[len(headRepo)-1], p[len(p)-1], workspace[len(workspace)-1] -} - -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) - } - } - 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) - return &MockWorkingDir_Delete_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_Delete_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_Delete_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest) { - logger, r, p := c.GetAllCapturedArguments() - return logger[len(logger)-1], r[len(r)-1], p[len(p)-1] -} - -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) - } - } - 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) - return &MockWorkingDir_DeleteForWorkspace_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_DeleteForWorkspace_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_DeleteForWorkspace_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, string) { - logger, r, p, workspace := c.GetAllCapturedArguments() - return logger[len(logger)-1], r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1] -} - -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) - } - } - 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) - return &MockWorkingDir_DeletePlan_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_DeletePlan_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_DeletePlan_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, string, string, string) { - logger, r, p, workspace, path, projectName := c.GetAllCapturedArguments() - return logger[len(logger)-1], r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1], path[len(path)-1], projectName[len(projectName)-1] -} - -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) - } - } - 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) - return &MockWorkingDir_GetGitUntrackedFiles_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_GetGitUntrackedFiles_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_GetGitUntrackedFiles_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, string) { - logger, r, p, workspace := c.GetAllCapturedArguments() - return logger[len(logger)-1], r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1] -} - -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) - } - } - 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) - return &MockWorkingDir_GetPullDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_GetPullDir_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_GetPullDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { - r, p := c.GetAllCapturedArguments() - return r[len(r)-1], p[len(p)-1] -} - -func (c *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) - } - } - 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) - return &MockWorkingDir_GetWorkingDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_GetWorkingDir_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_GetWorkingDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, string) { - r, p, workspace := c.GetAllCapturedArguments() - return r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1] -} - -func (c *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) - } - } - 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) - return &MockWorkingDir_HasDiverged_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_HasDiverged_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_HasDiverged_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, string) { - logger, cloneDir := c.GetAllCapturedArguments() - return logger[len(logger)-1], cloneDir[len(cloneDir)-1] -} - -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) - } - } - 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) - return &MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification) GetAllCapturedArguments() { -} diff --git a/server/events/mocks/mock_working_dir_locker.go b/server/events/mocks/mock_working_dir_locker.go deleted file mode 100644 index 6bb1cde91f..0000000000 --- a/server/events/mocks/mock_working_dir_locker.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: WorkingDirLocker) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - "reflect" - "time" -) - -type MockWorkingDirLocker struct { - fail func(message string, callerSkip ...int) -} - -func NewMockWorkingDirLocker(options ...pegomock.Option) *MockWorkingDirLocker { - mock := &MockWorkingDirLocker{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockWorkingDirLocker) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockWorkingDirLocker) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockWorkingDirLocker) TryLock(repoFullName string, pullNum int, workspace string, path string) (func(), error) { - 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()) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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()) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockWorkingDirLocker) VerifyWasCalledOnce() *VerifierMockWorkingDirLocker { - return &VerifierMockWorkingDirLocker{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockWorkingDirLocker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockWorkingDirLocker { - return &VerifierMockWorkingDirLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockWorkingDirLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDirLocker { - return &VerifierMockWorkingDirLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockWorkingDirLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockWorkingDirLocker { - return &VerifierMockWorkingDirLocker{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockWorkingDirLocker struct { - mock *MockWorkingDirLocker - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockWorkingDirLocker_TryLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDirLocker_TryLock_OngoingVerification struct { - mock *MockWorkingDirLocker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDirLocker_TryLock_OngoingVerification) GetCapturedArguments() (string, int, string, string) { - repoFullName, pullNum, workspace, path := c.GetAllCapturedArguments() - return repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1], workspace[len(workspace)-1], path[len(path)-1] -} - -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) - } - _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) - } - _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) - return &MockWorkingDirLocker_TryLockPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDirLocker_TryLockPull_OngoingVerification struct { - mock *MockWorkingDirLocker - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDirLocker_TryLockPull_OngoingVerification) GetCapturedArguments() (string, int) { - repoFullName, pullNum := c.GetAllCapturedArguments() - return repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1] -} - -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) - } - _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 deleted file mode 100644 index ffa37fe8cb..0000000000 --- a/server/events/vcs/mocks/mock_client.go +++ /dev/null @@ -1,870 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events/vcs (interfaces: Client) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockClient struct { - fail func(message string, callerSkip ...int) -} - -func NewMockClient(options ...pegomock.Option) *MockClient { - mock := &MockClient{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockClient) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockClient) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockClient) CreateComment(logger logging.SimpleLogging, repo models.Repo, pullNum int, comment string, command string) error { - 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) - } - } - 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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].([]byte) - } - if result[2] != nil { - ret2 = result[2].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockClient) PullIsMergeable(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, vcsstatusname string) (bool, error) { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockClient().") - } - params := []pegomock.Param{logger, repo, pull, vcsstatusname} - 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) - } - } - 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) - } - } - 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) - } - } - 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) - } - } - return ret0 -} - -func (mock *MockClient) VerifyWasCalledOnce() *VerifierMockClient { - return &VerifierMockClient{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockClient) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockClient { - return &VerifierMockClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockClient { - return &VerifierMockClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockClient { - return &VerifierMockClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockClient struct { - mock *MockClient - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockClient_CreateComment_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_CreateComment_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_CreateComment_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, int, string, string) { - logger, repo, pullNum, comment, command := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pullNum[len(pullNum)-1], comment[len(comment)-1], command[len(command)-1] -} - -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) - } - } - 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) - return &MockClient_DiscardReviews_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_DiscardReviews_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_DiscardReviews_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { - repo, pull := c.GetAllCapturedArguments() - return repo[len(repo)-1], pull[len(pull)-1] -} - -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) - } - _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) - return &MockClient_GetCloneURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_GetCloneURL_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_GetCloneURL_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.VCSHostType, string) { - logger, VCSHostType, repo := c.GetAllCapturedArguments() - return logger[len(logger)-1], VCSHostType[len(VCSHostType)-1], repo[len(repo)-1] -} - -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) - } - } - 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) - return &MockClient_GetFileContent_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_GetFileContent_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_GetFileContent_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.PullRequest, string) { - logger, pull, fileName := c.GetAllCapturedArguments() - return logger[len(logger)-1], pull[len(pull)-1], fileName[len(fileName)-1] -} - -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) - } - } - 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) - return &MockClient_GetModifiedFiles_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_GetModifiedFiles_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_GetModifiedFiles_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest) { - logger, repo, pull := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pull[len(pull)-1] -} - -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) - } - } - 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) - return &MockClient_GetPullLabels_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_GetPullLabels_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_GetPullLabels_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest) { - logger, repo, pull := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pull[len(pull)-1] -} - -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) - } - } - 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) - return &MockClient_GetTeamNamesForUser_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_GetTeamNamesForUser_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_GetTeamNamesForUser_OngoingVerification) GetCapturedArguments() (models.Repo, models.User) { - repo, user := c.GetAllCapturedArguments() - return repo[len(repo)-1], user[len(user)-1] -} - -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) - } - _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) - return &MockClient_HidePrevCommandComments_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_HidePrevCommandComments_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_HidePrevCommandComments_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, int, string, string) { - logger, repo, pullNum, command, dir := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pullNum[len(pullNum)-1], command[len(command)-1], dir[len(dir)-1] -} - -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) - } - } - 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) - return &MockClient_MarkdownPullLink_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_MarkdownPullLink_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_MarkdownPullLink_OngoingVerification) GetCapturedArguments() models.PullRequest { - pull := c.GetAllCapturedArguments() - return pull[len(pull)-1] -} - -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) - } - } - 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) - return &MockClient_MergePull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_MergePull_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_MergePull_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.PullRequest, models.PullRequestOptions) { - logger, pull, pullOptions := c.GetAllCapturedArguments() - return logger[len(logger)-1], pull[len(pull)-1], pullOptions[len(pullOptions)-1] -} - -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) - } - } - 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) - return &MockClient_PullIsApproved_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_PullIsApproved_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_PullIsApproved_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest) { - logger, repo, pull := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pull[len(pull)-1] -} - -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) - } - } - 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) - return &MockClient_PullIsMergeable_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_PullIsMergeable_OngoingVerification struct { - mock *MockClient - 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) 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) - } - } - 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) - return &MockClient_ReactToComment_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_ReactToComment_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_ReactToComment_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, int, int64, string) { - logger, repo, pullNum, commentID, reaction := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pullNum[len(pullNum)-1], commentID[len(commentID)-1], reaction[len(reaction)-1] -} - -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) - } - } - 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) - return &MockClient_SupportsSingleFileDownload_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_SupportsSingleFileDownload_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_SupportsSingleFileDownload_OngoingVerification) GetCapturedArguments() models.Repo { - repo := c.GetAllCapturedArguments() - return repo[len(repo)-1] -} - -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) - } - } - 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) - return &MockClient_UpdateStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockClient_UpdateStatus_OngoingVerification struct { - mock *MockClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockClient_UpdateStatus_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, models.CommitStatus, string, string, string) { - logger, repo, pull, state, src, description, url := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pull[len(pull)-1], state[len(state)-1], src[len(src)-1], description[len(description)-1], url[len(url)-1] -} - -func (c *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) - } - } - return -} diff --git a/server/events/vcs/mocks/mock_github_credentials.go b/server/events/vcs/mocks/mock_github_credentials.go deleted file mode 100644 index 2c6359c077..0000000000 --- a/server/events/vcs/mocks/mock_github_credentials.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events/vcs (interfaces: GithubCredentials) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - http "net/http" - "reflect" - "time" -) - -type MockGithubCredentials struct { - fail func(message string, callerSkip ...int) -} - -func NewMockGithubCredentials(options ...pegomock.Option) *MockGithubCredentials { - mock := &MockGithubCredentials{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockGithubCredentials) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockGithubCredentials) FailHandler() pegomock.FailHandler { return mock.fail } - -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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockGithubCredentials) VerifyWasCalledOnce() *VerifierMockGithubCredentials { - return &VerifierMockGithubCredentials{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockGithubCredentials) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockGithubCredentials { - return &VerifierMockGithubCredentials{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockGithubCredentials) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGithubCredentials { - return &VerifierMockGithubCredentials{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockGithubCredentials) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockGithubCredentials { - return &VerifierMockGithubCredentials{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockGithubCredentials struct { - mock *MockGithubCredentials - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockGithubCredentials) Client() *MockGithubCredentials_Client_OngoingVerification { - 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} -} - -type MockGithubCredentials_Client_OngoingVerification struct { - mock *MockGithubCredentials - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockGithubCredentials_Client_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockGithubCredentials_Client_OngoingVerification) GetAllCapturedArguments() { -} - -func (verifier *VerifierMockGithubCredentials) GetToken() *MockGithubCredentials_GetToken_OngoingVerification { - 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} -} - -type MockGithubCredentials_GetToken_OngoingVerification struct { - mock *MockGithubCredentials - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockGithubCredentials_GetToken_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockGithubCredentials_GetToken_OngoingVerification) GetAllCapturedArguments() { -} - -func (verifier *VerifierMockGithubCredentials) GetUser() *MockGithubCredentials_GetUser_OngoingVerification { - 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} -} - -type MockGithubCredentials_GetUser_OngoingVerification struct { - mock *MockGithubCredentials - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockGithubCredentials_GetUser_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockGithubCredentials_GetUser_OngoingVerification) GetAllCapturedArguments() { -} diff --git a/server/events/vcs/mocks/mock_github_pull_request_getter.go b/server/events/vcs/mocks/mock_github_pull_request_getter.go deleted file mode 100644 index 00b472db75..0000000000 --- a/server/events/vcs/mocks/mock_github_pull_request_getter.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events/vcs (interfaces: GithubPullRequestGetter) - -package mocks - -import ( - github "github.com/google/go-github/v59/github" - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockGithubPullRequestGetter struct { - fail func(message string, callerSkip ...int) -} - -func NewMockGithubPullRequestGetter(options ...pegomock.Option) *MockGithubPullRequestGetter { - mock := &MockGithubPullRequestGetter{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockGithubPullRequestGetter) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockGithubPullRequestGetter) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockGithubPullRequestGetter) GetPullRequest(logger logging.SimpleLogging, repo models.Repo, pullNum int) (*github.PullRequest, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockGithubPullRequestGetter) VerifyWasCalledOnce() *VerifierMockGithubPullRequestGetter { - return &VerifierMockGithubPullRequestGetter{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockGithubPullRequestGetter) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockGithubPullRequestGetter { - return &VerifierMockGithubPullRequestGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockGithubPullRequestGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGithubPullRequestGetter { - return &VerifierMockGithubPullRequestGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockGithubPullRequestGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockGithubPullRequestGetter { - return &VerifierMockGithubPullRequestGetter{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockGithubPullRequestGetter struct { - mock *MockGithubPullRequestGetter - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockGithubPullRequestGetter_GetPullRequest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockGithubPullRequestGetter_GetPullRequest_OngoingVerification struct { - mock *MockGithubPullRequestGetter - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockGithubPullRequestGetter_GetPullRequest_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, int) { - logger, repo, pullNum := c.GetAllCapturedArguments() - return logger[len(logger)-1], repo[len(repo)-1], pullNum[len(pullNum)-1] -} - -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) - } - _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) - } - } - 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 deleted file mode 100644 index d9e6494d9a..0000000000 --- a/server/events/vcs/mocks/mock_pull_req_status_fetcher.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events/vcs (interfaces: PullReqStatusFetcher) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockPullReqStatusFetcher struct { - fail func(message string, callerSkip ...int) -} - -func NewMockPullReqStatusFetcher(options ...pegomock.Option) *MockPullReqStatusFetcher { - mock := &MockPullReqStatusFetcher{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockPullReqStatusFetcher) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockPullReqStatusFetcher) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockPullReqStatusFetcher) FetchPullStatus(logger logging.SimpleLogging, pull models.PullRequest) (models.PullReqStatus, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockPullReqStatusFetcher) VerifyWasCalledOnce() *VerifierMockPullReqStatusFetcher { - return &VerifierMockPullReqStatusFetcher{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockPullReqStatusFetcher) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPullReqStatusFetcher { - return &VerifierMockPullReqStatusFetcher{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockPullReqStatusFetcher) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPullReqStatusFetcher { - return &VerifierMockPullReqStatusFetcher{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockPullReqStatusFetcher) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPullReqStatusFetcher { - return &VerifierMockPullReqStatusFetcher{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockPullReqStatusFetcher struct { - mock *MockPullReqStatusFetcher - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification struct { - mock *MockPullReqStatusFetcher - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.PullRequest) { - logger, pull := c.GetAllCapturedArguments() - return logger[len(logger)-1], pull[len(pull)-1] -} - -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) - } - _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 deleted file mode 100644 index 90b7a51b02..0000000000 --- a/server/events/webhooks/mocks/mock_sender.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events/webhooks (interfaces: Sender) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - webhooks "github.com/runatlantis/atlantis/server/events/webhooks" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockSender struct { - fail func(message string, callerSkip ...int) -} - -func NewMockSender(options ...pegomock.Option) *MockSender { - mock := &MockSender{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockSender) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockSender) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockSender) Send(log logging.SimpleLogging, applyResult webhooks.ApplyResult) error { - 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) - } - } - return ret0 -} - -func (mock *MockSender) VerifyWasCalledOnce() *VerifierMockSender { - return &VerifierMockSender{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockSender) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockSender { - return &VerifierMockSender{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockSender) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockSender { - return &VerifierMockSender{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockSender) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockSender { - return &VerifierMockSender{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockSender struct { - mock *MockSender - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockSender_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSender_Send_OngoingVerification struct { - mock *MockSender - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSender_Send_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, webhooks.ApplyResult) { - log, applyResult := c.GetAllCapturedArguments() - return log[len(log)-1], applyResult[len(applyResult)-1] -} - -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) - } - _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 deleted file mode 100644 index 7c65efd49a..0000000000 --- a/server/events/webhooks/mocks/mock_slack_client.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events/webhooks (interfaces: SlackClient) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - webhooks "github.com/runatlantis/atlantis/server/events/webhooks" - "reflect" - "time" -) - -type MockSlackClient struct { - fail func(message string, callerSkip ...int) -} - -func NewMockSlackClient(options ...pegomock.Option) *MockSlackClient { - mock := &MockSlackClient{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockSlackClient) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockSlackClient) FailHandler() pegomock.FailHandler { return mock.fail } - -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) - } - } - 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) - } - } - 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) - } - } - return ret0 -} - -func (mock *MockSlackClient) VerifyWasCalledOnce() *VerifierMockSlackClient { - return &VerifierMockSlackClient{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockSlackClient) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockSlackClient { - return &VerifierMockSlackClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockSlackClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockSlackClient { - return &VerifierMockSlackClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockSlackClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockSlackClient { - return &VerifierMockSlackClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockSlackClient struct { - mock *MockSlackClient - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockSlackClient) AuthTest() *MockSlackClient_AuthTest_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "AuthTest", params, verifier.timeout) - return &MockSlackClient_AuthTest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSlackClient_AuthTest_OngoingVerification struct { - mock *MockSlackClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSlackClient_AuthTest_OngoingVerification) GetCapturedArguments() { -} - -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) - return &MockSlackClient_PostMessage_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSlackClient_PostMessage_OngoingVerification struct { - mock *MockSlackClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSlackClient_PostMessage_OngoingVerification) GetCapturedArguments() (string, webhooks.ApplyResult) { - channel, applyResult := c.GetAllCapturedArguments() - return channel[len(channel)-1], applyResult[len(applyResult)-1] -} - -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) - } - _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) - return &MockSlackClient_TokenIsSet_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSlackClient_TokenIsSet_OngoingVerification struct { - mock *MockSlackClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSlackClient_TokenIsSet_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockSlackClient_TokenIsSet_OngoingVerification) GetAllCapturedArguments() { -} diff --git a/server/events/webhooks/mocks/mock_underlying_slack_client.go b/server/events/webhooks/mocks/mock_underlying_slack_client.go deleted file mode 100644 index 4d68cec665..0000000000 --- a/server/events/webhooks/mocks/mock_underlying_slack_client.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events/webhooks (interfaces: UnderlyingSlackClient) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - slack "github.com/slack-go/slack" - "reflect" - "time" -) - -type MockUnderlyingSlackClient struct { - fail func(message string, callerSkip ...int) -} - -func NewMockUnderlyingSlackClient(options ...pegomock.Option) *MockUnderlyingSlackClient { - mock := &MockUnderlyingSlackClient{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockUnderlyingSlackClient) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockUnderlyingSlackClient) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockUnderlyingSlackClient) AuthTest() (*slack.AuthTestResponse, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - 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) - } - if result[1] != nil { - ret1 = result[1].(string) - } - if result[2] != nil { - ret2 = result[2].(error) - } - } - 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} - for _, param := range options { - 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) - } - if result[1] != nil { - ret1 = result[1].(string) - } - if result[2] != nil { - ret2 = result[2].(error) - } - } - return ret0, ret1, ret2 -} - -func (mock *MockUnderlyingSlackClient) VerifyWasCalledOnce() *VerifierMockUnderlyingSlackClient { - return &VerifierMockUnderlyingSlackClient{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockUnderlyingSlackClient) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockUnderlyingSlackClient { - return &VerifierMockUnderlyingSlackClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockUnderlyingSlackClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockUnderlyingSlackClient { - return &VerifierMockUnderlyingSlackClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockUnderlyingSlackClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockUnderlyingSlackClient { - return &VerifierMockUnderlyingSlackClient{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockUnderlyingSlackClient struct { - mock *MockUnderlyingSlackClient - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockUnderlyingSlackClient) AuthTest() *MockUnderlyingSlackClient_AuthTest_OngoingVerification { - params := []pegomock.Param{} - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "AuthTest", params, verifier.timeout) - return &MockUnderlyingSlackClient_AuthTest_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockUnderlyingSlackClient_AuthTest_OngoingVerification struct { - mock *MockUnderlyingSlackClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockUnderlyingSlackClient_AuthTest_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockUnderlyingSlackClient_AuthTest_OngoingVerification) GetAllCapturedArguments() { -} - -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) - return &MockUnderlyingSlackClient_GetConversations_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockUnderlyingSlackClient_GetConversations_OngoingVerification struct { - mock *MockUnderlyingSlackClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockUnderlyingSlackClient_GetConversations_OngoingVerification) GetCapturedArguments() *slack.GetConversationsParameters { - conversationParams := c.GetAllCapturedArguments() - return conversationParams[len(conversationParams)-1] -} - -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) - } - } - return -} - -func (verifier *VerifierMockUnderlyingSlackClient) PostMessage(channelID string, options ...slack.MsgOption) *MockUnderlyingSlackClient_PostMessage_OngoingVerification { - params := []pegomock.Param{channelID} - for _, param := range options { - params = append(params, param) - } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "PostMessage", params, verifier.timeout) - return &MockUnderlyingSlackClient_PostMessage_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockUnderlyingSlackClient_PostMessage_OngoingVerification struct { - mock *MockUnderlyingSlackClient - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockUnderlyingSlackClient_PostMessage_OngoingVerification) GetCapturedArguments() (string, []slack.MsgOption) { - channelID, options := c.GetAllCapturedArguments() - return channelID[len(channelID)-1], options[len(options)-1] -} - -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) - } - _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) - } - } - } - } - return -} diff --git a/server/jobs/mocks/mock_project_command_output_handler.go b/server/jobs/mocks/mock_project_command_output_handler.go deleted file mode 100644 index 00d7ae8548..0000000000 --- a/server/jobs/mocks/mock_project_command_output_handler.go +++ /dev/null @@ -1,363 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/jobs (interfaces: ProjectCommandOutputHandler) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - models "github.com/runatlantis/atlantis/server/events/models" - jobs "github.com/runatlantis/atlantis/server/jobs" - "reflect" - "time" -) - -type MockProjectCommandOutputHandler struct { - fail func(message string, callerSkip ...int) -} - -func NewMockProjectCommandOutputHandler(options ...pegomock.Option) *MockProjectCommandOutputHandler { - mock := &MockProjectCommandOutputHandler{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockProjectCommandOutputHandler) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockProjectCommandOutputHandler) FailHandler() pegomock.FailHandler { return mock.fail } - -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{}) -} - -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{}) -} - -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) - } - } - 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{}) -} - -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) - } - } - 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{}) -} - -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{}) -} - -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{}) -} - -func (mock *MockProjectCommandOutputHandler) VerifyWasCalledOnce() *VerifierMockProjectCommandOutputHandler { - return &VerifierMockProjectCommandOutputHandler{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockProjectCommandOutputHandler) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockProjectCommandOutputHandler { - return &VerifierMockProjectCommandOutputHandler{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockProjectCommandOutputHandler) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectCommandOutputHandler { - return &VerifierMockProjectCommandOutputHandler{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockProjectCommandOutputHandler) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockProjectCommandOutputHandler { - return &VerifierMockProjectCommandOutputHandler{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockProjectCommandOutputHandler struct { - mock *MockProjectCommandOutputHandler - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockProjectCommandOutputHandler_CleanUp_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandOutputHandler_CleanUp_OngoingVerification struct { - mock *MockProjectCommandOutputHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandOutputHandler_CleanUp_OngoingVerification) GetCapturedArguments() jobs.PullInfo { - pullInfo := c.GetAllCapturedArguments() - return pullInfo[len(pullInfo)-1] -} - -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) - } - } - 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) - return &MockProjectCommandOutputHandler_Deregister_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandOutputHandler_Deregister_OngoingVerification struct { - mock *MockProjectCommandOutputHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandOutputHandler_Deregister_OngoingVerification) GetCapturedArguments() (string, chan string) { - jobID, receiver := c.GetAllCapturedArguments() - return jobID[len(jobID)-1], receiver[len(receiver)-1] -} - -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) - } - _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) - return &MockProjectCommandOutputHandler_GetPullToJobMapping_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandOutputHandler_GetPullToJobMapping_OngoingVerification struct { - mock *MockProjectCommandOutputHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandOutputHandler_GetPullToJobMapping_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockProjectCommandOutputHandler_GetPullToJobMapping_OngoingVerification) GetAllCapturedArguments() { -} - -func (verifier *VerifierMockProjectCommandOutputHandler) Handle() *MockProjectCommandOutputHandler_Handle_OngoingVerification { - 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} -} - -type MockProjectCommandOutputHandler_Handle_OngoingVerification struct { - mock *MockProjectCommandOutputHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandOutputHandler_Handle_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockProjectCommandOutputHandler_Handle_OngoingVerification) GetAllCapturedArguments() { -} - -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) - return &MockProjectCommandOutputHandler_IsKeyExists_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandOutputHandler_IsKeyExists_OngoingVerification struct { - mock *MockProjectCommandOutputHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandOutputHandler_IsKeyExists_OngoingVerification) GetCapturedArguments() string { - key := c.GetAllCapturedArguments() - return key[len(key)-1] -} - -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) - } - } - 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) - return &MockProjectCommandOutputHandler_Register_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandOutputHandler_Register_OngoingVerification struct { - mock *MockProjectCommandOutputHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandOutputHandler_Register_OngoingVerification) GetCapturedArguments() (string, chan string) { - jobID, receiver := c.GetAllCapturedArguments() - return jobID[len(jobID)-1], receiver[len(receiver)-1] -} - -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) - } - _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) - return &MockProjectCommandOutputHandler_Send_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandOutputHandler_Send_OngoingVerification struct { - mock *MockProjectCommandOutputHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandOutputHandler_Send_OngoingVerification) GetCapturedArguments() (command.ProjectContext, string, bool) { - ctx, msg, operationComplete := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], msg[len(msg)-1], operationComplete[len(operationComplete)-1] -} - -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) - } - _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) - } - } - 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) - return &MockProjectCommandOutputHandler_SendWorkflowHook_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectCommandOutputHandler_SendWorkflowHook_OngoingVerification struct { - mock *MockProjectCommandOutputHandler - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectCommandOutputHandler_SendWorkflowHook_OngoingVerification) GetCapturedArguments() (models.WorkflowHookCommandContext, string, bool) { - ctx, msg, operationComplete := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], msg[len(msg)-1], operationComplete[len(operationComplete)-1] -} - -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) - } - _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) - } - } - return -} diff --git a/server/jobs/mocks/mock_project_job_url_generator.go b/server/jobs/mocks/mock_project_job_url_generator.go deleted file mode 100644 index 5f37982af5..0000000000 --- a/server/jobs/mocks/mock_project_job_url_generator.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/jobs (interfaces: ProjectJobURLGenerator) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - "reflect" - "time" -) - -type MockProjectJobURLGenerator struct { - fail func(message string, callerSkip ...int) -} - -func NewMockProjectJobURLGenerator(options ...pegomock.Option) *MockProjectJobURLGenerator { - mock := &MockProjectJobURLGenerator{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockProjectJobURLGenerator) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockProjectJobURLGenerator) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockProjectJobURLGenerator) GenerateProjectJobURL(p command.ProjectContext) (string, error) { - 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) - } - if result[1] != nil { - ret1 = result[1].(error) - } - } - return ret0, ret1 -} - -func (mock *MockProjectJobURLGenerator) VerifyWasCalledOnce() *VerifierMockProjectJobURLGenerator { - return &VerifierMockProjectJobURLGenerator{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockProjectJobURLGenerator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockProjectJobURLGenerator { - return &VerifierMockProjectJobURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockProjectJobURLGenerator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectJobURLGenerator { - return &VerifierMockProjectJobURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockProjectJobURLGenerator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockProjectJobURLGenerator { - return &VerifierMockProjectJobURLGenerator{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockProjectJobURLGenerator struct { - mock *MockProjectJobURLGenerator - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockProjectJobURLGenerator_GenerateProjectJobURL_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectJobURLGenerator_GenerateProjectJobURL_OngoingVerification struct { - mock *MockProjectJobURLGenerator - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectJobURLGenerator_GenerateProjectJobURL_OngoingVerification) GetCapturedArguments() command.ProjectContext { - p := c.GetAllCapturedArguments() - return p[len(p)-1] -} - -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) - } - } - return -} diff --git a/server/jobs/mocks/mock_project_status_updater.go b/server/jobs/mocks/mock_project_status_updater.go deleted file mode 100644 index 9f0a18f037..0000000000 --- a/server/jobs/mocks/mock_project_status_updater.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/jobs (interfaces: ProjectStatusUpdater) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - command "github.com/runatlantis/atlantis/server/events/command" - models "github.com/runatlantis/atlantis/server/events/models" - "reflect" - "time" -) - -type MockProjectStatusUpdater struct { - fail func(message string, callerSkip ...int) -} - -func NewMockProjectStatusUpdater(options ...pegomock.Option) *MockProjectStatusUpdater { - mock := &MockProjectStatusUpdater{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockProjectStatusUpdater) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockProjectStatusUpdater) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockProjectStatusUpdater) UpdateProject(ctx command.ProjectContext, cmdName command.Name, status models.CommitStatus, url string, res *command.ProjectResult) error { - 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) - } - } - return ret0 -} - -func (mock *MockProjectStatusUpdater) VerifyWasCalledOnce() *VerifierMockProjectStatusUpdater { - return &VerifierMockProjectStatusUpdater{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockProjectStatusUpdater) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockProjectStatusUpdater { - return &VerifierMockProjectStatusUpdater{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockProjectStatusUpdater) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectStatusUpdater { - return &VerifierMockProjectStatusUpdater{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockProjectStatusUpdater) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockProjectStatusUpdater { - return &VerifierMockProjectStatusUpdater{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockProjectStatusUpdater struct { - mock *MockProjectStatusUpdater - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockProjectStatusUpdater_UpdateProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockProjectStatusUpdater_UpdateProject_OngoingVerification struct { - mock *MockProjectStatusUpdater - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockProjectStatusUpdater_UpdateProject_OngoingVerification) GetCapturedArguments() (command.ProjectContext, command.Name, models.CommitStatus, string, *command.ProjectResult) { - ctx, cmdName, status, url, res := c.GetAllCapturedArguments() - return ctx[len(ctx)-1], cmdName[len(cmdName)-1], status[len(status)-1], url[len(url)-1], res[len(res)-1] -} - -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) - } - _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) - } - _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) - } - } - return -} diff --git a/server/logging/mocks/mock_simple_logging.go b/server/logging/mocks/mock_simple_logging.go deleted file mode 100644 index 2afa845c4a..0000000000 --- a/server/logging/mocks/mock_simple_logging.go +++ /dev/null @@ -1,522 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/logging (interfaces: SimpleLogging) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockSimpleLogging struct { - fail func(message string, callerSkip ...int) -} - -func NewMockSimpleLogging(options ...pegomock.Option) *MockSimpleLogging { - mock := &MockSimpleLogging{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockSimpleLogging) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockSimpleLogging) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockSimpleLogging) Debug(format string, a ...interface{}) { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") - } - params := []pegomock.Param{format} - for _, param := range a { - params = append(params, param) - } - 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} - for _, param := range a { - params = append(params, param) - } - 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) - } - } - 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) - } - } - 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} - for _, param := range a { - params = append(params, param) - } - 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} - for _, param := range a { - params = append(params, param) - } - 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{}) -} - -func (mock *MockSimpleLogging) Warn(format string, a ...interface{}) { - if mock == nil { - panic("mock must not be nil. Use myMock := NewMockSimpleLogging().") - } - params := []pegomock.Param{format} - for _, param := range a { - params = append(params, param) - } - 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{} - for _, param := range a { - 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) - } - } - 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{} - for _, param := range a { - 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) - } - } - return ret0 -} - -func (mock *MockSimpleLogging) VerifyWasCalledOnce() *VerifierMockSimpleLogging { - return &VerifierMockSimpleLogging{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockSimpleLogging) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockSimpleLogging { - return &VerifierMockSimpleLogging{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockSimpleLogging) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockSimpleLogging { - return &VerifierMockSimpleLogging{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockSimpleLogging) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockSimpleLogging { - return &VerifierMockSimpleLogging{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockSimpleLogging struct { - mock *MockSimpleLogging - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockSimpleLogging) Debug(format string, a ...interface{}) *MockSimpleLogging_Debug_OngoingVerification { - params := []pegomock.Param{format} - for _, param := range a { - params = append(params, param) - } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Debug", params, verifier.timeout) - return &MockSimpleLogging_Debug_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSimpleLogging_Debug_OngoingVerification struct { - mock *MockSimpleLogging - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSimpleLogging_Debug_OngoingVerification) GetCapturedArguments() (string, []interface{}) { - format, a := c.GetAllCapturedArguments() - return format[len(format)-1], a[len(a)-1] -} - -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) - } - _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{}) - } - } - } - } - return -} - -func (verifier *VerifierMockSimpleLogging) Err(format string, a ...interface{}) *MockSimpleLogging_Err_OngoingVerification { - params := []pegomock.Param{format} - for _, param := range a { - params = append(params, param) - } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Err", params, verifier.timeout) - return &MockSimpleLogging_Err_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSimpleLogging_Err_OngoingVerification struct { - mock *MockSimpleLogging - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSimpleLogging_Err_OngoingVerification) GetCapturedArguments() (string, []interface{}) { - format, a := c.GetAllCapturedArguments() - return format[len(format)-1], a[len(a)-1] -} - -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) - } - _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{}) - } - } - } - } - return -} - -func (verifier *VerifierMockSimpleLogging) Flush() *MockSimpleLogging_Flush_OngoingVerification { - 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} -} - -type MockSimpleLogging_Flush_OngoingVerification struct { - mock *MockSimpleLogging - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSimpleLogging_Flush_OngoingVerification) GetCapturedArguments() { -} - -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) - return &MockSimpleLogging_GetHistory_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSimpleLogging_GetHistory_OngoingVerification struct { - mock *MockSimpleLogging - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSimpleLogging_GetHistory_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockSimpleLogging_GetHistory_OngoingVerification) GetAllCapturedArguments() { -} - -func (verifier *VerifierMockSimpleLogging) Info(format string, a ...interface{}) *MockSimpleLogging_Info_OngoingVerification { - params := []pegomock.Param{format} - for _, param := range a { - params = append(params, param) - } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Info", params, verifier.timeout) - return &MockSimpleLogging_Info_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSimpleLogging_Info_OngoingVerification struct { - mock *MockSimpleLogging - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSimpleLogging_Info_OngoingVerification) GetCapturedArguments() (string, []interface{}) { - format, a := c.GetAllCapturedArguments() - return format[len(format)-1], a[len(a)-1] -} - -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) - } - _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{}) - } - } - } - } - return -} - -func (verifier *VerifierMockSimpleLogging) Log(level logging.LogLevel, format string, a ...interface{}) *MockSimpleLogging_Log_OngoingVerification { - params := []pegomock.Param{level, format} - for _, param := range a { - params = append(params, param) - } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Log", params, verifier.timeout) - return &MockSimpleLogging_Log_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSimpleLogging_Log_OngoingVerification struct { - mock *MockSimpleLogging - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSimpleLogging_Log_OngoingVerification) GetCapturedArguments() (logging.LogLevel, string, []interface{}) { - level, format, a := c.GetAllCapturedArguments() - return level[len(level)-1], format[len(format)-1], a[len(a)-1] -} - -func (c *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) - } - _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{}) - } - } - } - } - return -} - -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) - return &MockSimpleLogging_SetLevel_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSimpleLogging_SetLevel_OngoingVerification struct { - mock *MockSimpleLogging - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSimpleLogging_SetLevel_OngoingVerification) GetCapturedArguments() logging.LogLevel { - lvl := c.GetAllCapturedArguments() - return lvl[len(lvl)-1] -} - -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) - } - } - return -} - -func (verifier *VerifierMockSimpleLogging) Warn(format string, a ...interface{}) *MockSimpleLogging_Warn_OngoingVerification { - params := []pegomock.Param{format} - for _, param := range a { - params = append(params, param) - } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Warn", params, verifier.timeout) - return &MockSimpleLogging_Warn_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSimpleLogging_Warn_OngoingVerification struct { - mock *MockSimpleLogging - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSimpleLogging_Warn_OngoingVerification) GetCapturedArguments() (string, []interface{}) { - format, a := c.GetAllCapturedArguments() - return format[len(format)-1], a[len(a)-1] -} - -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) - } - _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{}) - } - } - } - } - return -} - -func (verifier *VerifierMockSimpleLogging) With(a ...interface{}) *MockSimpleLogging_With_OngoingVerification { - params := []pegomock.Param{} - for _, param := range a { - params = append(params, param) - } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "With", params, verifier.timeout) - return &MockSimpleLogging_With_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSimpleLogging_With_OngoingVerification struct { - mock *MockSimpleLogging - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSimpleLogging_With_OngoingVerification) GetCapturedArguments() []interface{} { - a := c.GetAllCapturedArguments() - return a[len(a)-1] -} - -func (c *MockSimpleLogging_With_OngoingVerification) GetAllCapturedArguments() (_param0 [][]interface{}) { - 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{}) - } - } - } - } - return -} - -func (verifier *VerifierMockSimpleLogging) WithHistory(a ...interface{}) *MockSimpleLogging_WithHistory_OngoingVerification { - params := []pegomock.Param{} - for _, param := range a { - params = append(params, param) - } - methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "WithHistory", params, verifier.timeout) - return &MockSimpleLogging_WithHistory_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockSimpleLogging_WithHistory_OngoingVerification struct { - mock *MockSimpleLogging - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockSimpleLogging_WithHistory_OngoingVerification) GetCapturedArguments() []interface{} { - a := c.GetAllCapturedArguments() - return a[len(a)-1] -} - -func (c *MockSimpleLogging_WithHistory_OngoingVerification) GetAllCapturedArguments() (_param0 [][]interface{}) { - 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{}) - } - } - } - } - return -} diff --git a/server/scheduled/mocks/mock_executor_service_job.go b/server/scheduled/mocks/mock_executor_service_job.go deleted file mode 100644 index 404e91440d..0000000000 --- a/server/scheduled/mocks/mock_executor_service_job.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/scheduled (interfaces: Job) - -package mocks - -import ( - pegomock "github.com/petergtz/pegomock/v4" - "reflect" - "time" -) - -type MockJob struct { - fail func(message string, callerSkip ...int) -} - -func NewMockJob(options ...pegomock.Option) *MockJob { - mock := &MockJob{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockJob) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockJob) FailHandler() pegomock.FailHandler { return mock.fail } - -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{}) -} - -func (mock *MockJob) VerifyWasCalledOnce() *VerifierMockJob { - return &VerifierMockJob{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockJob) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockJob { - return &VerifierMockJob{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockJob) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockJob { - return &VerifierMockJob{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockJob) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockJob { - return &VerifierMockJob{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockJob struct { - mock *MockJob - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -func (verifier *VerifierMockJob) Run() *MockJob_Run_OngoingVerification { - 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} -} - -type MockJob_Run_OngoingVerification struct { - mock *MockJob - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockJob_Run_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockJob_Run_OngoingVerification) GetAllCapturedArguments() { -} From 4c7dd7f422db9c59b6d724d44d4c2ef2986763b5 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 18 Jun 2024 23:44:21 -0400 Subject: [PATCH 2/6] remove pegomock dep --- go.mod | 1 - go.sum | 2 -- 2 files changed, 3 deletions(-) diff --git a/go.mod b/go.mod index 1a64ad5d78..a2cbb75ad7 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,6 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/moby/patternmatcher v0.6.0 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/petergtz/pegomock/v4 v4.0.0 github.com/pkg/errors v0.9.1 github.com/redis/go-redis/v9 v9.5.2 github.com/remeh/sizedwaitgroup v1.0.0 diff --git a/go.sum b/go.sum index 3fe7d04325..f5195b3863 100644 --- a/go.sum +++ b/go.sum @@ -356,8 +356,6 @@ github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/petergtz/pegomock/v4 v4.0.0 h1:BIGMUof4NXc+xBbuFk0VBfK5Ls7DplcP+LWz4hfYWsY= -github.com/petergtz/pegomock/v4 v4.0.0/go.mod h1:Xscaw/kXYcuh9sGsns+If19FnSMMQy4Wz60YJTn3XOU= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= From f84a67f04e298a1414c17d8a9f5bf56250c8830d Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 18 Jun 2024 23:49:27 -0400 Subject: [PATCH 3/6] remove `go:generate peomomck directives` Signed-off-by: Rui Chen --- .../events/azuredevops_request_validator.go | 2 - .../events/github_request_validator.go | 2 - .../events/gitlab_request_parser_validator.go | 2 - .../web_templates/web_templates.go | 2 - server/core/locking/apply_locking.go | 4 - server/core/locking/locking.go | 4 - server/core/runtime/cache/version_path.go | 3 - server/core/runtime/executor.go | 2 - server/core/runtime/models/exec.go | 2 - server/core/runtime/models/filepath.go | 2 - server/core/runtime/policy/conftest_client.go | 2 - .../core/runtime/post_workflow_hook_runner.go | 1 - .../core/runtime/pre_workflow_hook_runner.go | 1 - server/core/runtime/pull_approved_checker.go | 2 - server/core/runtime/runtime.go | 6 - server/core/terraform/terraform_client.go | 4 - server/events/command_requirement_handler.go | 1 - server/events/command_runner.go | 8 - server/events/comment_parser.go | 4 - server/events/commit_status_updater.go | 2 - server/events/delete_lock_command.go | 2 - server/events/event_parser.go | 2 - server/events/mock_workingdir_test.go | 483 ++++++++++-------- server/events/pending_plan_finder.go | 2 - .../post_workflow_hooks_command_runner.go | 4 - .../pre_workflow_hooks_command_runner.go | 4 - server/events/project_command_builder.go | 2 - server/events/project_command_runner.go | 16 - server/events/project_locker.go | 2 - server/events/pull_closed_executor.go | 4 - server/events/vcs/client.go | 2 - server/events/vcs/github_credentials.go | 2 - server/events/vcs/instrumented_client.go | 2 - server/events/vcs/pull_status_fetcher.go | 2 - server/events/webhooks/slack_client.go | 4 - server/events/webhooks/webhooks.go | 2 - server/events/working_dir.go | 3 - server/events/working_dir_locker.go | 2 - server/jobs/job_url_setter.go | 4 - server/jobs/project_command_output_handler.go | 2 - server/logging/simple_logger.go | 2 - server/scheduled/executor_service.go | 1 - 42 files changed, 269 insertions(+), 336 deletions(-) diff --git a/server/controllers/events/azuredevops_request_validator.go b/server/controllers/events/azuredevops_request_validator.go index 17e48fe7cb..5ed8bc3d56 100644 --- a/server/controllers/events/azuredevops_request_validator.go +++ b/server/controllers/events/azuredevops_request_validator.go @@ -8,8 +8,6 @@ import ( "github.com/mcdafydd/go-azuredevops/azuredevops" ) -//go:generate pegomock generate --package mocks -o mocks/mock_azuredevops_request_validator.go AzureDevopsRequestValidator - // AzureDevopsRequestValidator handles checking if Azure DevOps requests // contain a valid Basic authentication username and password. type AzureDevopsRequestValidator interface { diff --git a/server/controllers/events/github_request_validator.go b/server/controllers/events/github_request_validator.go index 5aa7f1477b..c2ab032f17 100644 --- a/server/controllers/events/github_request_validator.go +++ b/server/controllers/events/github_request_validator.go @@ -22,8 +22,6 @@ import ( "github.com/google/go-github/v59/github" ) -//go:generate pegomock generate --package mocks -o mocks/mock_github_request_validator.go GithubRequestValidator - // GithubRequestValidator handles checking if GitHub requests are signed // properly by the secret. type GithubRequestValidator interface { diff --git a/server/controllers/events/gitlab_request_parser_validator.go b/server/controllers/events/gitlab_request_parser_validator.go index 5d58dba831..8a62406d45 100644 --- a/server/controllers/events/gitlab_request_parser_validator.go +++ b/server/controllers/events/gitlab_request_parser_validator.go @@ -25,8 +25,6 @@ import ( const secretHeader = "X-Gitlab-Token" // #nosec -//go:generate pegomock generate --package mocks -o mocks/mock_gitlab_request_parser_validator.go GitlabRequestParserValidator - // GitlabRequestParserValidator parses and validates GitLab requests. type GitlabRequestParserValidator interface { // ParseAndValidate validates that the request has a token header matching secret. diff --git a/server/controllers/web_templates/web_templates.go b/server/controllers/web_templates/web_templates.go index 0794c80fba..2a887cd9c9 100644 --- a/server/controllers/web_templates/web_templates.go +++ b/server/controllers/web_templates/web_templates.go @@ -23,8 +23,6 @@ import ( "github.com/runatlantis/atlantis/server/jobs" ) -//go:generate pegomock generate --package mocks -o mocks/mock_template_writer.go TemplateWriter - //go:embed templates/* var templatesFS embed.FS diff --git a/server/core/locking/apply_locking.go b/server/core/locking/apply_locking.go index bdb8546308..77eac1ab36 100644 --- a/server/core/locking/apply_locking.go +++ b/server/core/locking/apply_locking.go @@ -7,16 +7,12 @@ import ( "github.com/runatlantis/atlantis/server/events/command" ) -//go:generate pegomock generate --package mocks -o mocks/mock_apply_lock_checker.go ApplyLockChecker - // ApplyLockChecker is an implementation of the global apply lock retrieval. // It returns an object that contains information about apply locks status. type ApplyLockChecker interface { CheckApplyLock() (ApplyCommandLock, error) } -//go:generate pegomock generate --package mocks -o mocks/mock_apply_locker.go ApplyLocker - // ApplyLocker interface that manages locks for apply command runner type ApplyLocker interface { // LockApply creates a lock for ApplyCommand if lock already exists it will diff --git a/server/core/locking/locking.go b/server/core/locking/locking.go index e7c648a44b..d24dbc431c 100644 --- a/server/core/locking/locking.go +++ b/server/core/locking/locking.go @@ -26,8 +26,6 @@ import ( "github.com/runatlantis/atlantis/server/events/models" ) -//go:generate pegomock generate --package mocks -o mocks/mock_backend.go Backend - // Backend is an implementation of the locking API we require. type Backend interface { TryLock(lock models.ProjectLock) (bool, models.ProjectLock, error) @@ -60,8 +58,6 @@ type Client struct { backend Backend } -//go:generate pegomock generate --package mocks -o mocks/mock_locker.go Locker - type Locker interface { TryLock(p models.Project, workspace string, pull models.PullRequest, user models.User) (TryLockResponse, error) Unlock(key string) (*models.ProjectLock, error) diff --git a/server/core/runtime/cache/version_path.go b/server/core/runtime/cache/version_path.go index 197d5d9904..f1a789eb3c 100644 --- a/server/core/runtime/cache/version_path.go +++ b/server/core/runtime/cache/version_path.go @@ -9,9 +9,6 @@ import ( "github.com/runatlantis/atlantis/server/core/runtime/models" ) -//go:generate pegomock generate --package mocks -o mocks/mock_version_path.go ExecutionVersionCache -//go:generate pegomock generate --package mocks -o mocks/mock_key_serializer.go KeySerializer - type ExecutionVersionCache interface { Get(key *version.Version) (string, error) } diff --git a/server/core/runtime/executor.go b/server/core/runtime/executor.go index 69daafc229..b071a746cf 100644 --- a/server/core/runtime/executor.go +++ b/server/core/runtime/executor.go @@ -6,8 +6,6 @@ import ( "github.com/runatlantis/atlantis/server/logging" ) -//go:generate pegomock generate --package mocks -o mocks/mock_versionedexecutorworkflow.go VersionedExecutorWorkflow - // VersionedExecutorWorkflow defines a versioned execution for a given project context type VersionedExecutorWorkflow interface { ExecutorVersionEnsurer diff --git a/server/core/runtime/models/exec.go b/server/core/runtime/models/exec.go index 4a7df796f3..c34f4bf52a 100644 --- a/server/core/runtime/models/exec.go +++ b/server/core/runtime/models/exec.go @@ -7,8 +7,6 @@ import ( "strings" ) -//go:generate pegomock generate --package mocks -o mocks/mock_exec.go Exec - type Exec interface { LookPath(file string) (string, error) CombinedOutput(args []string, envs map[string]string, workdir string) (string, error) diff --git a/server/core/runtime/models/filepath.go b/server/core/runtime/models/filepath.go index 62eea76b8b..0deb59de50 100644 --- a/server/core/runtime/models/filepath.go +++ b/server/core/runtime/models/filepath.go @@ -5,8 +5,6 @@ import ( "path/filepath" ) -//go:generate pegomock generate --package mocks -o mocks/mock_filepath.go FilePath - type FilePath interface { NotExists() bool Join(elem ...string) FilePath diff --git a/server/core/runtime/policy/conftest_client.go b/server/core/runtime/policy/conftest_client.go index 5218f883d2..852d94b6f5 100644 --- a/server/core/runtime/policy/conftest_client.go +++ b/server/core/runtime/policy/conftest_client.go @@ -74,8 +74,6 @@ func (c ConftestTestCommandArgs) build() ([]string, error) { } // SourceResolver resolves the policy set to a local fs path -// -//go:generate pegomock generate --package mocks -o mocks/mock_conftest_client.go SourceResolver type SourceResolver interface { Resolve(policySet valid.PolicySet) (string, error) } diff --git a/server/core/runtime/post_workflow_hook_runner.go b/server/core/runtime/post_workflow_hook_runner.go index d2e1f8cbb4..c6fc17d7d4 100644 --- a/server/core/runtime/post_workflow_hook_runner.go +++ b/server/core/runtime/post_workflow_hook_runner.go @@ -11,7 +11,6 @@ import ( "github.com/runatlantis/atlantis/server/jobs" ) -//go:generate pegomock generate --package mocks -o mocks/mock_post_workflows_hook_runner.go PostWorkflowHookRunner type PostWorkflowHookRunner interface { Run(ctx models.WorkflowHookCommandContext, command string, shell string, shellArgs string, path string) (string, string, error) } diff --git a/server/core/runtime/pre_workflow_hook_runner.go b/server/core/runtime/pre_workflow_hook_runner.go index 9e30e8eb27..0ed9413014 100644 --- a/server/core/runtime/pre_workflow_hook_runner.go +++ b/server/core/runtime/pre_workflow_hook_runner.go @@ -11,7 +11,6 @@ import ( "github.com/runatlantis/atlantis/server/jobs" ) -//go:generate pegomock generate --package mocks -o mocks/mock_pre_workflows_hook_runner.go PreWorkflowHookRunner type PreWorkflowHookRunner interface { Run(ctx models.WorkflowHookCommandContext, command string, shell string, shellArgs string, path string) (string, string, error) } diff --git a/server/core/runtime/pull_approved_checker.go b/server/core/runtime/pull_approved_checker.go index f4884c2e98..55298a5001 100644 --- a/server/core/runtime/pull_approved_checker.go +++ b/server/core/runtime/pull_approved_checker.go @@ -5,8 +5,6 @@ import ( "github.com/runatlantis/atlantis/server/logging" ) -//go:generate pegomock generate --package mocks -o mocks/mock_pull_approved_checker.go PullApprovedChecker - type PullApprovedChecker interface { PullIsApproved(logger logging.SimpleLogging, baseRepo models.Repo, pull models.PullRequest) (models.ApprovalStatus, error) } diff --git a/server/core/runtime/runtime.go b/server/core/runtime/runtime.go index 52fc5180eb..8b7df552a9 100644 --- a/server/core/runtime/runtime.go +++ b/server/core/runtime/runtime.go @@ -34,8 +34,6 @@ type TerraformExec interface { // without causing circular imports. // It's split from TerraformExec because due to a bug in pegomock with channels, // we can't generate a mock for it so we hand-write it for this specific method. -// -//go:generate pegomock generate --package mocks -o mocks/mock_async_tfexec.go AsyncTFExec type AsyncTFExec interface { // RunCommandAsync runs terraform with args. It immediately returns an // input and output channel. Callers can use the output channel to @@ -48,15 +46,11 @@ type AsyncTFExec interface { // StatusUpdater brings the interface from CommitStatusUpdater into this package // without causing circular imports. -// -//go:generate pegomock generate --package mocks -o mocks/mock_status_updater.go StatusUpdater type StatusUpdater interface { UpdateProject(ctx command.ProjectContext, cmdName command.Name, status models.CommitStatus, url string, res *command.ProjectResult) error } // Runner mirrors events.StepRunner as a way to bring it into this package -// -//go:generate pegomock generate --package mocks -o mocks/mock_runner.go Runner type Runner interface { Run(ctx command.ProjectContext, extraArgs []string, path string, envs map[string]string) (string, error) } diff --git a/server/core/terraform/terraform_client.go b/server/core/terraform/terraform_client.go index 792b028612..f6b94ac8b9 100644 --- a/server/core/terraform/terraform_client.go +++ b/server/core/terraform/terraform_client.go @@ -46,8 +46,6 @@ import ( var LogStreamingValidCmds = [...]string{"init", "plan", "apply"} -//go:generate pegomock generate --package mocks -o mocks/mock_terraform_client.go Client - type Client interface { // RunCommandWithVersion executes terraform with args in path. If v is nil, // it will use the default Terraform version. workspace is the Terraform @@ -90,8 +88,6 @@ type DefaultClient struct { projectCmdOutputHandler jobs.ProjectCommandOutputHandler } -//go:generate pegomock generate --package mocks -o mocks/mock_downloader.go Downloader - // Downloader is for downloading terraform versions. type Downloader interface { Install(dir string, downloadURL string, v *version.Version) (string, error) diff --git a/server/events/command_requirement_handler.go b/server/events/command_requirement_handler.go index bf95a255ce..3d76abdee4 100644 --- a/server/events/command_requirement_handler.go +++ b/server/events/command_requirement_handler.go @@ -9,7 +9,6 @@ import ( "github.com/runatlantis/atlantis/server/events/models" ) -//go:generate pegomock generate --package mocks -o mocks/mock_command_requirement_handler.go CommandRequirementHandler type CommandRequirementHandler interface { ValidateProjectDependencies(ctx command.ProjectContext) (string, error) ValidatePlanProject(repoDir string, ctx command.ProjectContext) (string, error) diff --git a/server/events/command_runner.go b/server/events/command_runner.go index 14cdbce146..f8ea420a80 100644 --- a/server/events/command_runner.go +++ b/server/events/command_runner.go @@ -37,8 +37,6 @@ const ( ShutdownComment = "Atlantis server is shutting down, please try again later." ) -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package mocks -o mocks/mock_command_runner.go CommandRunner - // CommandRunner is the first step after a command request has been parsed. type CommandRunner interface { // RunCommentCommand is the first step after a command request has been parsed. @@ -48,24 +46,18 @@ type CommandRunner interface { RunAutoplanCommand(baseRepo models.Repo, headRepo models.Repo, pull models.PullRequest, user models.User) } -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package mocks -o mocks/mock_github_pull_getter.go GithubPullGetter - // GithubPullGetter makes API calls to get pull requests. type GithubPullGetter interface { // GetPullRequest gets the pull request with id pullNum for the repo. GetPullRequest(logger logging.SimpleLogging, repo models.Repo, pullNum int) (*github.PullRequest, error) } -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package mocks -o mocks/mock_azuredevops_pull_getter.go AzureDevopsPullGetter - // AzureDevopsPullGetter makes API calls to get pull requests. type AzureDevopsPullGetter interface { // GetPullRequest gets the pull request with id pullNum for the repo. GetPullRequest(logger logging.SimpleLogging, repo models.Repo, pullNum int) (*azuredevops.GitPullRequest, error) } -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package mocks -o mocks/mock_gitlab_merge_request_getter.go GitlabMergeRequestGetter - // GitlabMergeRequestGetter makes API calls to get merge requests. type GitlabMergeRequestGetter interface { // GetMergeRequest gets the pull request with the id pullNum for the repo. diff --git a/server/events/comment_parser.go b/server/events/comment_parser.go index 3b3d2d3b0a..43bdeb653a 100644 --- a/server/events/comment_parser.go +++ b/server/events/comment_parser.go @@ -54,8 +54,6 @@ const ( // and pasting GitHub comments. var multiLineRegex = regexp.MustCompile(`.*\r?\n[^\r\n]+`) -//go:generate pegomock generate --package mocks -o mocks/mock_comment_parsing.go CommentParsing - // CommentParsing handles parsing pull request comments. type CommentParsing interface { // Parse attempts to parse a pull request comment to see if it's an Atlantis @@ -63,8 +61,6 @@ type CommentParsing interface { Parse(comment string, vcsHost models.VCSHostType) CommentParseResult } -//go:generate pegomock generate --package mocks -o mocks/mock_comment_building.go CommentBuilder - // CommentBuilder builds comment commands that can be used on pull requests. type CommentBuilder interface { // BuildPlanComment builds a plan comment for the specified args. diff --git a/server/events/commit_status_updater.go b/server/events/commit_status_updater.go index a05b7ef808..1b06e92d6c 100644 --- a/server/events/commit_status_updater.go +++ b/server/events/commit_status_updater.go @@ -25,8 +25,6 @@ import ( "golang.org/x/text/language" ) -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package mocks -o mocks/mock_commit_status_updater.go CommitStatusUpdater - // CommitStatusUpdater updates the status of a commit with the VCS host. We set // the status to signify whether the plan/apply succeeds. type CommitStatusUpdater interface { diff --git a/server/events/delete_lock_command.go b/server/events/delete_lock_command.go index 1c9abcdda0..ae19f6ff38 100644 --- a/server/events/delete_lock_command.go +++ b/server/events/delete_lock_command.go @@ -6,8 +6,6 @@ import ( "github.com/runatlantis/atlantis/server/logging" ) -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package mocks -o mocks/mock_delete_lock_command.go DeleteLockCommand - // DeleteLockCommand is the first step after a command request has been parsed. type DeleteLockCommand interface { DeleteLock(logger logging.SimpleLogging, id string) (*models.ProjectLock, error) diff --git a/server/events/event_parser.go b/server/events/event_parser.go index 8a02f476e1..c1fd530c47 100644 --- a/server/events/event_parser.go +++ b/server/events/event_parser.go @@ -204,8 +204,6 @@ func NewCommentCommand(repoRelDir string, flags []string, name command.Name, sub } } -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package mocks -o mocks/mock_event_parsing.go EventParsing - // EventParsing parses webhook events from different VCS hosts into their // respective Atlantis models. // todo: rename to VCSParsing or the like because this also parses API responses #refactor diff --git a/server/events/mock_workingdir_test.go b/server/events/mock_workingdir_test.go index d298b2cee7..65d5fc00a7 100644 --- a/server/events/mock_workingdir_test.go +++ b/server/events/mock_workingdir_test.go @@ -4,12 +4,11 @@ package events import ( - "reflect" - "time" - pegomock "github.com/petergtz/pegomock/v4" models "github.com/runatlantis/atlantis/server/events/models" logging "github.com/runatlantis/atlantis/server/logging" + "reflect" + "time" ) type MockWorkingDir struct { @@ -31,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 { @@ -213,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} } @@ -229,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} } @@ -268,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} } @@ -303,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} } @@ -342,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} } @@ -389,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} } @@ -428,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} } @@ -459,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} } @@ -494,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/pending_plan_finder.go b/server/events/pending_plan_finder.go index 9a26866b1a..39e9073843 100644 --- a/server/events/pending_plan_finder.go +++ b/server/events/pending_plan_finder.go @@ -11,8 +11,6 @@ import ( "github.com/runatlantis/atlantis/server/utils" ) -//go:generate pegomock generate --package mocks -o mocks/mock_pending_plan_finder.go PendingPlanFinder - type PendingPlanFinder interface { Find(pullDir string) ([]PendingPlan, error) DeletePlans(pullDir string) error diff --git a/server/events/post_workflow_hooks_command_runner.go b/server/events/post_workflow_hooks_command_runner.go index f5fe0c5245..3e94aead9a 100644 --- a/server/events/post_workflow_hooks_command_runner.go +++ b/server/events/post_workflow_hooks_command_runner.go @@ -12,15 +12,11 @@ import ( "github.com/runatlantis/atlantis/server/events/vcs" ) -//go:generate pegomock generate --package mocks -o mocks/mock_post_workflow_hook_url_generator.go PostWorkflowHookURLGenerator - // PostWorkflowHookURLGenerator generates urls to view the post workflow progress. type PostWorkflowHookURLGenerator interface { GenerateProjectWorkflowHookURL(hookID string) (string, error) } -//go:generate pegomock generate --package mocks -o mocks/mock_post_workflows_hooks_command_runner.go PostWorkflowHooksCommandRunner - type PostWorkflowHooksCommandRunner interface { RunPostHooks(ctx *command.Context, cmd *CommentCommand) error } diff --git a/server/events/pre_workflow_hooks_command_runner.go b/server/events/pre_workflow_hooks_command_runner.go index 70462765a3..cd1b5cb499 100644 --- a/server/events/pre_workflow_hooks_command_runner.go +++ b/server/events/pre_workflow_hooks_command_runner.go @@ -12,15 +12,11 @@ import ( "github.com/runatlantis/atlantis/server/events/vcs" ) -//go:generate pegomock generate --package mocks -o mocks/mock_pre_workflow_hook_url_generator.go PreWorkflowHookURLGenerator - // PreWorkflowHookURLGenerator generates urls to view the pre workflow progress. type PreWorkflowHookURLGenerator interface { GenerateProjectWorkflowHookURL(hookID string) (string, error) } -//go:generate pegomock generate --package mocks -o mocks/mock_pre_workflows_hooks_command_runner.go PreWorkflowHooksCommandRunner - type PreWorkflowHooksCommandRunner interface { RunPreHooks(ctx *command.Context, cmd *CommentCommand) error } diff --git a/server/events/project_command_builder.go b/server/events/project_command_builder.go index 538c71a73f..d5b74523c9 100644 --- a/server/events/project_command_builder.go +++ b/server/events/project_command_builder.go @@ -191,8 +191,6 @@ type ProjectStateCommandBuilder interface { BuildStateRmCommands(ctx *command.Context, comment *CommentCommand) ([]command.ProjectContext, error) } -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package mocks -o mocks/mock_project_command_builder.go ProjectCommandBuilder - // ProjectCommandBuilder builds commands that run on individual projects. type ProjectCommandBuilder interface { ProjectPlanCommandBuilder diff --git a/server/events/project_command_runner.go b/server/events/project_command_runner.go index e97d919820..18449a2caf 100644 --- a/server/events/project_command_runner.go +++ b/server/events/project_command_runner.go @@ -43,16 +43,12 @@ func (d DirNotExistErr) Error() string { return fmt.Sprintf("dir %q does not exist", d.RepoRelDir) } -//go:generate pegomock generate --package mocks -o mocks/mock_lock_url_generator.go LockURLGenerator - // LockURLGenerator generates urls to locks. type LockURLGenerator interface { // GenerateLockURL returns the full URL to the lock at lockID. GenerateLockURL(lockID string) string } -//go:generate pegomock generate --package mocks -o mocks/mock_step_runner.go StepRunner - // StepRunner runs steps. Steps are individual pieces of execution like // `terraform plan`. type StepRunner interface { @@ -60,16 +56,12 @@ type StepRunner interface { Run(ctx command.ProjectContext, extraArgs []string, path string, envs map[string]string) (string, error) } -//go:generate pegomock generate --package mocks -o mocks/mock_custom_step_runner.go CustomStepRunner - // CustomStepRunner runs custom run steps. type CustomStepRunner interface { // Run cmd in path. Run(ctx command.ProjectContext, cmd string, path string, envs map[string]string, streamOutput bool, postProcessOutput valid.PostProcessRunOutputOption) (string, error) } -//go:generate pegomock generate --package mocks -o mocks/mock_env_step_runner.go EnvStepRunner - // EnvStepRunner runs env steps. type EnvStepRunner interface { Run(ctx command.ProjectContext, cmd string, value string, path string, envs map[string]string) (string, error) @@ -81,16 +73,12 @@ type MultiEnvStepRunner interface { Run(ctx command.ProjectContext, cmd string, path string, envs map[string]string, postProcessOutput valid.PostProcessRunOutputOption) (string, error) } -//go:generate pegomock generate --package mocks -o mocks/mock_webhooks_sender.go WebhooksSender - // WebhooksSender sends webhook. type WebhooksSender interface { // Send sends the webhook. Send(log logging.SimpleLogging, res webhooks.ApplyResult) error } -//go:generate pegomock generate --package mocks -o mocks/mock_project_command_runner.go ProjectCommandRunner - type ProjectPlanCommandRunner interface { // Plan runs terraform plan for the project described by ctx. Plan(ctx command.ProjectContext) command.ProjectResult @@ -138,16 +126,12 @@ type ProjectCommandRunner interface { ProjectStateCommandRunner } -//go:generate pegomock generate --package mocks -o mocks/mock_job_url_setter.go JobURLSetter - type JobURLSetter interface { // SetJobURLWithStatus sets the commit status for the project represented by // ctx and updates the status with and url to a job. SetJobURLWithStatus(ctx command.ProjectContext, cmdName command.Name, status models.CommitStatus, res *command.ProjectResult) error } -//go:generate pegomock generate --package mocks -o mocks/mock_job_message_sender.go JobMessageSender - type JobMessageSender interface { Send(ctx command.ProjectContext, msg string, operationComplete bool) } diff --git a/server/events/project_locker.go b/server/events/project_locker.go index 275b9e8c72..ff48db372c 100644 --- a/server/events/project_locker.go +++ b/server/events/project_locker.go @@ -22,8 +22,6 @@ import ( "github.com/runatlantis/atlantis/server/logging" ) -//go:generate pegomock generate --package mocks -o mocks/mock_project_lock.go ProjectLocker - // ProjectLocker locks this project against other plans being run until this // project is unlocked. type ProjectLocker interface { diff --git a/server/events/pull_closed_executor.go b/server/events/pull_closed_executor.go index 5c005dbc9a..491a926925 100644 --- a/server/events/pull_closed_executor.go +++ b/server/events/pull_closed_executor.go @@ -30,14 +30,10 @@ import ( "github.com/runatlantis/atlantis/server/jobs" ) -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package mocks -o mocks/mock_resource_cleaner.go ResourceCleaner - type ResourceCleaner interface { CleanUp(pullInfo jobs.PullInfo) } -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package mocks -o mocks/mock_pull_cleaner.go PullCleaner - // PullCleaner cleans up pull requests after they're closed/merged. type PullCleaner interface { // CleanUpPull deletes the workspaces used by the pull request on disk diff --git a/server/events/vcs/client.go b/server/events/vcs/client.go index b6ad7cb9cd..413fb6115e 100644 --- a/server/events/vcs/client.go +++ b/server/events/vcs/client.go @@ -18,8 +18,6 @@ import ( "github.com/runatlantis/atlantis/server/logging" ) -//go:generate pegomock generate --package mocks -o mocks/mock_client.go github.com/runatlantis/atlantis/server/events/vcs Client - // Client is used to make API calls to a VCS host like GitHub or GitLab. type Client interface { // GetModifiedFiles returns the names of files that were modified in the merge request diff --git a/server/events/vcs/github_credentials.go b/server/events/vcs/github_credentials.go index d1d59bffaa..9921762355 100644 --- a/server/events/vcs/github_credentials.go +++ b/server/events/vcs/github_credentials.go @@ -12,8 +12,6 @@ import ( "github.com/pkg/errors" ) -//go:generate pegomock generate --package mocks -o mocks/mock_github_credentials.go GithubCredentials - // GithubCredentials handles creating http.Clients that authenticate. type GithubCredentials interface { Client() (*http.Client, error) diff --git a/server/events/vcs/instrumented_client.go b/server/events/vcs/instrumented_client.go index f21cf76947..be082d5aa5 100644 --- a/server/events/vcs/instrumented_client.go +++ b/server/events/vcs/instrumented_client.go @@ -28,8 +28,6 @@ func NewInstrumentedGithubClient(client *GithubClient, statsScope tally.Scope, l } } -//go:generate pegomock generate --package mocks -o mocks/mock_github_pull_request_getter.go GithubPullRequestGetter - type GithubPullRequestGetter interface { GetPullRequest(logger logging.SimpleLogging, repo models.Repo, pullNum int) (*github.PullRequest, error) } diff --git a/server/events/vcs/pull_status_fetcher.go b/server/events/vcs/pull_status_fetcher.go index b5b8a46383..b7c2f21121 100644 --- a/server/events/vcs/pull_status_fetcher.go +++ b/server/events/vcs/pull_status_fetcher.go @@ -6,8 +6,6 @@ import ( "github.com/runatlantis/atlantis/server/logging" ) -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events/vcs --package mocks -o mocks/mock_pull_req_status_fetcher.go PullReqStatusFetcher - type PullReqStatusFetcher interface { FetchPullStatus(logger logging.SimpleLogging, pull models.PullRequest) (models.PullReqStatus, error) } diff --git a/server/events/webhooks/slack_client.go b/server/events/webhooks/slack_client.go index a548f9ea31..78c77cdf10 100644 --- a/server/events/webhooks/slack_client.go +++ b/server/events/webhooks/slack_client.go @@ -24,8 +24,6 @@ const ( slackFailureColour = "danger" ) -//go:generate pegomock generate --package mocks -o mocks/mock_slack_client.go SlackClient - // SlackClient handles making API calls to Slack. type SlackClient interface { AuthTest() error @@ -33,8 +31,6 @@ type SlackClient interface { PostMessage(channel string, applyResult ApplyResult) error } -//go:generate pegomock generate --package mocks -o mocks/mock_underlying_slack_client.go UnderlyingSlackClient - // UnderlyingSlackClient wraps the nlopes/slack.Client implementation so // we can mock it during tests. type UnderlyingSlackClient interface { diff --git a/server/events/webhooks/webhooks.go b/server/events/webhooks/webhooks.go index c4b43239a7..23ccda60da 100644 --- a/server/events/webhooks/webhooks.go +++ b/server/events/webhooks/webhooks.go @@ -26,8 +26,6 @@ import ( const SlackKind = "slack" const ApplyEvent = "apply" -//go:generate pegomock generate --package mocks -o mocks/mock_sender.go Sender - // Sender sends webhooks. type Sender interface { // Send sends the webhook (if the implementation thinks it should). diff --git a/server/events/working_dir.go b/server/events/working_dir.go index c2e56d8dc7..d68fc70274 100644 --- a/server/events/working_dir.go +++ b/server/events/working_dir.go @@ -33,9 +33,6 @@ const workingDirPrefix = "repos" var cloneLocks sync.Map -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package mocks -o mocks/mock_working_dir.go WorkingDir -//go:generate pegomock generate github.com/runatlantis/atlantis/server/events --package events WorkingDir - // WorkingDir handles the workspace on disk for running commands. type WorkingDir interface { // Clone git clones headRepo, checks out the branch and then returns the diff --git a/server/events/working_dir_locker.go b/server/events/working_dir_locker.go index 06af44ec5a..6857cc4433 100644 --- a/server/events/working_dir_locker.go +++ b/server/events/working_dir_locker.go @@ -19,8 +19,6 @@ import ( "sync" ) -//go:generate pegomock generate --package mocks -o mocks/mock_working_dir_locker.go WorkingDirLocker - // WorkingDirLocker is used to prevent multiple commands from executing // at the same time for a single repo, pull, and workspace. We need to prevent // this from happening because a specific repo/pull/workspace has a single workspace diff --git a/server/jobs/job_url_setter.go b/server/jobs/job_url_setter.go index d2c6209c17..4662dfdf9c 100644 --- a/server/jobs/job_url_setter.go +++ b/server/jobs/job_url_setter.go @@ -5,15 +5,11 @@ import ( "github.com/runatlantis/atlantis/server/events/models" ) -//go:generate pegomock generate --package mocks -o mocks/mock_project_job_url_generator.go ProjectJobURLGenerator - // ProjectJobURLGenerator generates urls to view project's progress. type ProjectJobURLGenerator interface { GenerateProjectJobURL(p command.ProjectContext) (string, error) } -//go:generate pegomock generate --package mocks -o mocks/mock_project_status_updater.go ProjectStatusUpdater - type ProjectStatusUpdater interface { // UpdateProject sets the commit status for the project represented by // ctx. diff --git a/server/jobs/project_command_output_handler.go b/server/jobs/project_command_output_handler.go index ede262de9b..9375916a41 100644 --- a/server/jobs/project_command_output_handler.go +++ b/server/jobs/project_command_output_handler.go @@ -68,8 +68,6 @@ type AsyncProjectCommandOutputHandler struct { pullToJobMapping sync.Map } -//go:generate pegomock generate --package mocks -o mocks/mock_project_command_output_handler.go ProjectCommandOutputHandler - type ProjectCommandOutputHandler interface { // Send will enqueue the msg and wait for Handle() to receive the message. Send(ctx command.ProjectContext, msg string, operationComplete bool) diff --git a/server/logging/simple_logger.go b/server/logging/simple_logger.go index 5003a1fda0..ca3436f03a 100644 --- a/server/logging/simple_logger.go +++ b/server/logging/simple_logger.go @@ -26,8 +26,6 @@ import ( "go.uber.org/zap/zaptest" ) -//go:generate pegomock generate --package mocks -o mocks/mock_simple_logging.go SimpleLogging - // SimpleLogging is the interface used for logging throughout the codebase. type SimpleLogging interface { diff --git a/server/scheduled/executor_service.go b/server/scheduled/executor_service.go index bfee89a035..4a205040a9 100644 --- a/server/scheduled/executor_service.go +++ b/server/scheduled/executor_service.go @@ -102,7 +102,6 @@ func (s *ExecutorService) runScheduledJob(ctx context.Context, wg *sync.WaitGrou } -//go:generate pegomock generate --package mocks -o mocks/mock_executor_service_job.go Job type Job interface { Run() } From 7f0dcc32b9347f83bd53404c81970697f0cff160 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 18 Jun 2024 23:50:49 -0400 Subject: [PATCH 4/6] remove generated mock Signed-off-by: Rui Chen --- server/events/mock_workingdir_test.go | 581 -------------------------- 1 file changed, 581 deletions(-) delete mode 100644 server/events/mock_workingdir_test.go diff --git a/server/events/mock_workingdir_test.go b/server/events/mock_workingdir_test.go deleted file mode 100644 index 65d5fc00a7..0000000000 --- a/server/events/mock_workingdir_test.go +++ /dev/null @@ -1,581 +0,0 @@ -// Code generated by pegomock. DO NOT EDIT. -// Source: github.com/runatlantis/atlantis/server/events (interfaces: WorkingDir) - -package events - -import ( - pegomock "github.com/petergtz/pegomock/v4" - models "github.com/runatlantis/atlantis/server/events/models" - logging "github.com/runatlantis/atlantis/server/logging" - "reflect" - "time" -) - -type MockWorkingDir struct { - fail func(message string, callerSkip ...int) -} - -func NewMockWorkingDir(options ...pegomock.Option) *MockWorkingDir { - mock := &MockWorkingDir{} - for _, option := range options { - option.Apply(mock) - } - return mock -} - -func (mock *MockWorkingDir) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } -func (mock *MockWorkingDir) FailHandler() pegomock.FailHandler { return mock.fail } - -func (mock *MockWorkingDir) Clone(logger logging.SimpleLogging, headRepo models.Repo, p models.PullRequest, workspace string) (string, bool, error) { - 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) - } - if _result[1] != nil { - _ret1 = _result[1].(bool) - } - if _result[2] != nil { - _ret2 = _result[2].(error) - } - } - 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) - } - } - 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) - } - } - 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) - } - } - 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) - } - if _result[1] != nil { - _ret1 = _result[1].(error) - } - } - 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) - } - if _result[1] != nil { - _ret1 = _result[1].(error) - } - } - 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) - } - if _result[1] != nil { - _ret1 = _result[1].(error) - } - } - 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) - } - } - 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{}) -} - -func (mock *MockWorkingDir) VerifyWasCalledOnce() *VerifierMockWorkingDir { - return &VerifierMockWorkingDir{ - mock: mock, - invocationCountMatcher: pegomock.Times(1), - } -} - -func (mock *MockWorkingDir) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockWorkingDir { - return &VerifierMockWorkingDir{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - } -} - -func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDir { - return &VerifierMockWorkingDir{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - inOrderContext: inOrderContext, - } -} - -func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockWorkingDir { - return &VerifierMockWorkingDir{ - mock: mock, - invocationCountMatcher: invocationCountMatcher, - timeout: timeout, - } -} - -type VerifierMockWorkingDir struct { - mock *MockWorkingDir - invocationCountMatcher pegomock.InvocationCountMatcher - inOrderContext *pegomock.InOrderContext - timeout time.Duration -} - -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) - return &MockWorkingDir_Clone_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_Clone_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_Clone_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, string) { - logger, headRepo, p, workspace := c.GetAllCapturedArguments() - return logger[len(logger)-1], headRepo[len(headRepo)-1], p[len(p)-1], workspace[len(workspace)-1] -} - -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 { - 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) - return &MockWorkingDir_Delete_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_Delete_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_Delete_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest) { - logger, r, p := c.GetAllCapturedArguments() - return logger[len(logger)-1], r[len(r)-1], p[len(p)-1] -} - -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 { - 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) - return &MockWorkingDir_DeleteForWorkspace_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_DeleteForWorkspace_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_DeleteForWorkspace_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, string) { - logger, r, p, workspace := c.GetAllCapturedArguments() - return logger[len(logger)-1], r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1] -} - -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 { - 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) - return &MockWorkingDir_DeletePlan_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_DeletePlan_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_DeletePlan_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, string, string, string) { - logger, r, p, workspace, path, projectName := c.GetAllCapturedArguments() - return logger[len(logger)-1], r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1], path[len(path)-1], projectName[len(projectName)-1] -} - -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 { - 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) - return &MockWorkingDir_GetGitUntrackedFiles_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_GetGitUntrackedFiles_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_GetGitUntrackedFiles_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, string) { - logger, r, p, workspace := c.GetAllCapturedArguments() - return logger[len(logger)-1], r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1] -} - -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 { - 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) - return &MockWorkingDir_GetPullDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_GetPullDir_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_GetPullDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) { - r, p := c.GetAllCapturedArguments() - return r[len(r)-1], p[len(p)-1] -} - -func (c *MockWorkingDir_GetPullDir_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []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) - return &MockWorkingDir_GetWorkingDir_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_GetWorkingDir_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_GetWorkingDir_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest, string) { - r, p, workspace := c.GetAllCapturedArguments() - return r[len(r)-1], p[len(p)-1], workspace[len(workspace)-1] -} - -func (c *MockWorkingDir_GetWorkingDir_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest, _param2 []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) - return &MockWorkingDir_HasDiverged_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_HasDiverged_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_HasDiverged_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, string) { - logger, cloneDir := c.GetAllCapturedArguments() - return logger[len(logger)-1], cloneDir[len(cloneDir)-1] -} - -func (c *MockWorkingDir_HasDiverged_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []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) - return &MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} -} - -type MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification struct { - mock *MockWorkingDir - methodInvocations []pegomock.MethodInvocation -} - -func (c *MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification) GetCapturedArguments() { -} - -func (c *MockWorkingDir_SetCheckForUpstreamChanges_OngoingVerification) GetAllCapturedArguments() { -} From dfc44dfa68af2f50afc1ca4633b3355e20f6c097 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Wed, 19 Jun 2024 00:01:15 -0400 Subject: [PATCH 5/6] init mockery config Signed-off-by: Rui Chen --- .mockery.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .mockery.yaml diff --git a/.mockery.yaml b/.mockery.yaml new file mode 100644 index 0000000000..ffdeb86536 --- /dev/null +++ b/.mockery.yaml @@ -0,0 +1,5 @@ +quiet: False +testonly: False +with-expecter: True +keeptree: True +all: True From 78afc8a66587a7ec81b133a350c491f6e8e6e018 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Wed, 19 Jun 2024 00:25:43 -0400 Subject: [PATCH 6/6] update --- .mockery.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.mockery.yaml b/.mockery.yaml index ffdeb86536..bab8e4254a 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -1,5 +1,6 @@ quiet: False +all: True testonly: False with-expecter: True -keeptree: True -all: True +outpkg: mocks +inpackage: true