Files
atlantis/server/events/mocks/mock_project_command_builder.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

312 lines
13 KiB
Go

// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/runatlantis/atlantis/server/events (interfaces: ProjectCommandBuilder)
package mocks
import (
"reflect"
"time"
pegomock "github.com/petergtz/pegomock"
events "github.com/runatlantis/atlantis/server/events"
"github.com/runatlantis/atlantis/server/events/command"
)
type MockProjectCommandBuilder struct {
fail func(message string, callerSkip ...int)
}
func NewMockProjectCommandBuilder(options ...pegomock.Option) *MockProjectCommandBuilder {
mock := &MockProjectCommandBuilder{}
for _, option := range options {
option.Apply(mock)
}
return mock
}
func (mock *MockProjectCommandBuilder) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
func (mock *MockProjectCommandBuilder) FailHandler() pegomock.FailHandler { return mock.fail }
func (mock *MockProjectCommandBuilder) BuildAutoplanCommands(ctx *command.Context) ([]command.ProjectContext, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().")
}
params := []pegomock.Param{ctx}
result := pegomock.GetGenericMockFrom(mock).Invoke("BuildAutoplanCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 []command.ProjectContext
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].([]command.ProjectContext)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockProjectCommandBuilder) BuildPlanCommands(ctx *command.Context, comment *events.CommentCommand) ([]command.ProjectContext, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().")
}
params := []pegomock.Param{ctx, comment}
result := pegomock.GetGenericMockFrom(mock).Invoke("BuildPlanCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 []command.ProjectContext
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].([]command.ProjectContext)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockProjectCommandBuilder) BuildApplyCommands(ctx *command.Context, comment *events.CommentCommand) ([]command.ProjectContext, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().")
}
params := []pegomock.Param{ctx, comment}
result := pegomock.GetGenericMockFrom(mock).Invoke("BuildApplyCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 []command.ProjectContext
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].([]command.ProjectContext)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockProjectCommandBuilder) BuildApprovePoliciesCommands(ctx *command.Context, comment *events.CommentCommand) ([]command.ProjectContext, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().")
}
params := []pegomock.Param{ctx, comment}
result := pegomock.GetGenericMockFrom(mock).Invoke("BuildApprovePoliciesCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 []command.ProjectContext
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].([]command.ProjectContext)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockProjectCommandBuilder) BuildVersionCommands(ctx *command.Context, comment *events.CommentCommand) ([]command.ProjectContext, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockProjectCommandBuilder().")
}
params := []pegomock.Param{ctx, comment}
result := pegomock.GetGenericMockFrom(mock).Invoke("BuildVersionCommands", params, []reflect.Type{reflect.TypeOf((*[]command.ProjectContext)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 []command.ProjectContext
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].([]command.ProjectContext)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockProjectCommandBuilder) VerifyWasCalledOnce() *VerifierMockProjectCommandBuilder {
return &VerifierMockProjectCommandBuilder{
mock: mock,
invocationCountMatcher: pegomock.Times(1),
}
}
func (mock *MockProjectCommandBuilder) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockProjectCommandBuilder {
return &VerifierMockProjectCommandBuilder{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
}
}
func (mock *MockProjectCommandBuilder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockProjectCommandBuilder {
return &VerifierMockProjectCommandBuilder{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
inOrderContext: inOrderContext,
}
}
func (mock *MockProjectCommandBuilder) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockProjectCommandBuilder {
return &VerifierMockProjectCommandBuilder{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
timeout: timeout,
}
}
type VerifierMockProjectCommandBuilder struct {
mock *MockProjectCommandBuilder
invocationCountMatcher pegomock.InvocationCountMatcher
inOrderContext *pegomock.InOrderContext
timeout time.Duration
}
func (verifier *VerifierMockProjectCommandBuilder) BuildAutoplanCommands(ctx *command.Context) *MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification {
params := []pegomock.Param{ctx}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildAutoplanCommands", params, verifier.timeout)
return &MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification struct {
mock *MockProjectCommandBuilder
methodInvocations []pegomock.MethodInvocation
}
func (c *MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification) GetCapturedArguments() *command.Context {
ctx := c.GetAllCapturedArguments()
return ctx[len(ctx)-1]
}
func (c *MockProjectCommandBuilder_BuildAutoplanCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]*command.Context, len(c.methodInvocations))
for u, param := range params[0] {
_param0[u] = param.(*command.Context)
}
}
return
}
func (verifier *VerifierMockProjectCommandBuilder) BuildPlanCommands(ctx *command.Context, comment *events.CommentCommand) *MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification {
params := []pegomock.Param{ctx, comment}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildPlanCommands", params, verifier.timeout)
return &MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification struct {
mock *MockProjectCommandBuilder
methodInvocations []pegomock.MethodInvocation
}
func (c *MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) {
ctx, comment := c.GetAllCapturedArguments()
return ctx[len(ctx)-1], comment[len(comment)-1]
}
func (c *MockProjectCommandBuilder_BuildPlanCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]*command.Context, len(c.methodInvocations))
for u, param := range params[0] {
_param0[u] = param.(*command.Context)
}
_param1 = make([]*events.CommentCommand, len(c.methodInvocations))
for u, param := range params[1] {
_param1[u] = param.(*events.CommentCommand)
}
}
return
}
func (verifier *VerifierMockProjectCommandBuilder) BuildApplyCommands(ctx *command.Context, comment *events.CommentCommand) *MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification {
params := []pegomock.Param{ctx, comment}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildApplyCommands", params, verifier.timeout)
return &MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification struct {
mock *MockProjectCommandBuilder
methodInvocations []pegomock.MethodInvocation
}
func (c *MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) {
ctx, comment := c.GetAllCapturedArguments()
return ctx[len(ctx)-1], comment[len(comment)-1]
}
func (c *MockProjectCommandBuilder_BuildApplyCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]*command.Context, len(c.methodInvocations))
for u, param := range params[0] {
_param0[u] = param.(*command.Context)
}
_param1 = make([]*events.CommentCommand, len(c.methodInvocations))
for u, param := range params[1] {
_param1[u] = param.(*events.CommentCommand)
}
}
return
}
func (verifier *VerifierMockProjectCommandBuilder) BuildApprovePoliciesCommands(ctx *command.Context, comment *events.CommentCommand) *MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerification {
params := []pegomock.Param{ctx, comment}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildApprovePoliciesCommands", params, verifier.timeout)
return &MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerification struct {
mock *MockProjectCommandBuilder
methodInvocations []pegomock.MethodInvocation
}
func (c *MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) {
ctx, comment := c.GetAllCapturedArguments()
return ctx[len(ctx)-1], comment[len(comment)-1]
}
func (c *MockProjectCommandBuilder_BuildApprovePoliciesCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]*command.Context, len(c.methodInvocations))
for u, param := range params[0] {
_param0[u] = param.(*command.Context)
}
_param1 = make([]*events.CommentCommand, len(c.methodInvocations))
for u, param := range params[1] {
_param1[u] = param.(*events.CommentCommand)
}
}
return
}
func (verifier *VerifierMockProjectCommandBuilder) BuildVersionCommands(ctx *command.Context, comment *events.CommentCommand) *MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification {
params := []pegomock.Param{ctx, comment}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "BuildVersionCommands", params, verifier.timeout)
return &MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification struct {
mock *MockProjectCommandBuilder
methodInvocations []pegomock.MethodInvocation
}
func (c *MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification) GetCapturedArguments() (*command.Context, *events.CommentCommand) {
ctx, comment := c.GetAllCapturedArguments()
return ctx[len(ctx)-1], comment[len(comment)-1]
}
func (c *MockProjectCommandBuilder_BuildVersionCommands_OngoingVerification) GetAllCapturedArguments() (_param0 []*command.Context, _param1 []*events.CommentCommand) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]*command.Context, len(c.methodInvocations))
for u, param := range params[0] {
_param0[u] = param.(*command.Context)
}
_param1 = make([]*events.CommentCommand, len(c.methodInvocations))
for u, param := range params[1] {
_param1[u] = param.(*events.CommentCommand)
}
}
return
}