github.com/jenkins-x/jx/v2@v2.1.155/pkg/cloud/amazon/awscli/mocks/awsclimock.go (about)

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