github.com/cs3org/reva/v2@v2.27.7/pkg/storage/utils/decomposedfs/usermapper/mocks/UserMapper.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  
    29  // UserMapper is an autogenerated mock type for the UserMapper type
    30  type UserMapper struct {
    31  	mock.Mock
    32  }
    33  
    34  type UserMapper_Expecter struct {
    35  	mock *mock.Mock
    36  }
    37  
    38  func (_m *UserMapper) EXPECT() *UserMapper_Expecter {
    39  	return &UserMapper_Expecter{mock: &_m.Mock}
    40  }
    41  
    42  // RunInBaseScope provides a mock function with given fields: f
    43  func (_m *UserMapper) RunInBaseScope(f func() error) error {
    44  	ret := _m.Called(f)
    45  
    46  	if len(ret) == 0 {
    47  		panic("no return value specified for RunInBaseScope")
    48  	}
    49  
    50  	var r0 error
    51  	if rf, ok := ret.Get(0).(func(func() error) error); ok {
    52  		r0 = rf(f)
    53  	} else {
    54  		r0 = ret.Error(0)
    55  	}
    56  
    57  	return r0
    58  }
    59  
    60  // UserMapper_RunInBaseScope_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunInBaseScope'
    61  type UserMapper_RunInBaseScope_Call struct {
    62  	*mock.Call
    63  }
    64  
    65  // RunInBaseScope is a helper method to define mock.On call
    66  //   - f func() error
    67  func (_e *UserMapper_Expecter) RunInBaseScope(f interface{}) *UserMapper_RunInBaseScope_Call {
    68  	return &UserMapper_RunInBaseScope_Call{Call: _e.mock.On("RunInBaseScope", f)}
    69  }
    70  
    71  func (_c *UserMapper_RunInBaseScope_Call) Run(run func(f func() error)) *UserMapper_RunInBaseScope_Call {
    72  	_c.Call.Run(func(args mock.Arguments) {
    73  		run(args[0].(func() error))
    74  	})
    75  	return _c
    76  }
    77  
    78  func (_c *UserMapper_RunInBaseScope_Call) Return(_a0 error) *UserMapper_RunInBaseScope_Call {
    79  	_c.Call.Return(_a0)
    80  	return _c
    81  }
    82  
    83  func (_c *UserMapper_RunInBaseScope_Call) RunAndReturn(run func(func() error) error) *UserMapper_RunInBaseScope_Call {
    84  	_c.Call.Return(run)
    85  	return _c
    86  }
    87  
    88  // ScopeBase provides a mock function with given fields:
    89  func (_m *UserMapper) ScopeBase() (func() error, error) {
    90  	ret := _m.Called()
    91  
    92  	if len(ret) == 0 {
    93  		panic("no return value specified for ScopeBase")
    94  	}
    95  
    96  	var r0 func() error
    97  	var r1 error
    98  	if rf, ok := ret.Get(0).(func() (func() error, error)); ok {
    99  		return rf()
   100  	}
   101  	if rf, ok := ret.Get(0).(func() func() error); ok {
   102  		r0 = rf()
   103  	} else {
   104  		if ret.Get(0) != nil {
   105  			r0 = ret.Get(0).(func() error)
   106  		}
   107  	}
   108  
   109  	if rf, ok := ret.Get(1).(func() error); ok {
   110  		r1 = rf()
   111  	} else {
   112  		r1 = ret.Error(1)
   113  	}
   114  
   115  	return r0, r1
   116  }
   117  
   118  // UserMapper_ScopeBase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeBase'
   119  type UserMapper_ScopeBase_Call struct {
   120  	*mock.Call
   121  }
   122  
   123  // ScopeBase is a helper method to define mock.On call
   124  func (_e *UserMapper_Expecter) ScopeBase() *UserMapper_ScopeBase_Call {
   125  	return &UserMapper_ScopeBase_Call{Call: _e.mock.On("ScopeBase")}
   126  }
   127  
   128  func (_c *UserMapper_ScopeBase_Call) Run(run func()) *UserMapper_ScopeBase_Call {
   129  	_c.Call.Run(func(args mock.Arguments) {
   130  		run()
   131  	})
   132  	return _c
   133  }
   134  
   135  func (_c *UserMapper_ScopeBase_Call) Return(_a0 func() error, _a1 error) *UserMapper_ScopeBase_Call {
   136  	_c.Call.Return(_a0, _a1)
   137  	return _c
   138  }
   139  
   140  func (_c *UserMapper_ScopeBase_Call) RunAndReturn(run func() (func() error, error)) *UserMapper_ScopeBase_Call {
   141  	_c.Call.Return(run)
   142  	return _c
   143  }
   144  
   145  // ScopeUser provides a mock function with given fields: ctx
   146  func (_m *UserMapper) ScopeUser(ctx context.Context) (func() error, error) {
   147  	ret := _m.Called(ctx)
   148  
   149  	if len(ret) == 0 {
   150  		panic("no return value specified for ScopeUser")
   151  	}
   152  
   153  	var r0 func() error
   154  	var r1 error
   155  	if rf, ok := ret.Get(0).(func(context.Context) (func() error, error)); ok {
   156  		return rf(ctx)
   157  	}
   158  	if rf, ok := ret.Get(0).(func(context.Context) func() error); ok {
   159  		r0 = rf(ctx)
   160  	} else {
   161  		if ret.Get(0) != nil {
   162  			r0 = ret.Get(0).(func() error)
   163  		}
   164  	}
   165  
   166  	if rf, ok := ret.Get(1).(func(context.Context) error); ok {
   167  		r1 = rf(ctx)
   168  	} else {
   169  		r1 = ret.Error(1)
   170  	}
   171  
   172  	return r0, r1
   173  }
   174  
   175  // UserMapper_ScopeUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeUser'
   176  type UserMapper_ScopeUser_Call struct {
   177  	*mock.Call
   178  }
   179  
   180  // ScopeUser is a helper method to define mock.On call
   181  //   - ctx context.Context
   182  func (_e *UserMapper_Expecter) ScopeUser(ctx interface{}) *UserMapper_ScopeUser_Call {
   183  	return &UserMapper_ScopeUser_Call{Call: _e.mock.On("ScopeUser", ctx)}
   184  }
   185  
   186  func (_c *UserMapper_ScopeUser_Call) Run(run func(ctx context.Context)) *UserMapper_ScopeUser_Call {
   187  	_c.Call.Run(func(args mock.Arguments) {
   188  		run(args[0].(context.Context))
   189  	})
   190  	return _c
   191  }
   192  
   193  func (_c *UserMapper_ScopeUser_Call) Return(_a0 func() error, _a1 error) *UserMapper_ScopeUser_Call {
   194  	_c.Call.Return(_a0, _a1)
   195  	return _c
   196  }
   197  
   198  func (_c *UserMapper_ScopeUser_Call) RunAndReturn(run func(context.Context) (func() error, error)) *UserMapper_ScopeUser_Call {
   199  	_c.Call.Return(run)
   200  	return _c
   201  }
   202  
   203  // ScopeUserByIds provides a mock function with given fields: uid, gid
   204  func (_m *UserMapper) ScopeUserByIds(uid int, gid int) (func() error, error) {
   205  	ret := _m.Called(uid, gid)
   206  
   207  	if len(ret) == 0 {
   208  		panic("no return value specified for ScopeUserByIds")
   209  	}
   210  
   211  	var r0 func() error
   212  	var r1 error
   213  	if rf, ok := ret.Get(0).(func(int, int) (func() error, error)); ok {
   214  		return rf(uid, gid)
   215  	}
   216  	if rf, ok := ret.Get(0).(func(int, int) func() error); ok {
   217  		r0 = rf(uid, gid)
   218  	} else {
   219  		if ret.Get(0) != nil {
   220  			r0 = ret.Get(0).(func() error)
   221  		}
   222  	}
   223  
   224  	if rf, ok := ret.Get(1).(func(int, int) error); ok {
   225  		r1 = rf(uid, gid)
   226  	} else {
   227  		r1 = ret.Error(1)
   228  	}
   229  
   230  	return r0, r1
   231  }
   232  
   233  // UserMapper_ScopeUserByIds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ScopeUserByIds'
   234  type UserMapper_ScopeUserByIds_Call struct {
   235  	*mock.Call
   236  }
   237  
   238  // ScopeUserByIds is a helper method to define mock.On call
   239  //   - uid int
   240  //   - gid int
   241  func (_e *UserMapper_Expecter) ScopeUserByIds(uid interface{}, gid interface{}) *UserMapper_ScopeUserByIds_Call {
   242  	return &UserMapper_ScopeUserByIds_Call{Call: _e.mock.On("ScopeUserByIds", uid, gid)}
   243  }
   244  
   245  func (_c *UserMapper_ScopeUserByIds_Call) Run(run func(uid int, gid int)) *UserMapper_ScopeUserByIds_Call {
   246  	_c.Call.Run(func(args mock.Arguments) {
   247  		run(args[0].(int), args[1].(int))
   248  	})
   249  	return _c
   250  }
   251  
   252  func (_c *UserMapper_ScopeUserByIds_Call) Return(_a0 func() error, _a1 error) *UserMapper_ScopeUserByIds_Call {
   253  	_c.Call.Return(_a0, _a1)
   254  	return _c
   255  }
   256  
   257  func (_c *UserMapper_ScopeUserByIds_Call) RunAndReturn(run func(int, int) (func() error, error)) *UserMapper_ScopeUserByIds_Call {
   258  	_c.Call.Return(run)
   259  	return _c
   260  }
   261  
   262  // NewUserMapper creates a new instance of UserMapper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   263  // The first argument is typically a *testing.T value.
   264  func NewUserMapper(t interface {
   265  	mock.TestingT
   266  	Cleanup(func())
   267  }) *UserMapper {
   268  	mock := &UserMapper{}
   269  	mock.Mock.Test(t)
   270  
   271  	t.Cleanup(func() { mock.AssertExpectations(t) })
   272  
   273  	return mock
   274  }