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