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

274 lines
11 KiB
Go

// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/runatlantis/atlantis/server/events (interfaces: CommandRequirementHandler)
package mocks
import (
pegomock "github.com/petergtz/pegomock/v4"
command "github.com/runatlantis/atlantis/server/events/command"
"reflect"
"time"
)
type MockCommandRequirementHandler struct {
fail func(message string, callerSkip ...int)
}
func NewMockCommandRequirementHandler(options ...pegomock.Option) *MockCommandRequirementHandler {
mock := &MockCommandRequirementHandler{}
for _, option := range options {
option.Apply(mock)
}
return mock
}
func (mock *MockCommandRequirementHandler) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
func (mock *MockCommandRequirementHandler) FailHandler() pegomock.FailHandler { return mock.fail }
func (mock *MockCommandRequirementHandler) ValidateApplyProject(repoDir string, ctx command.ProjectContext) (string, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockCommandRequirementHandler().")
}
_params := []pegomock.Param{repoDir, ctx}
_result := pegomock.GetGenericMockFrom(mock).Invoke("ValidateApplyProject", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var _ret0 string
var _ret1 error
if len(_result) != 0 {
if _result[0] != nil {
_ret0 = _result[0].(string)
}
if _result[1] != nil {
_ret1 = _result[1].(error)
}
}
return _ret0, _ret1
}
func (mock *MockCommandRequirementHandler) ValidateImportProject(repoDir string, ctx command.ProjectContext) (string, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockCommandRequirementHandler().")
}
_params := []pegomock.Param{repoDir, ctx}
_result := pegomock.GetGenericMockFrom(mock).Invoke("ValidateImportProject", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var _ret0 string
var _ret1 error
if len(_result) != 0 {
if _result[0] != nil {
_ret0 = _result[0].(string)
}
if _result[1] != nil {
_ret1 = _result[1].(error)
}
}
return _ret0, _ret1
}
func (mock *MockCommandRequirementHandler) ValidatePlanProject(repoDir string, ctx command.ProjectContext) (string, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockCommandRequirementHandler().")
}
_params := []pegomock.Param{repoDir, ctx}
_result := pegomock.GetGenericMockFrom(mock).Invoke("ValidatePlanProject", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var _ret0 string
var _ret1 error
if len(_result) != 0 {
if _result[0] != nil {
_ret0 = _result[0].(string)
}
if _result[1] != nil {
_ret1 = _result[1].(error)
}
}
return _ret0, _ret1
}
func (mock *MockCommandRequirementHandler) ValidateProjectDependencies(ctx command.ProjectContext) (string, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockCommandRequirementHandler().")
}
_params := []pegomock.Param{ctx}
_result := pegomock.GetGenericMockFrom(mock).Invoke("ValidateProjectDependencies", _params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var _ret0 string
var _ret1 error
if len(_result) != 0 {
if _result[0] != nil {
_ret0 = _result[0].(string)
}
if _result[1] != nil {
_ret1 = _result[1].(error)
}
}
return _ret0, _ret1
}
func (mock *MockCommandRequirementHandler) VerifyWasCalledOnce() *VerifierMockCommandRequirementHandler {
return &VerifierMockCommandRequirementHandler{
mock: mock,
invocationCountMatcher: pegomock.Times(1),
}
}
func (mock *MockCommandRequirementHandler) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCommandRequirementHandler {
return &VerifierMockCommandRequirementHandler{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
}
}
func (mock *MockCommandRequirementHandler) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommandRequirementHandler {
return &VerifierMockCommandRequirementHandler{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
inOrderContext: inOrderContext,
}
}
func (mock *MockCommandRequirementHandler) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCommandRequirementHandler {
return &VerifierMockCommandRequirementHandler{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
timeout: timeout,
}
}
type VerifierMockCommandRequirementHandler struct {
mock *MockCommandRequirementHandler
invocationCountMatcher pegomock.InvocationCountMatcher
inOrderContext *pegomock.InOrderContext
timeout time.Duration
}
func (verifier *VerifierMockCommandRequirementHandler) ValidateApplyProject(repoDir string, ctx command.ProjectContext) *MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification {
_params := []pegomock.Param{repoDir, ctx}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidateApplyProject", _params, verifier.timeout)
return &MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification struct {
mock *MockCommandRequirementHandler
methodInvocations []pegomock.MethodInvocation
}
func (c *MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification) GetCapturedArguments() (string, command.ProjectContext) {
repoDir, ctx := c.GetAllCapturedArguments()
return repoDir[len(repoDir)-1], ctx[len(ctx)-1]
}
func (c *MockCommandRequirementHandler_ValidateApplyProject_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []command.ProjectContext) {
_params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(_params) > 0 {
if len(_params) > 0 {
_param0 = make([]string, len(c.methodInvocations))
for u, param := range _params[0] {
_param0[u] = param.(string)
}
}
if len(_params) > 1 {
_param1 = make([]command.ProjectContext, len(c.methodInvocations))
for u, param := range _params[1] {
_param1[u] = param.(command.ProjectContext)
}
}
}
return
}
func (verifier *VerifierMockCommandRequirementHandler) ValidateImportProject(repoDir string, ctx command.ProjectContext) *MockCommandRequirementHandler_ValidateImportProject_OngoingVerification {
_params := []pegomock.Param{repoDir, ctx}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidateImportProject", _params, verifier.timeout)
return &MockCommandRequirementHandler_ValidateImportProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockCommandRequirementHandler_ValidateImportProject_OngoingVerification struct {
mock *MockCommandRequirementHandler
methodInvocations []pegomock.MethodInvocation
}
func (c *MockCommandRequirementHandler_ValidateImportProject_OngoingVerification) GetCapturedArguments() (string, command.ProjectContext) {
repoDir, ctx := c.GetAllCapturedArguments()
return repoDir[len(repoDir)-1], ctx[len(ctx)-1]
}
func (c *MockCommandRequirementHandler_ValidateImportProject_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []command.ProjectContext) {
_params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(_params) > 0 {
if len(_params) > 0 {
_param0 = make([]string, len(c.methodInvocations))
for u, param := range _params[0] {
_param0[u] = param.(string)
}
}
if len(_params) > 1 {
_param1 = make([]command.ProjectContext, len(c.methodInvocations))
for u, param := range _params[1] {
_param1[u] = param.(command.ProjectContext)
}
}
}
return
}
func (verifier *VerifierMockCommandRequirementHandler) ValidatePlanProject(repoDir string, ctx command.ProjectContext) *MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification {
_params := []pegomock.Param{repoDir, ctx}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidatePlanProject", _params, verifier.timeout)
return &MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification struct {
mock *MockCommandRequirementHandler
methodInvocations []pegomock.MethodInvocation
}
func (c *MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification) GetCapturedArguments() (string, command.ProjectContext) {
repoDir, ctx := c.GetAllCapturedArguments()
return repoDir[len(repoDir)-1], ctx[len(ctx)-1]
}
func (c *MockCommandRequirementHandler_ValidatePlanProject_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []command.ProjectContext) {
_params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(_params) > 0 {
if len(_params) > 0 {
_param0 = make([]string, len(c.methodInvocations))
for u, param := range _params[0] {
_param0[u] = param.(string)
}
}
if len(_params) > 1 {
_param1 = make([]command.ProjectContext, len(c.methodInvocations))
for u, param := range _params[1] {
_param1[u] = param.(command.ProjectContext)
}
}
}
return
}
func (verifier *VerifierMockCommandRequirementHandler) ValidateProjectDependencies(ctx command.ProjectContext) *MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerification {
_params := []pegomock.Param{ctx}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ValidateProjectDependencies", _params, verifier.timeout)
return &MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerification struct {
mock *MockCommandRequirementHandler
methodInvocations []pegomock.MethodInvocation
}
func (c *MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerification) GetCapturedArguments() command.ProjectContext {
ctx := c.GetAllCapturedArguments()
return ctx[len(ctx)-1]
}
func (c *MockCommandRequirementHandler_ValidateProjectDependencies_OngoingVerification) GetAllCapturedArguments() (_param0 []command.ProjectContext) {
_params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(_params) > 0 {
if len(_params) > 0 {
_param0 = make([]command.ProjectContext, len(c.methodInvocations))
for u, param := range _params[0] {
_param0[u] = param.(command.ProjectContext)
}
}
}
return
}