mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-04 02:08:37 +00:00
92 lines
3.7 KiB
Go
92 lines
3.7 KiB
Go
// Automatically generated by pegomock. DO NOT EDIT!
|
|
// Source: github.com/runatlantis/atlantis/server/events (interfaces: CommandRunner)
|
|
|
|
package mocks
|
|
|
|
import (
|
|
"reflect"
|
|
|
|
pegomock "github.com/petergtz/pegomock"
|
|
events "github.com/runatlantis/atlantis/server/events"
|
|
models "github.com/runatlantis/atlantis/server/events/models"
|
|
vcs "github.com/runatlantis/atlantis/server/events/vcs"
|
|
)
|
|
|
|
type MockCommandRunner struct {
|
|
fail func(message string, callerSkip ...int)
|
|
}
|
|
|
|
func NewMockCommandRunner() *MockCommandRunner {
|
|
return &MockCommandRunner{fail: pegomock.GlobalFailHandler}
|
|
}
|
|
|
|
func (mock *MockCommandRunner) ExecuteCommand(baseRepo models.Repo, headRepo models.Repo, user models.User, pullNum int, cmd *events.Command, vcsHost vcs.Host) {
|
|
params := []pegomock.Param{baseRepo, headRepo, user, pullNum, cmd, vcsHost}
|
|
pegomock.GetGenericMockFrom(mock).Invoke("ExecuteCommand", params, []reflect.Type{})
|
|
}
|
|
|
|
func (mock *MockCommandRunner) VerifyWasCalledOnce() *VerifierCommandRunner {
|
|
return &VerifierCommandRunner{mock, pegomock.Times(1), nil}
|
|
}
|
|
|
|
func (mock *MockCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierCommandRunner {
|
|
return &VerifierCommandRunner{mock, invocationCountMatcher, nil}
|
|
}
|
|
|
|
func (mock *MockCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierCommandRunner {
|
|
return &VerifierCommandRunner{mock, invocationCountMatcher, inOrderContext}
|
|
}
|
|
|
|
type VerifierCommandRunner struct {
|
|
mock *MockCommandRunner
|
|
invocationCountMatcher pegomock.Matcher
|
|
inOrderContext *pegomock.InOrderContext
|
|
}
|
|
|
|
func (verifier *VerifierCommandRunner) ExecuteCommand(baseRepo models.Repo, headRepo models.Repo, user models.User, pullNum int, cmd *events.Command, vcsHost vcs.Host) *CommandRunner_ExecuteCommand_OngoingVerification {
|
|
params := []pegomock.Param{baseRepo, headRepo, user, pullNum, cmd, vcsHost}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ExecuteCommand", params)
|
|
return &CommandRunner_ExecuteCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type CommandRunner_ExecuteCommand_OngoingVerification struct {
|
|
mock *MockCommandRunner
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *CommandRunner_ExecuteCommand_OngoingVerification) GetCapturedArguments() (models.Repo, models.Repo, models.User, int, *events.Command, vcs.Host) {
|
|
baseRepo, headRepo, user, pullNum, cmd, vcsHost := c.GetAllCapturedArguments()
|
|
return baseRepo[len(baseRepo)-1], headRepo[len(headRepo)-1], user[len(user)-1], pullNum[len(pullNum)-1], cmd[len(cmd)-1], vcsHost[len(vcsHost)-1]
|
|
}
|
|
|
|
func (c *CommandRunner_ExecuteCommand_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.Repo, _param2 []models.User, _param3 []int, _param4 []*events.Command, _param5 []vcs.Host) {
|
|
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
|
|
if len(params) > 0 {
|
|
_param0 = make([]models.Repo, len(params[0]))
|
|
for u, param := range params[0] {
|
|
_param0[u] = param.(models.Repo)
|
|
}
|
|
_param1 = make([]models.Repo, len(params[1]))
|
|
for u, param := range params[1] {
|
|
_param1[u] = param.(models.Repo)
|
|
}
|
|
_param2 = make([]models.User, len(params[2]))
|
|
for u, param := range params[2] {
|
|
_param2[u] = param.(models.User)
|
|
}
|
|
_param3 = make([]int, len(params[3]))
|
|
for u, param := range params[3] {
|
|
_param3[u] = param.(int)
|
|
}
|
|
_param4 = make([]*events.Command, len(params[4]))
|
|
for u, param := range params[4] {
|
|
_param4[u] = param.(*events.Command)
|
|
}
|
|
_param5 = make([]vcs.Host, len(params[5]))
|
|
for u, param := range params[5] {
|
|
_param5[u] = param.(vcs.Host)
|
|
}
|
|
}
|
|
return
|
|
}
|