github.com/argoproj/argo-cd/v3@v3.2.1/server/extension/mocks/UserGetter.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 "context" 9 10 mock "github.com/stretchr/testify/mock" 11 ) 12 13 // NewUserGetter creates a new instance of UserGetter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 14 // The first argument is typically a *testing.T value. 15 func NewUserGetter(t interface { 16 mock.TestingT 17 Cleanup(func()) 18 }) *UserGetter { 19 mock := &UserGetter{} 20 mock.Mock.Test(t) 21 22 t.Cleanup(func() { mock.AssertExpectations(t) }) 23 24 return mock 25 } 26 27 // UserGetter is an autogenerated mock type for the UserGetter type 28 type UserGetter struct { 29 mock.Mock 30 } 31 32 type UserGetter_Expecter struct { 33 mock *mock.Mock 34 } 35 36 func (_m *UserGetter) EXPECT() *UserGetter_Expecter { 37 return &UserGetter_Expecter{mock: &_m.Mock} 38 } 39 40 // GetGroups provides a mock function for the type UserGetter 41 func (_mock *UserGetter) GetGroups(ctx context.Context) []string { 42 ret := _mock.Called(ctx) 43 44 if len(ret) == 0 { 45 panic("no return value specified for GetGroups") 46 } 47 48 var r0 []string 49 if returnFunc, ok := ret.Get(0).(func(context.Context) []string); ok { 50 r0 = returnFunc(ctx) 51 } else { 52 if ret.Get(0) != nil { 53 r0 = ret.Get(0).([]string) 54 } 55 } 56 return r0 57 } 58 59 // UserGetter_GetGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGroups' 60 type UserGetter_GetGroups_Call struct { 61 *mock.Call 62 } 63 64 // GetGroups is a helper method to define mock.On call 65 // - ctx context.Context 66 func (_e *UserGetter_Expecter) GetGroups(ctx interface{}) *UserGetter_GetGroups_Call { 67 return &UserGetter_GetGroups_Call{Call: _e.mock.On("GetGroups", ctx)} 68 } 69 70 func (_c *UserGetter_GetGroups_Call) Run(run func(ctx context.Context)) *UserGetter_GetGroups_Call { 71 _c.Call.Run(func(args mock.Arguments) { 72 var arg0 context.Context 73 if args[0] != nil { 74 arg0 = args[0].(context.Context) 75 } 76 run( 77 arg0, 78 ) 79 }) 80 return _c 81 } 82 83 func (_c *UserGetter_GetGroups_Call) Return(strings []string) *UserGetter_GetGroups_Call { 84 _c.Call.Return(strings) 85 return _c 86 } 87 88 func (_c *UserGetter_GetGroups_Call) RunAndReturn(run func(ctx context.Context) []string) *UserGetter_GetGroups_Call { 89 _c.Call.Return(run) 90 return _c 91 } 92 93 // GetUserId provides a mock function for the type UserGetter 94 func (_mock *UserGetter) GetUserId(ctx context.Context) string { 95 ret := _mock.Called(ctx) 96 97 if len(ret) == 0 { 98 panic("no return value specified for GetUserId") 99 } 100 101 var r0 string 102 if returnFunc, ok := ret.Get(0).(func(context.Context) string); ok { 103 r0 = returnFunc(ctx) 104 } else { 105 r0 = ret.Get(0).(string) 106 } 107 return r0 108 } 109 110 // UserGetter_GetUserId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserId' 111 type UserGetter_GetUserId_Call struct { 112 *mock.Call 113 } 114 115 // GetUserId is a helper method to define mock.On call 116 // - ctx context.Context 117 func (_e *UserGetter_Expecter) GetUserId(ctx interface{}) *UserGetter_GetUserId_Call { 118 return &UserGetter_GetUserId_Call{Call: _e.mock.On("GetUserId", ctx)} 119 } 120 121 func (_c *UserGetter_GetUserId_Call) Run(run func(ctx context.Context)) *UserGetter_GetUserId_Call { 122 _c.Call.Run(func(args mock.Arguments) { 123 var arg0 context.Context 124 if args[0] != nil { 125 arg0 = args[0].(context.Context) 126 } 127 run( 128 arg0, 129 ) 130 }) 131 return _c 132 } 133 134 func (_c *UserGetter_GetUserId_Call) Return(s string) *UserGetter_GetUserId_Call { 135 _c.Call.Return(s) 136 return _c 137 } 138 139 func (_c *UserGetter_GetUserId_Call) RunAndReturn(run func(ctx context.Context) string) *UserGetter_GetUserId_Call { 140 _c.Call.Return(run) 141 return _c 142 } 143 144 // GetUsername provides a mock function for the type UserGetter 145 func (_mock *UserGetter) GetUsername(ctx context.Context) string { 146 ret := _mock.Called(ctx) 147 148 if len(ret) == 0 { 149 panic("no return value specified for GetUsername") 150 } 151 152 var r0 string 153 if returnFunc, ok := ret.Get(0).(func(context.Context) string); ok { 154 r0 = returnFunc(ctx) 155 } else { 156 r0 = ret.Get(0).(string) 157 } 158 return r0 159 } 160 161 // UserGetter_GetUsername_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUsername' 162 type UserGetter_GetUsername_Call struct { 163 *mock.Call 164 } 165 166 // GetUsername is a helper method to define mock.On call 167 // - ctx context.Context 168 func (_e *UserGetter_Expecter) GetUsername(ctx interface{}) *UserGetter_GetUsername_Call { 169 return &UserGetter_GetUsername_Call{Call: _e.mock.On("GetUsername", ctx)} 170 } 171 172 func (_c *UserGetter_GetUsername_Call) Run(run func(ctx context.Context)) *UserGetter_GetUsername_Call { 173 _c.Call.Run(func(args mock.Arguments) { 174 var arg0 context.Context 175 if args[0] != nil { 176 arg0 = args[0].(context.Context) 177 } 178 run( 179 arg0, 180 ) 181 }) 182 return _c 183 } 184 185 func (_c *UserGetter_GetUsername_Call) Return(s string) *UserGetter_GetUsername_Call { 186 _c.Call.Return(s) 187 return _c 188 } 189 190 func (_c *UserGetter_GetUsername_Call) RunAndReturn(run func(ctx context.Context) string) *UserGetter_GetUsername_Call { 191 _c.Call.Return(run) 192 return _c 193 }