mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-28 23:58:19 +00:00
* fix(deps): update module github.com/petergtz/pegomock/v3 to v4 in go.mod * remove pegomock generate m option, which is not support after v4 * make regen-mocks * replace pegomock v4 primitive eq/matchers * convert pegomock v4 Eq/Any matchers * remove custom models.Repo matcher * pegomock v4 cannot use result method args ref https://github.com/petergtz/pegomock/issues/123 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
110 lines
3.7 KiB
Go
110 lines
3.7 KiB
Go
// Code generated by pegomock. DO NOT EDIT.
|
|
// Source: github.com/runatlantis/atlantis/server/controllers/templates (interfaces: TemplateWriter)
|
|
|
|
package mocks
|
|
|
|
import (
|
|
pegomock "github.com/petergtz/pegomock/v4"
|
|
io "io"
|
|
"reflect"
|
|
"time"
|
|
)
|
|
|
|
type MockTemplateWriter struct {
|
|
fail func(message string, callerSkip ...int)
|
|
}
|
|
|
|
func NewMockTemplateWriter(options ...pegomock.Option) *MockTemplateWriter {
|
|
mock := &MockTemplateWriter{}
|
|
for _, option := range options {
|
|
option.Apply(mock)
|
|
}
|
|
return mock
|
|
}
|
|
|
|
func (mock *MockTemplateWriter) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
|
|
func (mock *MockTemplateWriter) FailHandler() pegomock.FailHandler { return mock.fail }
|
|
|
|
func (mock *MockTemplateWriter) Execute(wr io.Writer, data interface{}) error {
|
|
if mock == nil {
|
|
panic("mock must not be nil. Use myMock := NewMockTemplateWriter().")
|
|
}
|
|
params := []pegomock.Param{wr, data}
|
|
result := pegomock.GetGenericMockFrom(mock).Invoke("Execute", 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 *MockTemplateWriter) VerifyWasCalledOnce() *VerifierMockTemplateWriter {
|
|
return &VerifierMockTemplateWriter{
|
|
mock: mock,
|
|
invocationCountMatcher: pegomock.Times(1),
|
|
}
|
|
}
|
|
|
|
func (mock *MockTemplateWriter) VerifyWasCalled(invocationCountMatcher pegomock.InvocationCountMatcher) *VerifierMockTemplateWriter {
|
|
return &VerifierMockTemplateWriter{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
}
|
|
}
|
|
|
|
func (mock *MockTemplateWriter) VerifyWasCalledInOrder(invocationCountMatcher pegomock.InvocationCountMatcher, inOrderContext *pegomock.InOrderContext) *VerifierMockTemplateWriter {
|
|
return &VerifierMockTemplateWriter{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
inOrderContext: inOrderContext,
|
|
}
|
|
}
|
|
|
|
func (mock *MockTemplateWriter) VerifyWasCalledEventually(invocationCountMatcher pegomock.InvocationCountMatcher, timeout time.Duration) *VerifierMockTemplateWriter {
|
|
return &VerifierMockTemplateWriter{
|
|
mock: mock,
|
|
invocationCountMatcher: invocationCountMatcher,
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
type VerifierMockTemplateWriter struct {
|
|
mock *MockTemplateWriter
|
|
invocationCountMatcher pegomock.InvocationCountMatcher
|
|
inOrderContext *pegomock.InOrderContext
|
|
timeout time.Duration
|
|
}
|
|
|
|
func (verifier *VerifierMockTemplateWriter) Execute(wr io.Writer, data interface{}) *MockTemplateWriter_Execute_OngoingVerification {
|
|
params := []pegomock.Param{wr, data}
|
|
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Execute", params, verifier.timeout)
|
|
return &MockTemplateWriter_Execute_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
|
|
}
|
|
|
|
type MockTemplateWriter_Execute_OngoingVerification struct {
|
|
mock *MockTemplateWriter
|
|
methodInvocations []pegomock.MethodInvocation
|
|
}
|
|
|
|
func (c *MockTemplateWriter_Execute_OngoingVerification) GetCapturedArguments() (io.Writer, interface{}) {
|
|
wr, data := c.GetAllCapturedArguments()
|
|
return wr[len(wr)-1], data[len(data)-1]
|
|
}
|
|
|
|
func (c *MockTemplateWriter_Execute_OngoingVerification) GetAllCapturedArguments() (_param0 []io.Writer, _param1 []interface{}) {
|
|
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
|
|
if len(params) > 0 {
|
|
_param0 = make([]io.Writer, len(c.methodInvocations))
|
|
for u, param := range params[0] {
|
|
_param0[u] = param.(io.Writer)
|
|
}
|
|
_param1 = make([]interface{}, len(c.methodInvocations))
|
|
for u, param := range params[1] {
|
|
_param1[u] = param.(interface{})
|
|
}
|
|
}
|
|
return
|
|
}
|