k9s/internal/resource/mock_resource_test.go

376 lines
13 KiB
Go

// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/derailed/k9s/internal/resource (interfaces: Resource)
package resource_test
import (
resource "github.com/derailed/k9s/internal/resource"
pegomock "github.com/petergtz/pegomock"
genericclioptions "k8s.io/cli-runtime/pkg/genericclioptions"
"reflect"
"time"
)
type MockResource struct {
fail func(message string, callerSkip ...int)
}
func NewMockResource() *MockResource {
return &MockResource{fail: pegomock.GlobalFailHandler}
}
func (mock *MockResource) Delete(_param0 string) error {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockResource().")
}
params := []pegomock.Param{_param0}
result := pegomock.GetGenericMockFrom(mock).Invoke("Delete", 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 *MockResource) Describe(_param0 string, _param1 string, _param2 *genericclioptions.ConfigFlags) (string, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockResource().")
}
params := []pegomock.Param{_param0, _param1, _param2}
result := pegomock.GetGenericMockFrom(mock).Invoke("Describe", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 string
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(string)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockResource) Get(_param0 string) (resource.Columnar, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockResource().")
}
params := []pegomock.Param{_param0}
result := pegomock.GetGenericMockFrom(mock).Invoke("Get", params, []reflect.Type{reflect.TypeOf((*resource.Columnar)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 resource.Columnar
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(resource.Columnar)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockResource) Header(_param0 string) resource.Row {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockResource().")
}
params := []pegomock.Param{_param0}
result := pegomock.GetGenericMockFrom(mock).Invoke("Header", params, []reflect.Type{reflect.TypeOf((*resource.Row)(nil)).Elem()})
var ret0 resource.Row
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(resource.Row)
}
}
return ret0
}
func (mock *MockResource) List(_param0 string) (resource.Columnars, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockResource().")
}
params := []pegomock.Param{_param0}
result := pegomock.GetGenericMockFrom(mock).Invoke("List", params, []reflect.Type{reflect.TypeOf((*resource.Columnars)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 resource.Columnars
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(resource.Columnars)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockResource) Marshal(_param0 string) (string, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockResource().")
}
params := []pegomock.Param{_param0}
result := pegomock.GetGenericMockFrom(mock).Invoke("Marshal", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 string
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(string)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockResource) New(_param0 interface{}) resource.Columnar {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockResource().")
}
params := []pegomock.Param{_param0}
result := pegomock.GetGenericMockFrom(mock).Invoke("New", params, []reflect.Type{reflect.TypeOf((*resource.Columnar)(nil)).Elem()})
var ret0 resource.Columnar
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(resource.Columnar)
}
}
return ret0
}
func (mock *MockResource) VerifyWasCalledOnce() *VerifierResource {
return &VerifierResource{
mock: mock,
invocationCountMatcher: pegomock.Times(1),
}
}
func (mock *MockResource) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierResource {
return &VerifierResource{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
}
}
func (mock *MockResource) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierResource {
return &VerifierResource{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
inOrderContext: inOrderContext,
}
}
func (mock *MockResource) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierResource {
return &VerifierResource{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
timeout: timeout,
}
}
type VerifierResource struct {
mock *MockResource
invocationCountMatcher pegomock.Matcher
inOrderContext *pegomock.InOrderContext
timeout time.Duration
}
func (verifier *VerifierResource) Delete(_param0 string) *Resource_Delete_OngoingVerification {
params := []pegomock.Param{_param0}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Delete", params, verifier.timeout)
return &Resource_Delete_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type Resource_Delete_OngoingVerification struct {
mock *MockResource
methodInvocations []pegomock.MethodInvocation
}
func (c *Resource_Delete_OngoingVerification) GetCapturedArguments() string {
_param0 := c.GetAllCapturedArguments()
return _param0[len(_param0)-1]
}
func (c *Resource_Delete_OngoingVerification) GetAllCapturedArguments() (_param0 []string) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]string, len(params[0]))
for u, param := range params[0] {
_param0[u] = param.(string)
}
}
return
}
func (verifier *VerifierResource) Describe(_param0 string, _param1 string, _param2 *genericclioptions.ConfigFlags) *Resource_Describe_OngoingVerification {
params := []pegomock.Param{_param0, _param1, _param2}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Describe", params, verifier.timeout)
return &Resource_Describe_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type Resource_Describe_OngoingVerification struct {
mock *MockResource
methodInvocations []pegomock.MethodInvocation
}
func (c *Resource_Describe_OngoingVerification) GetCapturedArguments() (string, string, *genericclioptions.ConfigFlags) {
_param0, _param1, _param2 := c.GetAllCapturedArguments()
return _param0[len(_param0)-1], _param1[len(_param1)-1], _param2[len(_param2)-1]
}
func (c *Resource_Describe_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []*genericclioptions.ConfigFlags) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]string, len(params[0]))
for u, param := range params[0] {
_param0[u] = param.(string)
}
_param1 = make([]string, len(params[1]))
for u, param := range params[1] {
_param1[u] = param.(string)
}
_param2 = make([]*genericclioptions.ConfigFlags, len(params[2]))
for u, param := range params[2] {
_param2[u] = param.(*genericclioptions.ConfigFlags)
}
}
return
}
func (verifier *VerifierResource) Get(_param0 string) *Resource_Get_OngoingVerification {
params := []pegomock.Param{_param0}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Get", params, verifier.timeout)
return &Resource_Get_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type Resource_Get_OngoingVerification struct {
mock *MockResource
methodInvocations []pegomock.MethodInvocation
}
func (c *Resource_Get_OngoingVerification) GetCapturedArguments() string {
_param0 := c.GetAllCapturedArguments()
return _param0[len(_param0)-1]
}
func (c *Resource_Get_OngoingVerification) GetAllCapturedArguments() (_param0 []string) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]string, len(params[0]))
for u, param := range params[0] {
_param0[u] = param.(string)
}
}
return
}
func (verifier *VerifierResource) Header(_param0 string) *Resource_Header_OngoingVerification {
params := []pegomock.Param{_param0}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Header", params, verifier.timeout)
return &Resource_Header_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type Resource_Header_OngoingVerification struct {
mock *MockResource
methodInvocations []pegomock.MethodInvocation
}
func (c *Resource_Header_OngoingVerification) GetCapturedArguments() string {
_param0 := c.GetAllCapturedArguments()
return _param0[len(_param0)-1]
}
func (c *Resource_Header_OngoingVerification) GetAllCapturedArguments() (_param0 []string) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]string, len(params[0]))
for u, param := range params[0] {
_param0[u] = param.(string)
}
}
return
}
func (verifier *VerifierResource) List(_param0 string) *Resource_List_OngoingVerification {
params := []pegomock.Param{_param0}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "List", params, verifier.timeout)
return &Resource_List_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type Resource_List_OngoingVerification struct {
mock *MockResource
methodInvocations []pegomock.MethodInvocation
}
func (c *Resource_List_OngoingVerification) GetCapturedArguments() string {
_param0 := c.GetAllCapturedArguments()
return _param0[len(_param0)-1]
}
func (c *Resource_List_OngoingVerification) GetAllCapturedArguments() (_param0 []string) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]string, len(params[0]))
for u, param := range params[0] {
_param0[u] = param.(string)
}
}
return
}
func (verifier *VerifierResource) Marshal(_param0 string) *Resource_Marshal_OngoingVerification {
params := []pegomock.Param{_param0}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Marshal", params, verifier.timeout)
return &Resource_Marshal_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type Resource_Marshal_OngoingVerification struct {
mock *MockResource
methodInvocations []pegomock.MethodInvocation
}
func (c *Resource_Marshal_OngoingVerification) GetCapturedArguments() string {
_param0 := c.GetAllCapturedArguments()
return _param0[len(_param0)-1]
}
func (c *Resource_Marshal_OngoingVerification) GetAllCapturedArguments() (_param0 []string) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]string, len(params[0]))
for u, param := range params[0] {
_param0[u] = param.(string)
}
}
return
}
func (verifier *VerifierResource) New(_param0 interface{}) *Resource_New_OngoingVerification {
params := []pegomock.Param{_param0}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "New", params, verifier.timeout)
return &Resource_New_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type Resource_New_OngoingVerification struct {
mock *MockResource
methodInvocations []pegomock.MethodInvocation
}
func (c *Resource_New_OngoingVerification) GetCapturedArguments() interface{} {
_param0 := c.GetAllCapturedArguments()
return _param0[len(_param0)-1]
}
func (c *Resource_New_OngoingVerification) GetAllCapturedArguments() (_param0 []interface{}) {
params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
if len(params) > 0 {
_param0 = make([]interface{}, len(params[0]))
for u, param := range params[0] {
_param0[u] = param.(interface{})
}
}
return
}