mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-28 19:38:24 +00:00
119 lines
4.5 KiB
Go
119 lines
4.5 KiB
Go
// Code generated by pegomock. DO NOT EDIT.
|
|
// Source: github.com/runatlantis/atlantis/server/events/vcs (interfaces: PullReqStatusFetcher)
|
|
|
|
package mocks
|
|
|
|
import (
|
|
pegomock "github.com/petergtz/pegomock/v4"
|
|
models "github.com/runatlantis/atlantis/server/events/models"
|
|
logging "github.com/runatlantis/atlantis/server/logging"
|
|
"reflect"
|
|
"time"
|
|
)
|
|
|
|
type MockPullReqStatusFetcher struct {
|
|
fail func(message string, callerSkip ...int)
|
|
}
|
|
|
|
func NewMockPullReqStatusFetcher(options ...pegomock.Option) *MockPullReqStatusFetcher {
|
|
mock := &MockPullReqStatusFetcher{}
|
|
for _, option := range options {
|
|
option.Apply(mock)
|
|
}
|
|
return mock
|
|
}
|
|
|
|
func (mock *MockPullReqStatusFetcher) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
|
|
func (mock *MockPullReqStatusFetcher) FailHandler() pegomock.FailHandler { return mock.fail }
|
|
|
|
func (mock *MockPullReqStatusFetcher) FetchPullStatus(logger logging.SimpleLogging, pull models.PullRequest) (models.PullReqStatus, error) {
|
|
if mock == nil {
|
|
panic("mock must not be nil. Use myMock := NewMockPullReqStatusFetcher().")
|
|
}
|
|
_params := []pegomock.Param{logger, pull}
|
|
_result := pegomock.GetGenericMockFrom(mock).Invoke("FetchPullStatus", _params, []reflect.Type{reflect.TypeOf((*models.PullReqStatus)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
|
|
var _ret0 models.PullReqStatus
|
|
var _ret1 error
|
|
if len(_result) != 0 {
|
|
if _result[0] != nil {
|
|
_ret0 = _result[0].(models.PullReqStatus)
|
|
}
|
|
if _result[1] != nil {
|
|
_ret1 = _result[1].(error)
|
|
}
|
|
}
|
|
return _ret0, _ret1
|
|
}
|
|
|
|
func (mock *MockPullReqStatusFetcher) VerifyWasCalledOnce() *VerifierMockPullReqStatusFetcher {
|
|
return &VerifierMockPullReqStatusFetcher{
|
|
mock: mock,
|
|
invocationCountMatcher: pegomock.Times(1),
|
|
}
|
|
}
|
|
|
|
func (mock *MockPullReqStatusFetcher) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockPullReqStatusFetcher {
|
|
return &VerifierMockPullReqStatusFetcher{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
}
|
|
}
|
|
|
|
func (mock *MockPullReqStatusFetcher) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockPullReqStatusFetcher {
|
|
return &VerifierMockPullReqStatusFetcher{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
inOrderContext: inOrderContext,
|
|
}
|
|
}
|
|
|
|
func (mock *MockPullReqStatusFetcher) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockPullReqStatusFetcher {
|
|
return &VerifierMockPullReqStatusFetcher{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
type VerifierMockPullReqStatusFetcher struct {
|
|
mock *MockPullReqStatusFetcher
|
|
invocationCountMatcher pegomock.InvocationCountMatcher
|
|
inOrderContext *pegomock.InOrderContext
|
|
timeout time.Duration
|
|
}
|
|
|
|
func (verifier *VerifierMockPullReqStatusFetcher) FetchPullStatus(logger logging.SimpleLogging, pull models.PullRequest) *MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification {
|
|
_params := []pegomock.Param{logger, pull}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "FetchPullStatus", _params, verifier.timeout)
|
|
return &MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification struct {
|
|
mock *MockPullReqStatusFetcher
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification) GetCapturedArguments() (logging.SimpleLogging, models.PullRequest) {
|
|
logger, pull := c.GetAllCapturedArguments()
|
|
return logger[len(logger)-1], pull[len(pull)-1]
|
|
}
|
|
|
|
func (c *MockPullReqStatusFetcher_FetchPullStatus_OngoingVerification) GetAllCapturedArguments() (_param0 []logging.SimpleLogging, _param1 []models.PullRequest) {
|
|
_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)
|
|
}
|
|
}
|
|
}
|
|
return
|
|
}
|