github.com/jenkins-x/jx/v2@v2.1.155/pkg/cloud/amazon/ec2/mocks/ec2erMock.go (about) 1 // Code generated by pegomock. DO NOT EDIT. 2 // Source: github.com/jenkins-x/jx/v2/pkg/cloud/amazon/ec2 (interfaces: EC2er) 3 4 package ec2_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 MockEC2er struct { 15 fail func(message string, callerSkip ...int) 16 } 17 18 func NewMockEC2er(options ...pegomock.Option) *MockEC2er { 19 mock := &MockEC2er{} 20 for _, option := range options { 21 option.Apply(mock) 22 } 23 return mock 24 } 25 26 func (mock *MockEC2er) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } 27 func (mock *MockEC2er) FailHandler() pegomock.FailHandler { return mock.fail } 28 29 func (mock *MockEC2er) DeleteVolumesForCluster(_param0 *cluster.Cluster) error { 30 if mock == nil { 31 panic("mock must not be nil. Use myMock := NewMockEC2er().") 32 } 33 params := []pegomock.Param{_param0} 34 result := pegomock.GetGenericMockFrom(mock).Invoke("DeleteVolumesForCluster", 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 *MockEC2er) VerifyWasCalledOnce() *VerifierMockEC2er { 45 return &VerifierMockEC2er{ 46 mock: mock, 47 invocationCountMatcher: pegomock.Times(1), 48 } 49 } 50 51 func (mock *MockEC2er) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockEC2er { 52 return &VerifierMockEC2er{ 53 mock: mock, 54 invocationCountMatcher: invocationCountMatcher, 55 } 56 } 57 58 func (mock *MockEC2er) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockEC2er { 59 return &VerifierMockEC2er{ 60 mock: mock, 61 invocationCountMatcher: invocationCountMatcher, 62 inOrderContext: inOrderContext, 63 } 64 } 65 66 func (mock *MockEC2er) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockEC2er { 67 return &VerifierMockEC2er{ 68 mock: mock, 69 invocationCountMatcher: invocationCountMatcher, 70 timeout: timeout, 71 } 72 } 73 74 type VerifierMockEC2er struct { 75 mock *MockEC2er 76 invocationCountMatcher pegomock.Matcher 77 inOrderContext *pegomock.InOrderContext 78 timeout time.Duration 79 } 80 81 func (verifier *VerifierMockEC2er) DeleteVolumesForCluster(_param0 *cluster.Cluster) *MockEC2er_DeleteVolumesForCluster_OngoingVerification { 82 params := []pegomock.Param{_param0} 83 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DeleteVolumesForCluster", params, verifier.timeout) 84 return &MockEC2er_DeleteVolumesForCluster_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 85 } 86 87 type MockEC2er_DeleteVolumesForCluster_OngoingVerification struct { 88 mock *MockEC2er 89 methodInvocations []pegomock.MethodInvocation 90 } 91 92 func (c *MockEC2er_DeleteVolumesForCluster_OngoingVerification) GetCapturedArguments() *cluster.Cluster { 93 _param0 := c.GetAllCapturedArguments() 94 return _param0[len(_param0)-1] 95 } 96 97 func (c *MockEC2er_DeleteVolumesForCluster_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 }