mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-31 00:48:45 +00:00
* disable pegomock --use-experimental-model-gen, cause random fail by segv * make regen-mocks * fix mock code which uses non experimental pegomock codes
167 lines
7.2 KiB
Go
167 lines
7.2 KiB
Go
// Code generated by pegomock. DO NOT EDIT.
|
|
// Source: github.com/runatlantis/atlantis/server/events (interfaces: CommandRunner)
|
|
|
|
package mocks
|
|
|
|
import (
|
|
pegomock "github.com/petergtz/pegomock"
|
|
events "github.com/runatlantis/atlantis/server/events"
|
|
models "github.com/runatlantis/atlantis/server/events/models"
|
|
"reflect"
|
|
"time"
|
|
)
|
|
|
|
type MockCommandRunner struct {
|
|
fail func(message string, callerSkip ...int)
|
|
}
|
|
|
|
func NewMockCommandRunner(options ...pegomock.Option) *MockCommandRunner {
|
|
mock := &MockCommandRunner{}
|
|
for _, option := range options {
|
|
option.Apply(mock)
|
|
}
|
|
return mock
|
|
}
|
|
|
|
func (mock *MockCommandRunner) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
|
|
func (mock *MockCommandRunner) FailHandler() pegomock.FailHandler { return mock.fail }
|
|
|
|
func (mock *MockCommandRunner) RunAutoplanCommand(_param0 models.Repo, _param1 models.Repo, _param2 models.PullRequest, _param3 models.User) {
|
|
if mock == nil {
|
|
panic("mock must not be nil. Use myMock := NewMockCommandRunner().")
|
|
}
|
|
params := []pegomock.Param{_param0, _param1, _param2, _param3}
|
|
pegomock.GetGenericMockFrom(mock).Invoke("RunAutoplanCommand", params, []reflect.Type{})
|
|
}
|
|
|
|
func (mock *MockCommandRunner) RunCommentCommand(_param0 models.Repo, _param1 *models.Repo, _param2 *models.PullRequest, _param3 models.User, _param4 int, _param5 *events.CommentCommand) {
|
|
if mock == nil {
|
|
panic("mock must not be nil. Use myMock := NewMockCommandRunner().")
|
|
}
|
|
params := []pegomock.Param{_param0, _param1, _param2, _param3, _param4, _param5}
|
|
pegomock.GetGenericMockFrom(mock).Invoke("RunCommentCommand", params, []reflect.Type{})
|
|
}
|
|
|
|
func (mock *MockCommandRunner) VerifyWasCalledOnce() *VerifierMockCommandRunner {
|
|
return &VerifierMockCommandRunner{
|
|
mock: mock,
|
|
invocationCountMatcher: pegomock.Times(1),
|
|
}
|
|
}
|
|
|
|
func (mock *MockCommandRunner) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCommandRunner {
|
|
return &VerifierMockCommandRunner{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
}
|
|
}
|
|
|
|
func (mock *MockCommandRunner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommandRunner {
|
|
return &VerifierMockCommandRunner{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
inOrderContext: inOrderContext,
|
|
}
|
|
}
|
|
|
|
func (mock *MockCommandRunner) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCommandRunner {
|
|
return &VerifierMockCommandRunner{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
type VerifierMockCommandRunner struct {
|
|
mock *MockCommandRunner
|
|
invocationCountMatcher pegomock.InvocationCountMatcher
|
|
inOrderContext *pegomock.InOrderContext
|
|
timeout time.Duration
|
|
}
|
|
|
|
func (verifier *VerifierMockCommandRunner) RunAutoplanCommand(_param0 models.Repo, _param1 models.Repo, _param2 models.PullRequest, _param3 models.User) *MockCommandRunner_RunAutoplanCommand_OngoingVerification {
|
|
params := []pegomock.Param{_param0, _param1, _param2, _param3}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunAutoplanCommand", params, verifier.timeout)
|
|
return &MockCommandRunner_RunAutoplanCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type MockCommandRunner_RunAutoplanCommand_OngoingVerification struct {
|
|
mock *MockCommandRunner
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *MockCommandRunner_RunAutoplanCommand_OngoingVerification) GetCapturedArguments() (models.Repo, models.Repo, models.PullRequest, models.User) {
|
|
_param0, _param1, _param2, _param3 := c.GetAllCapturedArguments()
|
|
return _param0[len(_param0)-1], _param1[len(_param1)-1], _param2[len(_param2)-1], _param3[len(_param3)-1]
|
|
}
|
|
|
|
func (c *MockCommandRunner_RunAutoplanCommand_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []models.User) {
|
|
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
|
|
if len(params) > 0 {
|
|
_param0 = make([]models.Repo, len(c.methodInvocations))
|
|
for u, param := range params[0] {
|
|
_param0[u] = param.(models.Repo)
|
|
}
|
|
_param1 = make([]models.Repo, len(c.methodInvocations))
|
|
for u, param := range params[1] {
|
|
_param1[u] = param.(models.Repo)
|
|
}
|
|
_param2 = make([]models.PullRequest, len(c.methodInvocations))
|
|
for u, param := range params[2] {
|
|
_param2[u] = param.(models.PullRequest)
|
|
}
|
|
_param3 = make([]models.User, len(c.methodInvocations))
|
|
for u, param := range params[3] {
|
|
_param3[u] = param.(models.User)
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
func (verifier *VerifierMockCommandRunner) RunCommentCommand(_param0 models.Repo, _param1 *models.Repo, _param2 *models.PullRequest, _param3 models.User, _param4 int, _param5 *events.CommentCommand) *MockCommandRunner_RunCommentCommand_OngoingVerification {
|
|
params := []pegomock.Param{_param0, _param1, _param2, _param3, _param4, _param5}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "RunCommentCommand", params, verifier.timeout)
|
|
return &MockCommandRunner_RunCommentCommand_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type MockCommandRunner_RunCommentCommand_OngoingVerification struct {
|
|
mock *MockCommandRunner
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *MockCommandRunner_RunCommentCommand_OngoingVerification) GetCapturedArguments() (models.Repo, *models.Repo, *models.PullRequest, models.User, int, *events.CommentCommand) {
|
|
_param0, _param1, _param2, _param3, _param4, _param5 := c.GetAllCapturedArguments()
|
|
return _param0[len(_param0)-1], _param1[len(_param1)-1], _param2[len(_param2)-1], _param3[len(_param3)-1], _param4[len(_param4)-1], _param5[len(_param5)-1]
|
|
}
|
|
|
|
func (c *MockCommandRunner_RunCommentCommand_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []*models.Repo, _param2 []*models.PullRequest, _param3 []models.User, _param4 []int, _param5 []*events.CommentCommand) {
|
|
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
|
|
if len(params) > 0 {
|
|
_param0 = make([]models.Repo, len(c.methodInvocations))
|
|
for u, param := range params[0] {
|
|
_param0[u] = param.(models.Repo)
|
|
}
|
|
_param1 = make([]*models.Repo, len(c.methodInvocations))
|
|
for u, param := range params[1] {
|
|
_param1[u] = param.(*models.Repo)
|
|
}
|
|
_param2 = make([]*models.PullRequest, len(c.methodInvocations))
|
|
for u, param := range params[2] {
|
|
_param2[u] = param.(*models.PullRequest)
|
|
}
|
|
_param3 = make([]models.User, len(c.methodInvocations))
|
|
for u, param := range params[3] {
|
|
_param3[u] = param.(models.User)
|
|
}
|
|
_param4 = make([]int, len(c.methodInvocations))
|
|
for u, param := range params[4] {
|
|
_param4[u] = param.(int)
|
|
}
|
|
_param5 = make([]*events.CommentCommand, len(c.methodInvocations))
|
|
for u, param := range params[5] {
|
|
_param5[u] = param.(*events.CommentCommand)
|
|
}
|
|
}
|
|
return
|
|
}
|