Files
atlantis/server/events/mocks/mock_apply_command_locker.go
Sarvar Muminov 90e92e3a13 chore: move CommandContext and CommandResult to models (#193) (#2093)
* Moved CommandContext and CommandResult to models (#193)

* Moved CommandContext and CommandResult to models

* move from models to command

rename CommandContext -> Context
rename CommandResult -> Result

* moved command related helpers into command package

* move ProjectCommandContext and ProjectResult to command/project package

* move project command context and project result

* revert unrelated code

* move tests

* fix left over

* fix linting

* fix tests

* remove unused import

* fix project context dependencies

* fix depenedecies

* fix typo
2022-03-21 10:36:13 -07:00

107 lines
3.7 KiB
Go

// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/runatlantis/atlantis/server/events (interfaces: ApplyCommandLocker)
package mocks
import (
"reflect"
"time"
pegomock "github.com/petergtz/pegomock"
"github.com/runatlantis/atlantis/server/events/command"
)
type MockApplyCommandLocker struct {
fail func(message string, callerSkip ...int)
}
func NewMockApplyCommandLocker(options ...pegomock.Option) *MockApplyCommandLocker {
mock := &MockApplyCommandLocker{}
for _, option := range options {
option.Apply(mock)
}
return mock
}
func (mock *MockApplyCommandLocker) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
func (mock *MockApplyCommandLocker) FailHandler() pegomock.FailHandler { return mock.fail }
func (mock *MockApplyCommandLocker) IsDisabled(ctx *command.Context) bool {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockApplyCommandLocker().")
}
params := []pegomock.Param{ctx}
result := pegomock.GetGenericMockFrom(mock).Invoke("IsDisabled", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()})
var ret0 bool
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(bool)
}
}
return ret0
}
func (mock *MockApplyCommandLocker) VerifyWasCalledOnce() *VerifierMockApplyCommandLocker {
return &VerifierMockApplyCommandLocker{
mock: mock,
invocationCountMatcher: pegomock.Times(1),
}
}
func (mock *MockApplyCommandLocker) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockApplyCommandLocker {
return &VerifierMockApplyCommandLocker{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
}
}
func (mock *MockApplyCommandLocker) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockApplyCommandLocker {
return &VerifierMockApplyCommandLocker{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
inOrderContext: inOrderContext,
}
}
func (mock *MockApplyCommandLocker) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockApplyCommandLocker {
return &VerifierMockApplyCommandLocker{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
timeout: timeout,
}
}
type VerifierMockApplyCommandLocker struct {
mock *MockApplyCommandLocker
invocationCountMatcher pegomock.Matcher
inOrderContext *pegomock.InOrderContext
timeout time.Duration
}
func (verifier *VerifierMockApplyCommandLocker) IsDisabled(ctx *command.Context) *MockApplyCommandLocker_IsDisabled_OngoingVerification {
params := []pegomock.Param{ctx}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "IsDisabled", params, verifier.timeout)
return &MockApplyCommandLocker_IsDisabled_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockApplyCommandLocker_IsDisabled_OngoingVerification struct {
mock *MockApplyCommandLocker
methodInvocations []pegomock.MethodInvocation
}
func (c *MockApplyCommandLocker_IsDisabled_OngoingVerification) GetCapturedArguments() *command.Context {
ctx := c.GetAllCapturedArguments()
return ctx[len(ctx)-1]
}
func (c *MockApplyCommandLocker_IsDisabled_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]*command.Context, len(c.methodInvocations))
for u, param := range params[0] {
_param0[u] = param.(*command.Context)
}
}
return
}