github.com/cs3org/reva/v2@v2.27.7/pkg/share/manager/owncloudsql/mocks/UserConverter.go (about) 1 // Copyright 2018-2022 CERN 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // 15 // In applying this license, CERN does not waive the privileges and immunities 16 // granted to it by virtue of its status as an Intergovernmental Organization 17 // or submit itself to any jurisdiction. 18 19 // Code generated by mockery v2.40.2. DO NOT EDIT. 20 21 package mocks 22 23 import ( 24 context "context" 25 26 mock "github.com/stretchr/testify/mock" 27 28 userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" 29 ) 30 31 // UserConverter is an autogenerated mock type for the UserConverter type 32 type UserConverter struct { 33 mock.Mock 34 } 35 36 type UserConverter_Expecter struct { 37 mock *mock.Mock 38 } 39 40 func (_m *UserConverter) EXPECT() *UserConverter_Expecter { 41 return &UserConverter_Expecter{mock: &_m.Mock} 42 } 43 44 // GetUser provides a mock function with given fields: userid 45 func (_m *UserConverter) GetUser(userid *userv1beta1.UserId) (*userv1beta1.User, error) { 46 ret := _m.Called(userid) 47 48 if len(ret) == 0 { 49 panic("no return value specified for GetUser") 50 } 51 52 var r0 *userv1beta1.User 53 var r1 error 54 if rf, ok := ret.Get(0).(func(*userv1beta1.UserId) (*userv1beta1.User, error)); ok { 55 return rf(userid) 56 } 57 if rf, ok := ret.Get(0).(func(*userv1beta1.UserId) *userv1beta1.User); ok { 58 r0 = rf(userid) 59 } else { 60 if ret.Get(0) != nil { 61 r0 = ret.Get(0).(*userv1beta1.User) 62 } 63 } 64 65 if rf, ok := ret.Get(1).(func(*userv1beta1.UserId) error); ok { 66 r1 = rf(userid) 67 } else { 68 r1 = ret.Error(1) 69 } 70 71 return r0, r1 72 } 73 74 // UserConverter_GetUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUser' 75 type UserConverter_GetUser_Call struct { 76 *mock.Call 77 } 78 79 // GetUser is a helper method to define mock.On call 80 // - userid *userv1beta1.UserId 81 func (_e *UserConverter_Expecter) GetUser(userid interface{}) *UserConverter_GetUser_Call { 82 return &UserConverter_GetUser_Call{Call: _e.mock.On("GetUser", userid)} 83 } 84 85 func (_c *UserConverter_GetUser_Call) Run(run func(userid *userv1beta1.UserId)) *UserConverter_GetUser_Call { 86 _c.Call.Run(func(args mock.Arguments) { 87 run(args[0].(*userv1beta1.UserId)) 88 }) 89 return _c 90 } 91 92 func (_c *UserConverter_GetUser_Call) Return(_a0 *userv1beta1.User, _a1 error) *UserConverter_GetUser_Call { 93 _c.Call.Return(_a0, _a1) 94 return _c 95 } 96 97 func (_c *UserConverter_GetUser_Call) RunAndReturn(run func(*userv1beta1.UserId) (*userv1beta1.User, error)) *UserConverter_GetUser_Call { 98 _c.Call.Return(run) 99 return _c 100 } 101 102 // UserIDToUserName provides a mock function with given fields: ctx, userid 103 func (_m *UserConverter) UserIDToUserName(ctx context.Context, userid *userv1beta1.UserId) (string, error) { 104 ret := _m.Called(ctx, userid) 105 106 if len(ret) == 0 { 107 panic("no return value specified for UserIDToUserName") 108 } 109 110 var r0 string 111 var r1 error 112 if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.UserId) (string, error)); ok { 113 return rf(ctx, userid) 114 } 115 if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.UserId) string); ok { 116 r0 = rf(ctx, userid) 117 } else { 118 r0 = ret.Get(0).(string) 119 } 120 121 if rf, ok := ret.Get(1).(func(context.Context, *userv1beta1.UserId) error); ok { 122 r1 = rf(ctx, userid) 123 } else { 124 r1 = ret.Error(1) 125 } 126 127 return r0, r1 128 } 129 130 // UserConverter_UserIDToUserName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserIDToUserName' 131 type UserConverter_UserIDToUserName_Call struct { 132 *mock.Call 133 } 134 135 // UserIDToUserName is a helper method to define mock.On call 136 // - ctx context.Context 137 // - userid *userv1beta1.UserId 138 func (_e *UserConverter_Expecter) UserIDToUserName(ctx interface{}, userid interface{}) *UserConverter_UserIDToUserName_Call { 139 return &UserConverter_UserIDToUserName_Call{Call: _e.mock.On("UserIDToUserName", ctx, userid)} 140 } 141 142 func (_c *UserConverter_UserIDToUserName_Call) Run(run func(ctx context.Context, userid *userv1beta1.UserId)) *UserConverter_UserIDToUserName_Call { 143 _c.Call.Run(func(args mock.Arguments) { 144 run(args[0].(context.Context), args[1].(*userv1beta1.UserId)) 145 }) 146 return _c 147 } 148 149 func (_c *UserConverter_UserIDToUserName_Call) Return(_a0 string, _a1 error) *UserConverter_UserIDToUserName_Call { 150 _c.Call.Return(_a0, _a1) 151 return _c 152 } 153 154 func (_c *UserConverter_UserIDToUserName_Call) RunAndReturn(run func(context.Context, *userv1beta1.UserId) (string, error)) *UserConverter_UserIDToUserName_Call { 155 _c.Call.Return(run) 156 return _c 157 } 158 159 // UserNameToUserID provides a mock function with given fields: ctx, username 160 func (_m *UserConverter) UserNameToUserID(ctx context.Context, username string) (*userv1beta1.UserId, error) { 161 ret := _m.Called(ctx, username) 162 163 if len(ret) == 0 { 164 panic("no return value specified for UserNameToUserID") 165 } 166 167 var r0 *userv1beta1.UserId 168 var r1 error 169 if rf, ok := ret.Get(0).(func(context.Context, string) (*userv1beta1.UserId, error)); ok { 170 return rf(ctx, username) 171 } 172 if rf, ok := ret.Get(0).(func(context.Context, string) *userv1beta1.UserId); ok { 173 r0 = rf(ctx, username) 174 } else { 175 if ret.Get(0) != nil { 176 r0 = ret.Get(0).(*userv1beta1.UserId) 177 } 178 } 179 180 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 181 r1 = rf(ctx, username) 182 } else { 183 r1 = ret.Error(1) 184 } 185 186 return r0, r1 187 } 188 189 // UserConverter_UserNameToUserID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserNameToUserID' 190 type UserConverter_UserNameToUserID_Call struct { 191 *mock.Call 192 } 193 194 // UserNameToUserID is a helper method to define mock.On call 195 // - ctx context.Context 196 // - username string 197 func (_e *UserConverter_Expecter) UserNameToUserID(ctx interface{}, username interface{}) *UserConverter_UserNameToUserID_Call { 198 return &UserConverter_UserNameToUserID_Call{Call: _e.mock.On("UserNameToUserID", ctx, username)} 199 } 200 201 func (_c *UserConverter_UserNameToUserID_Call) Run(run func(ctx context.Context, username string)) *UserConverter_UserNameToUserID_Call { 202 _c.Call.Run(func(args mock.Arguments) { 203 run(args[0].(context.Context), args[1].(string)) 204 }) 205 return _c 206 } 207 208 func (_c *UserConverter_UserNameToUserID_Call) Return(_a0 *userv1beta1.UserId, _a1 error) *UserConverter_UserNameToUserID_Call { 209 _c.Call.Return(_a0, _a1) 210 return _c 211 } 212 213 func (_c *UserConverter_UserNameToUserID_Call) RunAndReturn(run func(context.Context, string) (*userv1beta1.UserId, error)) *UserConverter_UserNameToUserID_Call { 214 _c.Call.Return(run) 215 return _c 216 } 217 218 // NewUserConverter creates a new instance of UserConverter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 219 // The first argument is typically a *testing.T value. 220 func NewUserConverter(t interface { 221 mock.TestingT 222 Cleanup(func()) 223 }) *UserConverter { 224 mock := &UserConverter{} 225 mock.Mock.Test(t) 226 227 t.Cleanup(func() { mock.AssertExpectations(t) }) 228 229 return mock 230 }