279 lines
9.1 KiB
Go
279 lines
9.1 KiB
Go
// Code generated by pegomock. DO NOT EDIT.
|
|
// Source: github.com/k8sland/k9s/resource (interfaces: Resource)
|
|
|
|
package resource_test
|
|
|
|
import (
|
|
resource "github.com/k8sland/k9s/resource"
|
|
pegomock "github.com/petergtz/pegomock"
|
|
"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) 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) 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) 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
|
|
}
|