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

     1  // Code generated by pegomock. DO NOT EDIT.
     2  // Source: github.com/jenkins-x/jx/v2/pkg/cloud/amazon/eks (interfaces: EKSer)
     3  
     4  package eks_test
     5  
     6  import (
     7  	"reflect"
     8  	"time"
     9  
    10  	eks "github.com/aws/aws-sdk-go/service/eks"
    11  	cluster "github.com/jenkins-x/jx/v2/pkg/cluster"
    12  	pegomock "github.com/petergtz/pegomock"
    13  )
    14  
    15  type MockEKSer struct {
    16  	fail func(message string, callerSkip ...int)
    17  }
    18  
    19  func NewMockEKSer(options ...pegomock.Option) *MockEKSer {
    20  	mock := &MockEKSer{}
    21  	for _, option := range options {
    22  		option.Apply(mock)
    23  	}
    24  	return mock
    25  }
    26  
    27  func (mock *MockEKSer) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh }
    28  func (mock *MockEKSer) FailHandler() pegomock.FailHandler      { return mock.fail }
    29  
    30  func (mock *MockEKSer) AddTagsToCluster(_param0 string, _param1 map[string]*string) error {
    31  	if mock == nil {
    32  		panic("mock must not be nil. Use myMock := NewMockEKSer().")
    33  	}
    34  	params := []pegomock.Param{_param0, _param1}
    35  	result := pegomock.GetGenericMockFrom(mock).Invoke("AddTagsToCluster", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()})
    36  	var ret0 error
    37  	if len(result) != 0 {
    38  		if result[0] != nil {
    39  			ret0 = result[0].(error)
    40  		}
    41  	}
    42  	return ret0
    43  }
    44  
    45  func (mock *MockEKSer) CleanUpObsoleteEksClusterStack(_param0 string, _param1 string, _param2 string) error {
    46  	if mock == nil {
    47  		panic("mock must not be nil. Use myMock := NewMockEKSer().")
    48  	}
    49  	params := []pegomock.Param{_param0, _param1, _param2}
    50  	result := pegomock.GetGenericMockFrom(mock).Invoke("CleanUpObsoleteEksClusterStack", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()})
    51  	var ret0 error
    52  	if len(result) != 0 {
    53  		if result[0] != nil {
    54  			ret0 = result[0].(error)
    55  		}
    56  	}
    57  	return ret0
    58  }
    59  
    60  func (mock *MockEKSer) DescribeCluster(_param0 string) (*cluster.Cluster, string, error) {
    61  	if mock == nil {
    62  		panic("mock must not be nil. Use myMock := NewMockEKSer().")
    63  	}
    64  	params := []pegomock.Param{_param0}
    65  	result := pegomock.GetGenericMockFrom(mock).Invoke("DescribeCluster", params, []reflect.Type{reflect.TypeOf((**cluster.Cluster)(nil)).Elem(), reflect.TypeOf((*string)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
    66  	var ret0 *cluster.Cluster
    67  	var ret1 string
    68  	var ret2 error
    69  	if len(result) != 0 {
    70  		if result[0] != nil {
    71  			ret0 = result[0].(*cluster.Cluster)
    72  		}
    73  		if result[1] != nil {
    74  			ret1 = result[1].(string)
    75  		}
    76  		if result[2] != nil {
    77  			ret2 = result[2].(error)
    78  		}
    79  	}
    80  	return ret0, ret1, ret2
    81  }
    82  
    83  func (mock *MockEKSer) EksClusterExists(_param0 string, _param1 string, _param2 string) (bool, error) {
    84  	if mock == nil {
    85  		panic("mock must not be nil. Use myMock := NewMockEKSer().")
    86  	}
    87  	params := []pegomock.Param{_param0, _param1, _param2}
    88  	result := pegomock.GetGenericMockFrom(mock).Invoke("EksClusterExists", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
    89  	var ret0 bool
    90  	var ret1 error
    91  	if len(result) != 0 {
    92  		if result[0] != nil {
    93  			ret0 = result[0].(bool)
    94  		}
    95  		if result[1] != nil {
    96  			ret1 = result[1].(error)
    97  		}
    98  	}
    99  	return ret0, ret1
   100  }
   101  
   102  func (mock *MockEKSer) EksClusterObsoleteStackExists(_param0 string, _param1 string, _param2 string) (bool, error) {
   103  	if mock == nil {
   104  		panic("mock must not be nil. Use myMock := NewMockEKSer().")
   105  	}
   106  	params := []pegomock.Param{_param0, _param1, _param2}
   107  	result := pegomock.GetGenericMockFrom(mock).Invoke("EksClusterObsoleteStackExists", params, []reflect.Type{reflect.TypeOf((*bool)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
   108  	var ret0 bool
   109  	var ret1 error
   110  	if len(result) != 0 {
   111  		if result[0] != nil {
   112  			ret0 = result[0].(bool)
   113  		}
   114  		if result[1] != nil {
   115  			ret1 = result[1].(error)
   116  		}
   117  	}
   118  	return ret0, ret1
   119  }
   120  
   121  func (mock *MockEKSer) GetClusterAsEKSCluster(_param0 string) (*eks.Cluster, error) {
   122  	if mock == nil {
   123  		panic("mock must not be nil. Use myMock := NewMockEKSer().")
   124  	}
   125  	params := []pegomock.Param{_param0}
   126  	result := pegomock.GetGenericMockFrom(mock).Invoke("GetClusterAsEKSCluster", params, []reflect.Type{reflect.TypeOf((**eks.Cluster)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
   127  	var ret0 *eks.Cluster
   128  	var ret1 error
   129  	if len(result) != 0 {
   130  		if result[0] != nil {
   131  			ret0 = result[0].(*eks.Cluster)
   132  		}
   133  		if result[1] != nil {
   134  			ret1 = result[1].(error)
   135  		}
   136  	}
   137  	return ret0, ret1
   138  }
   139  
   140  func (mock *MockEKSer) ListClusters() ([]*cluster.Cluster, error) {
   141  	if mock == nil {
   142  		panic("mock must not be nil. Use myMock := NewMockEKSer().")
   143  	}
   144  	params := []pegomock.Param{}
   145  	result := pegomock.GetGenericMockFrom(mock).Invoke("ListClusters", params, []reflect.Type{reflect.TypeOf((*[]*cluster.Cluster)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()})
   146  	var ret0 []*cluster.Cluster
   147  	var ret1 error
   148  	if len(result) != 0 {
   149  		if result[0] != nil {
   150  			ret0 = result[0].([]*cluster.Cluster)
   151  		}
   152  		if result[1] != nil {
   153  			ret1 = result[1].(error)
   154  		}
   155  	}
   156  	return ret0, ret1
   157  }
   158  
   159  func (mock *MockEKSer) VerifyWasCalledOnce() *VerifierMockEKSer {
   160  	return &VerifierMockEKSer{
   161  		mock:                   mock,
   162  		invocationCountMatcher: pegomock.Times(1),
   163  	}
   164  }
   165  
   166  func (mock *MockEKSer) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockEKSer {
   167  	return &VerifierMockEKSer{
   168  		mock:                   mock,
   169  		invocationCountMatcher: invocationCountMatcher,
   170  	}
   171  }
   172  
   173  func (mock *MockEKSer) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockEKSer {
   174  	return &VerifierMockEKSer{
   175  		mock:                   mock,
   176  		invocationCountMatcher: invocationCountMatcher,
   177  		inOrderContext:         inOrderContext,
   178  	}
   179  }
   180  
   181  func (mock *MockEKSer) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockEKSer {
   182  	return &VerifierMockEKSer{
   183  		mock:                   mock,
   184  		invocationCountMatcher: invocationCountMatcher,
   185  		timeout:                timeout,
   186  	}
   187  }
   188  
   189  type VerifierMockEKSer struct {
   190  	mock                   *MockEKSer
   191  	invocationCountMatcher pegomock.Matcher
   192  	inOrderContext         *pegomock.InOrderContext
   193  	timeout                time.Duration
   194  }
   195  
   196  func (verifier *VerifierMockEKSer) AddTagsToCluster(_param0 string, _param1 map[string]*string) *MockEKSer_AddTagsToCluster_OngoingVerification {
   197  	params := []pegomock.Param{_param0, _param1}
   198  	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "AddTagsToCluster", params, verifier.timeout)
   199  	return &MockEKSer_AddTagsToCluster_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
   200  }
   201  
   202  type MockEKSer_AddTagsToCluster_OngoingVerification struct {
   203  	mock              *MockEKSer
   204  	methodInvocations []pegomock.MethodInvocation
   205  }
   206  
   207  func (c *MockEKSer_AddTagsToCluster_OngoingVerification) GetCapturedArguments() (string, map[string]*string) {
   208  	_param0, _param1 := c.GetAllCapturedArguments()
   209  	return _param0[len(_param0)-1], _param1[len(_param1)-1]
   210  }
   211  
   212  func (c *MockEKSer_AddTagsToCluster_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []map[string]*string) {
   213  	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
   214  	if len(params) > 0 {
   215  		_param0 = make([]string, len(c.methodInvocations))
   216  		for u, param := range params[0] {
   217  			_param0[u] = param.(string)
   218  		}
   219  		_param1 = make([]map[string]*string, len(c.methodInvocations))
   220  		for u, param := range params[1] {
   221  			_param1[u] = param.(map[string]*string)
   222  		}
   223  	}
   224  	return
   225  }
   226  
   227  func (verifier *VerifierMockEKSer) CleanUpObsoleteEksClusterStack(_param0 string, _param1 string, _param2 string) *MockEKSer_CleanUpObsoleteEksClusterStack_OngoingVerification {
   228  	params := []pegomock.Param{_param0, _param1, _param2}
   229  	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CleanUpObsoleteEksClusterStack", params, verifier.timeout)
   230  	return &MockEKSer_CleanUpObsoleteEksClusterStack_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
   231  }
   232  
   233  type MockEKSer_CleanUpObsoleteEksClusterStack_OngoingVerification struct {
   234  	mock              *MockEKSer
   235  	methodInvocations []pegomock.MethodInvocation
   236  }
   237  
   238  func (c *MockEKSer_CleanUpObsoleteEksClusterStack_OngoingVerification) GetCapturedArguments() (string, string, string) {
   239  	_param0, _param1, _param2 := c.GetAllCapturedArguments()
   240  	return _param0[len(_param0)-1], _param1[len(_param1)-1], _param2[len(_param2)-1]
   241  }
   242  
   243  func (c *MockEKSer_CleanUpObsoleteEksClusterStack_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []string) {
   244  	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
   245  	if len(params) > 0 {
   246  		_param0 = make([]string, len(c.methodInvocations))
   247  		for u, param := range params[0] {
   248  			_param0[u] = param.(string)
   249  		}
   250  		_param1 = make([]string, len(c.methodInvocations))
   251  		for u, param := range params[1] {
   252  			_param1[u] = param.(string)
   253  		}
   254  		_param2 = make([]string, len(c.methodInvocations))
   255  		for u, param := range params[2] {
   256  			_param2[u] = param.(string)
   257  		}
   258  	}
   259  	return
   260  }
   261  
   262  func (verifier *VerifierMockEKSer) DescribeCluster(_param0 string) *MockEKSer_DescribeCluster_OngoingVerification {
   263  	params := []pegomock.Param{_param0}
   264  	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "DescribeCluster", params, verifier.timeout)
   265  	return &MockEKSer_DescribeCluster_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
   266  }
   267  
   268  type MockEKSer_DescribeCluster_OngoingVerification struct {
   269  	mock              *MockEKSer
   270  	methodInvocations []pegomock.MethodInvocation
   271  }
   272  
   273  func (c *MockEKSer_DescribeCluster_OngoingVerification) GetCapturedArguments() string {
   274  	_param0 := c.GetAllCapturedArguments()
   275  	return _param0[len(_param0)-1]
   276  }
   277  
   278  func (c *MockEKSer_DescribeCluster_OngoingVerification) GetAllCapturedArguments() (_param0 []string) {
   279  	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
   280  	if len(params) > 0 {
   281  		_param0 = make([]string, len(c.methodInvocations))
   282  		for u, param := range params[0] {
   283  			_param0[u] = param.(string)
   284  		}
   285  	}
   286  	return
   287  }
   288  
   289  func (verifier *VerifierMockEKSer) EksClusterExists(_param0 string, _param1 string, _param2 string) *MockEKSer_EksClusterExists_OngoingVerification {
   290  	params := []pegomock.Param{_param0, _param1, _param2}
   291  	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "EksClusterExists", params, verifier.timeout)
   292  	return &MockEKSer_EksClusterExists_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
   293  }
   294  
   295  type MockEKSer_EksClusterExists_OngoingVerification struct {
   296  	mock              *MockEKSer
   297  	methodInvocations []pegomock.MethodInvocation
   298  }
   299  
   300  func (c *MockEKSer_EksClusterExists_OngoingVerification) GetCapturedArguments() (string, string, string) {
   301  	_param0, _param1, _param2 := c.GetAllCapturedArguments()
   302  	return _param0[len(_param0)-1], _param1[len(_param1)-1], _param2[len(_param2)-1]
   303  }
   304  
   305  func (c *MockEKSer_EksClusterExists_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []string) {
   306  	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
   307  	if len(params) > 0 {
   308  		_param0 = make([]string, len(c.methodInvocations))
   309  		for u, param := range params[0] {
   310  			_param0[u] = param.(string)
   311  		}
   312  		_param1 = make([]string, len(c.methodInvocations))
   313  		for u, param := range params[1] {
   314  			_param1[u] = param.(string)
   315  		}
   316  		_param2 = make([]string, len(c.methodInvocations))
   317  		for u, param := range params[2] {
   318  			_param2[u] = param.(string)
   319  		}
   320  	}
   321  	return
   322  }
   323  
   324  func (verifier *VerifierMockEKSer) EksClusterObsoleteStackExists(_param0 string, _param1 string, _param2 string) *MockEKSer_EksClusterObsoleteStackExists_OngoingVerification {
   325  	params := []pegomock.Param{_param0, _param1, _param2}
   326  	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "EksClusterObsoleteStackExists", params, verifier.timeout)
   327  	return &MockEKSer_EksClusterObsoleteStackExists_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
   328  }
   329  
   330  type MockEKSer_EksClusterObsoleteStackExists_OngoingVerification struct {
   331  	mock              *MockEKSer
   332  	methodInvocations []pegomock.MethodInvocation
   333  }
   334  
   335  func (c *MockEKSer_EksClusterObsoleteStackExists_OngoingVerification) GetCapturedArguments() (string, string, string) {
   336  	_param0, _param1, _param2 := c.GetAllCapturedArguments()
   337  	return _param0[len(_param0)-1], _param1[len(_param1)-1], _param2[len(_param2)-1]
   338  }
   339  
   340  func (c *MockEKSer_EksClusterObsoleteStackExists_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []string) {
   341  	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
   342  	if len(params) > 0 {
   343  		_param0 = make([]string, len(c.methodInvocations))
   344  		for u, param := range params[0] {
   345  			_param0[u] = param.(string)
   346  		}
   347  		_param1 = make([]string, len(c.methodInvocations))
   348  		for u, param := range params[1] {
   349  			_param1[u] = param.(string)
   350  		}
   351  		_param2 = make([]string, len(c.methodInvocations))
   352  		for u, param := range params[2] {
   353  			_param2[u] = param.(string)
   354  		}
   355  	}
   356  	return
   357  }
   358  
   359  func (verifier *VerifierMockEKSer) GetClusterAsEKSCluster(_param0 string) *MockEKSer_GetClusterAsEKSCluster_OngoingVerification {
   360  	params := []pegomock.Param{_param0}
   361  	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "GetClusterAsEKSCluster", params, verifier.timeout)
   362  	return &MockEKSer_GetClusterAsEKSCluster_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
   363  }
   364  
   365  type MockEKSer_GetClusterAsEKSCluster_OngoingVerification struct {
   366  	mock              *MockEKSer
   367  	methodInvocations []pegomock.MethodInvocation
   368  }
   369  
   370  func (c *MockEKSer_GetClusterAsEKSCluster_OngoingVerification) GetCapturedArguments() string {
   371  	_param0 := c.GetAllCapturedArguments()
   372  	return _param0[len(_param0)-1]
   373  }
   374  
   375  func (c *MockEKSer_GetClusterAsEKSCluster_OngoingVerification) GetAllCapturedArguments() (_param0 []string) {
   376  	params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations)
   377  	if len(params) > 0 {
   378  		_param0 = make([]string, len(c.methodInvocations))
   379  		for u, param := range params[0] {
   380  			_param0[u] = param.(string)
   381  		}
   382  	}
   383  	return
   384  }
   385  
   386  func (verifier *VerifierMockEKSer) ListClusters() *MockEKSer_ListClusters_OngoingVerification {
   387  	params := []pegomock.Param{}
   388  	methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "ListClusters", params, verifier.timeout)
   389  	return &MockEKSer_ListClusters_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations}
   390  }
   391  
   392  type MockEKSer_ListClusters_OngoingVerification struct {
   393  	mock              *MockEKSer
   394  	methodInvocations []pegomock.MethodInvocation
   395  }
   396  
   397  func (c *MockEKSer_ListClusters_OngoingVerification) GetCapturedArguments() {
   398  }
   399  
   400  func (c *MockEKSer_ListClusters_OngoingVerification) GetAllCapturedArguments() {
   401  }