github.com/cs3org/reva/v2@v2.27.7/pkg/storage/utils/decomposedfs/permissions/mocks/CS3PermissionsClient.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 grpc "google.golang.org/grpc" 27 28 mock "github.com/stretchr/testify/mock" 29 30 permissionsv1beta1 "github.com/cs3org/go-cs3apis/cs3/permissions/v1beta1" 31 ) 32 33 // CS3PermissionsClient is an autogenerated mock type for the CS3PermissionsClient type 34 type CS3PermissionsClient struct { 35 mock.Mock 36 } 37 38 type CS3PermissionsClient_Expecter struct { 39 mock *mock.Mock 40 } 41 42 func (_m *CS3PermissionsClient) EXPECT() *CS3PermissionsClient_Expecter { 43 return &CS3PermissionsClient_Expecter{mock: &_m.Mock} 44 } 45 46 // CheckPermission provides a mock function with given fields: ctx, in, opts 47 func (_m *CS3PermissionsClient) CheckPermission(ctx context.Context, in *permissionsv1beta1.CheckPermissionRequest, opts ...grpc.CallOption) (*permissionsv1beta1.CheckPermissionResponse, error) { 48 _va := make([]interface{}, len(opts)) 49 for _i := range opts { 50 _va[_i] = opts[_i] 51 } 52 var _ca []interface{} 53 _ca = append(_ca, ctx, in) 54 _ca = append(_ca, _va...) 55 ret := _m.Called(_ca...) 56 57 if len(ret) == 0 { 58 panic("no return value specified for CheckPermission") 59 } 60 61 var r0 *permissionsv1beta1.CheckPermissionResponse 62 var r1 error 63 if rf, ok := ret.Get(0).(func(context.Context, *permissionsv1beta1.CheckPermissionRequest, ...grpc.CallOption) (*permissionsv1beta1.CheckPermissionResponse, error)); ok { 64 return rf(ctx, in, opts...) 65 } 66 if rf, ok := ret.Get(0).(func(context.Context, *permissionsv1beta1.CheckPermissionRequest, ...grpc.CallOption) *permissionsv1beta1.CheckPermissionResponse); ok { 67 r0 = rf(ctx, in, opts...) 68 } else { 69 if ret.Get(0) != nil { 70 r0 = ret.Get(0).(*permissionsv1beta1.CheckPermissionResponse) 71 } 72 } 73 74 if rf, ok := ret.Get(1).(func(context.Context, *permissionsv1beta1.CheckPermissionRequest, ...grpc.CallOption) error); ok { 75 r1 = rf(ctx, in, opts...) 76 } else { 77 r1 = ret.Error(1) 78 } 79 80 return r0, r1 81 } 82 83 // CS3PermissionsClient_CheckPermission_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckPermission' 84 type CS3PermissionsClient_CheckPermission_Call struct { 85 *mock.Call 86 } 87 88 // CheckPermission is a helper method to define mock.On call 89 // - ctx context.Context 90 // - in *permissionsv1beta1.CheckPermissionRequest 91 // - opts ...grpc.CallOption 92 func (_e *CS3PermissionsClient_Expecter) CheckPermission(ctx interface{}, in interface{}, opts ...interface{}) *CS3PermissionsClient_CheckPermission_Call { 93 return &CS3PermissionsClient_CheckPermission_Call{Call: _e.mock.On("CheckPermission", 94 append([]interface{}{ctx, in}, opts...)...)} 95 } 96 97 func (_c *CS3PermissionsClient_CheckPermission_Call) Run(run func(ctx context.Context, in *permissionsv1beta1.CheckPermissionRequest, opts ...grpc.CallOption)) *CS3PermissionsClient_CheckPermission_Call { 98 _c.Call.Run(func(args mock.Arguments) { 99 variadicArgs := make([]grpc.CallOption, len(args)-2) 100 for i, a := range args[2:] { 101 if a != nil { 102 variadicArgs[i] = a.(grpc.CallOption) 103 } 104 } 105 run(args[0].(context.Context), args[1].(*permissionsv1beta1.CheckPermissionRequest), variadicArgs...) 106 }) 107 return _c 108 } 109 110 func (_c *CS3PermissionsClient_CheckPermission_Call) Return(_a0 *permissionsv1beta1.CheckPermissionResponse, _a1 error) *CS3PermissionsClient_CheckPermission_Call { 111 _c.Call.Return(_a0, _a1) 112 return _c 113 } 114 115 func (_c *CS3PermissionsClient_CheckPermission_Call) RunAndReturn(run func(context.Context, *permissionsv1beta1.CheckPermissionRequest, ...grpc.CallOption) (*permissionsv1beta1.CheckPermissionResponse, error)) *CS3PermissionsClient_CheckPermission_Call { 116 _c.Call.Return(run) 117 return _c 118 } 119 120 // NewCS3PermissionsClient creates a new instance of CS3PermissionsClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 121 // The first argument is typically a *testing.T value. 122 func NewCS3PermissionsClient(t interface { 123 mock.TestingT 124 Cleanup(func()) 125 }) *CS3PermissionsClient { 126 mock := &CS3PermissionsClient{} 127 mock.Mock.Test(t) 128 129 t.Cleanup(func() { mock.AssertExpectations(t) }) 130 131 return mock 132 }