github.com/jenkins-x/jx/v2@v2.1.155/pkg/cloud/amazon/eksctl/mocks/eksctl.go (about) 1 // Code generated by pegomock. DO NOT EDIT. 2 // Source: github.com/jenkins-x/jx/v2/pkg/cloud/amazon/eksctl (interfaces: EKSCtl) 3 4 package eksctl_test 5 6 import ( 7 "reflect" 8 "time" 9 10 cluster "github.com/jenkins-x/jx/v2/pkg/cluster" 11 pegomock "github.com/petergtz/pegomock" 12 ) 13 14 type MockEKSCtl struct { 15 fail func(message string, callerSkip ...int) 16 } 17 18 func NewMockEKSCtl(options ...pegomock.Option) *MockEKSCtl { 19 mock := &MockEKSCtl{} 20 for _, option := range options { 21 option.Apply(mock) 22 } 23 return mock 24 } 25 26 func (mock *MockEKSCtl) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } 27 func (mock *MockEKSCtl) FailHandler() pegomock.FailHandler { return mock.fail } 28 29 func (mock *MockEKSCtl) DeleteCluster(_param0 *cluster.Cluster) error { 30 if mock == nil { 31 panic("mock must not be nil. Use myMock := NewMockEKSCtl().") 32 } 33 params := []pegomock.Param{_param0} 34 result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteCluster", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) 35 var ret0 error 36 if len(result) != 0 { 37 if result[0] != nil { 38 ret0 = result[0].(error) 39 } 40 } 41 return ret0 42 } 43 44 func (mock *MockEKSCtl) VerifyWasCalledOnce() *VerifierMockEKSCtl { 45 return &VerifierMockEKSCtl{ 46 mock: mock, 47 invocationCountMatcher: pegomock.Times(1), 48 } 49 } 50 51 func (mock *MockEKSCtl) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockEKSCtl { 52 return &VerifierMockEKSCtl{ 53 mock: mock, 54 invocationCountMatcher: invocationCountMatcher, 55 } 56 } 57 58 func (mock *MockEKSCtl) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockEKSCtl { 59 return &VerifierMockEKSCtl{ 60 mock: mock, 61 invocationCountMatcher: invocationCountMatcher, 62 inOrderContext: inOrderContext, 63 } 64 } 65 66 func (mock *MockEKSCtl) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockEKSCtl { 67 return &VerifierMockEKSCtl{ 68 mock: mock, 69 invocationCountMatcher: invocationCountMatcher, 70 timeout: timeout, 71 } 72 } 73 74 type VerifierMockEKSCtl struct { 75 mock *MockEKSCtl 76 invocationCountMatcher pegomock.Matcher 77 inOrderContext *pegomock.InOrderContext 78 timeout time.Duration 79 } 80 81 func (verifier *VerifierMockEKSCtl) DeleteCluster(_param0 *cluster.Cluster) *MockEKSCtl_DeleteCluster_OngoingVerification { 82 params := []pegomock.Param{_param0} 83 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteCluster", params, verifier.timeout) 84 return &MockEKSCtl_DeleteCluster_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 85 } 86 87 type MockEKSCtl_DeleteCluster_OngoingVerification struct { 88 mock *MockEKSCtl 89 methodInvocations []pegomock.MethodInvocation 90 } 91 92 func (c *MockEKSCtl_DeleteCluster_OngoingVerification) GetCapturedArguments() *cluster.Cluster { 93 _param0 := c.GetAllCapturedArguments() 94 return _param0[len(_param0)-1] 95 } 96 97 func (c *MockEKSCtl_DeleteCluster_OngoingVerification) GetAllCapturedArguments() (_param0 []*cluster.Cluster) { 98 params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) 99 if len(params) > 0 { 100 _param0 = make([]*cluster.Cluster, len(c.methodInvocations)) 101 for u, param := range params[0] { 102 _param0[u] = param.(*cluster.Cluster) 103 } 104 } 105 return 106 }