mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-30 18:08:42 +00:00
362 lines
15 KiB
Go
362 lines
15 KiB
Go
// Code generated by pegomock. DO NOT EDIT.
|
|
// Source: github.com/runatlantis/atlantis/server/events (interfaces: CommitStatusUpdater)
|
|
|
|
package mocks
|
|
|
|
import (
|
|
pegomock "github.com/petergtz/pegomock/v4"
|
|
command "github.com/runatlantis/atlantis/server/events/command"
|
|
models "github.com/runatlantis/atlantis/server/events/models"
|
|
logging "github.com/runatlantis/atlantis/server/logging"
|
|
"reflect"
|
|
"time"
|
|
)
|
|
|
|
type MockCommitStatusUpdater struct {
|
|
fail func(message string, callerSkip ...int)
|
|
}
|
|
|
|
func NewMockCommitStatusUpdater(options ...pegomock.Option) *MockCommitStatusUpdater {
|
|
mock := &MockCommitStatusUpdater{}
|
|
for _, option := range options {
|
|
option.Apply(mock)
|
|
}
|
|
return mock
|
|
}
|
|
|
|
func (mock *MockCommitStatusUpdater) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
|
|
func (mock *MockCommitStatusUpdater) FailHandler() pegomock.FailHandler { return mock.fail }
|
|
|
|
func (mock *MockCommitStatusUpdater) UpdateCombined(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, status models.CommitStatus, cmdName command.Name) error {
|
|
if mock == nil {
|
|
panic("mock must not be nil. Use myMock := NewMockCommitStatusUpdater().")
|
|
}
|
|
_params := []pegomock.Param{logger, repo, pull, status, cmdName}
|
|
_result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateCombined", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()})
|
|
var _ret0 error
|
|
if len(_result) != 0 {
|
|
if _result[0] != nil {
|
|
_ret0 = _result[0].(error)
|
|
}
|
|
}
|
|
return _ret0
|
|
}
|
|
|
|
func (mock *MockCommitStatusUpdater) UpdateCombinedCount(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, status models.CommitStatus, cmdName command.Name, numSuccess int, numTotal int) error {
|
|
if mock == nil {
|
|
panic("mock must not be nil. Use myMock := NewMockCommitStatusUpdater().")
|
|
}
|
|
_params := []pegomock.Param{logger, repo, pull, status, cmdName, numSuccess, numTotal}
|
|
_result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateCombinedCount", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()})
|
|
var _ret0 error
|
|
if len(_result) != 0 {
|
|
if _result[0] != nil {
|
|
_ret0 = _result[0].(error)
|
|
}
|
|
}
|
|
return _ret0
|
|
}
|
|
|
|
func (mock *MockCommitStatusUpdater) UpdatePostWorkflowHook(logger logging.SimpleLogging, pull models.PullRequest, status models.CommitStatus, hookDescription string, runtimeDescription string, url string) error {
|
|
if mock == nil {
|
|
panic("mock must not be nil. Use myMock := NewMockCommitStatusUpdater().")
|
|
}
|
|
_params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url}
|
|
_result := pegomock.GetGenericMockFrom(mock).Invoke("UpdatePostWorkflowHook", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()})
|
|
var _ret0 error
|
|
if len(_result) != 0 {
|
|
if _result[0] != nil {
|
|
_ret0 = _result[0].(error)
|
|
}
|
|
}
|
|
return _ret0
|
|
}
|
|
|
|
func (mock *MockCommitStatusUpdater) UpdatePreWorkflowHook(logger logging.SimpleLogging, pull models.PullRequest, status models.CommitStatus, hookDescription string, runtimeDescription string, url string) error {
|
|
if mock == nil {
|
|
panic("mock must not be nil. Use myMock := NewMockCommitStatusUpdater().")
|
|
}
|
|
_params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url}
|
|
_result := pegomock.GetGenericMockFrom(mock).Invoke("UpdatePreWorkflowHook", _params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()})
|
|
var _ret0 error
|
|
if len(_result) != 0 {
|
|
if _result[0] != nil {
|
|
_ret0 = _result[0].(error)
|
|
}
|
|
}
|
|
return _ret0
|
|
}
|
|
|
|
func (mock *MockCommitStatusUpdater) VerifyWasCalledOnce() *VerifierMockCommitStatusUpdater {
|
|
return &VerifierMockCommitStatusUpdater{
|
|
mock: mock,
|
|
invocationCountMatcher: pegomock.Times(1),
|
|
}
|
|
}
|
|
|
|
func (mock *MockCommitStatusUpdater) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockCommitStatusUpdater {
|
|
return &VerifierMockCommitStatusUpdater{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
}
|
|
}
|
|
|
|
func (mock *MockCommitStatusUpdater) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockCommitStatusUpdater {
|
|
return &VerifierMockCommitStatusUpdater{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
inOrderContext: inOrderContext,
|
|
}
|
|
}
|
|
|
|
func (mock *MockCommitStatusUpdater) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockCommitStatusUpdater {
|
|
return &VerifierMockCommitStatusUpdater{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
type VerifierMockCommitStatusUpdater struct {
|
|
mock *MockCommitStatusUpdater
|
|
invocationCountMatcher pegomock.InvocationCountMatcher
|
|
inOrderContext *pegomock.InOrderContext
|
|
timeout time.Duration
|
|
}
|
|
|
|
func (verifier *VerifierMockCommitStatusUpdater) UpdateCombined(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, status models.CommitStatus, cmdName command.Name) *MockCommitStatusUpdater_UpdateCombined_OngoingVerification {
|
|
_params := []pegomock.Param{logger, repo, pull, status, cmdName}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateCombined", _params, verifier.timeout)
|
|
return &MockCommitStatusUpdater_UpdateCombined_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type MockCommitStatusUpdater_UpdateCombined_OngoingVerification struct {
|
|
mock *MockCommitStatusUpdater
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *MockCommitStatusUpdater_UpdateCombined_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, models.CommitStatus, command.Name) {
|
|
logger, repo, pull, status, cmdName := c.GetAllCapturedArguments()
|
|
return logger[len(logger)-1], repo[len(repo)-1], pull[len(pull)-1], status[len(status)-1], cmdName[len(cmdName)-1]
|
|
}
|
|
|
|
func (c *MockCommitStatusUpdater_UpdateCombined_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []models.CommitStatus, _param4 []command.Name) {
|
|
_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([]models.Repo, len(c.methodInvocations))
|
|
for u, param := range _params[1] {
|
|
_param1[u] = param.(models.Repo)
|
|
}
|
|
}
|
|
if len(_params) > 2 {
|
|
_param2 = make([]models.PullRequest, len(c.methodInvocations))
|
|
for u, param := range _params[2] {
|
|
_param2[u] = param.(models.PullRequest)
|
|
}
|
|
}
|
|
if len(_params) > 3 {
|
|
_param3 = make([]models.CommitStatus, len(c.methodInvocations))
|
|
for u, param := range _params[3] {
|
|
_param3[u] = param.(models.CommitStatus)
|
|
}
|
|
}
|
|
if len(_params) > 4 {
|
|
_param4 = make([]command.Name, len(c.methodInvocations))
|
|
for u, param := range _params[4] {
|
|
_param4[u] = param.(command.Name)
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
func (verifier *VerifierMockCommitStatusUpdater) UpdateCombinedCount(logger logging.SimpleLogging, repo models.Repo, pull models.PullRequest, status models.CommitStatus, cmdName command.Name, numSuccess int, numTotal int) *MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification {
|
|
_params := []pegomock.Param{logger, repo, pull, status, cmdName, numSuccess, numTotal}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateCombinedCount", _params, verifier.timeout)
|
|
return &MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification struct {
|
|
mock *MockCommitStatusUpdater
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.Repo, models.PullRequest, models.CommitStatus, command.Name, int, int) {
|
|
logger, repo, pull, status, cmdName, numSuccess, numTotal := c.GetAllCapturedArguments()
|
|
return logger[len(logger)-1], repo[len(repo)-1], pull[len(pull)-1], status[len(status)-1], cmdName[len(cmdName)-1], numSuccess[len(numSuccess)-1], numTotal[len(numTotal)-1]
|
|
}
|
|
|
|
func (c *MockCommitStatusUpdater_UpdateCombinedCount_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.Repo, _param2 []models.PullRequest, _param3 []models.CommitStatus, _param4 []command.Name, _param5 []int, _param6 []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([]models.Repo, len(c.methodInvocations))
|
|
for u, param := range _params[1] {
|
|
_param1[u] = param.(models.Repo)
|
|
}
|
|
}
|
|
if len(_params) > 2 {
|
|
_param2 = make([]models.PullRequest, len(c.methodInvocations))
|
|
for u, param := range _params[2] {
|
|
_param2[u] = param.(models.PullRequest)
|
|
}
|
|
}
|
|
if len(_params) > 3 {
|
|
_param3 = make([]models.CommitStatus, len(c.methodInvocations))
|
|
for u, param := range _params[3] {
|
|
_param3[u] = param.(models.CommitStatus)
|
|
}
|
|
}
|
|
if len(_params) > 4 {
|
|
_param4 = make([]command.Name, len(c.methodInvocations))
|
|
for u, param := range _params[4] {
|
|
_param4[u] = param.(command.Name)
|
|
}
|
|
}
|
|
if len(_params) > 5 {
|
|
_param5 = make([]int, len(c.methodInvocations))
|
|
for u, param := range _params[5] {
|
|
_param5[u] = param.(int)
|
|
}
|
|
}
|
|
if len(_params) > 6 {
|
|
_param6 = make([]int, len(c.methodInvocations))
|
|
for u, param := range _params[6] {
|
|
_param6[u] = param.(int)
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
func (verifier *VerifierMockCommitStatusUpdater) UpdatePostWorkflowHook(logger logging.SimpleLogging, pull models.PullRequest, status models.CommitStatus, hookDescription string, runtimeDescription string, url string) *MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification {
|
|
_params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdatePostWorkflowHook", _params, verifier.timeout)
|
|
return &MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification struct {
|
|
mock *MockCommitStatusUpdater
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.PullRequest, models.CommitStatus, string, string, string) {
|
|
logger, pull, status, hookDescription, runtimeDescription, url := c.GetAllCapturedArguments()
|
|
return logger[len(logger)-1], pull[len(pull)-1], status[len(status)-1], hookDescription[len(hookDescription)-1], runtimeDescription[len(runtimeDescription)-1], url[len(url)-1]
|
|
}
|
|
|
|
func (c *MockCommitStatusUpdater_UpdatePostWorkflowHook_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.PullRequest, _param2 []models.CommitStatus, _param3 []string, _param4 []string, _param5 []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([]models.PullRequest, len(c.methodInvocations))
|
|
for u, param := range _params[1] {
|
|
_param1[u] = param.(models.PullRequest)
|
|
}
|
|
}
|
|
if len(_params) > 2 {
|
|
_param2 = make([]models.CommitStatus, len(c.methodInvocations))
|
|
for u, param := range _params[2] {
|
|
_param2[u] = param.(models.CommitStatus)
|
|
}
|
|
}
|
|
if len(_params) > 3 {
|
|
_param3 = make([]string, len(c.methodInvocations))
|
|
for u, param := range _params[3] {
|
|
_param3[u] = param.(string)
|
|
}
|
|
}
|
|
if len(_params) > 4 {
|
|
_param4 = make([]string, len(c.methodInvocations))
|
|
for u, param := range _params[4] {
|
|
_param4[u] = param.(string)
|
|
}
|
|
}
|
|
if len(_params) > 5 {
|
|
_param5 = make([]string, len(c.methodInvocations))
|
|
for u, param := range _params[5] {
|
|
_param5[u] = param.(string)
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
func (verifier *VerifierMockCommitStatusUpdater) UpdatePreWorkflowHook(logger logging.SimpleLogging, pull models.PullRequest, status models.CommitStatus, hookDescription string, runtimeDescription string, url string) *MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification {
|
|
_params := []pegomock.Param{logger, pull, status, hookDescription, runtimeDescription, url}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdatePreWorkflowHook", _params, verifier.timeout)
|
|
return &MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification struct {
|
|
mock *MockCommitStatusUpdater
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.PullRequest, models.CommitStatus, string, string, string) {
|
|
logger, pull, status, hookDescription, runtimeDescription, url := c.GetAllCapturedArguments()
|
|
return logger[len(logger)-1], pull[len(pull)-1], status[len(status)-1], hookDescription[len(hookDescription)-1], runtimeDescription[len(runtimeDescription)-1], url[len(url)-1]
|
|
}
|
|
|
|
func (c *MockCommitStatusUpdater_UpdatePreWorkflowHook_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.PullRequest, _param2 []models.CommitStatus, _param3 []string, _param4 []string, _param5 []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([]models.PullRequest, len(c.methodInvocations))
|
|
for u, param := range _params[1] {
|
|
_param1[u] = param.(models.PullRequest)
|
|
}
|
|
}
|
|
if len(_params) > 2 {
|
|
_param2 = make([]models.CommitStatus, len(c.methodInvocations))
|
|
for u, param := range _params[2] {
|
|
_param2[u] = param.(models.CommitStatus)
|
|
}
|
|
}
|
|
if len(_params) > 3 {
|
|
_param3 = make([]string, len(c.methodInvocations))
|
|
for u, param := range _params[3] {
|
|
_param3[u] = param.(string)
|
|
}
|
|
}
|
|
if len(_params) > 4 {
|
|
_param4 = make([]string, len(c.methodInvocations))
|
|
for u, param := range _params[4] {
|
|
_param4[u] = param.(string)
|
|
}
|
|
}
|
|
if len(_params) > 5 {
|
|
_param5 = make([]string, len(c.methodInvocations))
|
|
for u, param := range _params[5] {
|
|
_param5[u] = param.(string)
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|