diff --git a/.circleci/config.yml b/.circleci/config.yml index 1a07cea8f..75a88a76a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,7 @@ jobs: - image: runatlantis/testing-env:20296f9638a4eca04733f60b39e1d3025b9d708a steps: - checkout + - run: make test-all - run: make check-fmt - run: make check-lint e2e: diff --git a/Makefile b/Makefile index f6db17599..b78447628 100644 --- a/Makefile +++ b/Makefile @@ -23,14 +23,14 @@ build-service: ## Build the main Go service CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o atlantis . go-generate: ## Run go generate in all packages - go generate $(PKG) + ./scripts/go-generate.sh regen-mocks: ## Delete all mocks and matchers and then run go generate to regen them. find . -type f | grep mocks/mock_ | xargs rm find . -type f | grep mocks/matchers | xargs rm @# not using $(PKG) here because that includes directories that have now @# been made empty, causing go generate to fail. - go list ./... | grep -v e2e | grep -v static | xargs go generate + ./scripts/go-generate.sh test: ## Run tests @go test -short $(PKG) diff --git a/scripts/go-generate.sh b/scripts/go-generate.sh new file mode 100755 index 000000000..370817c15 --- /dev/null +++ b/scripts/go-generate.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -eou pipefail + +pkgs=$(go list ./... | grep -v mocks | grep -v matchers | grep -v e2e | grep -v static) +for pkg in $pkgs; do + echo "go generate $pkg" + go generate $pkg +done diff --git a/server/events/locking/mocks/matchers/locking_applycommandlock.go b/server/events/locking/mocks/matchers/locking_applycommandlock.go new file mode 100644 index 000000000..bc9103cda --- /dev/null +++ b/server/events/locking/mocks/matchers/locking_applycommandlock.go @@ -0,0 +1,33 @@ +// Code generated by pegomock. DO NOT EDIT. +package matchers + +import ( + "github.com/petergtz/pegomock" + "reflect" + + locking "github.com/runatlantis/atlantis/server/events/locking" +) + +func AnyLockingApplyCommandLock() locking.ApplyCommandLock { + pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(locking.ApplyCommandLock))(nil)).Elem())) + var nullValue locking.ApplyCommandLock + return nullValue +} + +func EqLockingApplyCommandLock(value locking.ApplyCommandLock) locking.ApplyCommandLock { + pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) + var nullValue locking.ApplyCommandLock + return nullValue +} + +func NotEqLockingApplyCommandLock(value locking.ApplyCommandLock) locking.ApplyCommandLock { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue locking.ApplyCommandLock + return nullValue +} + +func LockingApplyCommandLockThat(matcher pegomock.ArgumentMatcher) locking.ApplyCommandLock { + pegomock.RegisterMatcher(matcher) + var nullValue locking.ApplyCommandLock + return nullValue +} diff --git a/server/events/locking/mocks/matchers/locking_trylockresponse.go b/server/events/locking/mocks/matchers/locking_trylockresponse.go index fa6d08343..1fd8636ae 100644 --- a/server/events/locking/mocks/matchers/locking_trylockresponse.go +++ b/server/events/locking/mocks/matchers/locking_trylockresponse.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + locking "github.com/runatlantis/atlantis/server/events/locking" ) @@ -18,3 +19,15 @@ func EqLockingTryLockResponse(value locking.TryLockResponse) locking.TryLockResp var nullValue locking.TryLockResponse return nullValue } + +func NotEqLockingTryLockResponse(value locking.TryLockResponse) locking.TryLockResponse { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue locking.TryLockResponse + return nullValue +} + +func LockingTryLockResponseThat(matcher pegomock.ArgumentMatcher) locking.TryLockResponse { + pegomock.RegisterMatcher(matcher) + var nullValue locking.TryLockResponse + return nullValue +} diff --git a/server/events/locking/mocks/matchers/map_of_string_to_models_projectlock.go b/server/events/locking/mocks/matchers/map_of_string_to_models_projectlock.go index 39b8af132..eb1b54416 100644 --- a/server/events/locking/mocks/matchers/map_of_string_to_models_projectlock.go +++ b/server/events/locking/mocks/matchers/map_of_string_to_models_projectlock.go @@ -2,10 +2,10 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - -models "github.com/runatlantis/atlantis/server/events/models" + "reflect" + + models "github.com/runatlantis/atlantis/server/events/models" ) func AnyMapOfStringToModelsProjectLock() map[string]models.ProjectLock { @@ -19,3 +19,15 @@ func EqMapOfStringToModelsProjectLock(value map[string]models.ProjectLock) map[s var nullValue map[string]models.ProjectLock return nullValue } + +func NotEqMapOfStringToModelsProjectLock(value map[string]models.ProjectLock) map[string]models.ProjectLock { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue map[string]models.ProjectLock + return nullValue +} + +func MapOfStringToModelsProjectLockThat(matcher pegomock.ArgumentMatcher) map[string]models.ProjectLock { + pegomock.RegisterMatcher(matcher) + var nullValue map[string]models.ProjectLock + return nullValue +} diff --git a/server/events/locking/mocks/matchers/models_commandname.go b/server/events/locking/mocks/matchers/models_commandname.go index 6eba95f8e..f586b4d21 100644 --- a/server/events/locking/mocks/matchers/models_commandname.go +++ b/server/events/locking/mocks/matchers/models_commandname.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsCommandName(value models.CommandName) models.CommandName { var nullValue models.CommandName return nullValue } + +func NotEqModelsCommandName(value models.CommandName) models.CommandName { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.CommandName + return nullValue +} + +func ModelsCommandNameThat(matcher pegomock.ArgumentMatcher) models.CommandName { + pegomock.RegisterMatcher(matcher) + var nullValue models.CommandName + return nullValue +} diff --git a/server/events/locking/mocks/matchers/models_project.go b/server/events/locking/mocks/matchers/models_project.go index 4d1a43a96..a5a87e6f0 100644 --- a/server/events/locking/mocks/matchers/models_project.go +++ b/server/events/locking/mocks/matchers/models_project.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsProject(value models.Project) models.Project { var nullValue models.Project return nullValue } + +func NotEqModelsProject(value models.Project) models.Project { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.Project + return nullValue +} + +func ModelsProjectThat(matcher pegomock.ArgumentMatcher) models.Project { + pegomock.RegisterMatcher(matcher) + var nullValue models.Project + return nullValue +} diff --git a/server/events/locking/mocks/matchers/models_projectlock.go b/server/events/locking/mocks/matchers/models_projectlock.go index a7f790db0..182266c5e 100644 --- a/server/events/locking/mocks/matchers/models_projectlock.go +++ b/server/events/locking/mocks/matchers/models_projectlock.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsProjectLock(value models.ProjectLock) models.ProjectLock { var nullValue models.ProjectLock return nullValue } + +func NotEqModelsProjectLock(value models.ProjectLock) models.ProjectLock { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.ProjectLock + return nullValue +} + +func ModelsProjectLockThat(matcher pegomock.ArgumentMatcher) models.ProjectLock { + pegomock.RegisterMatcher(matcher) + var nullValue models.ProjectLock + return nullValue +} diff --git a/server/events/locking/mocks/matchers/models_pullrequest.go b/server/events/locking/mocks/matchers/models_pullrequest.go index dd1fb0d4e..9ae2a7e92 100644 --- a/server/events/locking/mocks/matchers/models_pullrequest.go +++ b/server/events/locking/mocks/matchers/models_pullrequest.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsPullRequest(value models.PullRequest) models.PullRequest { var nullValue models.PullRequest return nullValue } + +func NotEqModelsPullRequest(value models.PullRequest) models.PullRequest { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.PullRequest + return nullValue +} + +func ModelsPullRequestThat(matcher pegomock.ArgumentMatcher) models.PullRequest { + pegomock.RegisterMatcher(matcher) + var nullValue models.PullRequest + return nullValue +} diff --git a/server/events/locking/mocks/matchers/models_user.go b/server/events/locking/mocks/matchers/models_user.go index aa45448dd..0aa92b5d8 100644 --- a/server/events/locking/mocks/matchers/models_user.go +++ b/server/events/locking/mocks/matchers/models_user.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsUser(value models.User) models.User { var nullValue models.User return nullValue } + +func NotEqModelsUser(value models.User) models.User { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.User + return nullValue +} + +func ModelsUserThat(matcher pegomock.ArgumentMatcher) models.User { + pegomock.RegisterMatcher(matcher) + var nullValue models.User + return nullValue +} diff --git a/server/events/locking/mocks/matchers/ptr_to_models_commandlock.go b/server/events/locking/mocks/matchers/ptr_to_models_commandlock.go index bac0e1a4d..fbd210aad 100644 --- a/server/events/locking/mocks/matchers/ptr_to_models_commandlock.go +++ b/server/events/locking/mocks/matchers/ptr_to_models_commandlock.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqPtrToModelsCommandLock(value *models.CommandLock) *models.CommandLock { var nullValue *models.CommandLock return nullValue } + +func NotEqPtrToModelsCommandLock(value *models.CommandLock) *models.CommandLock { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *models.CommandLock + return nullValue +} + +func PtrToModelsCommandLockThat(matcher pegomock.ArgumentMatcher) *models.CommandLock { + pegomock.RegisterMatcher(matcher) + var nullValue *models.CommandLock + return nullValue +} diff --git a/server/events/locking/mocks/matchers/ptr_to_models_projectlock.go b/server/events/locking/mocks/matchers/ptr_to_models_projectlock.go index bf95261d1..7b0b6f108 100644 --- a/server/events/locking/mocks/matchers/ptr_to_models_projectlock.go +++ b/server/events/locking/mocks/matchers/ptr_to_models_projectlock.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqPtrToModelsProjectLock(value *models.ProjectLock) *models.ProjectLock { var nullValue *models.ProjectLock return nullValue } + +func NotEqPtrToModelsProjectLock(value *models.ProjectLock) *models.ProjectLock { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *models.ProjectLock + return nullValue +} + +func PtrToModelsProjectLockThat(matcher pegomock.ArgumentMatcher) *models.ProjectLock { + pegomock.RegisterMatcher(matcher) + var nullValue *models.ProjectLock + return nullValue +} diff --git a/server/events/locking/mocks/matchers/slice_of_models_projectlock.go b/server/events/locking/mocks/matchers/slice_of_models_projectlock.go index 07666359b..f510db6e8 100644 --- a/server/events/locking/mocks/matchers/slice_of_models_projectlock.go +++ b/server/events/locking/mocks/matchers/slice_of_models_projectlock.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqSliceOfModelsProjectLock(value []models.ProjectLock) []models.ProjectLock var nullValue []models.ProjectLock return nullValue } + +func NotEqSliceOfModelsProjectLock(value []models.ProjectLock) []models.ProjectLock { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue []models.ProjectLock + return nullValue +} + +func SliceOfModelsProjectLockThat(matcher pegomock.ArgumentMatcher) []models.ProjectLock { + pegomock.RegisterMatcher(matcher) + var nullValue []models.ProjectLock + return nullValue +} diff --git a/server/events/locking/mocks/matchers/time_time.go b/server/events/locking/mocks/matchers/time_time.go index b08cb5e17..461e1dd6d 100644 --- a/server/events/locking/mocks/matchers/time_time.go +++ b/server/events/locking/mocks/matchers/time_time.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + time "time" ) @@ -18,3 +19,15 @@ func EqTimeTime(value time.Time) time.Time { var nullValue time.Time return nullValue } + +func NotEqTimeTime(value time.Time) time.Time { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue time.Time + return nullValue +} + +func TimeTimeThat(matcher pegomock.ArgumentMatcher) time.Time { + pegomock.RegisterMatcher(matcher) + var nullValue time.Time + return nullValue +} diff --git a/server/events/locking/mocks/mock_apply_lock_checker.go b/server/events/locking/mocks/mock_apply_lock_checker.go index 15b5294d3..7504ad65a 100644 --- a/server/events/locking/mocks/mock_apply_lock_checker.go +++ b/server/events/locking/mocks/mock_apply_lock_checker.go @@ -51,14 +51,14 @@ func (mock *MockApplyLockChecker) VerifyWasCalledOnce() *VerifierMockApplyLockCh } } -func (mock *MockApplyLockChecker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockApplyLockChecker { +func (mock *MockApplyLockChecker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockApplyLockChecker { return &VerifierMockApplyLockChecker{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockApplyLockChecker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockApplyLockChecker { +func (mock *MockApplyLockChecker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockApplyLockChecker { return &VerifierMockApplyLockChecker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockApplyLockChecker) VerifyWasCalledInOrder(invocationCountMatcher } } -func (mock *MockApplyLockChecker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockApplyLockChecker { +func (mock *MockApplyLockChecker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockApplyLockChecker { return &VerifierMockApplyLockChecker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockApplyLockChecker) VerifyWasCalledEventually(invocationCountMatch type VerifierMockApplyLockChecker struct { mock *MockApplyLockChecker - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/locking/mocks/mock_apply_locker.go b/server/events/locking/mocks/mock_apply_locker.go index 3275a975d..86ebb0e2d 100644 --- a/server/events/locking/mocks/mock_apply_locker.go +++ b/server/events/locking/mocks/mock_apply_locker.go @@ -85,14 +85,14 @@ func (mock *MockApplyLocker) VerifyWasCalledOnce() *VerifierMockApplyLocker { } } -func (mock *MockApplyLocker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockApplyLocker { +func (mock *MockApplyLocker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockApplyLocker { return &VerifierMockApplyLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockApplyLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockApplyLocker { +func (mock *MockApplyLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockApplyLocker { return &VerifierMockApplyLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -100,7 +100,7 @@ func (mock *MockApplyLocker) VerifyWasCalledInOrder(invocationCountMatcher pegom } } -func (mock *MockApplyLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockApplyLocker { +func (mock *MockApplyLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockApplyLocker { return &VerifierMockApplyLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -110,7 +110,7 @@ func (mock *MockApplyLocker) VerifyWasCalledEventually(invocationCountMatcher pe type VerifierMockApplyLocker struct { mock *MockApplyLocker - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/locking/mocks/mock_backend.go b/server/events/locking/mocks/mock_backend.go index 3bad8fc61..6869e7783 100644 --- a/server/events/locking/mocks/mock_backend.go +++ b/server/events/locking/mocks/mock_backend.go @@ -184,14 +184,14 @@ func (mock *MockBackend) VerifyWasCalledOnce() *VerifierMockBackend { } } -func (mock *MockBackend) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockBackend { +func (mock *MockBackend) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockBackend { return &VerifierMockBackend{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockBackend) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockBackend { +func (mock *MockBackend) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockBackend { return &VerifierMockBackend{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -199,7 +199,7 @@ func (mock *MockBackend) VerifyWasCalledInOrder(invocationCountMatcher pegomock. } } -func (mock *MockBackend) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockBackend { +func (mock *MockBackend) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockBackend { return &VerifierMockBackend{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -209,7 +209,7 @@ func (mock *MockBackend) VerifyWasCalledEventually(invocationCountMatcher pegomo type VerifierMockBackend struct { mock *MockBackend - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/locking/mocks/mock_locker.go b/server/events/locking/mocks/mock_locker.go index d0341c0cc..bc5c2486a 100644 --- a/server/events/locking/mocks/mock_locker.go +++ b/server/events/locking/mocks/mock_locker.go @@ -128,14 +128,14 @@ func (mock *MockLocker) VerifyWasCalledOnce() *VerifierMockLocker { } } -func (mock *MockLocker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockLocker { +func (mock *MockLocker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockLocker { return &VerifierMockLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockLocker { +func (mock *MockLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockLocker { return &VerifierMockLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -143,7 +143,7 @@ func (mock *MockLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.M } } -func (mock *MockLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockLocker { +func (mock *MockLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockLocker { return &VerifierMockLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -153,7 +153,7 @@ func (mock *MockLocker) VerifyWasCalledEventually(invocationCountMatcher pegomoc type VerifierMockLocker struct { mock *MockLocker - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/matchers/logging_simplelogging.go b/server/events/matchers/logging_simplelogging.go new file mode 100644 index 000000000..c3b96f61f --- /dev/null +++ b/server/events/matchers/logging_simplelogging.go @@ -0,0 +1,34 @@ +// Code generated by pegomock. DO NOT EDIT. +package matchers + +import ( + "reflect" + + "github.com/petergtz/pegomock" + + logging "github.com/runatlantis/atlantis/server/logging" +) + +func AnyLoggingSimpleLogging() logging.SimpleLogging { + pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(logging.SimpleLogging))(nil)).Elem())) + var nullValue logging.SimpleLogging + return nullValue +} + +func EqLoggingSimpleLogging(value logging.SimpleLogging) logging.SimpleLogging { + pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) + var nullValue logging.SimpleLogging + return nullValue +} + +func NotEqLoggingSimpleLogging(value logging.SimpleLogging) logging.SimpleLogging { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue logging.SimpleLogging + return nullValue +} + +func LoggingSimpleLoggingThat(matcher pegomock.ArgumentMatcher) logging.SimpleLogging { + pegomock.RegisterMatcher(matcher) + var nullValue logging.SimpleLogging + return nullValue +} diff --git a/server/events/matchers/models_pullrequest.go b/server/events/matchers/models_pullrequest.go index dd1fb0d4e..db2666f02 100644 --- a/server/events/matchers/models_pullrequest.go +++ b/server/events/matchers/models_pullrequest.go @@ -3,7 +3,9 @@ package matchers import ( "reflect" + "github.com/petergtz/pegomock" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +20,15 @@ func EqModelsPullRequest(value models.PullRequest) models.PullRequest { var nullValue models.PullRequest return nullValue } + +func NotEqModelsPullRequest(value models.PullRequest) models.PullRequest { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.PullRequest + return nullValue +} + +func ModelsPullRequestThat(matcher pegomock.ArgumentMatcher) models.PullRequest { + pegomock.RegisterMatcher(matcher) + var nullValue models.PullRequest + return nullValue +} diff --git a/server/events/matchers/models_repo.go b/server/events/matchers/models_repo.go index 418f13cfc..2ca60819c 100644 --- a/server/events/matchers/models_repo.go +++ b/server/events/matchers/models_repo.go @@ -3,7 +3,9 @@ package matchers import ( "reflect" + "github.com/petergtz/pegomock" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +20,15 @@ func EqModelsRepo(value models.Repo) models.Repo { var nullValue models.Repo return nullValue } + +func NotEqModelsRepo(value models.Repo) models.Repo { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.Repo + return nullValue +} + +func ModelsRepoThat(matcher pegomock.ArgumentMatcher) models.Repo { + pegomock.RegisterMatcher(matcher) + var nullValue models.Repo + return nullValue +} diff --git a/server/events/matchers/ptr_to_logging_simplelogger.go b/server/events/matchers/ptr_to_logging_simplelogger.go index cf9bb5453..e7c8b942f 100644 --- a/server/events/matchers/ptr_to_logging_simplelogger.go +++ b/server/events/matchers/ptr_to_logging_simplelogger.go @@ -2,9 +2,10 @@ package matchers import ( + "reflect" + "github.com/petergtz/pegomock" logging "github.com/runatlantis/atlantis/server/logging" - "reflect" ) func AnyPtrToLoggingSimpleLogger() logging.SimpleLogging { diff --git a/server/events/mock_workingdir_test.go b/server/events/mock_workingdir_test.go index 163d3549b..3fa4508ff 100644 --- a/server/events/mock_workingdir_test.go +++ b/server/events/mock_workingdir_test.go @@ -125,14 +125,14 @@ func (mock *MockWorkingDir) VerifyWasCalledOnce() *VerifierMockWorkingDir { } } -func (mock *MockWorkingDir) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockWorkingDir { +func (mock *MockWorkingDir) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockWorkingDir { return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDir { +func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDir { return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -140,7 +140,7 @@ func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomo } } -func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockWorkingDir { +func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockWorkingDir { return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -150,7 +150,7 @@ func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher peg type VerifierMockWorkingDir struct { mock *MockWorkingDir - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/matchers/azuredevops_event.go b/server/events/mocks/matchers/azuredevops_event.go index e8bb43d1c..c6b599082 100644 --- a/server/events/mocks/matchers/azuredevops_event.go +++ b/server/events/mocks/matchers/azuredevops_event.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + azuredevops "github.com/mcdafydd/go-azuredevops/azuredevops" ) @@ -18,3 +19,15 @@ func EqAzuredevopsEvent(value azuredevops.Event) azuredevops.Event { var nullValue azuredevops.Event return nullValue } + +func NotEqAzuredevopsEvent(value azuredevops.Event) azuredevops.Event { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue azuredevops.Event + return nullValue +} + +func AzuredevopsEventThat(matcher pegomock.ArgumentMatcher) azuredevops.Event { + pegomock.RegisterMatcher(matcher) + var nullValue azuredevops.Event + return nullValue +} diff --git a/server/events/mocks/matchers/go_gitlab_mergecommentevent.go b/server/events/mocks/matchers/go_gitlab_mergecommentevent.go index c7f196d69..37e79a883 100644 --- a/server/events/mocks/matchers/go_gitlab_mergecommentevent.go +++ b/server/events/mocks/matchers/go_gitlab_mergecommentevent.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + go_gitlab "github.com/xanzy/go-gitlab" ) @@ -18,3 +19,15 @@ func EqGoGitlabMergeCommentEvent(value go_gitlab.MergeCommentEvent) go_gitlab.Me var nullValue go_gitlab.MergeCommentEvent return nullValue } + +func NotEqGoGitlabMergeCommentEvent(value go_gitlab.MergeCommentEvent) go_gitlab.MergeCommentEvent { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue go_gitlab.MergeCommentEvent + return nullValue +} + +func GoGitlabMergeCommentEventThat(matcher pegomock.ArgumentMatcher) go_gitlab.MergeCommentEvent { + pegomock.RegisterMatcher(matcher) + var nullValue go_gitlab.MergeCommentEvent + return nullValue +} diff --git a/server/events/mocks/matchers/go_gitlab_mergeevent.go b/server/events/mocks/matchers/go_gitlab_mergeevent.go index e259a6da5..4276b1f06 100644 --- a/server/events/mocks/matchers/go_gitlab_mergeevent.go +++ b/server/events/mocks/matchers/go_gitlab_mergeevent.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + go_gitlab "github.com/xanzy/go-gitlab" ) @@ -18,3 +19,15 @@ func EqGoGitlabMergeEvent(value go_gitlab.MergeEvent) go_gitlab.MergeEvent { var nullValue go_gitlab.MergeEvent return nullValue } + +func NotEqGoGitlabMergeEvent(value go_gitlab.MergeEvent) go_gitlab.MergeEvent { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue go_gitlab.MergeEvent + return nullValue +} + +func GoGitlabMergeEventThat(matcher pegomock.ArgumentMatcher) go_gitlab.MergeEvent { + pegomock.RegisterMatcher(matcher) + var nullValue go_gitlab.MergeEvent + return nullValue +} diff --git a/server/events/mocks/matchers/logging_simplelogging.go b/server/events/mocks/matchers/logging_simplelogging.go new file mode 100644 index 000000000..502456e7c --- /dev/null +++ b/server/events/mocks/matchers/logging_simplelogging.go @@ -0,0 +1,33 @@ +// Code generated by pegomock. DO NOT EDIT. +package matchers + +import ( + "github.com/petergtz/pegomock" + "reflect" + + logging "github.com/runatlantis/atlantis/server/logging" +) + +func AnyLoggingSimpleLogging() logging.SimpleLogging { + pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(logging.SimpleLogging))(nil)).Elem())) + var nullValue logging.SimpleLogging + return nullValue +} + +func EqLoggingSimpleLogging(value logging.SimpleLogging) logging.SimpleLogging { + pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) + var nullValue logging.SimpleLogging + return nullValue +} + +func NotEqLoggingSimpleLogging(value logging.SimpleLogging) logging.SimpleLogging { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue logging.SimpleLogging + return nullValue +} + +func LoggingSimpleLoggingThat(matcher pegomock.ArgumentMatcher) logging.SimpleLogging { + pegomock.RegisterMatcher(matcher) + var nullValue logging.SimpleLogging + return nullValue +} diff --git a/server/events/mocks/matchers/map_of_string_to_string.go b/server/events/mocks/matchers/map_of_string_to_string.go index 4d969915a..65175de1a 100644 --- a/server/events/mocks/matchers/map_of_string_to_string.go +++ b/server/events/mocks/matchers/map_of_string_to_string.go @@ -2,10 +2,8 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - - + "reflect" ) func AnyMapOfStringToString() map[string]string { @@ -19,3 +17,15 @@ func EqMapOfStringToString(value map[string]string) map[string]string { var nullValue map[string]string return nullValue } + +func NotEqMapOfStringToString(value map[string]string) map[string]string { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue map[string]string + return nullValue +} + +func MapOfStringToStringThat(matcher pegomock.ArgumentMatcher) map[string]string { + pegomock.RegisterMatcher(matcher) + var nullValue map[string]string + return nullValue +} diff --git a/server/events/mocks/matchers/models_commandname.go b/server/events/mocks/matchers/models_commandname.go index 6eba95f8e..f586b4d21 100644 --- a/server/events/mocks/matchers/models_commandname.go +++ b/server/events/mocks/matchers/models_commandname.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsCommandName(value models.CommandName) models.CommandName { var nullValue models.CommandName return nullValue } + +func NotEqModelsCommandName(value models.CommandName) models.CommandName { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.CommandName + return nullValue +} + +func ModelsCommandNameThat(matcher pegomock.ArgumentMatcher) models.CommandName { + pegomock.RegisterMatcher(matcher) + var nullValue models.CommandName + return nullValue +} diff --git a/server/events/mocks/matchers/models_commitstatus.go b/server/events/mocks/matchers/models_commitstatus.go index 0f579baf8..1e10ed782 100644 --- a/server/events/mocks/matchers/models_commitstatus.go +++ b/server/events/mocks/matchers/models_commitstatus.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsCommitStatus(value models.CommitStatus) models.CommitStatus { var nullValue models.CommitStatus return nullValue } + +func NotEqModelsCommitStatus(value models.CommitStatus) models.CommitStatus { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.CommitStatus + return nullValue +} + +func ModelsCommitStatusThat(matcher pegomock.ArgumentMatcher) models.CommitStatus { + pegomock.RegisterMatcher(matcher) + var nullValue models.CommitStatus + return nullValue +} diff --git a/server/events/mocks/matchers/models_project.go b/server/events/mocks/matchers/models_project.go index 4d1a43a96..a5a87e6f0 100644 --- a/server/events/mocks/matchers/models_project.go +++ b/server/events/mocks/matchers/models_project.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsProject(value models.Project) models.Project { var nullValue models.Project return nullValue } + +func NotEqModelsProject(value models.Project) models.Project { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.Project + return nullValue +} + +func ModelsProjectThat(matcher pegomock.ArgumentMatcher) models.Project { + pegomock.RegisterMatcher(matcher) + var nullValue models.Project + return nullValue +} diff --git a/server/events/mocks/matchers/models_projectcommandcontext.go b/server/events/mocks/matchers/models_projectcommandcontext.go index 1b68eb9e3..535f8b967 100644 --- a/server/events/mocks/matchers/models_projectcommandcontext.go +++ b/server/events/mocks/matchers/models_projectcommandcontext.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsProjectCommandContext(value models.ProjectCommandContext) models.Pr var nullValue models.ProjectCommandContext return nullValue } + +func NotEqModelsProjectCommandContext(value models.ProjectCommandContext) models.ProjectCommandContext { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.ProjectCommandContext + return nullValue +} + +func ModelsProjectCommandContextThat(matcher pegomock.ArgumentMatcher) models.ProjectCommandContext { + pegomock.RegisterMatcher(matcher) + var nullValue models.ProjectCommandContext + return nullValue +} diff --git a/server/events/mocks/matchers/models_projectresult.go b/server/events/mocks/matchers/models_projectresult.go index 4411f242c..0eee757ef 100644 --- a/server/events/mocks/matchers/models_projectresult.go +++ b/server/events/mocks/matchers/models_projectresult.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsProjectResult(value models.ProjectResult) models.ProjectResult { var nullValue models.ProjectResult return nullValue } + +func NotEqModelsProjectResult(value models.ProjectResult) models.ProjectResult { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.ProjectResult + return nullValue +} + +func ModelsProjectResultThat(matcher pegomock.ArgumentMatcher) models.ProjectResult { + pegomock.RegisterMatcher(matcher) + var nullValue models.ProjectResult + return nullValue +} diff --git a/server/events/mocks/matchers/models_pullrequest.go b/server/events/mocks/matchers/models_pullrequest.go index dd1fb0d4e..9ae2a7e92 100644 --- a/server/events/mocks/matchers/models_pullrequest.go +++ b/server/events/mocks/matchers/models_pullrequest.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsPullRequest(value models.PullRequest) models.PullRequest { var nullValue models.PullRequest return nullValue } + +func NotEqModelsPullRequest(value models.PullRequest) models.PullRequest { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.PullRequest + return nullValue +} + +func ModelsPullRequestThat(matcher pegomock.ArgumentMatcher) models.PullRequest { + pegomock.RegisterMatcher(matcher) + var nullValue models.PullRequest + return nullValue +} diff --git a/server/events/mocks/matchers/models_pullrequesteventtype.go b/server/events/mocks/matchers/models_pullrequesteventtype.go index 1ee73e2ea..5952b4189 100644 --- a/server/events/mocks/matchers/models_pullrequesteventtype.go +++ b/server/events/mocks/matchers/models_pullrequesteventtype.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsPullRequestEventType(value models.PullRequestEventType) models.Pull var nullValue models.PullRequestEventType return nullValue } + +func NotEqModelsPullRequestEventType(value models.PullRequestEventType) models.PullRequestEventType { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.PullRequestEventType + return nullValue +} + +func ModelsPullRequestEventTypeThat(matcher pegomock.ArgumentMatcher) models.PullRequestEventType { + pegomock.RegisterMatcher(matcher) + var nullValue models.PullRequestEventType + return nullValue +} diff --git a/server/events/mocks/matchers/models_repo.go b/server/events/mocks/matchers/models_repo.go index 418f13cfc..fd44665f8 100644 --- a/server/events/mocks/matchers/models_repo.go +++ b/server/events/mocks/matchers/models_repo.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsRepo(value models.Repo) models.Repo { var nullValue models.Repo return nullValue } + +func NotEqModelsRepo(value models.Repo) models.Repo { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.Repo + return nullValue +} + +func ModelsRepoThat(matcher pegomock.ArgumentMatcher) models.Repo { + pegomock.RegisterMatcher(matcher) + var nullValue models.Repo + return nullValue +} diff --git a/server/events/mocks/matchers/models_user.go b/server/events/mocks/matchers/models_user.go index aa45448dd..0aa92b5d8 100644 --- a/server/events/mocks/matchers/models_user.go +++ b/server/events/mocks/matchers/models_user.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsUser(value models.User) models.User { var nullValue models.User return nullValue } + +func NotEqModelsUser(value models.User) models.User { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.User + return nullValue +} + +func ModelsUserThat(matcher pegomock.ArgumentMatcher) models.User { + pegomock.RegisterMatcher(matcher) + var nullValue models.User + return nullValue +} diff --git a/server/events/mocks/matchers/ptr_to_azuredevops_gitpullrequest.go b/server/events/mocks/matchers/ptr_to_azuredevops_gitpullrequest.go index 8c5088273..7a3bf3a69 100644 --- a/server/events/mocks/matchers/ptr_to_azuredevops_gitpullrequest.go +++ b/server/events/mocks/matchers/ptr_to_azuredevops_gitpullrequest.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + azuredevops "github.com/mcdafydd/go-azuredevops/azuredevops" ) @@ -18,3 +19,15 @@ func EqPtrToAzuredevopsGitPullRequest(value *azuredevops.GitPullRequest) *azured var nullValue *azuredevops.GitPullRequest return nullValue } + +func NotEqPtrToAzuredevopsGitPullRequest(value *azuredevops.GitPullRequest) *azuredevops.GitPullRequest { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *azuredevops.GitPullRequest + return nullValue +} + +func PtrToAzuredevopsGitPullRequestThat(matcher pegomock.ArgumentMatcher) *azuredevops.GitPullRequest { + pegomock.RegisterMatcher(matcher) + var nullValue *azuredevops.GitPullRequest + return nullValue +} diff --git a/server/events/mocks/matchers/ptr_to_azuredevops_gitrepository.go b/server/events/mocks/matchers/ptr_to_azuredevops_gitrepository.go index f9499615e..d9f81edff 100644 --- a/server/events/mocks/matchers/ptr_to_azuredevops_gitrepository.go +++ b/server/events/mocks/matchers/ptr_to_azuredevops_gitrepository.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + azuredevops "github.com/mcdafydd/go-azuredevops/azuredevops" ) @@ -18,3 +19,15 @@ func EqPtrToAzuredevopsGitRepository(value *azuredevops.GitRepository) *azuredev var nullValue *azuredevops.GitRepository return nullValue } + +func NotEqPtrToAzuredevopsGitRepository(value *azuredevops.GitRepository) *azuredevops.GitRepository { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *azuredevops.GitRepository + return nullValue +} + +func PtrToAzuredevopsGitRepositoryThat(matcher pegomock.ArgumentMatcher) *azuredevops.GitRepository { + pegomock.RegisterMatcher(matcher) + var nullValue *azuredevops.GitRepository + return nullValue +} diff --git a/server/events/mocks/matchers/ptr_to_events_commentcommand.go b/server/events/mocks/matchers/ptr_to_events_commentcommand.go index a153bb327..55b3b5ba6 100644 --- a/server/events/mocks/matchers/ptr_to_events_commentcommand.go +++ b/server/events/mocks/matchers/ptr_to_events_commentcommand.go @@ -3,8 +3,9 @@ package matchers import ( "github.com/petergtz/pegomock" - events "github.com/runatlantis/atlantis/server/events" "reflect" + + events "github.com/runatlantis/atlantis/server/events" ) func AnyPtrToEventsCommentCommand() *events.CommentCommand { @@ -18,3 +19,15 @@ func EqPtrToEventsCommentCommand(value *events.CommentCommand) *events.CommentCo var nullValue *events.CommentCommand return nullValue } + +func NotEqPtrToEventsCommentCommand(value *events.CommentCommand) *events.CommentCommand { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *events.CommentCommand + return nullValue +} + +func PtrToEventsCommentCommandThat(matcher pegomock.ArgumentMatcher) *events.CommentCommand { + pegomock.RegisterMatcher(matcher) + var nullValue *events.CommentCommand + return nullValue +} diff --git a/server/events/mocks/matchers/ptr_to_events_trylockresponse.go b/server/events/mocks/matchers/ptr_to_events_trylockresponse.go index f3baeb8d6..71d8a4721 100644 --- a/server/events/mocks/matchers/ptr_to_events_trylockresponse.go +++ b/server/events/mocks/matchers/ptr_to_events_trylockresponse.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + events "github.com/runatlantis/atlantis/server/events" ) @@ -18,3 +19,15 @@ func EqPtrToEventsTryLockResponse(value *events.TryLockResponse) *events.TryLock var nullValue *events.TryLockResponse return nullValue } + +func NotEqPtrToEventsTryLockResponse(value *events.TryLockResponse) *events.TryLockResponse { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *events.TryLockResponse + return nullValue +} + +func PtrToEventsTryLockResponseThat(matcher pegomock.ArgumentMatcher) *events.TryLockResponse { + pegomock.RegisterMatcher(matcher) + var nullValue *events.TryLockResponse + return nullValue +} diff --git a/server/events/mocks/matchers/ptr_to_github_issuecommentevent.go b/server/events/mocks/matchers/ptr_to_github_issuecommentevent.go index c199e0e9c..919b42f26 100644 --- a/server/events/mocks/matchers/ptr_to_github_issuecommentevent.go +++ b/server/events/mocks/matchers/ptr_to_github_issuecommentevent.go @@ -2,10 +2,10 @@ package matchers import ( + "github.com/petergtz/pegomock" "reflect" github "github.com/google/go-github/v31/github" - "github.com/petergtz/pegomock" ) func AnyPtrToGithubIssueCommentEvent() *github.IssueCommentEvent { @@ -19,3 +19,15 @@ func EqPtrToGithubIssueCommentEvent(value *github.IssueCommentEvent) *github.Iss var nullValue *github.IssueCommentEvent return nullValue } + +func NotEqPtrToGithubIssueCommentEvent(value *github.IssueCommentEvent) *github.IssueCommentEvent { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *github.IssueCommentEvent + return nullValue +} + +func PtrToGithubIssueCommentEventThat(matcher pegomock.ArgumentMatcher) *github.IssueCommentEvent { + pegomock.RegisterMatcher(matcher) + var nullValue *github.IssueCommentEvent + return nullValue +} diff --git a/server/events/mocks/matchers/ptr_to_github_pullrequest.go b/server/events/mocks/matchers/ptr_to_github_pullrequest.go index 8d79771b3..d7cc48f64 100644 --- a/server/events/mocks/matchers/ptr_to_github_pullrequest.go +++ b/server/events/mocks/matchers/ptr_to_github_pullrequest.go @@ -2,10 +2,10 @@ package matchers import ( + "github.com/petergtz/pegomock" "reflect" github "github.com/google/go-github/v31/github" - "github.com/petergtz/pegomock" ) func AnyPtrToGithubPullRequest() *github.PullRequest { @@ -19,3 +19,15 @@ func EqPtrToGithubPullRequest(value *github.PullRequest) *github.PullRequest { var nullValue *github.PullRequest return nullValue } + +func NotEqPtrToGithubPullRequest(value *github.PullRequest) *github.PullRequest { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *github.PullRequest + return nullValue +} + +func PtrToGithubPullRequestThat(matcher pegomock.ArgumentMatcher) *github.PullRequest { + pegomock.RegisterMatcher(matcher) + var nullValue *github.PullRequest + return nullValue +} diff --git a/server/events/mocks/matchers/ptr_to_github_pullrequestevent.go b/server/events/mocks/matchers/ptr_to_github_pullrequestevent.go index 43855ca8a..5a247a90c 100644 --- a/server/events/mocks/matchers/ptr_to_github_pullrequestevent.go +++ b/server/events/mocks/matchers/ptr_to_github_pullrequestevent.go @@ -2,10 +2,10 @@ package matchers import ( + "github.com/petergtz/pegomock" "reflect" github "github.com/google/go-github/v31/github" - "github.com/petergtz/pegomock" ) func AnyPtrToGithubPullRequestEvent() *github.PullRequestEvent { @@ -19,3 +19,15 @@ func EqPtrToGithubPullRequestEvent(value *github.PullRequestEvent) *github.PullR var nullValue *github.PullRequestEvent return nullValue } + +func NotEqPtrToGithubPullRequestEvent(value *github.PullRequestEvent) *github.PullRequestEvent { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *github.PullRequestEvent + return nullValue +} + +func PtrToGithubPullRequestEventThat(matcher pegomock.ArgumentMatcher) *github.PullRequestEvent { + pegomock.RegisterMatcher(matcher) + var nullValue *github.PullRequestEvent + return nullValue +} diff --git a/server/events/mocks/matchers/ptr_to_github_repository.go b/server/events/mocks/matchers/ptr_to_github_repository.go index 5b5924254..322d3d0fd 100644 --- a/server/events/mocks/matchers/ptr_to_github_repository.go +++ b/server/events/mocks/matchers/ptr_to_github_repository.go @@ -2,10 +2,10 @@ package matchers import ( + "github.com/petergtz/pegomock" "reflect" github "github.com/google/go-github/v31/github" - "github.com/petergtz/pegomock" ) func AnyPtrToGithubRepository() *github.Repository { @@ -19,3 +19,15 @@ func EqPtrToGithubRepository(value *github.Repository) *github.Repository { var nullValue *github.Repository return nullValue } + +func NotEqPtrToGithubRepository(value *github.Repository) *github.Repository { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *github.Repository + return nullValue +} + +func PtrToGithubRepositoryThat(matcher pegomock.ArgumentMatcher) *github.Repository { + pegomock.RegisterMatcher(matcher) + var nullValue *github.Repository + return nullValue +} diff --git a/server/events/mocks/matchers/ptr_to_go_gitlab_mergerequest.go b/server/events/mocks/matchers/ptr_to_go_gitlab_mergerequest.go index 1d965e939..245737cfa 100644 --- a/server/events/mocks/matchers/ptr_to_go_gitlab_mergerequest.go +++ b/server/events/mocks/matchers/ptr_to_go_gitlab_mergerequest.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + go_gitlab "github.com/xanzy/go-gitlab" ) @@ -18,3 +19,15 @@ func EqPtrToGoGitlabMergeRequest(value *go_gitlab.MergeRequest) *go_gitlab.Merge var nullValue *go_gitlab.MergeRequest return nullValue } + +func NotEqPtrToGoGitlabMergeRequest(value *go_gitlab.MergeRequest) *go_gitlab.MergeRequest { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *go_gitlab.MergeRequest + return nullValue +} + +func PtrToGoGitlabMergeRequestThat(matcher pegomock.ArgumentMatcher) *go_gitlab.MergeRequest { + pegomock.RegisterMatcher(matcher) + var nullValue *go_gitlab.MergeRequest + return nullValue +} diff --git a/server/events/mocks/matchers/ptr_to_models_pullrequest.go b/server/events/mocks/matchers/ptr_to_models_pullrequest.go index efee225c8..1f8678a09 100644 --- a/server/events/mocks/matchers/ptr_to_models_pullrequest.go +++ b/server/events/mocks/matchers/ptr_to_models_pullrequest.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqPtrToModelsPullRequest(value *models.PullRequest) *models.PullRequest { var nullValue *models.PullRequest return nullValue } + +func NotEqPtrToModelsPullRequest(value *models.PullRequest) *models.PullRequest { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *models.PullRequest + return nullValue +} + +func PtrToModelsPullRequestThat(matcher pegomock.ArgumentMatcher) *models.PullRequest { + pegomock.RegisterMatcher(matcher) + var nullValue *models.PullRequest + return nullValue +} diff --git a/server/events/mocks/matchers/ptr_to_models_repo.go b/server/events/mocks/matchers/ptr_to_models_repo.go index 9ae197ffc..a85a0629a 100644 --- a/server/events/mocks/matchers/ptr_to_models_repo.go +++ b/server/events/mocks/matchers/ptr_to_models_repo.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqPtrToModelsRepo(value *models.Repo) *models.Repo { var nullValue *models.Repo return nullValue } + +func NotEqPtrToModelsRepo(value *models.Repo) *models.Repo { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *models.Repo + return nullValue +} + +func PtrToModelsRepoThat(matcher pegomock.ArgumentMatcher) *models.Repo { + pegomock.RegisterMatcher(matcher) + var nullValue *models.Repo + return nullValue +} diff --git a/server/events/mocks/matchers/slice_of_byte.go b/server/events/mocks/matchers/slice_of_byte.go index 9a9894fa0..951531345 100644 --- a/server/events/mocks/matchers/slice_of_byte.go +++ b/server/events/mocks/matchers/slice_of_byte.go @@ -2,9 +2,8 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - + "reflect" ) func AnySliceOfByte() []byte { @@ -18,3 +17,15 @@ func EqSliceOfByte(value []byte) []byte { var nullValue []byte return nullValue } + +func NotEqSliceOfByte(value []byte) []byte { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue []byte + return nullValue +} + +func SliceOfByteThat(matcher pegomock.ArgumentMatcher) []byte { + pegomock.RegisterMatcher(matcher) + var nullValue []byte + return nullValue +} diff --git a/server/events/mocks/matchers/slice_of_events_pendingplan.go b/server/events/mocks/matchers/slice_of_events_pendingplan.go index f6b3d9e1e..59eb3d579 100644 --- a/server/events/mocks/matchers/slice_of_events_pendingplan.go +++ b/server/events/mocks/matchers/slice_of_events_pendingplan.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + events "github.com/runatlantis/atlantis/server/events" ) @@ -18,3 +19,15 @@ func EqSliceOfEventsPendingPlan(value []events.PendingPlan) []events.PendingPlan var nullValue []events.PendingPlan return nullValue } + +func NotEqSliceOfEventsPendingPlan(value []events.PendingPlan) []events.PendingPlan { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue []events.PendingPlan + return nullValue +} + +func SliceOfEventsPendingPlanThat(matcher pegomock.ArgumentMatcher) []events.PendingPlan { + pegomock.RegisterMatcher(matcher) + var nullValue []events.PendingPlan + return nullValue +} diff --git a/server/events/mocks/matchers/slice_of_models_projectcommandcontext.go b/server/events/mocks/matchers/slice_of_models_projectcommandcontext.go index 5e868e9a8..2eb2ecbfd 100644 --- a/server/events/mocks/matchers/slice_of_models_projectcommandcontext.go +++ b/server/events/mocks/matchers/slice_of_models_projectcommandcontext.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqSliceOfModelsProjectCommandContext(value []models.ProjectCommandContext) var nullValue []models.ProjectCommandContext return nullValue } + +func NotEqSliceOfModelsProjectCommandContext(value []models.ProjectCommandContext) []models.ProjectCommandContext { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue []models.ProjectCommandContext + return nullValue +} + +func SliceOfModelsProjectCommandContextThat(matcher pegomock.ArgumentMatcher) []models.ProjectCommandContext { + pegomock.RegisterMatcher(matcher) + var nullValue []models.ProjectCommandContext + return nullValue +} diff --git a/server/events/mocks/matchers/webhooks_applyresult.go b/server/events/mocks/matchers/webhooks_applyresult.go index 5263a34df..adbcf9817 100644 --- a/server/events/mocks/matchers/webhooks_applyresult.go +++ b/server/events/mocks/matchers/webhooks_applyresult.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + webhooks "github.com/runatlantis/atlantis/server/events/webhooks" ) @@ -18,3 +19,15 @@ func EqWebhooksApplyResult(value webhooks.ApplyResult) webhooks.ApplyResult { var nullValue webhooks.ApplyResult return nullValue } + +func NotEqWebhooksApplyResult(value webhooks.ApplyResult) webhooks.ApplyResult { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue webhooks.ApplyResult + return nullValue +} + +func WebhooksApplyResultThat(matcher pegomock.ArgumentMatcher) webhooks.ApplyResult { + pegomock.RegisterMatcher(matcher) + var nullValue webhooks.ApplyResult + return nullValue +} diff --git a/server/events/mocks/mock_azuredevops_pull_getter.go b/server/events/mocks/mock_azuredevops_pull_getter.go index 7da07e54b..5f7dde582 100644 --- a/server/events/mocks/mock_azuredevops_pull_getter.go +++ b/server/events/mocks/mock_azuredevops_pull_getter.go @@ -52,14 +52,14 @@ func (mock *MockAzureDevopsPullGetter) VerifyWasCalledOnce() *VerifierMockAzureD } } -func (mock *MockAzureDevopsPullGetter) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockAzureDevopsPullGetter { +func (mock *MockAzureDevopsPullGetter) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockAzureDevopsPullGetter { return &VerifierMockAzureDevopsPullGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockAzureDevopsPullGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockAzureDevopsPullGetter { +func (mock *MockAzureDevopsPullGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockAzureDevopsPullGetter { return &VerifierMockAzureDevopsPullGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -67,7 +67,7 @@ func (mock *MockAzureDevopsPullGetter) VerifyWasCalledInOrder(invocationCountMat } } -func (mock *MockAzureDevopsPullGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockAzureDevopsPullGetter { +func (mock *MockAzureDevopsPullGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockAzureDevopsPullGetter { return &VerifierMockAzureDevopsPullGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -77,7 +77,7 @@ func (mock *MockAzureDevopsPullGetter) VerifyWasCalledEventually(invocationCount type VerifierMockAzureDevopsPullGetter struct { mock *MockAzureDevopsPullGetter - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_command_runner.go b/server/events/mocks/mock_command_runner.go index 5db33e70d..b4d0e4c2e 100644 --- a/server/events/mocks/mock_command_runner.go +++ b/server/events/mocks/mock_command_runner.go @@ -49,14 +49,14 @@ func (mock *MockCommandRunner) VerifyWasCalledOnce() *VerifierMockCommandRunner } } -func (mock *MockCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockCommandRunner { +func (mock *MockCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCommandRunner { return &VerifierMockCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommandRunner { +func (mock *MockCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommandRunner { return &VerifierMockCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -64,7 +64,7 @@ func (mock *MockCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher peg } } -func (mock *MockCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockCommandRunner { +func (mock *MockCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCommandRunner { return &VerifierMockCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -74,7 +74,7 @@ func (mock *MockCommandRunner) VerifyWasCalledEventually(invocationCountMatcher type VerifierMockCommandRunner struct { mock *MockCommandRunner - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_commit_status_updater.go b/server/events/mocks/mock_commit_status_updater.go index b811c9d9e..67395a36e 100644 --- a/server/events/mocks/mock_commit_status_updater.go +++ b/server/events/mocks/mock_commit_status_updater.go @@ -77,14 +77,14 @@ func (mock *MockCommitStatusUpdater) VerifyWasCalledOnce() *VerifierMockCommitSt } } -func (mock *MockCommitStatusUpdater) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockCommitStatusUpdater { +func (mock *MockCommitStatusUpdater) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCommitStatusUpdater { return &VerifierMockCommitStatusUpdater{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockCommitStatusUpdater) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommitStatusUpdater { +func (mock *MockCommitStatusUpdater) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommitStatusUpdater { return &VerifierMockCommitStatusUpdater{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -92,7 +92,7 @@ func (mock *MockCommitStatusUpdater) VerifyWasCalledInOrder(invocationCountMatch } } -func (mock *MockCommitStatusUpdater) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockCommitStatusUpdater { +func (mock *MockCommitStatusUpdater) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCommitStatusUpdater { return &VerifierMockCommitStatusUpdater{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -102,7 +102,7 @@ func (mock *MockCommitStatusUpdater) VerifyWasCalledEventually(invocationCountMa type VerifierMockCommitStatusUpdater struct { mock *MockCommitStatusUpdater - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_custom_step_runner.go b/server/events/mocks/mock_custom_step_runner.go index 83d37e02a..21d1fffa8 100644 --- a/server/events/mocks/mock_custom_step_runner.go +++ b/server/events/mocks/mock_custom_step_runner.go @@ -51,14 +51,14 @@ func (mock *MockCustomStepRunner) VerifyWasCalledOnce() *VerifierMockCustomStepR } } -func (mock *MockCustomStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockCustomStepRunner { +func (mock *MockCustomStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCustomStepRunner { return &VerifierMockCustomStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockCustomStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCustomStepRunner { +func (mock *MockCustomStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCustomStepRunner { return &VerifierMockCustomStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockCustomStepRunner) VerifyWasCalledInOrder(invocationCountMatcher } } -func (mock *MockCustomStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockCustomStepRunner { +func (mock *MockCustomStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCustomStepRunner { return &VerifierMockCustomStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockCustomStepRunner) VerifyWasCalledEventually(invocationCountMatch type VerifierMockCustomStepRunner struct { mock *MockCustomStepRunner - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_env_step_runner.go b/server/events/mocks/mock_env_step_runner.go index 96f5c4e67..23c17624a 100644 --- a/server/events/mocks/mock_env_step_runner.go +++ b/server/events/mocks/mock_env_step_runner.go @@ -51,14 +51,14 @@ func (mock *MockEnvStepRunner) VerifyWasCalledOnce() *VerifierMockEnvStepRunner } } -func (mock *MockEnvStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockEnvStepRunner { +func (mock *MockEnvStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockEnvStepRunner { return &VerifierMockEnvStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockEnvStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockEnvStepRunner { +func (mock *MockEnvStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockEnvStepRunner { return &VerifierMockEnvStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockEnvStepRunner) VerifyWasCalledInOrder(invocationCountMatcher peg } } -func (mock *MockEnvStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockEnvStepRunner { +func (mock *MockEnvStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockEnvStepRunner { return &VerifierMockEnvStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockEnvStepRunner) VerifyWasCalledEventually(invocationCountMatcher type VerifierMockEnvStepRunner struct { mock *MockEnvStepRunner - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_event_parsing.go b/server/events/mocks/mock_event_parsing.go index db5c0ff03..8aabb4291 100644 --- a/server/events/mocks/mock_event_parsing.go +++ b/server/events/mocks/mock_event_parsing.go @@ -4,14 +4,13 @@ package mocks import ( - "reflect" - "time" - github "github.com/google/go-github/v31/github" azuredevops "github.com/mcdafydd/go-azuredevops/azuredevops" pegomock "github.com/petergtz/pegomock" models "github.com/runatlantis/atlantis/server/events/models" go_gitlab "github.com/xanzy/go-gitlab" + "reflect" + "time" ) type MockEventParsing struct { @@ -464,14 +463,14 @@ func (mock *MockEventParsing) VerifyWasCalledOnce() *VerifierMockEventParsing { } } -func (mock *MockEventParsing) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockEventParsing { +func (mock *MockEventParsing) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockEventParsing { return &VerifierMockEventParsing{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockEventParsing) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockEventParsing { +func (mock *MockEventParsing) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockEventParsing { return &VerifierMockEventParsing{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -479,7 +478,7 @@ func (mock *MockEventParsing) VerifyWasCalledInOrder(invocationCountMatcher pego } } -func (mock *MockEventParsing) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockEventParsing { +func (mock *MockEventParsing) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockEventParsing { return &VerifierMockEventParsing{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -489,7 +488,7 @@ func (mock *MockEventParsing) VerifyWasCalledEventually(invocationCountMatcher p type VerifierMockEventParsing struct { mock *MockEventParsing - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_github_pull_getter.go b/server/events/mocks/mock_github_pull_getter.go index 79de5558a..6eac00167 100644 --- a/server/events/mocks/mock_github_pull_getter.go +++ b/server/events/mocks/mock_github_pull_getter.go @@ -4,12 +4,11 @@ package mocks import ( - "reflect" - "time" - github "github.com/google/go-github/v31/github" pegomock "github.com/petergtz/pegomock" models "github.com/runatlantis/atlantis/server/events/models" + "reflect" + "time" ) type MockGithubPullGetter struct { @@ -53,14 +52,14 @@ func (mock *MockGithubPullGetter) VerifyWasCalledOnce() *VerifierMockGithubPullG } } -func (mock *MockGithubPullGetter) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockGithubPullGetter { +func (mock *MockGithubPullGetter) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockGithubPullGetter { return &VerifierMockGithubPullGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockGithubPullGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGithubPullGetter { +func (mock *MockGithubPullGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGithubPullGetter { return &VerifierMockGithubPullGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -68,7 +67,7 @@ func (mock *MockGithubPullGetter) VerifyWasCalledInOrder(invocationCountMatcher } } -func (mock *MockGithubPullGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockGithubPullGetter { +func (mock *MockGithubPullGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockGithubPullGetter { return &VerifierMockGithubPullGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -78,7 +77,7 @@ func (mock *MockGithubPullGetter) VerifyWasCalledEventually(invocationCountMatch type VerifierMockGithubPullGetter struct { mock *MockGithubPullGetter - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_gitlab_merge_request_getter.go b/server/events/mocks/mock_gitlab_merge_request_getter.go index 112b0948d..96d509eb3 100644 --- a/server/events/mocks/mock_gitlab_merge_request_getter.go +++ b/server/events/mocks/mock_gitlab_merge_request_getter.go @@ -51,14 +51,14 @@ func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledOnce() *VerifierMockGit } } -func (mock *MockGitlabMergeRequestGetter) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockGitlabMergeRequestGetter { +func (mock *MockGitlabMergeRequestGetter) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockGitlabMergeRequestGetter { return &VerifierMockGitlabMergeRequestGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGitlabMergeRequestGetter { +func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGitlabMergeRequestGetter { return &VerifierMockGitlabMergeRequestGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledInOrder(invocationCount } } -func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockGitlabMergeRequestGetter { +func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockGitlabMergeRequestGetter { return &VerifierMockGitlabMergeRequestGetter{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockGitlabMergeRequestGetter) VerifyWasCalledEventually(invocationCo type VerifierMockGitlabMergeRequestGetter struct { mock *MockGitlabMergeRequestGetter - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_lock_url_generator.go b/server/events/mocks/mock_lock_url_generator.go index 8f071488c..a126da24f 100644 --- a/server/events/mocks/mock_lock_url_generator.go +++ b/server/events/mocks/mock_lock_url_generator.go @@ -46,14 +46,14 @@ func (mock *MockLockURLGenerator) VerifyWasCalledOnce() *VerifierMockLockURLGene } } -func (mock *MockLockURLGenerator) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockLockURLGenerator { +func (mock *MockLockURLGenerator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockLockURLGenerator { return &VerifierMockLockURLGenerator{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockLockURLGenerator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockLockURLGenerator { +func (mock *MockLockURLGenerator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockLockURLGenerator { return &VerifierMockLockURLGenerator{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -61,7 +61,7 @@ func (mock *MockLockURLGenerator) VerifyWasCalledInOrder(invocationCountMatcher } } -func (mock *MockLockURLGenerator) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockLockURLGenerator { +func (mock *MockLockURLGenerator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockLockURLGenerator { return &VerifierMockLockURLGenerator{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -71,7 +71,7 @@ func (mock *MockLockURLGenerator) VerifyWasCalledEventually(invocationCountMatch type VerifierMockLockURLGenerator struct { mock *MockLockURLGenerator - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_pending_plan_finder.go b/server/events/mocks/mock_pending_plan_finder.go index 626379a68..7a2974dc5 100644 --- a/server/events/mocks/mock_pending_plan_finder.go +++ b/server/events/mocks/mock_pending_plan_finder.go @@ -66,14 +66,14 @@ func (mock *MockPendingPlanFinder) VerifyWasCalledOnce() *VerifierMockPendingPla } } -func (mock *MockPendingPlanFinder) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockPendingPlanFinder { +func (mock *MockPendingPlanFinder) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPendingPlanFinder { return &VerifierMockPendingPlanFinder{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockPendingPlanFinder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPendingPlanFinder { +func (mock *MockPendingPlanFinder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPendingPlanFinder { return &VerifierMockPendingPlanFinder{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -81,7 +81,7 @@ func (mock *MockPendingPlanFinder) VerifyWasCalledInOrder(invocationCountMatcher } } -func (mock *MockPendingPlanFinder) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockPendingPlanFinder { +func (mock *MockPendingPlanFinder) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPendingPlanFinder { return &VerifierMockPendingPlanFinder{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -91,7 +91,7 @@ func (mock *MockPendingPlanFinder) VerifyWasCalledEventually(invocationCountMatc type VerifierMockPendingPlanFinder struct { mock *MockPendingPlanFinder - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_project_command_builder.go b/server/events/mocks/mock_project_command_builder.go index d4a365973..3f41fdc3e 100644 --- a/server/events/mocks/mock_project_command_builder.go +++ b/server/events/mocks/mock_project_command_builder.go @@ -109,14 +109,14 @@ func (mock *MockProjectCommandBuilder) VerifyWasCalledOnce() *VerifierMockProjec } } -func (mock *MockProjectCommandBuilder) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockProjectCommandBuilder { +func (mock *MockProjectCommandBuilder) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockProjectCommandBuilder { return &VerifierMockProjectCommandBuilder{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockProjectCommandBuilder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectCommandBuilder { +func (mock *MockProjectCommandBuilder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectCommandBuilder { return &VerifierMockProjectCommandBuilder{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -124,7 +124,7 @@ func (mock *MockProjectCommandBuilder) VerifyWasCalledInOrder(invocationCountMat } } -func (mock *MockProjectCommandBuilder) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockProjectCommandBuilder { +func (mock *MockProjectCommandBuilder) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockProjectCommandBuilder { return &VerifierMockProjectCommandBuilder{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -134,7 +134,7 @@ func (mock *MockProjectCommandBuilder) VerifyWasCalledEventually(invocationCount type VerifierMockProjectCommandBuilder struct { mock *MockProjectCommandBuilder - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_project_command_runner.go b/server/events/mocks/mock_project_command_runner.go index e0b8ff770..deba757c8 100644 --- a/server/events/mocks/mock_project_command_runner.go +++ b/server/events/mocks/mock_project_command_runner.go @@ -92,14 +92,14 @@ func (mock *MockProjectCommandRunner) VerifyWasCalledOnce() *VerifierMockProject } } -func (mock *MockProjectCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockProjectCommandRunner { +func (mock *MockProjectCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockProjectCommandRunner { return &VerifierMockProjectCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockProjectCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectCommandRunner { +func (mock *MockProjectCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectCommandRunner { return &VerifierMockProjectCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -107,7 +107,7 @@ func (mock *MockProjectCommandRunner) VerifyWasCalledInOrder(invocationCountMatc } } -func (mock *MockProjectCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockProjectCommandRunner { +func (mock *MockProjectCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockProjectCommandRunner { return &VerifierMockProjectCommandRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -117,7 +117,7 @@ func (mock *MockProjectCommandRunner) VerifyWasCalledEventually(invocationCountM type VerifierMockProjectCommandRunner struct { mock *MockProjectCommandRunner - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_project_lock.go b/server/events/mocks/mock_project_lock.go index 5674a361c..c280b4955 100644 --- a/server/events/mocks/mock_project_lock.go +++ b/server/events/mocks/mock_project_lock.go @@ -53,14 +53,14 @@ func (mock *MockProjectLocker) VerifyWasCalledOnce() *VerifierMockProjectLocker } } -func (mock *MockProjectLocker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockProjectLocker { +func (mock *MockProjectLocker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockProjectLocker { return &VerifierMockProjectLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockProjectLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectLocker { +func (mock *MockProjectLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectLocker { return &VerifierMockProjectLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -68,7 +68,7 @@ func (mock *MockProjectLocker) VerifyWasCalledInOrder(invocationCountMatcher peg } } -func (mock *MockProjectLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockProjectLocker { +func (mock *MockProjectLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockProjectLocker { return &VerifierMockProjectLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -78,7 +78,7 @@ func (mock *MockProjectLocker) VerifyWasCalledEventually(invocationCountMatcher type VerifierMockProjectLocker struct { mock *MockProjectLocker - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_pull_cleaner.go b/server/events/mocks/mock_pull_cleaner.go index af7825981..2288c67d7 100644 --- a/server/events/mocks/mock_pull_cleaner.go +++ b/server/events/mocks/mock_pull_cleaner.go @@ -47,14 +47,14 @@ func (mock *MockPullCleaner) VerifyWasCalledOnce() *VerifierMockPullCleaner { } } -func (mock *MockPullCleaner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockPullCleaner { +func (mock *MockPullCleaner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPullCleaner { return &VerifierMockPullCleaner{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockPullCleaner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPullCleaner { +func (mock *MockPullCleaner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPullCleaner { return &VerifierMockPullCleaner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -62,7 +62,7 @@ func (mock *MockPullCleaner) VerifyWasCalledInOrder(invocationCountMatcher pegom } } -func (mock *MockPullCleaner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockPullCleaner { +func (mock *MockPullCleaner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPullCleaner { return &VerifierMockPullCleaner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -72,7 +72,7 @@ func (mock *MockPullCleaner) VerifyWasCalledEventually(invocationCountMatcher pe type VerifierMockPullCleaner struct { mock *MockPullCleaner - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_step_runner.go b/server/events/mocks/mock_step_runner.go index d4a846994..5fa0f7b0a 100644 --- a/server/events/mocks/mock_step_runner.go +++ b/server/events/mocks/mock_step_runner.go @@ -51,14 +51,14 @@ func (mock *MockStepRunner) VerifyWasCalledOnce() *VerifierMockStepRunner { } } -func (mock *MockStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockStepRunner { +func (mock *MockStepRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockStepRunner { return &VerifierMockStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockStepRunner { +func (mock *MockStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockStepRunner { return &VerifierMockStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockStepRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomo } } -func (mock *MockStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockStepRunner { +func (mock *MockStepRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockStepRunner { return &VerifierMockStepRunner{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockStepRunner) VerifyWasCalledEventually(invocationCountMatcher peg type VerifierMockStepRunner struct { mock *MockStepRunner - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_webhooks_sender.go b/server/events/mocks/mock_webhooks_sender.go index 8f3562458..fcbc85503 100644 --- a/server/events/mocks/mock_webhooks_sender.go +++ b/server/events/mocks/mock_webhooks_sender.go @@ -48,14 +48,14 @@ func (mock *MockWebhooksSender) VerifyWasCalledOnce() *VerifierMockWebhooksSende } } -func (mock *MockWebhooksSender) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockWebhooksSender { +func (mock *MockWebhooksSender) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockWebhooksSender { return &VerifierMockWebhooksSender{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockWebhooksSender) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWebhooksSender { +func (mock *MockWebhooksSender) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWebhooksSender { return &VerifierMockWebhooksSender{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -63,7 +63,7 @@ func (mock *MockWebhooksSender) VerifyWasCalledInOrder(invocationCountMatcher pe } } -func (mock *MockWebhooksSender) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockWebhooksSender { +func (mock *MockWebhooksSender) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockWebhooksSender { return &VerifierMockWebhooksSender{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -73,7 +73,7 @@ func (mock *MockWebhooksSender) VerifyWasCalledEventually(invocationCountMatcher type VerifierMockWebhooksSender struct { mock *MockWebhooksSender - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_working_dir.go b/server/events/mocks/mock_working_dir.go index 30e756d87..2444fe602 100644 --- a/server/events/mocks/mock_working_dir.go +++ b/server/events/mocks/mock_working_dir.go @@ -124,14 +124,14 @@ func (mock *MockWorkingDir) VerifyWasCalledOnce() *VerifierMockWorkingDir { } } -func (mock *MockWorkingDir) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockWorkingDir { +func (mock *MockWorkingDir) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockWorkingDir { return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDir { +func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDir { return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -139,7 +139,7 @@ func (mock *MockWorkingDir) VerifyWasCalledInOrder(invocationCountMatcher pegomo } } -func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockWorkingDir { +func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockWorkingDir { return &VerifierMockWorkingDir{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -149,7 +149,7 @@ func (mock *MockWorkingDir) VerifyWasCalledEventually(invocationCountMatcher peg type VerifierMockWorkingDir struct { mock *MockWorkingDir - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/mocks/mock_working_dir_locker.go b/server/events/mocks/mock_working_dir_locker.go index 6cb661fe3..57ffe9f5d 100644 --- a/server/events/mocks/mock_working_dir_locker.go +++ b/server/events/mocks/mock_working_dir_locker.go @@ -69,14 +69,14 @@ func (mock *MockWorkingDirLocker) VerifyWasCalledOnce() *VerifierMockWorkingDirL } } -func (mock *MockWorkingDirLocker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockWorkingDirLocker { +func (mock *MockWorkingDirLocker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockWorkingDirLocker { return &VerifierMockWorkingDirLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockWorkingDirLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDirLocker { +func (mock *MockWorkingDirLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockWorkingDirLocker { return &VerifierMockWorkingDirLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -84,7 +84,7 @@ func (mock *MockWorkingDirLocker) VerifyWasCalledInOrder(invocationCountMatcher } } -func (mock *MockWorkingDirLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockWorkingDirLocker { +func (mock *MockWorkingDirLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockWorkingDirLocker { return &VerifierMockWorkingDirLocker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -94,7 +94,7 @@ func (mock *MockWorkingDirLocker) VerifyWasCalledEventually(invocationCountMatch type VerifierMockWorkingDirLocker struct { mock *MockWorkingDirLocker - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/runtime/cache/mocks/matchers/ptr_to_go_version_version.go b/server/events/runtime/cache/mocks/matchers/ptr_to_go_version_version.go index 587598c7a..bb596fe3d 100644 --- a/server/events/runtime/cache/mocks/matchers/ptr_to_go_version_version.go +++ b/server/events/runtime/cache/mocks/matchers/ptr_to_go_version_version.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + go_version "github.com/hashicorp/go-version" ) @@ -18,3 +19,15 @@ func EqPtrToGoVersionVersion(value *go_version.Version) *go_version.Version { var nullValue *go_version.Version return nullValue } + +func NotEqPtrToGoVersionVersion(value *go_version.Version) *go_version.Version { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *go_version.Version + return nullValue +} + +func PtrToGoVersionVersionThat(matcher pegomock.ArgumentMatcher) *go_version.Version { + pegomock.RegisterMatcher(matcher) + var nullValue *go_version.Version + return nullValue +} diff --git a/server/events/runtime/cache/mocks/mock_key_serializer.go b/server/events/runtime/cache/mocks/mock_key_serializer.go index e5a65f169..b82210099 100644 --- a/server/events/runtime/cache/mocks/mock_key_serializer.go +++ b/server/events/runtime/cache/mocks/mock_key_serializer.go @@ -51,14 +51,14 @@ func (mock *MockKeySerializer) VerifyWasCalledOnce() *VerifierMockKeySerializer } } -func (mock *MockKeySerializer) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockKeySerializer { +func (mock *MockKeySerializer) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockKeySerializer { return &VerifierMockKeySerializer{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockKeySerializer) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockKeySerializer { +func (mock *MockKeySerializer) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockKeySerializer { return &VerifierMockKeySerializer{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockKeySerializer) VerifyWasCalledInOrder(invocationCountMatcher peg } } -func (mock *MockKeySerializer) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockKeySerializer { +func (mock *MockKeySerializer) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockKeySerializer { return &VerifierMockKeySerializer{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockKeySerializer) VerifyWasCalledEventually(invocationCountMatcher type VerifierMockKeySerializer struct { mock *MockKeySerializer - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/runtime/cache/mocks/mock_version_path.go b/server/events/runtime/cache/mocks/mock_version_path.go index a79c3d9b0..b1c5b4658 100644 --- a/server/events/runtime/cache/mocks/mock_version_path.go +++ b/server/events/runtime/cache/mocks/mock_version_path.go @@ -51,14 +51,14 @@ func (mock *MockExecutionVersionCache) VerifyWasCalledOnce() *VerifierMockExecut } } -func (mock *MockExecutionVersionCache) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockExecutionVersionCache { +func (mock *MockExecutionVersionCache) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockExecutionVersionCache { return &VerifierMockExecutionVersionCache{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockExecutionVersionCache) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockExecutionVersionCache { +func (mock *MockExecutionVersionCache) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockExecutionVersionCache { return &VerifierMockExecutionVersionCache{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockExecutionVersionCache) VerifyWasCalledInOrder(invocationCountMat } } -func (mock *MockExecutionVersionCache) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockExecutionVersionCache { +func (mock *MockExecutionVersionCache) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockExecutionVersionCache { return &VerifierMockExecutionVersionCache{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockExecutionVersionCache) VerifyWasCalledEventually(invocationCount type VerifierMockExecutionVersionCache struct { mock *MockExecutionVersionCache - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/runtime/mocks/matchers/logging_simplelogging.go b/server/events/runtime/mocks/matchers/logging_simplelogging.go new file mode 100644 index 000000000..502456e7c --- /dev/null +++ b/server/events/runtime/mocks/matchers/logging_simplelogging.go @@ -0,0 +1,33 @@ +// Code generated by pegomock. DO NOT EDIT. +package matchers + +import ( + "github.com/petergtz/pegomock" + "reflect" + + logging "github.com/runatlantis/atlantis/server/logging" +) + +func AnyLoggingSimpleLogging() logging.SimpleLogging { + pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(logging.SimpleLogging))(nil)).Elem())) + var nullValue logging.SimpleLogging + return nullValue +} + +func EqLoggingSimpleLogging(value logging.SimpleLogging) logging.SimpleLogging { + pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) + var nullValue logging.SimpleLogging + return nullValue +} + +func NotEqLoggingSimpleLogging(value logging.SimpleLogging) logging.SimpleLogging { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue logging.SimpleLogging + return nullValue +} + +func LoggingSimpleLoggingThat(matcher pegomock.ArgumentMatcher) logging.SimpleLogging { + pegomock.RegisterMatcher(matcher) + var nullValue logging.SimpleLogging + return nullValue +} diff --git a/server/events/runtime/mocks/matchers/models_pullrequest.go b/server/events/runtime/mocks/matchers/models_pullrequest.go index dd1fb0d4e..9ae2a7e92 100644 --- a/server/events/runtime/mocks/matchers/models_pullrequest.go +++ b/server/events/runtime/mocks/matchers/models_pullrequest.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsPullRequest(value models.PullRequest) models.PullRequest { var nullValue models.PullRequest return nullValue } + +func NotEqModelsPullRequest(value models.PullRequest) models.PullRequest { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.PullRequest + return nullValue +} + +func ModelsPullRequestThat(matcher pegomock.ArgumentMatcher) models.PullRequest { + pegomock.RegisterMatcher(matcher) + var nullValue models.PullRequest + return nullValue +} diff --git a/server/events/runtime/mocks/matchers/models_repo.go b/server/events/runtime/mocks/matchers/models_repo.go index 418f13cfc..fd44665f8 100644 --- a/server/events/runtime/mocks/matchers/models_repo.go +++ b/server/events/runtime/mocks/matchers/models_repo.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsRepo(value models.Repo) models.Repo { var nullValue models.Repo return nullValue } + +func NotEqModelsRepo(value models.Repo) models.Repo { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.Repo + return nullValue +} + +func ModelsRepoThat(matcher pegomock.ArgumentMatcher) models.Repo { + pegomock.RegisterMatcher(matcher) + var nullValue models.Repo + return nullValue +} diff --git a/server/events/runtime/mocks/matchers/ptr_to_go_version_version.go b/server/events/runtime/mocks/matchers/ptr_to_go_version_version.go index 587598c7a..bb596fe3d 100644 --- a/server/events/runtime/mocks/matchers/ptr_to_go_version_version.go +++ b/server/events/runtime/mocks/matchers/ptr_to_go_version_version.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + go_version "github.com/hashicorp/go-version" ) @@ -18,3 +19,15 @@ func EqPtrToGoVersionVersion(value *go_version.Version) *go_version.Version { var nullValue *go_version.Version return nullValue } + +func NotEqPtrToGoVersionVersion(value *go_version.Version) *go_version.Version { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *go_version.Version + return nullValue +} + +func PtrToGoVersionVersionThat(matcher pegomock.ArgumentMatcher) *go_version.Version { + pegomock.RegisterMatcher(matcher) + var nullValue *go_version.Version + return nullValue +} diff --git a/server/events/runtime/mocks/mock_pull_approved_checker.go b/server/events/runtime/mocks/mock_pull_approved_checker.go index 7e3e7f507..7acee92c7 100644 --- a/server/events/runtime/mocks/mock_pull_approved_checker.go +++ b/server/events/runtime/mocks/mock_pull_approved_checker.go @@ -51,14 +51,14 @@ func (mock *MockPullApprovedChecker) VerifyWasCalledOnce() *VerifierMockPullAppr } } -func (mock *MockPullApprovedChecker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockPullApprovedChecker { +func (mock *MockPullApprovedChecker) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPullApprovedChecker { return &VerifierMockPullApprovedChecker{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockPullApprovedChecker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPullApprovedChecker { +func (mock *MockPullApprovedChecker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPullApprovedChecker { return &VerifierMockPullApprovedChecker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockPullApprovedChecker) VerifyWasCalledInOrder(invocationCountMatch } } -func (mock *MockPullApprovedChecker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockPullApprovedChecker { +func (mock *MockPullApprovedChecker) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPullApprovedChecker { return &VerifierMockPullApprovedChecker{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockPullApprovedChecker) VerifyWasCalledEventually(invocationCountMa type VerifierMockPullApprovedChecker struct { mock *MockPullApprovedChecker - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/runtime/mocks/mock_versionedexecutorworkflow.go b/server/events/runtime/mocks/mock_versionedexecutorworkflow.go index cfe6556d7..f57fedcea 100644 --- a/server/events/runtime/mocks/mock_versionedexecutorworkflow.go +++ b/server/events/runtime/mocks/mock_versionedexecutorworkflow.go @@ -72,14 +72,14 @@ func (mock *MockVersionedExecutorWorkflow) VerifyWasCalledOnce() *VerifierMockVe } } -func (mock *MockVersionedExecutorWorkflow) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockVersionedExecutorWorkflow { +func (mock *MockVersionedExecutorWorkflow) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockVersionedExecutorWorkflow { return &VerifierMockVersionedExecutorWorkflow{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockVersionedExecutorWorkflow) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockVersionedExecutorWorkflow { +func (mock *MockVersionedExecutorWorkflow) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockVersionedExecutorWorkflow { return &VerifierMockVersionedExecutorWorkflow{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -87,7 +87,7 @@ func (mock *MockVersionedExecutorWorkflow) VerifyWasCalledInOrder(invocationCoun } } -func (mock *MockVersionedExecutorWorkflow) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockVersionedExecutorWorkflow { +func (mock *MockVersionedExecutorWorkflow) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockVersionedExecutorWorkflow { return &VerifierMockVersionedExecutorWorkflow{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -97,7 +97,7 @@ func (mock *MockVersionedExecutorWorkflow) VerifyWasCalledEventually(invocationC type VerifierMockVersionedExecutorWorkflow struct { mock *MockVersionedExecutorWorkflow - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/runtime/models/mocks/matchers/map_of_string_to_string.go b/server/events/runtime/models/mocks/matchers/map_of_string_to_string.go index 4d969915a..65175de1a 100644 --- a/server/events/runtime/models/mocks/matchers/map_of_string_to_string.go +++ b/server/events/runtime/models/mocks/matchers/map_of_string_to_string.go @@ -2,10 +2,8 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - - + "reflect" ) func AnyMapOfStringToString() map[string]string { @@ -19,3 +17,15 @@ func EqMapOfStringToString(value map[string]string) map[string]string { var nullValue map[string]string return nullValue } + +func NotEqMapOfStringToString(value map[string]string) map[string]string { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue map[string]string + return nullValue +} + +func MapOfStringToStringThat(matcher pegomock.ArgumentMatcher) map[string]string { + pegomock.RegisterMatcher(matcher) + var nullValue map[string]string + return nullValue +} diff --git a/server/events/runtime/models/mocks/matchers/models_filepath.go b/server/events/runtime/models/mocks/matchers/models_filepath.go index 0350b2015..e30e6b2a7 100644 --- a/server/events/runtime/models/mocks/matchers/models_filepath.go +++ b/server/events/runtime/models/mocks/matchers/models_filepath.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/runtime/models" ) @@ -18,3 +19,15 @@ func EqModelsFilePath(value models.FilePath) models.FilePath { var nullValue models.FilePath return nullValue } + +func NotEqModelsFilePath(value models.FilePath) models.FilePath { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.FilePath + return nullValue +} + +func ModelsFilePathThat(matcher pegomock.ArgumentMatcher) models.FilePath { + pegomock.RegisterMatcher(matcher) + var nullValue models.FilePath + return nullValue +} diff --git a/server/events/runtime/models/mocks/matchers/slice_of_string.go b/server/events/runtime/models/mocks/matchers/slice_of_string.go index 96f9b24ae..f9281819d 100644 --- a/server/events/runtime/models/mocks/matchers/slice_of_string.go +++ b/server/events/runtime/models/mocks/matchers/slice_of_string.go @@ -2,9 +2,8 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - + "reflect" ) func AnySliceOfString() []string { @@ -18,3 +17,15 @@ func EqSliceOfString(value []string) []string { var nullValue []string return nullValue } + +func NotEqSliceOfString(value []string) []string { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue []string + return nullValue +} + +func SliceOfStringThat(matcher pegomock.ArgumentMatcher) []string { + pegomock.RegisterMatcher(matcher) + var nullValue []string + return nullValue +} diff --git a/server/events/runtime/models/mocks/mock_exec.go b/server/events/runtime/models/mocks/mock_exec.go index ccbcb92b5..1755e66ac 100644 --- a/server/events/runtime/models/mocks/mock_exec.go +++ b/server/events/runtime/models/mocks/mock_exec.go @@ -69,14 +69,14 @@ func (mock *MockExec) VerifyWasCalledOnce() *VerifierMockExec { } } -func (mock *MockExec) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockExec { +func (mock *MockExec) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockExec { return &VerifierMockExec{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockExec) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockExec { +func (mock *MockExec) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockExec { return &VerifierMockExec{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -84,7 +84,7 @@ func (mock *MockExec) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Mat } } -func (mock *MockExec) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockExec { +func (mock *MockExec) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockExec { return &VerifierMockExec{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -94,7 +94,7 @@ func (mock *MockExec) VerifyWasCalledEventually(invocationCountMatcher pegomock. type VerifierMockExec struct { mock *MockExec - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/runtime/models/mocks/mock_filepath.go b/server/events/runtime/models/mocks/mock_filepath.go index 869df1de3..9304c29e4 100644 --- a/server/events/runtime/models/mocks/mock_filepath.go +++ b/server/events/runtime/models/mocks/mock_filepath.go @@ -99,14 +99,14 @@ func (mock *MockFilePath) VerifyWasCalledOnce() *VerifierMockFilePath { } } -func (mock *MockFilePath) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockFilePath { +func (mock *MockFilePath) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockFilePath { return &VerifierMockFilePath{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockFilePath) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockFilePath { +func (mock *MockFilePath) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockFilePath { return &VerifierMockFilePath{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -114,7 +114,7 @@ func (mock *MockFilePath) VerifyWasCalledInOrder(invocationCountMatcher pegomock } } -func (mock *MockFilePath) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockFilePath { +func (mock *MockFilePath) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockFilePath { return &VerifierMockFilePath{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -124,7 +124,7 @@ func (mock *MockFilePath) VerifyWasCalledEventually(invocationCountMatcher pegom type VerifierMockFilePath struct { mock *MockFilePath - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/runtime/policy/mocks/matchers/valid_policyset.go b/server/events/runtime/policy/mocks/matchers/valid_policyset.go index 40e5b7da9..c8eaab2cf 100644 --- a/server/events/runtime/policy/mocks/matchers/valid_policyset.go +++ b/server/events/runtime/policy/mocks/matchers/valid_policyset.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + valid "github.com/runatlantis/atlantis/server/events/yaml/valid" ) @@ -18,3 +19,15 @@ func EqValidPolicySet(value valid.PolicySet) valid.PolicySet { var nullValue valid.PolicySet return nullValue } + +func NotEqValidPolicySet(value valid.PolicySet) valid.PolicySet { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue valid.PolicySet + return nullValue +} + +func ValidPolicySetThat(matcher pegomock.ArgumentMatcher) valid.PolicySet { + pegomock.RegisterMatcher(matcher) + var nullValue valid.PolicySet + return nullValue +} diff --git a/server/events/runtime/policy/mocks/mock_conftest_client.go b/server/events/runtime/policy/mocks/mock_conftest_client.go index 47fd257bf..b9a4a411b 100644 --- a/server/events/runtime/policy/mocks/mock_conftest_client.go +++ b/server/events/runtime/policy/mocks/mock_conftest_client.go @@ -51,14 +51,14 @@ func (mock *MockSourceResolver) VerifyWasCalledOnce() *VerifierMockSourceResolve } } -func (mock *MockSourceResolver) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockSourceResolver { +func (mock *MockSourceResolver) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockSourceResolver { return &VerifierMockSourceResolver{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockSourceResolver) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockSourceResolver { +func (mock *MockSourceResolver) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockSourceResolver { return &VerifierMockSourceResolver{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockSourceResolver) VerifyWasCalledInOrder(invocationCountMatcher pe } } -func (mock *MockSourceResolver) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockSourceResolver { +func (mock *MockSourceResolver) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockSourceResolver { return &VerifierMockSourceResolver{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockSourceResolver) VerifyWasCalledEventually(invocationCountMatcher type VerifierMockSourceResolver struct { mock *MockSourceResolver - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/terraform/mocks/matchers/go_getter_clientoption.go b/server/events/terraform/mocks/matchers/go_getter_clientoption.go index 182ba2576..c6a41e3bd 100644 --- a/server/events/terraform/mocks/matchers/go_getter_clientoption.go +++ b/server/events/terraform/mocks/matchers/go_getter_clientoption.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + go_getter "github.com/hashicorp/go-getter" ) @@ -18,3 +19,15 @@ func EqGoGetterClientOption(value go_getter.ClientOption) go_getter.ClientOption var nullValue go_getter.ClientOption return nullValue } + +func NotEqGoGetterClientOption(value go_getter.ClientOption) go_getter.ClientOption { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue go_getter.ClientOption + return nullValue +} + +func GoGetterClientOptionThat(matcher pegomock.ArgumentMatcher) go_getter.ClientOption { + pegomock.RegisterMatcher(matcher) + var nullValue go_getter.ClientOption + return nullValue +} diff --git a/server/events/terraform/mocks/matchers/logging_simplelogging.go b/server/events/terraform/mocks/matchers/logging_simplelogging.go new file mode 100644 index 000000000..502456e7c --- /dev/null +++ b/server/events/terraform/mocks/matchers/logging_simplelogging.go @@ -0,0 +1,33 @@ +// Code generated by pegomock. DO NOT EDIT. +package matchers + +import ( + "github.com/petergtz/pegomock" + "reflect" + + logging "github.com/runatlantis/atlantis/server/logging" +) + +func AnyLoggingSimpleLogging() logging.SimpleLogging { + pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(logging.SimpleLogging))(nil)).Elem())) + var nullValue logging.SimpleLogging + return nullValue +} + +func EqLoggingSimpleLogging(value logging.SimpleLogging) logging.SimpleLogging { + pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) + var nullValue logging.SimpleLogging + return nullValue +} + +func NotEqLoggingSimpleLogging(value logging.SimpleLogging) logging.SimpleLogging { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue logging.SimpleLogging + return nullValue +} + +func LoggingSimpleLoggingThat(matcher pegomock.ArgumentMatcher) logging.SimpleLogging { + pegomock.RegisterMatcher(matcher) + var nullValue logging.SimpleLogging + return nullValue +} diff --git a/server/events/terraform/mocks/matchers/map_of_string_to_string.go b/server/events/terraform/mocks/matchers/map_of_string_to_string.go index 4d969915a..65175de1a 100644 --- a/server/events/terraform/mocks/matchers/map_of_string_to_string.go +++ b/server/events/terraform/mocks/matchers/map_of_string_to_string.go @@ -2,10 +2,8 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - - + "reflect" ) func AnyMapOfStringToString() map[string]string { @@ -19,3 +17,15 @@ func EqMapOfStringToString(value map[string]string) map[string]string { var nullValue map[string]string return nullValue } + +func NotEqMapOfStringToString(value map[string]string) map[string]string { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue map[string]string + return nullValue +} + +func MapOfStringToStringThat(matcher pegomock.ArgumentMatcher) map[string]string { + pegomock.RegisterMatcher(matcher) + var nullValue map[string]string + return nullValue +} diff --git a/server/events/terraform/mocks/matchers/ptr_to_go_version_version.go b/server/events/terraform/mocks/matchers/ptr_to_go_version_version.go index 587598c7a..bb596fe3d 100644 --- a/server/events/terraform/mocks/matchers/ptr_to_go_version_version.go +++ b/server/events/terraform/mocks/matchers/ptr_to_go_version_version.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + go_version "github.com/hashicorp/go-version" ) @@ -18,3 +19,15 @@ func EqPtrToGoVersionVersion(value *go_version.Version) *go_version.Version { var nullValue *go_version.Version return nullValue } + +func NotEqPtrToGoVersionVersion(value *go_version.Version) *go_version.Version { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *go_version.Version + return nullValue +} + +func PtrToGoVersionVersionThat(matcher pegomock.ArgumentMatcher) *go_version.Version { + pegomock.RegisterMatcher(matcher) + var nullValue *go_version.Version + return nullValue +} diff --git a/server/events/terraform/mocks/matchers/slice_of_string.go b/server/events/terraform/mocks/matchers/slice_of_string.go index 96f9b24ae..f9281819d 100644 --- a/server/events/terraform/mocks/matchers/slice_of_string.go +++ b/server/events/terraform/mocks/matchers/slice_of_string.go @@ -2,9 +2,8 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - + "reflect" ) func AnySliceOfString() []string { @@ -18,3 +17,15 @@ func EqSliceOfString(value []string) []string { var nullValue []string return nullValue } + +func NotEqSliceOfString(value []string) []string { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue []string + return nullValue +} + +func SliceOfStringThat(matcher pegomock.ArgumentMatcher) []string { + pegomock.RegisterMatcher(matcher) + var nullValue []string + return nullValue +} diff --git a/server/events/terraform/mocks/mock_downloader.go b/server/events/terraform/mocks/mock_downloader.go index 6ab9467e5..1a520af16 100644 --- a/server/events/terraform/mocks/mock_downloader.go +++ b/server/events/terraform/mocks/mock_downloader.go @@ -68,14 +68,14 @@ func (mock *MockDownloader) VerifyWasCalledOnce() *VerifierMockDownloader { } } -func (mock *MockDownloader) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockDownloader { +func (mock *MockDownloader) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockDownloader { return &VerifierMockDownloader{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockDownloader) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockDownloader { +func (mock *MockDownloader) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockDownloader { return &VerifierMockDownloader{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -83,7 +83,7 @@ func (mock *MockDownloader) VerifyWasCalledInOrder(invocationCountMatcher pegomo } } -func (mock *MockDownloader) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockDownloader { +func (mock *MockDownloader) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockDownloader { return &VerifierMockDownloader{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -93,7 +93,7 @@ func (mock *MockDownloader) VerifyWasCalledEventually(invocationCountMatcher peg type VerifierMockDownloader struct { mock *MockDownloader - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/terraform/mocks/mock_terraform_client.go b/server/events/terraform/mocks/mock_terraform_client.go index b92077775..89820350a 100644 --- a/server/events/terraform/mocks/mock_terraform_client.go +++ b/server/events/terraform/mocks/mock_terraform_client.go @@ -67,14 +67,14 @@ func (mock *MockClient) VerifyWasCalledOnce() *VerifierMockClient { } } -func (mock *MockClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockClient { +func (mock *MockClient) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockClient { return &VerifierMockClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockClient { +func (mock *MockClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockClient { return &VerifierMockClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -82,7 +82,7 @@ func (mock *MockClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.M } } -func (mock *MockClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockClient { +func (mock *MockClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockClient { return &VerifierMockClient{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -92,7 +92,7 @@ func (mock *MockClient) VerifyWasCalledEventually(invocationCountMatcher pegomoc type VerifierMockClient struct { mock *MockClient - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/events/vcs/mocks/matchers/models_commitstatus.go b/server/events/vcs/mocks/matchers/models_commitstatus.go index 0f579baf8..1e10ed782 100644 --- a/server/events/vcs/mocks/matchers/models_commitstatus.go +++ b/server/events/vcs/mocks/matchers/models_commitstatus.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsCommitStatus(value models.CommitStatus) models.CommitStatus { var nullValue models.CommitStatus return nullValue } + +func NotEqModelsCommitStatus(value models.CommitStatus) models.CommitStatus { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.CommitStatus + return nullValue +} + +func ModelsCommitStatusThat(matcher pegomock.ArgumentMatcher) models.CommitStatus { + pegomock.RegisterMatcher(matcher) + var nullValue models.CommitStatus + return nullValue +} diff --git a/server/events/vcs/mocks/matchers/models_pullrequest.go b/server/events/vcs/mocks/matchers/models_pullrequest.go index dd1fb0d4e..9ae2a7e92 100644 --- a/server/events/vcs/mocks/matchers/models_pullrequest.go +++ b/server/events/vcs/mocks/matchers/models_pullrequest.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsPullRequest(value models.PullRequest) models.PullRequest { var nullValue models.PullRequest return nullValue } + +func NotEqModelsPullRequest(value models.PullRequest) models.PullRequest { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.PullRequest + return nullValue +} + +func ModelsPullRequestThat(matcher pegomock.ArgumentMatcher) models.PullRequest { + pegomock.RegisterMatcher(matcher) + var nullValue models.PullRequest + return nullValue +} diff --git a/server/events/vcs/mocks/matchers/models_pullrequestoptions.go b/server/events/vcs/mocks/matchers/models_pullrequestoptions.go new file mode 100644 index 000000000..c2c240c7a --- /dev/null +++ b/server/events/vcs/mocks/matchers/models_pullrequestoptions.go @@ -0,0 +1,33 @@ +// Code generated by pegomock. DO NOT EDIT. +package matchers + +import ( + "github.com/petergtz/pegomock" + "reflect" + + models "github.com/runatlantis/atlantis/server/events/models" +) + +func AnyModelsPullRequestOptions() models.PullRequestOptions { + pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(models.PullRequestOptions))(nil)).Elem())) + var nullValue models.PullRequestOptions + return nullValue +} + +func EqModelsPullRequestOptions(value models.PullRequestOptions) models.PullRequestOptions { + pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) + var nullValue models.PullRequestOptions + return nullValue +} + +func NotEqModelsPullRequestOptions(value models.PullRequestOptions) models.PullRequestOptions { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.PullRequestOptions + return nullValue +} + +func ModelsPullRequestOptionsThat(matcher pegomock.ArgumentMatcher) models.PullRequestOptions { + pegomock.RegisterMatcher(matcher) + var nullValue models.PullRequestOptions + return nullValue +} diff --git a/server/events/vcs/mocks/matchers/models_repo.go b/server/events/vcs/mocks/matchers/models_repo.go index 418f13cfc..fd44665f8 100644 --- a/server/events/vcs/mocks/matchers/models_repo.go +++ b/server/events/vcs/mocks/matchers/models_repo.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + models "github.com/runatlantis/atlantis/server/events/models" ) @@ -18,3 +19,15 @@ func EqModelsRepo(value models.Repo) models.Repo { var nullValue models.Repo return nullValue } + +func NotEqModelsRepo(value models.Repo) models.Repo { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue models.Repo + return nullValue +} + +func ModelsRepoThat(matcher pegomock.ArgumentMatcher) models.Repo { + pegomock.RegisterMatcher(matcher) + var nullValue models.Repo + return nullValue +} diff --git a/server/events/vcs/mocks/matchers/slice_of_byte.go b/server/events/vcs/mocks/matchers/slice_of_byte.go index 9a9894fa0..951531345 100644 --- a/server/events/vcs/mocks/matchers/slice_of_byte.go +++ b/server/events/vcs/mocks/matchers/slice_of_byte.go @@ -2,9 +2,8 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - + "reflect" ) func AnySliceOfByte() []byte { @@ -18,3 +17,15 @@ func EqSliceOfByte(value []byte) []byte { var nullValue []byte return nullValue } + +func NotEqSliceOfByte(value []byte) []byte { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue []byte + return nullValue +} + +func SliceOfByteThat(matcher pegomock.ArgumentMatcher) []byte { + pegomock.RegisterMatcher(matcher) + var nullValue []byte + return nullValue +} diff --git a/server/events/vcs/mocks/matchers/slice_of_string.go b/server/events/vcs/mocks/matchers/slice_of_string.go index 96f9b24ae..f9281819d 100644 --- a/server/events/vcs/mocks/matchers/slice_of_string.go +++ b/server/events/vcs/mocks/matchers/slice_of_string.go @@ -2,9 +2,8 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - + "reflect" ) func AnySliceOfString() []string { @@ -18,3 +17,15 @@ func EqSliceOfString(value []string) []string { var nullValue []string return nullValue } + +func NotEqSliceOfString(value []string) []string { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue []string + return nullValue +} + +func SliceOfStringThat(matcher pegomock.ArgumentMatcher) []string { + pegomock.RegisterMatcher(matcher) + var nullValue []string + return nullValue +} diff --git a/server/events/vcs/mocks/mock_client.go b/server/events/vcs/mocks/mock_client.go index ad7eeef19..b3e5c3a9f 100644 --- a/server/events/vcs/mocks/mock_client.go +++ b/server/events/vcs/mocks/mock_client.go @@ -4,11 +4,10 @@ package mocks import ( - "reflect" - "time" - pegomock "github.com/petergtz/pegomock" models "github.com/runatlantis/atlantis/server/events/models" + "reflect" + "time" ) type MockClient struct { diff --git a/server/events/webhooks/mocks/matchers/logging_simplelogging.go b/server/events/webhooks/mocks/matchers/logging_simplelogging.go new file mode 100644 index 000000000..502456e7c --- /dev/null +++ b/server/events/webhooks/mocks/matchers/logging_simplelogging.go @@ -0,0 +1,33 @@ +// Code generated by pegomock. DO NOT EDIT. +package matchers + +import ( + "github.com/petergtz/pegomock" + "reflect" + + logging "github.com/runatlantis/atlantis/server/logging" +) + +func AnyLoggingSimpleLogging() logging.SimpleLogging { + pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(logging.SimpleLogging))(nil)).Elem())) + var nullValue logging.SimpleLogging + return nullValue +} + +func EqLoggingSimpleLogging(value logging.SimpleLogging) logging.SimpleLogging { + pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) + var nullValue logging.SimpleLogging + return nullValue +} + +func NotEqLoggingSimpleLogging(value logging.SimpleLogging) logging.SimpleLogging { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue logging.SimpleLogging + return nullValue +} + +func LoggingSimpleLoggingThat(matcher pegomock.ArgumentMatcher) logging.SimpleLogging { + pegomock.RegisterMatcher(matcher) + var nullValue logging.SimpleLogging + return nullValue +} diff --git a/server/events/webhooks/mocks/matchers/ptr_to_slack_getconversationsparameters.go b/server/events/webhooks/mocks/matchers/ptr_to_slack_getconversationsparameters.go new file mode 100644 index 000000000..ca4220019 --- /dev/null +++ b/server/events/webhooks/mocks/matchers/ptr_to_slack_getconversationsparameters.go @@ -0,0 +1,33 @@ +// Code generated by pegomock. DO NOT EDIT. +package matchers + +import ( + "github.com/petergtz/pegomock" + "reflect" + + slack "github.com/nlopes/slack" +) + +func AnyPtrToSlackGetConversationsParameters() *slack.GetConversationsParameters { + pegomock.RegisterMatcher(pegomock.NewAnyMatcher(reflect.TypeOf((*(*slack.GetConversationsParameters))(nil)).Elem())) + var nullValue *slack.GetConversationsParameters + return nullValue +} + +func EqPtrToSlackGetConversationsParameters(value *slack.GetConversationsParameters) *slack.GetConversationsParameters { + pegomock.RegisterMatcher(&pegomock.EqMatcher{Value: value}) + var nullValue *slack.GetConversationsParameters + return nullValue +} + +func NotEqPtrToSlackGetConversationsParameters(value *slack.GetConversationsParameters) *slack.GetConversationsParameters { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *slack.GetConversationsParameters + return nullValue +} + +func PtrToSlackGetConversationsParametersThat(matcher pegomock.ArgumentMatcher) *slack.GetConversationsParameters { + pegomock.RegisterMatcher(matcher) + var nullValue *slack.GetConversationsParameters + return nullValue +} diff --git a/server/logging/mocks/mock_simple_logging.go b/server/logging/mocks/mock_simple_logging.go index ed2eb414b..3efaa7b0c 100644 --- a/server/logging/mocks/mock_simple_logging.go +++ b/server/logging/mocks/mock_simple_logging.go @@ -139,6 +139,21 @@ func (mock *MockSimpleLogging) GetHistory() string { return ret0 } +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) VerifyWasCalledOnce() *VerifierMockSimpleLogging { return &VerifierMockSimpleLogging{ mock: mock, @@ -488,3 +503,20 @@ func (c *MockSimpleLogging_GetHistory_OngoingVerification) GetCapturedArguments( func (c *MockSimpleLogging_GetHistory_OngoingVerification) GetAllCapturedArguments() { } + +func (verifier *VerifierMockSimpleLogging) Flush() *MockSimpleLogging_Flush_OngoingVerification { + params := []pegomock.Param{} + methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Flush", params, verifier.timeout) + 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() { +} diff --git a/server/mocks/matchers/io_writer.go b/server/mocks/matchers/io_writer.go index 50346e327..856053322 100644 --- a/server/mocks/matchers/io_writer.go +++ b/server/mocks/matchers/io_writer.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + io "io" ) @@ -18,3 +19,15 @@ func EqIoWriter(value io.Writer) io.Writer { var nullValue io.Writer return nullValue } + +func NotEqIoWriter(value io.Writer) io.Writer { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue io.Writer + return nullValue +} + +func IoWriterThat(matcher pegomock.ArgumentMatcher) io.Writer { + pegomock.RegisterMatcher(matcher) + var nullValue io.Writer + return nullValue +} diff --git a/server/mocks/matchers/ptr_to_http_request.go b/server/mocks/matchers/ptr_to_http_request.go index 806038bbe..dfbfc1867 100644 --- a/server/mocks/matchers/ptr_to_http_request.go +++ b/server/mocks/matchers/ptr_to_http_request.go @@ -2,8 +2,9 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" + "reflect" + http "net/http" ) @@ -18,3 +19,15 @@ func EqPtrToHttpRequest(value *http.Request) *http.Request { var nullValue *http.Request return nullValue } + +func NotEqPtrToHttpRequest(value *http.Request) *http.Request { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue *http.Request + return nullValue +} + +func PtrToHttpRequestThat(matcher pegomock.ArgumentMatcher) *http.Request { + pegomock.RegisterMatcher(matcher) + var nullValue *http.Request + return nullValue +} diff --git a/server/mocks/matchers/slice_of_byte.go b/server/mocks/matchers/slice_of_byte.go index 9a9894fa0..951531345 100644 --- a/server/mocks/matchers/slice_of_byte.go +++ b/server/mocks/matchers/slice_of_byte.go @@ -2,9 +2,8 @@ package matchers import ( - "reflect" "github.com/petergtz/pegomock" - + "reflect" ) func AnySliceOfByte() []byte { @@ -18,3 +17,15 @@ func EqSliceOfByte(value []byte) []byte { var nullValue []byte return nullValue } + +func NotEqSliceOfByte(value []byte) []byte { + pegomock.RegisterMatcher(&pegomock.NotEqMatcher{Value: value}) + var nullValue []byte + return nullValue +} + +func SliceOfByteThat(matcher pegomock.ArgumentMatcher) []byte { + pegomock.RegisterMatcher(matcher) + var nullValue []byte + return nullValue +} diff --git a/server/mocks/mock_azuredevops_request_validator.go b/server/mocks/mock_azuredevops_request_validator.go index f32ab4f36..ac84f5185 100644 --- a/server/mocks/mock_azuredevops_request_validator.go +++ b/server/mocks/mock_azuredevops_request_validator.go @@ -51,14 +51,14 @@ func (mock *MockAzureDevopsRequestValidator) VerifyWasCalledOnce() *VerifierMock } } -func (mock *MockAzureDevopsRequestValidator) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockAzureDevopsRequestValidator { +func (mock *MockAzureDevopsRequestValidator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockAzureDevopsRequestValidator { return &VerifierMockAzureDevopsRequestValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockAzureDevopsRequestValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockAzureDevopsRequestValidator { +func (mock *MockAzureDevopsRequestValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockAzureDevopsRequestValidator { return &VerifierMockAzureDevopsRequestValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockAzureDevopsRequestValidator) VerifyWasCalledInOrder(invocationCo } } -func (mock *MockAzureDevopsRequestValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockAzureDevopsRequestValidator { +func (mock *MockAzureDevopsRequestValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockAzureDevopsRequestValidator { return &VerifierMockAzureDevopsRequestValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockAzureDevopsRequestValidator) VerifyWasCalledEventually(invocatio type VerifierMockAzureDevopsRequestValidator struct { mock *MockAzureDevopsRequestValidator - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/mocks/mock_github_request_validator.go b/server/mocks/mock_github_request_validator.go index 00bbaeef3..70e45e9e5 100644 --- a/server/mocks/mock_github_request_validator.go +++ b/server/mocks/mock_github_request_validator.go @@ -51,14 +51,14 @@ func (mock *MockGithubRequestValidator) VerifyWasCalledOnce() *VerifierMockGithu } } -func (mock *MockGithubRequestValidator) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockGithubRequestValidator { +func (mock *MockGithubRequestValidator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockGithubRequestValidator { return &VerifierMockGithubRequestValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockGithubRequestValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGithubRequestValidator { +func (mock *MockGithubRequestValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGithubRequestValidator { return &VerifierMockGithubRequestValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockGithubRequestValidator) VerifyWasCalledInOrder(invocationCountMa } } -func (mock *MockGithubRequestValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockGithubRequestValidator { +func (mock *MockGithubRequestValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockGithubRequestValidator { return &VerifierMockGithubRequestValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockGithubRequestValidator) VerifyWasCalledEventually(invocationCoun type VerifierMockGithubRequestValidator struct { mock *MockGithubRequestValidator - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/mocks/mock_gitlab_request_parser_validator.go b/server/mocks/mock_gitlab_request_parser_validator.go index 101023ba5..ac2db9856 100644 --- a/server/mocks/mock_gitlab_request_parser_validator.go +++ b/server/mocks/mock_gitlab_request_parser_validator.go @@ -51,14 +51,14 @@ func (mock *MockGitlabRequestParserValidator) VerifyWasCalledOnce() *VerifierMoc } } -func (mock *MockGitlabRequestParserValidator) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockGitlabRequestParserValidator { +func (mock *MockGitlabRequestParserValidator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockGitlabRequestParserValidator { return &VerifierMockGitlabRequestParserValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockGitlabRequestParserValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGitlabRequestParserValidator { +func (mock *MockGitlabRequestParserValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGitlabRequestParserValidator { return &VerifierMockGitlabRequestParserValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -66,7 +66,7 @@ func (mock *MockGitlabRequestParserValidator) VerifyWasCalledInOrder(invocationC } } -func (mock *MockGitlabRequestParserValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockGitlabRequestParserValidator { +func (mock *MockGitlabRequestParserValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockGitlabRequestParserValidator { return &VerifierMockGitlabRequestParserValidator{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -76,7 +76,7 @@ func (mock *MockGitlabRequestParserValidator) VerifyWasCalledEventually(invocati type VerifierMockGitlabRequestParserValidator struct { mock *MockGitlabRequestParserValidator - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration } diff --git a/server/mocks/mock_template_writer.go b/server/mocks/mock_template_writer.go index 637a7b428..11bfd3575 100644 --- a/server/mocks/mock_template_writer.go +++ b/server/mocks/mock_template_writer.go @@ -47,14 +47,14 @@ func (mock *MockTemplateWriter) VerifyWasCalledOnce() *VerifierMockTemplateWrite } } -func (mock *MockTemplateWriter) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockTemplateWriter { +func (mock *MockTemplateWriter) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockTemplateWriter { return &VerifierMockTemplateWriter{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } -func (mock *MockTemplateWriter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockTemplateWriter { +func (mock *MockTemplateWriter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockTemplateWriter { return &VerifierMockTemplateWriter{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -62,7 +62,7 @@ func (mock *MockTemplateWriter) VerifyWasCalledInOrder(invocationCountMatcher pe } } -func (mock *MockTemplateWriter) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockTemplateWriter { +func (mock *MockTemplateWriter) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockTemplateWriter { return &VerifierMockTemplateWriter{ mock: mock, invocationCountMatcher: invocationCountMatcher, @@ -72,7 +72,7 @@ func (mock *MockTemplateWriter) VerifyWasCalledEventually(invocationCountMatcher type VerifierMockTemplateWriter struct { mock *MockTemplateWriter - invocationCountMatcher pegomock.Matcher + invocationCountMatcher pegomock.InvocationCountMatcher inOrderContext *pegomock.InOrderContext timeout time.Duration }