Files
atlantis/server/events/mocks/mock_pull_cleaner.go
2018-12-11 08:31:59 -06:00

103 lines
3.4 KiB
Go

// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/runatlantis/atlantis/server/events (interfaces: PullCleaner)
package mocks
import (
pegomock "github.com/petergtz/pegomock"
models "github.com/runatlantis/atlantis/server/events/models"
"reflect"
"time"
)
type MockPullCleaner struct {
fail func(message string, callerSkip ...int)
}
func NewMockPullCleaner() *MockPullCleaner {
return &MockPullCleaner{fail: pegomock.GlobalFailHandler}
}
func (mock *MockPullCleaner) CleanUpPull(repo models.Repo, pull models.PullRequest) error {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockPullCleaner().")
}
params := []pegomock.Param{repo, pull}
result := pegomock.GetGenericMockFrom(mock).Invoke("CleanUpPull", 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 *MockPullCleaner) VerifyWasCalledOnce() *VerifierPullCleaner {
return &VerifierPullCleaner{
mock: mock,
invocationCountMatcher: pegomock.Times(1),
}
}
func (mock *MockPullCleaner) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierPullCleaner {
return &VerifierPullCleaner{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
}
}
func (mock *MockPullCleaner) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierPullCleaner {
return &VerifierPullCleaner{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
inOrderContext: inOrderContext,
}
}
func (mock *MockPullCleaner) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierPullCleaner {
return &VerifierPullCleaner{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
timeout: timeout,
}
}
type VerifierPullCleaner struct {
mock *MockPullCleaner
invocationCountMatcher pegomock.Matcher
inOrderContext *pegomock.InOrderContext
timeout time.Duration
}
func (verifier *VerifierPullCleaner) CleanUpPull(repo models.Repo, pull models.PullRequest) *PullCleaner_CleanUpPull_OngoingVerification {
params := []pegomock.Param{repo, pull}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CleanUpPull", params, verifier.timeout)
return &PullCleaner_CleanUpPull_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type PullCleaner_CleanUpPull_OngoingVerification struct {
mock *MockPullCleaner
methodInvocations []pegomock.MethodInvocation
}
func (c *PullCleaner_CleanUpPull_OngoingVerification) GetCapturedArguments() (models.Repo, models.PullRequest) {
repo, pull := c.GetAllCapturedArguments()
return repo[len(repo)-1], pull[len(pull)-1]
}
func (c *PullCleaner_CleanUpPull_OngoingVerification) GetAllCapturedArguments() (_param0 []models.Repo, _param1 []models.PullRequest) {
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.PullRequest, len(params[1]))
for u, param := range params[1] {
_param1[u] = param.(models.PullRequest)
}
}
return
}