github.com/cs3org/reva/v2@v2.27.7/pkg/storage/registry/spaces/mocks/StorageProviderClient.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 providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" 31 ) 32 33 // StorageProviderClient is an autogenerated mock type for the StorageProviderClient type 34 type StorageProviderClient struct { 35 mock.Mock 36 } 37 38 type StorageProviderClient_Expecter struct { 39 mock *mock.Mock 40 } 41 42 func (_m *StorageProviderClient) EXPECT() *StorageProviderClient_Expecter { 43 return &StorageProviderClient_Expecter{mock: &_m.Mock} 44 } 45 46 // ListStorageSpaces provides a mock function with given fields: ctx, in, opts 47 func (_m *StorageProviderClient) ListStorageSpaces(ctx context.Context, in *providerv1beta1.ListStorageSpacesRequest, opts ...grpc.CallOption) (*providerv1beta1.ListStorageSpacesResponse, 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 ListStorageSpaces") 59 } 60 61 var r0 *providerv1beta1.ListStorageSpacesResponse 62 var r1 error 63 if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ListStorageSpacesRequest, ...grpc.CallOption) (*providerv1beta1.ListStorageSpacesResponse, error)); ok { 64 return rf(ctx, in, opts...) 65 } 66 if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ListStorageSpacesRequest, ...grpc.CallOption) *providerv1beta1.ListStorageSpacesResponse); ok { 67 r0 = rf(ctx, in, opts...) 68 } else { 69 if ret.Get(0) != nil { 70 r0 = ret.Get(0).(*providerv1beta1.ListStorageSpacesResponse) 71 } 72 } 73 74 if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ListStorageSpacesRequest, ...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 // StorageProviderClient_ListStorageSpaces_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListStorageSpaces' 84 type StorageProviderClient_ListStorageSpaces_Call struct { 85 *mock.Call 86 } 87 88 // ListStorageSpaces is a helper method to define mock.On call 89 // - ctx context.Context 90 // - in *providerv1beta1.ListStorageSpacesRequest 91 // - opts ...grpc.CallOption 92 func (_e *StorageProviderClient_Expecter) ListStorageSpaces(ctx interface{}, in interface{}, opts ...interface{}) *StorageProviderClient_ListStorageSpaces_Call { 93 return &StorageProviderClient_ListStorageSpaces_Call{Call: _e.mock.On("ListStorageSpaces", 94 append([]interface{}{ctx, in}, opts...)...)} 95 } 96 97 func (_c *StorageProviderClient_ListStorageSpaces_Call) Run(run func(ctx context.Context, in *providerv1beta1.ListStorageSpacesRequest, opts ...grpc.CallOption)) *StorageProviderClient_ListStorageSpaces_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].(*providerv1beta1.ListStorageSpacesRequest), variadicArgs...) 106 }) 107 return _c 108 } 109 110 func (_c *StorageProviderClient_ListStorageSpaces_Call) Return(_a0 *providerv1beta1.ListStorageSpacesResponse, _a1 error) *StorageProviderClient_ListStorageSpaces_Call { 111 _c.Call.Return(_a0, _a1) 112 return _c 113 } 114 115 func (_c *StorageProviderClient_ListStorageSpaces_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ListStorageSpacesRequest, ...grpc.CallOption) (*providerv1beta1.ListStorageSpacesResponse, error)) *StorageProviderClient_ListStorageSpaces_Call { 116 _c.Call.Return(run) 117 return _c 118 } 119 120 // NewStorageProviderClient creates a new instance of StorageProviderClient. 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 NewStorageProviderClient(t interface { 123 mock.TestingT 124 Cleanup(func()) 125 }) *StorageProviderClient { 126 mock := &StorageProviderClient{} 127 mock.Mock.Test(t) 128 129 t.Cleanup(func() { mock.AssertExpectations(t) }) 130 131 return mock 132 }