Files
atlantis/server/controllers/events/mocks/mock_github_request_validator.go
Ken Kaizu 27b9897517 chore(build): rm pegomock experimental feature for smooth mock generation (#2886)
* disable pegomock --use-experimental-model-gen, cause random fail by segv

* make regen-mocks

* fix mock code which uses non experimental pegomock codes
2022-12-27 19:58:15 -06:00

114 lines
4.2 KiB
Go

// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/runatlantis/atlantis/server/controllers/events (interfaces: GithubRequestValidator)
package mocks
import (
pegomock "github.com/petergtz/pegomock"
http "net/http"
"reflect"
"time"
)
type MockGithubRequestValidator struct {
fail func(message string, callerSkip ...int)
}
func NewMockGithubRequestValidator(options ...pegomock.Option) *MockGithubRequestValidator {
mock := &MockGithubRequestValidator{}
for _, option := range options {
option.Apply(mock)
}
return mock
}
func (mock *MockGithubRequestValidator) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
func (mock *MockGithubRequestValidator) FailHandler() pegomock.FailHandler { return mock.fail }
func (mock *MockGithubRequestValidator) Validate(_param0 *http.Request, _param1 []byte) ([]byte, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockGithubRequestValidator().")
}
params := []pegomock.Param{_param0, _param1}
result := pegomock.GetGenericMockFrom(mock).Invoke("Validate", params, []reflect.Type{reflect.TypeOf((*[]byte)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 []byte
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].([]byte)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockGithubRequestValidator) VerifyWasCalledOnce() *VerifierMockGithubRequestValidator {
return &VerifierMockGithubRequestValidator{
mock: mock,
invocationCountMatcher: pegomock.Times(1),
}
}
func (mock *MockGithubRequestValidator) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockGithubRequestValidator {
return &VerifierMockGithubRequestValidator{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
}
}
func (mock *MockGithubRequestValidator) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockGithubRequestValidator {
return &VerifierMockGithubRequestValidator{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
inOrderContext: inOrderContext,
}
}
func (mock *MockGithubRequestValidator) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockGithubRequestValidator {
return &VerifierMockGithubRequestValidator{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
timeout: timeout,
}
}
type VerifierMockGithubRequestValidator struct {
mock *MockGithubRequestValidator
invocationCountMatcher pegomock.InvocationCountMatcher
inOrderContext *pegomock.InOrderContext
timeout time.Duration
}
func (verifier *VerifierMockGithubRequestValidator) Validate(_param0 *http.Request, _param1 []byte) *MockGithubRequestValidator_Validate_OngoingVerification {
params := []pegomock.Param{_param0, _param1}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Validate", params, verifier.timeout)
return &MockGithubRequestValidator_Validate_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MockGithubRequestValidator_Validate_OngoingVerification struct {
mock *MockGithubRequestValidator
methodInvocations []pegomock.MethodInvocation
}
func (c *MockGithubRequestValidator_Validate_OngoingVerification) GetCapturedArguments() (*http.Request, []byte) {
_param0, _param1 := c.GetAllCapturedArguments()
return _param0[len(_param0)-1], _param1[len(_param1)-1]
}
func (c *MockGithubRequestValidator_Validate_OngoingVerification) GetAllCapturedArguments() (_param0 []*http.Request, _param1 [][]byte) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]*http.Request, len(c.methodInvocations))
for u, param := range params[0] {
_param0[u] = param.(*http.Request)
}
_param1 = make([][]byte, len(c.methodInvocations))
for u, param := range params[1] {
_param1[u] = param.([]byte)
}
}
return
}