Files
atlantis/server/events/mocks/mock_delete_lock_command.go
2024-11-16 15:00:42 +00:00

179 lines
6.7 KiB
Go

// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/runatlantis/atlantis/server/events (interfaces: DeleteLockCommand)
package mocks
import (
pegomock "github.com/petergtz/pegomock/v4"
models "github.com/runatlantis/atlantis/server/events/models"
logging "github.com/runatlantis/atlantis/server/logging"
"reflect"
"time"
)
type MockDeleteLockCommand struct {
fail func(message string, callerSkip ...int)
}
func NewMockDeleteLockCommand(options ...pegomock.Option) *MockDeleteLockCommand {
mock := &MockDeleteLockCommand{}
for _, option := range options {
option.Apply(mock)
}
return mock
}
func (mock *MockDeleteLockCommand) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
func (mock *MockDeleteLockCommand) FailHandler() pegomock.FailHandler { return mock.fail }
func (mock *MockDeleteLockCommand) DeleteLock(logger logging.SimpleLogging, id string) (*models.ProjectLock, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockDeleteLockCommand().")
}
_params := []pegomock.Param{logger, id}
_result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteLock", _params, []reflect.Type{reflect.TypeOf((**models.ProjectLock)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var _ret0 *models.ProjectLock
var _ret1 error
if len(_result) != 0 {
if _result[0] != nil {
_ret0 = _result[0].(*models.ProjectLock)
}
if _result[1] != nil {
_ret1 = _result[1].(error)
}
}
return _ret0, _ret1
}
func (mock *MockDeleteLockCommand) DeleteLocksByPull(logger logging.SimpleLogging, repoFullName string, pullNum int) (int, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockDeleteLockCommand().")
}
_params := []pegomock.Param{logger, repoFullName, pullNum}
_result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteLocksByPull", _params, []reflect.Type{reflect.TypeOf((*int)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var _ret0 int
var _ret1 error
if len(_result) != 0 {
if _result[0] != nil {
_ret0 = _result[0].(int)
}
if _result[1] != nil {
_ret1 = _result[1].(error)
}
}
return _ret0, _ret1
}
func (mock *MockDeleteLockCommand) VerifyWasCalledOnce() *VerifierMockDeleteLockCommand {
return &VerifierMockDeleteLockCommand{
mock: mock,
invocationCountMatcher: pegomock.Times(1),
}
}
func (mock *MockDeleteLockCommand) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockDeleteLockCommand {
return &VerifierMockDeleteLockCommand{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
}
}
func (mock *MockDeleteLockCommand) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockDeleteLockCommand {
return &VerifierMockDeleteLockCommand{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
inOrderContext: inOrderContext,
}
}
func (mock *MockDeleteLockCommand) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockDeleteLockCommand {
return &VerifierMockDeleteLockCommand{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
timeout: timeout,
}
}
type VerifierMockDeleteLockCommand struct {
mock *MockDeleteLockCommand
invocationCountMatcher pegomock.InvocationCountMatcher
inOrderContext *pegomock.InOrderContext
timeout time.Duration
}
func (verifier *VerifierMockDeleteLockCommand) DeleteLock(logger logging.SimpleLogging, id string) *MockDeleteLockCommand_DeleteLock_OngoingVerification {
_params := []pegomock.Param{logger, id}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteLock", _params, verifier.timeout)
return &MockDeleteLockCommand_DeleteLock_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockDeleteLockCommand_DeleteLock_OngoingVerification struct {
mock *MockDeleteLockCommand
methodInvocations []pegomock.MethodInvocation
}
func (c *MockDeleteLockCommand_DeleteLock_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, string) {
logger, id := c.GetAllCapturedArguments()
return logger[len(logger)-1], id[len(id)-1]
}
func (c *MockDeleteLockCommand_DeleteLock_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []string) {
_params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(_params) > 0 {
if len(_params) > 0 {
_param0 = make([]logging.SimpleLogging, len(c.methodInvocations))
for u, param := range _params[0] {
_param0[u] = param.(logging.SimpleLogging)
}
}
if len(_params) > 1 {
_param1 = make([]string, len(c.methodInvocations))
for u, param := range _params[1] {
_param1[u] = param.(string)
}
}
}
return
}
func (verifier *VerifierMockDeleteLockCommand) DeleteLocksByPull(logger logging.SimpleLogging, repoFullName string, pullNum int) *MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification {
_params := []pegomock.Param{logger, repoFullName, pullNum}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteLocksByPull", _params, verifier.timeout)
return &MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification struct {
mock *MockDeleteLockCommand
methodInvocations []pegomock.MethodInvocation
}
func (c *MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, string, int) {
logger, repoFullName, pullNum := c.GetAllCapturedArguments()
return logger[len(logger)-1], repoFullName[len(repoFullName)-1], pullNum[len(pullNum)-1]
}
func (c *MockDeleteLockCommand_DeleteLocksByPull_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []string, _param2 []int) {
_params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(_params) > 0 {
if len(_params) > 0 {
_param0 = make([]logging.SimpleLogging, len(c.methodInvocations))
for u, param := range _params[0] {
_param0[u] = param.(logging.SimpleLogging)
}
}
if len(_params) > 1 {
_param1 = make([]string, len(c.methodInvocations))
for u, param := range _params[1] {
_param1[u] = param.(string)
}
}
if len(_params) > 2 {
_param2 = make([]int, len(c.methodInvocations))
for u, param := range _params[2] {
_param2[u] = param.(int)
}
}
}
return
}