k9s/internal/views/mock_metricsservice.go

171 lines
5.9 KiB
Go

// Code generated by pegomock. DO NOT EDIT.
// Source: github.com/derailed/k9s/internal/resource (interfaces: MetricsService)
package views
import (
pegomock "github.com/petergtz/pegomock"
v1beta1 "k8s.io/metrics/pkg/apis/metrics/v1beta1"
"reflect"
"time"
)
type MockMetricsService struct {
fail func(message string, callerSkip ...int)
}
func NewMockMetricsService() *MockMetricsService {
return &MockMetricsService{fail: pegomock.GlobalFailHandler}
}
func (mock *MockMetricsService) FetchNodesMetrics() ([]v1beta1.NodeMetrics, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockMetricsService().")
}
params := []pegomock.Param{}
result := pegomock.GetGenericMockFrom(mock).Invoke("FetchNodesMetrics", params, []reflect.Type{reflect.TypeOf((*[]v1beta1.NodeMetrics)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 []v1beta1.NodeMetrics
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].([]v1beta1.NodeMetrics)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockMetricsService) FetchPodsMetrics(_param0 string) ([]v1beta1.PodMetrics, error) {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockMetricsService().")
}
params := []pegomock.Param{_param0}
result := pegomock.GetGenericMockFrom(mock).Invoke("FetchPodsMetrics", params, []reflect.Type{reflect.TypeOf((*[]v1beta1.PodMetrics)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
var ret0 []v1beta1.PodMetrics
var ret1 error
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].([]v1beta1.PodMetrics)
}
if result[1] != nil {
ret1 = result[1].(error)
}
}
return ret0, ret1
}
func (mock *MockMetricsService) HasMetrics() bool {
if mock == nil {
panic("mock must not be nil. Use myMock := NewMockMetricsService().")
}
params := []pegomock.Param{}
result := pegomock.GetGenericMockFrom(mock).Invoke("HasMetrics", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem()})
var ret0 bool
if len(result) != 0 {
if result[0] != nil {
ret0 = result[0].(bool)
}
}
return ret0
}
func (mock *MockMetricsService) VerifyWasCalledOnce() *VerifierMetricsService {
return &VerifierMetricsService{
mock: mock,
invocationCountMatcher: pegomock.Times(1),
}
}
func (mock *MockMetricsService) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMetricsService {
return &VerifierMetricsService{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
}
}
func (mock *MockMetricsService) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMetricsService {
return &VerifierMetricsService{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
inOrderContext: inOrderContext,
}
}
func (mock *MockMetricsService) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMetricsService {
return &VerifierMetricsService{
mock: mock,
invocationCountMatcher: invocationCountMatcher,
timeout: timeout,
}
}
type VerifierMetricsService struct {
mock *MockMetricsService
invocationCountMatcher pegomock.Matcher
inOrderContext *pegomock.InOrderContext
timeout time.Duration
}
func (verifier *VerifierMetricsService) FetchNodesMetrics() *MetricsService_FetchNodesMetrics_OngoingVerification {
params := []pegomock.Param{}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "FetchNodesMetrics", params, verifier.timeout)
return &MetricsService_FetchNodesMetrics_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MetricsService_FetchNodesMetrics_OngoingVerification struct {
mock *MockMetricsService
methodInvocations []pegomock.MethodInvocation
}
func (c *MetricsService_FetchNodesMetrics_OngoingVerification) GetCapturedArguments() {
}
func (c *MetricsService_FetchNodesMetrics_OngoingVerification) GetAllCapturedArguments() {
}
func (verifier *VerifierMetricsService) FetchPodsMetrics(_param0 string) *MetricsService_FetchPodsMetrics_OngoingVerification {
params := []pegomock.Param{_param0}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "FetchPodsMetrics", params, verifier.timeout)
return &MetricsService_FetchPodsMetrics_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MetricsService_FetchPodsMetrics_OngoingVerification struct {
mock *MockMetricsService
methodInvocations []pegomock.MethodInvocation
}
func (c *MetricsService_FetchPodsMetrics_OngoingVerification) GetCapturedArguments() string {
_param0 := c.GetAllCapturedArguments()
return _param0[len(_param0)-1]
}
func (c *MetricsService_FetchPodsMetrics_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 *VerifierMetricsService) HasMetrics() *MetricsService_HasMetrics_OngoingVerification {
params := []pegomock.Param{}
methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "HasMetrics", params, verifier.timeout)
return &MetricsService_HasMetrics_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
}
type MetricsService_HasMetrics_OngoingVerification struct {
mock *MockMetricsService
methodInvocations []pegomock.MethodInvocation
}
func (c *MetricsService_HasMetrics_OngoingVerification) GetCapturedArguments() {
}
func (c *MetricsService_HasMetrics_OngoingVerification) GetAllCapturedArguments() {
}