// 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/v4" 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(r *http.Request, secret []byte) ([]byte, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockGithubRequestValidator().") } _params := []pegomock.Param{r, secret} _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(r *http.Request, secret []byte) *MockGithubRequestValidator_Validate_OngoingVerification { _params := []pegomock.Param{r, secret} 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) { r, secret := c.GetAllCapturedArguments() return r[len(r)-1], secret[len(secret)-1] } func (c *MockGithubRequestValidator_Validate_OngoingVerification) GetAllCapturedArguments() (_param0 []*http.Request, _param1 [][]byte) { _params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(_params) > 0 { if len(_params) > 0 { _param0 = make([]*http.Request, len(c.methodInvocations)) for u, param := range _params[0] { _param0[u] = param.(*http.Request) } } if len(_params) > 1 { _param1 = make([][]byte, len(c.methodInvocations)) for u, param := range _params[1] { _param1[u] = param.([]byte) } } } return }