github.com/argoproj/argo-cd/v3@v3.2.1/server/extension/mocks/ApplicationGetter.go (about)

     1  // Code generated by mockery; DO NOT EDIT.
     2  // github.com/vektra/mockery
     3  // template: testify
     4  
     5  package mocks
     6  
     7  import (
     8  	"github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1"
     9  	mock "github.com/stretchr/testify/mock"
    10  )
    11  
    12  // NewApplicationGetter creates a new instance of ApplicationGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    13  // The first argument is typically a *testing.T value.
    14  func NewApplicationGetter(t interface {
    15  	mock.TestingT
    16  	Cleanup(func())
    17  }) *ApplicationGetter {
    18  	mock := &ApplicationGetter{}
    19  	mock.Mock.Test(t)
    20  
    21  	t.Cleanup(func() { mock.AssertExpectations(t) })
    22  
    23  	return mock
    24  }
    25  
    26  // ApplicationGetter is an autogenerated mock type for the ApplicationGetter type
    27  type ApplicationGetter struct {
    28  	mock.Mock
    29  }
    30  
    31  type ApplicationGetter_Expecter struct {
    32  	mock *mock.Mock
    33  }
    34  
    35  func (_m *ApplicationGetter) EXPECT() *ApplicationGetter_Expecter {
    36  	return &ApplicationGetter_Expecter{mock: &_m.Mock}
    37  }
    38  
    39  // Get provides a mock function for the type ApplicationGetter
    40  func (_mock *ApplicationGetter) Get(ns string, name string) (*v1alpha1.Application, error) {
    41  	ret := _mock.Called(ns, name)
    42  
    43  	if len(ret) == 0 {
    44  		panic("no return value specified for Get")
    45  	}
    46  
    47  	var r0 *v1alpha1.Application
    48  	var r1 error
    49  	if returnFunc, ok := ret.Get(0).(func(string, string) (*v1alpha1.Application, error)); ok {
    50  		return returnFunc(ns, name)
    51  	}
    52  	if returnFunc, ok := ret.Get(0).(func(string, string) *v1alpha1.Application); ok {
    53  		r0 = returnFunc(ns, name)
    54  	} else {
    55  		if ret.Get(0) != nil {
    56  			r0 = ret.Get(0).(*v1alpha1.Application)
    57  		}
    58  	}
    59  	if returnFunc, ok := ret.Get(1).(func(string, string) error); ok {
    60  		r1 = returnFunc(ns, name)
    61  	} else {
    62  		r1 = ret.Error(1)
    63  	}
    64  	return r0, r1
    65  }
    66  
    67  // ApplicationGetter_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
    68  type ApplicationGetter_Get_Call struct {
    69  	*mock.Call
    70  }
    71  
    72  // Get is a helper method to define mock.On call
    73  //   - ns string
    74  //   - name string
    75  func (_e *ApplicationGetter_Expecter) Get(ns interface{}, name interface{}) *ApplicationGetter_Get_Call {
    76  	return &ApplicationGetter_Get_Call{Call: _e.mock.On("Get", ns, name)}
    77  }
    78  
    79  func (_c *ApplicationGetter_Get_Call) Run(run func(ns string, name string)) *ApplicationGetter_Get_Call {
    80  	_c.Call.Run(func(args mock.Arguments) {
    81  		var arg0 string
    82  		if args[0] != nil {
    83  			arg0 = args[0].(string)
    84  		}
    85  		var arg1 string
    86  		if args[1] != nil {
    87  			arg1 = args[1].(string)
    88  		}
    89  		run(
    90  			arg0,
    91  			arg1,
    92  		)
    93  	})
    94  	return _c
    95  }
    96  
    97  func (_c *ApplicationGetter_Get_Call) Return(application *v1alpha1.Application, err error) *ApplicationGetter_Get_Call {
    98  	_c.Call.Return(application, err)
    99  	return _c
   100  }
   101  
   102  func (_c *ApplicationGetter_Get_Call) RunAndReturn(run func(ns string, name string) (*v1alpha1.Application, error)) *ApplicationGetter_Get_Call {
   103  	_c.Call.Return(run)
   104  	return _c
   105  }