github.com/jenkins-x/jx/v2@v2.1.155/pkg/kube/mocks/kuber.go (about)

     1  // Code generated by pegomock. DO NOT EDIT.
     2  // Source: github.com/jenkins-x/jx/v2/pkg/kube (interfaces: Kuber)
     3  
     4  package kube_test
     5  
     6  import (
     7  	"reflect"
     8  	"time"
     9  
    10  	pegomock "github.com/petergtz/pegomock"
    11  	clientcmd "k8s.io/client-go/tools/clientcmd"
    12  	api "k8s.io/client-go/tools/clientcmd/api"
    13  )
    14  
    15  type MockKuber struct {
    16  	fail func(message string, callerSkip ...int)
    17  }
    18  
    19  func NewMockKuber(options ...pegomock.Option) *MockKuber {
    20  	mock := &MockKuber{}
    21  	for _, option := range options {
    22  		option.Apply(mock)
    23  	}
    24  	return mock
    25  }
    26  
    27  func (mock *MockKuber) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
    28  func (mock *MockKuber) FailHandler() pegomock.FailHandler      { return mock.fail }
    29  
    30  func (mock *MockKuber) LoadConfig() (*api.Config, *clientcmd.PathOptions, error) {
    31  	if mock == nil {
    32  		panic("mock must not be nil. Use myMock := NewMockKuber().")
    33  	}
    34  	params := []pegomock.Param{}
    35  	result := pegomock.GetGenericMockFrom(mock).Invoke("LoadConfig", params, []reflect.Type{reflect.TypeOf((**api.Config)(nil)).Elem(), reflect.TypeOf((**clientcmd.PathOptions)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
    36  	var ret0 *api.Config
    37  	var ret1 *clientcmd.PathOptions
    38  	var ret2 error
    39  	if len(result) != 0 {
    40  		if result[0] != nil {
    41  			ret0 = result[0].(*api.Config)
    42  		}
    43  		if result[1] != nil {
    44  			ret1 = result[1].(*clientcmd.PathOptions)
    45  		}
    46  		if result[2] != nil {
    47  			ret2 = result[2].(error)
    48  		}
    49  	}
    50  	return ret0, ret1, ret2
    51  }
    52  
    53  func (mock *MockKuber) UpdateConfig(_param0 string, _param1 string, _param2 string, _param3 string, _param4 string) error {
    54  	if mock == nil {
    55  		panic("mock must not be nil. Use myMock := NewMockKuber().")
    56  	}
    57  	params := []pegomock.Param{_param0, _param1, _param2, _param3, _param4}
    58  	result := pegomock.GetGenericMockFrom(mock).Invoke("UpdateConfig", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()})
    59  	var ret0 error
    60  	if len(result) != 0 {
    61  		if result[0] != nil {
    62  			ret0 = result[0].(error)
    63  		}
    64  	}
    65  	return ret0
    66  }
    67  
    68  func (mock *MockKuber) VerifyWasCalledOnce() *VerifierMockKuber {
    69  	return &VerifierMockKuber{
    70  		mock:                   mock,
    71  		invocationCountMatcher: pegomock.Times(1),
    72  	}
    73  }
    74  
    75  func (mock *MockKuber) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockKuber {
    76  	return &VerifierMockKuber{
    77  		mock:                   mock,
    78  		invocationCountMatcher: invocationCountMatcher,
    79  	}
    80  }
    81  
    82  func (mock *MockKuber) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockKuber {
    83  	return &VerifierMockKuber{
    84  		mock:                   mock,
    85  		invocationCountMatcher: invocationCountMatcher,
    86  		inOrderContext:         inOrderContext,
    87  	}
    88  }
    89  
    90  func (mock *MockKuber) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockKuber {
    91  	return &VerifierMockKuber{
    92  		mock:                   mock,
    93  		invocationCountMatcher: invocationCountMatcher,
    94  		timeout:                timeout,
    95  	}
    96  }
    97  
    98  type VerifierMockKuber struct {
    99  	mock                   *MockKuber
   100  	invocationCountMatcher pegomock.Matcher
   101  	inOrderContext         *pegomock.InOrderContext
   102  	timeout                time.Duration
   103  }
   104  
   105  func (verifier *VerifierMockKuber) LoadConfig() *MockKuber_LoadConfig_OngoingVerification {
   106  	params := []pegomock.Param{}
   107  	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "LoadConfig", params, verifier.timeout)
   108  	return &MockKuber_LoadConfig_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
   109  }
   110  
   111  type MockKuber_LoadConfig_OngoingVerification struct {
   112  	mock              *MockKuber
   113  	methodInvocations []pegomock.MethodInvocation
   114  }
   115  
   116  func (c *MockKuber_LoadConfig_OngoingVerification) GetCapturedArguments() {
   117  }
   118  
   119  func (c *MockKuber_LoadConfig_OngoingVerification) GetAllCapturedArguments() {
   120  }
   121  
   122  func (verifier *VerifierMockKuber) UpdateConfig(_param0 string, _param1 string, _param2 string, _param3 string, _param4 string) *MockKuber_UpdateConfig_OngoingVerification {
   123  	params := []pegomock.Param{_param0, _param1, _param2, _param3, _param4}
   124  	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "UpdateConfig", params, verifier.timeout)
   125  	return &MockKuber_UpdateConfig_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
   126  }
   127  
   128  type MockKuber_UpdateConfig_OngoingVerification struct {
   129  	mock              *MockKuber
   130  	methodInvocations []pegomock.MethodInvocation
   131  }
   132  
   133  func (c *MockKuber_UpdateConfig_OngoingVerification) GetCapturedArguments() (string, string, string, string, string) {
   134  	_param0, _param1, _param2, _param3, _param4 := c.GetAllCapturedArguments()
   135  	return _param0[len(_param0)-1], _param1[len(_param1)-1], _param2[len(_param2)-1], _param3[len(_param3)-1], _param4[len(_param4)-1]
   136  }
   137  
   138  func (c *MockKuber_UpdateConfig_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []string, _param3 []string, _param4 []string) {
   139  	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
   140  	if len(params) > 0 {
   141  		_param0 = make([]string, len(c.methodInvocations))
   142  		for u, param := range params[0] {
   143  			_param0[u] = param.(string)
   144  		}
   145  		_param1 = make([]string, len(c.methodInvocations))
   146  		for u, param := range params[1] {
   147  			_param1[u] = param.(string)
   148  		}
   149  		_param2 = make([]string, len(c.methodInvocations))
   150  		for u, param := range params[2] {
   151  			_param2[u] = param.(string)
   152  		}
   153  		_param3 = make([]string, len(c.methodInvocations))
   154  		for u, param := range params[3] {
   155  			_param3[u] = param.(string)
   156  		}
   157  		_param4 = make([]string, len(c.methodInvocations))
   158  		for u, param := range params[4] {
   159  			_param4[u] = param.(string)
   160  		}
   161  	}
   162  	return
   163  }