mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-23 22:29:59 -05:00
build: Modify mockery config to work with v3
Maintaining the positioning of the files from v2 to reduce cognitive
load.
Indentation of yaml files now matches `.editorconfig`.
All mock files regenerated.
Added empty `{}` following convention from `mockery init` etc.
Removed directory specification where it would already match.
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
issue-845-fix: True
|
||||
resolve-type-alias: False
|
||||
with-expecter: true
|
||||
disable-version-string: True
|
||||
# maintain v2 separate mocks dir
|
||||
dir: "{{.InterfaceDir}}/mocks"
|
||||
structname: "{{.InterfaceName}}"
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
dir: "{{.PackageName}}/mocks"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
pkgname: mocks
|
||||
|
||||
template: testify
|
||||
packages:
|
||||
github.com/opencloud-eu/opencloud/pkg/oidc:
|
||||
interfaces:
|
||||
OIDCClient:
|
||||
github.com/opencloud-eu/opencloud/pkg/oidc:
|
||||
interfaces:
|
||||
OIDCClient: {}
|
||||
|
||||
@@ -1,18 +1,32 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"context"
|
||||
|
||||
jwt "github.com/golang-jwt/jwt/v5"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/opencloud-eu/opencloud/pkg/oidc"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
oauth2 "golang.org/x/oauth2"
|
||||
|
||||
oidc "github.com/opencloud-eu/opencloud/pkg/oidc"
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
// NewOIDCClient creates a new instance of OIDCClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewOIDCClient(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *OIDCClient {
|
||||
mock := &OIDCClient{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// OIDCClient is an autogenerated mock type for the OIDCClient type
|
||||
type OIDCClient struct {
|
||||
mock.Mock
|
||||
@@ -26,9 +40,9 @@ func (_m *OIDCClient) EXPECT() *OIDCClient_Expecter {
|
||||
return &OIDCClient_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// UserInfo provides a mock function with given fields: ctx, ts
|
||||
func (_m *OIDCClient) UserInfo(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) {
|
||||
ret := _m.Called(ctx, ts)
|
||||
// UserInfo provides a mock function for the type OIDCClient
|
||||
func (_mock *OIDCClient) UserInfo(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) {
|
||||
ret := _mock.Called(ctx, ts)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UserInfo")
|
||||
@@ -36,23 +50,21 @@ func (_m *OIDCClient) UserInfo(ctx context.Context, ts oauth2.TokenSource) (*oid
|
||||
|
||||
var r0 *oidc.UserInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, oauth2.TokenSource) (*oidc.UserInfo, error)); ok {
|
||||
return rf(ctx, ts)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, oauth2.TokenSource) (*oidc.UserInfo, error)); ok {
|
||||
return returnFunc(ctx, ts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, oauth2.TokenSource) *oidc.UserInfo); ok {
|
||||
r0 = rf(ctx, ts)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, oauth2.TokenSource) *oidc.UserInfo); ok {
|
||||
r0 = returnFunc(ctx, ts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*oidc.UserInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, oauth2.TokenSource) error); ok {
|
||||
r1 = rf(ctx, ts)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, oauth2.TokenSource) error); ok {
|
||||
r1 = returnFunc(ctx, ts)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -70,24 +82,35 @@ func (_e *OIDCClient_Expecter) UserInfo(ctx interface{}, ts interface{}) *OIDCCl
|
||||
|
||||
func (_c *OIDCClient_UserInfo_Call) Run(run func(ctx context.Context, ts oauth2.TokenSource)) *OIDCClient_UserInfo_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(oauth2.TokenSource))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 oauth2.TokenSource
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(oauth2.TokenSource)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *OIDCClient_UserInfo_Call) Return(_a0 *oidc.UserInfo, _a1 error) *OIDCClient_UserInfo_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *OIDCClient_UserInfo_Call) Return(userInfo *oidc.UserInfo, err error) *OIDCClient_UserInfo_Call {
|
||||
_c.Call.Return(userInfo, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *OIDCClient_UserInfo_Call) RunAndReturn(run func(context.Context, oauth2.TokenSource) (*oidc.UserInfo, error)) *OIDCClient_UserInfo_Call {
|
||||
func (_c *OIDCClient_UserInfo_Call) RunAndReturn(run func(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error)) *OIDCClient_UserInfo_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// VerifyAccessToken provides a mock function with given fields: ctx, token
|
||||
func (_m *OIDCClient) VerifyAccessToken(ctx context.Context, token string) (oidc.RegClaimsWithSID, jwt.MapClaims, error) {
|
||||
ret := _m.Called(ctx, token)
|
||||
// VerifyAccessToken provides a mock function for the type OIDCClient
|
||||
func (_mock *OIDCClient) VerifyAccessToken(ctx context.Context, token string) (oidc.RegClaimsWithSID, jwt.MapClaims, error) {
|
||||
ret := _mock.Called(ctx, token)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for VerifyAccessToken")
|
||||
@@ -96,29 +119,26 @@ func (_m *OIDCClient) VerifyAccessToken(ctx context.Context, token string) (oidc
|
||||
var r0 oidc.RegClaimsWithSID
|
||||
var r1 jwt.MapClaims
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) (oidc.RegClaimsWithSID, jwt.MapClaims, error)); ok {
|
||||
return rf(ctx, token)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (oidc.RegClaimsWithSID, jwt.MapClaims, error)); ok {
|
||||
return returnFunc(ctx, token)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) oidc.RegClaimsWithSID); ok {
|
||||
r0 = rf(ctx, token)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) oidc.RegClaimsWithSID); ok {
|
||||
r0 = returnFunc(ctx, token)
|
||||
} else {
|
||||
r0 = ret.Get(0).(oidc.RegClaimsWithSID)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) jwt.MapClaims); ok {
|
||||
r1 = rf(ctx, token)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string) jwt.MapClaims); ok {
|
||||
r1 = returnFunc(ctx, token)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(jwt.MapClaims)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(context.Context, string) error); ok {
|
||||
r2 = rf(ctx, token)
|
||||
if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok {
|
||||
r2 = returnFunc(ctx, token)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
@@ -136,24 +156,35 @@ func (_e *OIDCClient_Expecter) VerifyAccessToken(ctx interface{}, token interfac
|
||||
|
||||
func (_c *OIDCClient_VerifyAccessToken_Call) Run(run func(ctx context.Context, token string)) *OIDCClient_VerifyAccessToken_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *OIDCClient_VerifyAccessToken_Call) Return(_a0 oidc.RegClaimsWithSID, _a1 jwt.MapClaims, _a2 error) *OIDCClient_VerifyAccessToken_Call {
|
||||
_c.Call.Return(_a0, _a1, _a2)
|
||||
func (_c *OIDCClient_VerifyAccessToken_Call) Return(regClaimsWithSID oidc.RegClaimsWithSID, mapClaims jwt.MapClaims, err error) *OIDCClient_VerifyAccessToken_Call {
|
||||
_c.Call.Return(regClaimsWithSID, mapClaims, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *OIDCClient_VerifyAccessToken_Call) RunAndReturn(run func(context.Context, string) (oidc.RegClaimsWithSID, jwt.MapClaims, error)) *OIDCClient_VerifyAccessToken_Call {
|
||||
func (_c *OIDCClient_VerifyAccessToken_Call) RunAndReturn(run func(ctx context.Context, token string) (oidc.RegClaimsWithSID, jwt.MapClaims, error)) *OIDCClient_VerifyAccessToken_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// VerifyLogoutToken provides a mock function with given fields: ctx, token
|
||||
func (_m *OIDCClient) VerifyLogoutToken(ctx context.Context, token string) (*oidc.LogoutToken, error) {
|
||||
ret := _m.Called(ctx, token)
|
||||
// VerifyLogoutToken provides a mock function for the type OIDCClient
|
||||
func (_mock *OIDCClient) VerifyLogoutToken(ctx context.Context, token string) (*oidc.LogoutToken, error) {
|
||||
ret := _mock.Called(ctx, token)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for VerifyLogoutToken")
|
||||
@@ -161,23 +192,21 @@ func (_m *OIDCClient) VerifyLogoutToken(ctx context.Context, token string) (*oid
|
||||
|
||||
var r0 *oidc.LogoutToken
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) (*oidc.LogoutToken, error)); ok {
|
||||
return rf(ctx, token)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*oidc.LogoutToken, error)); ok {
|
||||
return returnFunc(ctx, token)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) *oidc.LogoutToken); ok {
|
||||
r0 = rf(ctx, token)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) *oidc.LogoutToken); ok {
|
||||
r0 = returnFunc(ctx, token)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*oidc.LogoutToken)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, token)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = returnFunc(ctx, token)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -195,31 +224,28 @@ func (_e *OIDCClient_Expecter) VerifyLogoutToken(ctx interface{}, token interfac
|
||||
|
||||
func (_c *OIDCClient_VerifyLogoutToken_Call) Run(run func(ctx context.Context, token string)) *OIDCClient_VerifyLogoutToken_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *OIDCClient_VerifyLogoutToken_Call) Return(_a0 *oidc.LogoutToken, _a1 error) *OIDCClient_VerifyLogoutToken_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *OIDCClient_VerifyLogoutToken_Call) Return(logoutToken *oidc.LogoutToken, err error) *OIDCClient_VerifyLogoutToken_Call {
|
||||
_c.Call.Return(logoutToken, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *OIDCClient_VerifyLogoutToken_Call) RunAndReturn(run func(context.Context, string) (*oidc.LogoutToken, error)) *OIDCClient_VerifyLogoutToken_Call {
|
||||
func (_c *OIDCClient_VerifyLogoutToken_Call) RunAndReturn(run func(ctx context.Context, token string) (*oidc.LogoutToken, error)) *OIDCClient_VerifyLogoutToken_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewOIDCClient creates a new instance of OIDCClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewOIDCClient(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *OIDCClient {
|
||||
mock := &OIDCClient{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
issue-845-fix: True
|
||||
resolve-type-alias: False
|
||||
with-expecter: true
|
||||
disable-version-string: True
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
# maintain v2 separate mocks dir
|
||||
dir: "{{.InterfaceDir}}/mocks"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
structname: "{{.InterfaceName}}"
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
pkgname: mocks
|
||||
|
||||
template: testify
|
||||
packages:
|
||||
github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/eventhistory/v0:
|
||||
interfaces:
|
||||
EventHistoryService:
|
||||
github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/policies/v0:
|
||||
interfaces:
|
||||
PoliciesProviderService:
|
||||
github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0:
|
||||
interfaces:
|
||||
SearchProviderService:
|
||||
github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0:
|
||||
interfaces:
|
||||
ValueService:
|
||||
github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/thumbnails/v0:
|
||||
interfaces:
|
||||
ThumbnailService:
|
||||
github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/eventhistory/v0:
|
||||
interfaces:
|
||||
EventHistoryService: {}
|
||||
github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/policies/v0:
|
||||
interfaces:
|
||||
PoliciesProviderService: {}
|
||||
github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0:
|
||||
interfaces:
|
||||
SearchProviderService: {}
|
||||
github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0:
|
||||
interfaces:
|
||||
ValueService: {}
|
||||
github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/thumbnails/v0:
|
||||
interfaces:
|
||||
ThumbnailService: {}
|
||||
|
||||
@@ -1,178 +1,17 @@
|
||||
// Code generated by mockery v2.50.2. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
client "go-micro.dev/v4/client"
|
||||
"context"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/eventhistory/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/eventhistory/v0"
|
||||
"go-micro.dev/v4/client"
|
||||
)
|
||||
|
||||
// EventHistoryService is an autogenerated mock type for the EventHistoryService type
|
||||
type EventHistoryService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type EventHistoryService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *EventHistoryService) EXPECT() *EventHistoryService_Expecter {
|
||||
return &EventHistoryService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetEvents provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *EventHistoryService) GetEvents(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetEvents")
|
||||
}
|
||||
|
||||
var r0 *v0.GetEventsResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) *v0.GetEventsResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetEventsResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// EventHistoryService_GetEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEvents'
|
||||
type EventHistoryService_GetEvents_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetEvents is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.GetEventsRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *EventHistoryService_Expecter) GetEvents(ctx interface{}, in interface{}, opts ...interface{}) *EventHistoryService_GetEvents_Call {
|
||||
return &EventHistoryService_GetEvents_Call{Call: _e.mock.On("GetEvents",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEvents_Call) Run(run func(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption)) *EventHistoryService_GetEvents_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.GetEventsRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEvents_Call) Return(_a0 *v0.GetEventsResponse, _a1 error) *EventHistoryService_GetEvents_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEvents_Call) RunAndReturn(run func(context.Context, *v0.GetEventsRequest, ...client.CallOption) (*v0.GetEventsResponse, error)) *EventHistoryService_GetEvents_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetEventsForUser provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *EventHistoryService) GetEventsForUser(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetEventsForUser")
|
||||
}
|
||||
|
||||
var r0 *v0.GetEventsResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) *v0.GetEventsResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetEventsResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// EventHistoryService_GetEventsForUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEventsForUser'
|
||||
type EventHistoryService_GetEventsForUser_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetEventsForUser is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.GetEventsForUserRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *EventHistoryService_Expecter) GetEventsForUser(ctx interface{}, in interface{}, opts ...interface{}) *EventHistoryService_GetEventsForUser_Call {
|
||||
return &EventHistoryService_GetEventsForUser_Call{Call: _e.mock.On("GetEventsForUser",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEventsForUser_Call) Run(run func(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption)) *EventHistoryService_GetEventsForUser_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.GetEventsForUserRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEventsForUser_Call) Return(_a0 *v0.GetEventsResponse, _a1 error) *EventHistoryService_GetEventsForUser_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEventsForUser_Call) RunAndReturn(run func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) (*v0.GetEventsResponse, error)) *EventHistoryService_GetEventsForUser_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewEventHistoryService creates a new instance of EventHistoryService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewEventHistoryService(t interface {
|
||||
@@ -186,3 +25,148 @@ func NewEventHistoryService(t interface {
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// EventHistoryService is an autogenerated mock type for the EventHistoryService type
|
||||
type EventHistoryService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type EventHistoryService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *EventHistoryService) EXPECT() *EventHistoryService_Expecter {
|
||||
return &EventHistoryService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetEvents provides a mock function for the type EventHistoryService
|
||||
func (_mock *EventHistoryService) GetEvents(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetEvents")
|
||||
}
|
||||
|
||||
var r0 *v0.GetEventsResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) *v0.GetEventsResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetEventsResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// EventHistoryService_GetEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEvents'
|
||||
type EventHistoryService_GetEvents_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetEvents is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - in
|
||||
// - opts
|
||||
func (_e *EventHistoryService_Expecter) GetEvents(ctx interface{}, in interface{}, opts ...interface{}) *EventHistoryService_GetEvents_Call {
|
||||
return &EventHistoryService_GetEvents_Call{Call: _e.mock.On("GetEvents",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEvents_Call) Run(run func(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption)) *EventHistoryService_GetEvents_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := args[2].([]client.CallOption)
|
||||
run(args[0].(context.Context), args[1].(*v0.GetEventsRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEvents_Call) Return(getEventsResponse *v0.GetEventsResponse, err error) *EventHistoryService_GetEvents_Call {
|
||||
_c.Call.Return(getEventsResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEvents_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error)) *EventHistoryService_GetEvents_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetEventsForUser provides a mock function for the type EventHistoryService
|
||||
func (_mock *EventHistoryService) GetEventsForUser(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetEventsForUser")
|
||||
}
|
||||
|
||||
var r0 *v0.GetEventsResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) *v0.GetEventsResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetEventsResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// EventHistoryService_GetEventsForUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEventsForUser'
|
||||
type EventHistoryService_GetEventsForUser_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetEventsForUser is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - in
|
||||
// - opts
|
||||
func (_e *EventHistoryService_Expecter) GetEventsForUser(ctx interface{}, in interface{}, opts ...interface{}) *EventHistoryService_GetEventsForUser_Call {
|
||||
return &EventHistoryService_GetEventsForUser_Call{Call: _e.mock.On("GetEventsForUser",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEventsForUser_Call) Run(run func(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption)) *EventHistoryService_GetEventsForUser_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := args[2].([]client.CallOption)
|
||||
run(args[0].(context.Context), args[1].(*v0.GetEventsForUserRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEventsForUser_Call) Return(getEventsResponse *v0.GetEventsResponse, err error) *EventHistoryService_GetEventsForUser_Call {
|
||||
_c.Call.Return(getEventsResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *EventHistoryService_GetEventsForUser_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error)) *EventHistoryService_GetEventsForUser_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
@@ -1,104 +1,17 @@
|
||||
// Code generated by mockery v2.50.2. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
client "go-micro.dev/v4/client"
|
||||
"context"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/policies/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/policies/v0"
|
||||
"go-micro.dev/v4/client"
|
||||
)
|
||||
|
||||
// PoliciesProviderService is an autogenerated mock type for the PoliciesProviderService type
|
||||
type PoliciesProviderService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type PoliciesProviderService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *PoliciesProviderService) EXPECT() *PoliciesProviderService_Expecter {
|
||||
return &PoliciesProviderService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Evaluate provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *PoliciesProviderService) Evaluate(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption) (*v0.EvaluateResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Evaluate")
|
||||
}
|
||||
|
||||
var r0 *v0.EvaluateResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) (*v0.EvaluateResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) *v0.EvaluateResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.EvaluateResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PoliciesProviderService_Evaluate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Evaluate'
|
||||
type PoliciesProviderService_Evaluate_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// Evaluate is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.EvaluateRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *PoliciesProviderService_Expecter) Evaluate(ctx interface{}, in interface{}, opts ...interface{}) *PoliciesProviderService_Evaluate_Call {
|
||||
return &PoliciesProviderService_Evaluate_Call{Call: _e.mock.On("Evaluate",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *PoliciesProviderService_Evaluate_Call) Run(run func(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption)) *PoliciesProviderService_Evaluate_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.EvaluateRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *PoliciesProviderService_Evaluate_Call) Return(_a0 *v0.EvaluateResponse, _a1 error) *PoliciesProviderService_Evaluate_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *PoliciesProviderService_Evaluate_Call) RunAndReturn(run func(context.Context, *v0.EvaluateRequest, ...client.CallOption) (*v0.EvaluateResponse, error)) *PoliciesProviderService_Evaluate_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewPoliciesProviderService creates a new instance of PoliciesProviderService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewPoliciesProviderService(t interface {
|
||||
@@ -112,3 +25,82 @@ func NewPoliciesProviderService(t interface {
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// PoliciesProviderService is an autogenerated mock type for the PoliciesProviderService type
|
||||
type PoliciesProviderService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type PoliciesProviderService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *PoliciesProviderService) EXPECT() *PoliciesProviderService_Expecter {
|
||||
return &PoliciesProviderService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Evaluate provides a mock function for the type PoliciesProviderService
|
||||
func (_mock *PoliciesProviderService) Evaluate(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption) (*v0.EvaluateResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Evaluate")
|
||||
}
|
||||
|
||||
var r0 *v0.EvaluateResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) (*v0.EvaluateResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) *v0.EvaluateResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.EvaluateResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.EvaluateRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// PoliciesProviderService_Evaluate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Evaluate'
|
||||
type PoliciesProviderService_Evaluate_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// Evaluate is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - in
|
||||
// - opts
|
||||
func (_e *PoliciesProviderService_Expecter) Evaluate(ctx interface{}, in interface{}, opts ...interface{}) *PoliciesProviderService_Evaluate_Call {
|
||||
return &PoliciesProviderService_Evaluate_Call{Call: _e.mock.On("Evaluate",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *PoliciesProviderService_Evaluate_Call) Run(run func(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption)) *PoliciesProviderService_Evaluate_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := args[2].([]client.CallOption)
|
||||
run(args[0].(context.Context), args[1].(*v0.EvaluateRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *PoliciesProviderService_Evaluate_Call) Return(evaluateResponse *v0.EvaluateResponse, err error) *PoliciesProviderService_Evaluate_Call {
|
||||
_c.Call.Return(evaluateResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *PoliciesProviderService_Evaluate_Call) RunAndReturn(run func(ctx context.Context, in *v0.EvaluateRequest, opts ...client.CallOption) (*v0.EvaluateResponse, error)) *PoliciesProviderService_Evaluate_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
@@ -1,178 +1,17 @@
|
||||
// Code generated by mockery v2.50.2. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
client "go-micro.dev/v4/client"
|
||||
"context"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0"
|
||||
"go-micro.dev/v4/client"
|
||||
)
|
||||
|
||||
// SearchProviderService is an autogenerated mock type for the SearchProviderService type
|
||||
type SearchProviderService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type SearchProviderService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *SearchProviderService) EXPECT() *SearchProviderService_Expecter {
|
||||
return &SearchProviderService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// IndexSpace provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *SearchProviderService) IndexSpace(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption) (*v0.IndexSpaceResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for IndexSpace")
|
||||
}
|
||||
|
||||
var r0 *v0.IndexSpaceResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) (*v0.IndexSpaceResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) *v0.IndexSpaceResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.IndexSpaceResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchProviderService_IndexSpace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexSpace'
|
||||
type SearchProviderService_IndexSpace_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// IndexSpace is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.IndexSpaceRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *SearchProviderService_Expecter) IndexSpace(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_IndexSpace_Call {
|
||||
return &SearchProviderService_IndexSpace_Call{Call: _e.mock.On("IndexSpace",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_IndexSpace_Call) Run(run func(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption)) *SearchProviderService_IndexSpace_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.IndexSpaceRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_IndexSpace_Call) Return(_a0 *v0.IndexSpaceResponse, _a1 error) *SearchProviderService_IndexSpace_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_IndexSpace_Call) RunAndReturn(run func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) (*v0.IndexSpaceResponse, error)) *SearchProviderService_IndexSpace_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Search provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *SearchProviderService) Search(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption) (*v0.SearchResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Search")
|
||||
}
|
||||
|
||||
var r0 *v0.SearchResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) (*v0.SearchResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) *v0.SearchResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.SearchResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.SearchRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchProviderService_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search'
|
||||
type SearchProviderService_Search_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// Search is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.SearchRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *SearchProviderService_Expecter) Search(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_Search_Call {
|
||||
return &SearchProviderService_Search_Call{Call: _e.mock.On("Search",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_Search_Call) Run(run func(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption)) *SearchProviderService_Search_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.SearchRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_Search_Call) Return(_a0 *v0.SearchResponse, _a1 error) *SearchProviderService_Search_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_Search_Call) RunAndReturn(run func(context.Context, *v0.SearchRequest, ...client.CallOption) (*v0.SearchResponse, error)) *SearchProviderService_Search_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewSearchProviderService creates a new instance of SearchProviderService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSearchProviderService(t interface {
|
||||
@@ -186,3 +25,148 @@ func NewSearchProviderService(t interface {
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// SearchProviderService is an autogenerated mock type for the SearchProviderService type
|
||||
type SearchProviderService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type SearchProviderService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *SearchProviderService) EXPECT() *SearchProviderService_Expecter {
|
||||
return &SearchProviderService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// IndexSpace provides a mock function for the type SearchProviderService
|
||||
func (_mock *SearchProviderService) IndexSpace(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption) (*v0.IndexSpaceResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for IndexSpace")
|
||||
}
|
||||
|
||||
var r0 *v0.IndexSpaceResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) (*v0.IndexSpaceResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) *v0.IndexSpaceResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.IndexSpaceResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.IndexSpaceRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchProviderService_IndexSpace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexSpace'
|
||||
type SearchProviderService_IndexSpace_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// IndexSpace is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - in
|
||||
// - opts
|
||||
func (_e *SearchProviderService_Expecter) IndexSpace(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_IndexSpace_Call {
|
||||
return &SearchProviderService_IndexSpace_Call{Call: _e.mock.On("IndexSpace",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_IndexSpace_Call) Run(run func(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption)) *SearchProviderService_IndexSpace_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := args[2].([]client.CallOption)
|
||||
run(args[0].(context.Context), args[1].(*v0.IndexSpaceRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_IndexSpace_Call) Return(indexSpaceResponse *v0.IndexSpaceResponse, err error) *SearchProviderService_IndexSpace_Call {
|
||||
_c.Call.Return(indexSpaceResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_IndexSpace_Call) RunAndReturn(run func(ctx context.Context, in *v0.IndexSpaceRequest, opts ...client.CallOption) (*v0.IndexSpaceResponse, error)) *SearchProviderService_IndexSpace_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Search provides a mock function for the type SearchProviderService
|
||||
func (_mock *SearchProviderService) Search(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption) (*v0.SearchResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Search")
|
||||
}
|
||||
|
||||
var r0 *v0.SearchResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) (*v0.SearchResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest, ...client.CallOption) *v0.SearchResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.SearchResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SearchRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SearchProviderService_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search'
|
||||
type SearchProviderService_Search_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// Search is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - in
|
||||
// - opts
|
||||
func (_e *SearchProviderService_Expecter) Search(ctx interface{}, in interface{}, opts ...interface{}) *SearchProviderService_Search_Call {
|
||||
return &SearchProviderService_Search_Call{Call: _e.mock.On("Search",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_Search_Call) Run(run func(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption)) *SearchProviderService_Search_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := args[2].([]client.CallOption)
|
||||
run(args[0].(context.Context), args[1].(*v0.SearchRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_Search_Call) Return(searchResponse *v0.SearchResponse, err error) *SearchProviderService_Search_Call {
|
||||
_c.Call.Return(searchResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *SearchProviderService_Search_Call) RunAndReturn(run func(ctx context.Context, in *v0.SearchRequest, opts ...client.CallOption) (*v0.SearchResponse, error)) *SearchProviderService_Search_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
@@ -1,326 +1,17 @@
|
||||
// Code generated by mockery v2.50.2. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
client "go-micro.dev/v4/client"
|
||||
"context"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0"
|
||||
"go-micro.dev/v4/client"
|
||||
)
|
||||
|
||||
// ValueService is an autogenerated mock type for the ValueService type
|
||||
type ValueService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type ValueService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *ValueService) EXPECT() *ValueService_Expecter {
|
||||
return &ValueService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetValue provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *ValueService) GetValue(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetValue")
|
||||
}
|
||||
|
||||
var r0 *v0.GetValueResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) *v0.GetValueResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetValueResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_GetValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValue'
|
||||
type ValueService_GetValue_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetValue is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.GetValueRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *ValueService_Expecter) GetValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValue_Call {
|
||||
return &ValueService_GetValue_Call{Call: _e.mock.On("GetValue",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValue_Call) Run(run func(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption)) *ValueService_GetValue_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.GetValueRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValue_Call) Return(_a0 *v0.GetValueResponse, _a1 error) *ValueService_GetValue_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValue_Call) RunAndReturn(run func(context.Context, *v0.GetValueRequest, ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValue_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetValueByUniqueIdentifiers provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *ValueService) GetValueByUniqueIdentifiers(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetValueByUniqueIdentifiers")
|
||||
}
|
||||
|
||||
var r0 *v0.GetValueResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) *v0.GetValueResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetValueResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_GetValueByUniqueIdentifiers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValueByUniqueIdentifiers'
|
||||
type ValueService_GetValueByUniqueIdentifiers_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetValueByUniqueIdentifiers is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.GetValueByUniqueIdentifiersRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *ValueService_Expecter) GetValueByUniqueIdentifiers(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
return &ValueService_GetValueByUniqueIdentifiers_Call{Call: _e.mock.On("GetValueByUniqueIdentifiers",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Run(run func(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption)) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.GetValueByUniqueIdentifiersRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Return(_a0 *v0.GetValueResponse, _a1 error) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) RunAndReturn(run func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListValues provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *ValueService) ListValues(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption) (*v0.ListValuesResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListValues")
|
||||
}
|
||||
|
||||
var r0 *v0.ListValuesResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) (*v0.ListValuesResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) *v0.ListValuesResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.ListValuesResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_ListValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListValues'
|
||||
type ValueService_ListValues_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ListValues is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.ListValuesRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *ValueService_Expecter) ListValues(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_ListValues_Call {
|
||||
return &ValueService_ListValues_Call{Call: _e.mock.On("ListValues",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_ListValues_Call) Run(run func(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption)) *ValueService_ListValues_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.ListValuesRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_ListValues_Call) Return(_a0 *v0.ListValuesResponse, _a1 error) *ValueService_ListValues_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_ListValues_Call) RunAndReturn(run func(context.Context, *v0.ListValuesRequest, ...client.CallOption) (*v0.ListValuesResponse, error)) *ValueService_ListValues_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SaveValue provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *ValueService) SaveValue(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption) (*v0.SaveValueResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveValue")
|
||||
}
|
||||
|
||||
var r0 *v0.SaveValueResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) (*v0.SaveValueResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) *v0.SaveValueResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.SaveValueResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_SaveValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveValue'
|
||||
type ValueService_SaveValue_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// SaveValue is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.SaveValueRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *ValueService_Expecter) SaveValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_SaveValue_Call {
|
||||
return &ValueService_SaveValue_Call{Call: _e.mock.On("SaveValue",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_SaveValue_Call) Run(run func(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption)) *ValueService_SaveValue_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.SaveValueRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_SaveValue_Call) Return(_a0 *v0.SaveValueResponse, _a1 error) *ValueService_SaveValue_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_SaveValue_Call) RunAndReturn(run func(context.Context, *v0.SaveValueRequest, ...client.CallOption) (*v0.SaveValueResponse, error)) *ValueService_SaveValue_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewValueService creates a new instance of ValueService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewValueService(t interface {
|
||||
@@ -334,3 +25,280 @@ func NewValueService(t interface {
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// ValueService is an autogenerated mock type for the ValueService type
|
||||
type ValueService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type ValueService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *ValueService) EXPECT() *ValueService_Expecter {
|
||||
return &ValueService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetValue provides a mock function for the type ValueService
|
||||
func (_mock *ValueService) GetValue(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetValue")
|
||||
}
|
||||
|
||||
var r0 *v0.GetValueResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) *v0.GetValueResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetValueResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_GetValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValue'
|
||||
type ValueService_GetValue_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetValue is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - in
|
||||
// - opts
|
||||
func (_e *ValueService_Expecter) GetValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValue_Call {
|
||||
return &ValueService_GetValue_Call{Call: _e.mock.On("GetValue",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValue_Call) Run(run func(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption)) *ValueService_GetValue_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := args[2].([]client.CallOption)
|
||||
run(args[0].(context.Context), args[1].(*v0.GetValueRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValue_Call) Return(getValueResponse *v0.GetValueResponse, err error) *ValueService_GetValue_Call {
|
||||
_c.Call.Return(getValueResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValue_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValue_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetValueByUniqueIdentifiers provides a mock function for the type ValueService
|
||||
func (_mock *ValueService) GetValueByUniqueIdentifiers(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetValueByUniqueIdentifiers")
|
||||
}
|
||||
|
||||
var r0 *v0.GetValueResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) *v0.GetValueResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetValueResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_GetValueByUniqueIdentifiers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValueByUniqueIdentifiers'
|
||||
type ValueService_GetValueByUniqueIdentifiers_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetValueByUniqueIdentifiers is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - in
|
||||
// - opts
|
||||
func (_e *ValueService_Expecter) GetValueByUniqueIdentifiers(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
return &ValueService_GetValueByUniqueIdentifiers_Call{Call: _e.mock.On("GetValueByUniqueIdentifiers",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Run(run func(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption)) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := args[2].([]client.CallOption)
|
||||
run(args[0].(context.Context), args[1].(*v0.GetValueByUniqueIdentifiersRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Return(getValueResponse *v0.GetValueResponse, err error) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Return(getValueResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListValues provides a mock function for the type ValueService
|
||||
func (_mock *ValueService) ListValues(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption) (*v0.ListValuesResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListValues")
|
||||
}
|
||||
|
||||
var r0 *v0.ListValuesResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) (*v0.ListValuesResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) *v0.ListValuesResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.ListValuesResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_ListValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListValues'
|
||||
type ValueService_ListValues_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ListValues is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - in
|
||||
// - opts
|
||||
func (_e *ValueService_Expecter) ListValues(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_ListValues_Call {
|
||||
return &ValueService_ListValues_Call{Call: _e.mock.On("ListValues",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_ListValues_Call) Run(run func(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption)) *ValueService_ListValues_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := args[2].([]client.CallOption)
|
||||
run(args[0].(context.Context), args[1].(*v0.ListValuesRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_ListValues_Call) Return(listValuesResponse *v0.ListValuesResponse, err error) *ValueService_ListValues_Call {
|
||||
_c.Call.Return(listValuesResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_ListValues_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption) (*v0.ListValuesResponse, error)) *ValueService_ListValues_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SaveValue provides a mock function for the type ValueService
|
||||
func (_mock *ValueService) SaveValue(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption) (*v0.SaveValueResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveValue")
|
||||
}
|
||||
|
||||
var r0 *v0.SaveValueResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) (*v0.SaveValueResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) *v0.SaveValueResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.SaveValueResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_SaveValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveValue'
|
||||
type ValueService_SaveValue_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// SaveValue is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - in
|
||||
// - opts
|
||||
func (_e *ValueService_Expecter) SaveValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_SaveValue_Call {
|
||||
return &ValueService_SaveValue_Call{Call: _e.mock.On("SaveValue",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_SaveValue_Call) Run(run func(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption)) *ValueService_SaveValue_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := args[2].([]client.CallOption)
|
||||
run(args[0].(context.Context), args[1].(*v0.SaveValueRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_SaveValue_Call) Return(saveValueResponse *v0.SaveValueResponse, err error) *ValueService_SaveValue_Call {
|
||||
_c.Call.Return(saveValueResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_SaveValue_Call) RunAndReturn(run func(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption) (*v0.SaveValueResponse, error)) *ValueService_SaveValue_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
@@ -1,104 +1,17 @@
|
||||
// Code generated by mockery v2.50.2. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
client "go-micro.dev/v4/client"
|
||||
"context"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/thumbnails/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/thumbnails/v0"
|
||||
"go-micro.dev/v4/client"
|
||||
)
|
||||
|
||||
// ThumbnailService is an autogenerated mock type for the ThumbnailService type
|
||||
type ThumbnailService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type ThumbnailService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *ThumbnailService) EXPECT() *ThumbnailService_Expecter {
|
||||
return &ThumbnailService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetThumbnail provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *ThumbnailService) GetThumbnail(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption) (*v0.GetThumbnailResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetThumbnail")
|
||||
}
|
||||
|
||||
var r0 *v0.GetThumbnailResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) (*v0.GetThumbnailResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) *v0.GetThumbnailResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetThumbnailResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ThumbnailService_GetThumbnail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetThumbnail'
|
||||
type ThumbnailService_GetThumbnail_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetThumbnail is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.GetThumbnailRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *ThumbnailService_Expecter) GetThumbnail(ctx interface{}, in interface{}, opts ...interface{}) *ThumbnailService_GetThumbnail_Call {
|
||||
return &ThumbnailService_GetThumbnail_Call{Call: _e.mock.On("GetThumbnail",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ThumbnailService_GetThumbnail_Call) Run(run func(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption)) *ThumbnailService_GetThumbnail_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.GetThumbnailRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ThumbnailService_GetThumbnail_Call) Return(_a0 *v0.GetThumbnailResponse, _a1 error) *ThumbnailService_GetThumbnail_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ThumbnailService_GetThumbnail_Call) RunAndReturn(run func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) (*v0.GetThumbnailResponse, error)) *ThumbnailService_GetThumbnail_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewThumbnailService creates a new instance of ThumbnailService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewThumbnailService(t interface {
|
||||
@@ -112,3 +25,82 @@ func NewThumbnailService(t interface {
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// ThumbnailService is an autogenerated mock type for the ThumbnailService type
|
||||
type ThumbnailService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type ThumbnailService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *ThumbnailService) EXPECT() *ThumbnailService_Expecter {
|
||||
return &ThumbnailService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetThumbnail provides a mock function for the type ThumbnailService
|
||||
func (_mock *ThumbnailService) GetThumbnail(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption) (*v0.GetThumbnailResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetThumbnail")
|
||||
}
|
||||
|
||||
var r0 *v0.GetThumbnailResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) (*v0.GetThumbnailResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) *v0.GetThumbnailResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetThumbnailResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ThumbnailService_GetThumbnail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetThumbnail'
|
||||
type ThumbnailService_GetThumbnail_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetThumbnail is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - in
|
||||
// - opts
|
||||
func (_e *ThumbnailService_Expecter) GetThumbnail(ctx interface{}, in interface{}, opts ...interface{}) *ThumbnailService_GetThumbnail_Call {
|
||||
return &ThumbnailService_GetThumbnail_Call{Call: _e.mock.On("GetThumbnail",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ThumbnailService_GetThumbnail_Call) Run(run func(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption)) *ThumbnailService_GetThumbnail_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := args[2].([]client.CallOption)
|
||||
run(args[0].(context.Context), args[1].(*v0.GetThumbnailRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ThumbnailService_GetThumbnail_Call) Return(getThumbnailResponse *v0.GetThumbnailResponse, err error) *ThumbnailService_GetThumbnail_Call {
|
||||
_c.Call.Return(getThumbnailResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ThumbnailService_GetThumbnail_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption) (*v0.GetThumbnailResponse, error)) *ThumbnailService_GetThumbnail_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
issue-845-fix: True
|
||||
resolve-type-alias: False
|
||||
with-expecter: true
|
||||
disable-version-string: True
|
||||
# maintain v2 separate mocks dir
|
||||
dir: "{{.InterfaceDir}}/mocks"
|
||||
structname: "{{.InterfaceName}}"
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
dir: "pkg/{{.PackageName}}/mocks"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
pkgname: mocks
|
||||
|
||||
template: testify
|
||||
packages:
|
||||
github.com/opencloud-eu/opencloud/services/antivirus/pkg/scanners:
|
||||
interfaces:
|
||||
Scanner:
|
||||
github.com/opencloud-eu/opencloud/services/antivirus/pkg/scanners:
|
||||
interfaces:
|
||||
Scanner: {}
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
icapclient "github.com/egirna/icap-client"
|
||||
"github.com/egirna/icap-client"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NewScanner creates a new instance of Scanner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewScanner(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Scanner {
|
||||
mock := &Scanner{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// Scanner is an autogenerated mock type for the Scanner type
|
||||
type Scanner struct {
|
||||
mock.Mock
|
||||
@@ -20,9 +36,9 @@ func (_m *Scanner) EXPECT() *Scanner_Expecter {
|
||||
return &Scanner_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Do provides a mock function with given fields: req
|
||||
func (_m *Scanner) Do(req icapclient.Request) (icapclient.Response, error) {
|
||||
ret := _m.Called(req)
|
||||
// Do provides a mock function for the type Scanner
|
||||
func (_mock *Scanner) Do(req icapclient.Request) (icapclient.Response, error) {
|
||||
ret := _mock.Called(req)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Do")
|
||||
@@ -30,21 +46,19 @@ func (_m *Scanner) Do(req icapclient.Request) (icapclient.Response, error) {
|
||||
|
||||
var r0 icapclient.Response
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(icapclient.Request) (icapclient.Response, error)); ok {
|
||||
return rf(req)
|
||||
if returnFunc, ok := ret.Get(0).(func(icapclient.Request) (icapclient.Response, error)); ok {
|
||||
return returnFunc(req)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(icapclient.Request) icapclient.Response); ok {
|
||||
r0 = rf(req)
|
||||
if returnFunc, ok := ret.Get(0).(func(icapclient.Request) icapclient.Response); ok {
|
||||
r0 = returnFunc(req)
|
||||
} else {
|
||||
r0 = ret.Get(0).(icapclient.Response)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(icapclient.Request) error); ok {
|
||||
r1 = rf(req)
|
||||
if returnFunc, ok := ret.Get(1).(func(icapclient.Request) error); ok {
|
||||
r1 = returnFunc(req)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -61,31 +75,23 @@ func (_e *Scanner_Expecter) Do(req interface{}) *Scanner_Do_Call {
|
||||
|
||||
func (_c *Scanner_Do_Call) Run(run func(req icapclient.Request)) *Scanner_Do_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(icapclient.Request))
|
||||
var arg0 icapclient.Request
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(icapclient.Request)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Scanner_Do_Call) Return(_a0 icapclient.Response, _a1 error) *Scanner_Do_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Scanner_Do_Call) Return(response icapclient.Response, err error) *Scanner_Do_Call {
|
||||
_c.Call.Return(response, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Scanner_Do_Call) RunAndReturn(run func(icapclient.Request) (icapclient.Response, error)) *Scanner_Do_Call {
|
||||
func (_c *Scanner_Do_Call) RunAndReturn(run func(req icapclient.Request) (icapclient.Response, error)) *Scanner_Do_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewScanner creates a new instance of Scanner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewScanner(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Scanner {
|
||||
mock := &Scanner{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
issue-845-fix: True
|
||||
resolve-type-alias: False
|
||||
with-expecter: true
|
||||
disable-version-string: True
|
||||
# maintain v2 separate mocks dir
|
||||
dir: "{{.InterfaceDir}}/mocks"
|
||||
structname: "{{.InterfaceName}}"
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
pkgname: mocks
|
||||
|
||||
template: testify
|
||||
packages:
|
||||
github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector:
|
||||
github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector:
|
||||
config:
|
||||
dir: mocks
|
||||
interfaces:
|
||||
ConnectorService: {}
|
||||
ContentConnectorService: {}
|
||||
FileConnectorService: {}
|
||||
github.com/opencloud-eu/opencloud/services/collaboration/pkg/locks:
|
||||
config:
|
||||
dir: mocks
|
||||
interfaces:
|
||||
LockParser: {}
|
||||
github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool:
|
||||
config:
|
||||
dir: mocks
|
||||
interfaces:
|
||||
Selectable:
|
||||
config:
|
||||
dir: "mocks"
|
||||
interfaces:
|
||||
ConnectorService:
|
||||
ContentConnectorService:
|
||||
FileConnectorService:
|
||||
github.com/opencloud-eu/opencloud/services/collaboration/pkg/locks:
|
||||
config:
|
||||
dir: "mocks"
|
||||
interfaces:
|
||||
LockParser:
|
||||
github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool:
|
||||
config:
|
||||
dir: "mocks"
|
||||
interfaces:
|
||||
Selectable:
|
||||
config:
|
||||
filename: "gateway_selector.go"
|
||||
filename: gateway_selector.go
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
connector "github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector"
|
||||
"github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NewConnectorService creates a new instance of ConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewConnectorService(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ConnectorService {
|
||||
mock := &ConnectorService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// ConnectorService is an autogenerated mock type for the ConnectorService type
|
||||
type ConnectorService struct {
|
||||
mock.Mock
|
||||
@@ -20,23 +36,22 @@ func (_m *ConnectorService) EXPECT() *ConnectorService_Expecter {
|
||||
return &ConnectorService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetContentConnector provides a mock function with no fields
|
||||
func (_m *ConnectorService) GetContentConnector() connector.ContentConnectorService {
|
||||
ret := _m.Called()
|
||||
// GetContentConnector provides a mock function for the type ConnectorService
|
||||
func (_mock *ConnectorService) GetContentConnector() connector.ContentConnectorService {
|
||||
ret := _mock.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetContentConnector")
|
||||
}
|
||||
|
||||
var r0 connector.ContentConnectorService
|
||||
if rf, ok := ret.Get(0).(func() connector.ContentConnectorService); ok {
|
||||
r0 = rf()
|
||||
if returnFunc, ok := ret.Get(0).(func() connector.ContentConnectorService); ok {
|
||||
r0 = returnFunc()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(connector.ContentConnectorService)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -57,8 +72,8 @@ func (_c *ConnectorService_GetContentConnector_Call) Run(run func()) *ConnectorS
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ConnectorService_GetContentConnector_Call) Return(_a0 connector.ContentConnectorService) *ConnectorService_GetContentConnector_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *ConnectorService_GetContentConnector_Call) Return(contentConnectorService connector.ContentConnectorService) *ConnectorService_GetContentConnector_Call {
|
||||
_c.Call.Return(contentConnectorService)
|
||||
return _c
|
||||
}
|
||||
|
||||
@@ -67,23 +82,22 @@ func (_c *ConnectorService_GetContentConnector_Call) RunAndReturn(run func() con
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetFileConnector provides a mock function with no fields
|
||||
func (_m *ConnectorService) GetFileConnector() connector.FileConnectorService {
|
||||
ret := _m.Called()
|
||||
// GetFileConnector provides a mock function for the type ConnectorService
|
||||
func (_mock *ConnectorService) GetFileConnector() connector.FileConnectorService {
|
||||
ret := _mock.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetFileConnector")
|
||||
}
|
||||
|
||||
var r0 connector.FileConnectorService
|
||||
if rf, ok := ret.Get(0).(func() connector.FileConnectorService); ok {
|
||||
r0 = rf()
|
||||
if returnFunc, ok := ret.Get(0).(func() connector.FileConnectorService); ok {
|
||||
r0 = returnFunc()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(connector.FileConnectorService)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -104,8 +118,8 @@ func (_c *ConnectorService_GetFileConnector_Call) Run(run func()) *ConnectorServ
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ConnectorService_GetFileConnector_Call) Return(_a0 connector.FileConnectorService) *ConnectorService_GetFileConnector_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *ConnectorService_GetFileConnector_Call) Return(fileConnectorService connector.FileConnectorService) *ConnectorService_GetFileConnector_Call {
|
||||
_c.Call.Return(fileConnectorService)
|
||||
return _c
|
||||
}
|
||||
|
||||
@@ -113,17 +127,3 @@ func (_c *ConnectorService_GetFileConnector_Call) RunAndReturn(run func() connec
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewConnectorService creates a new instance of ConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewConnectorService(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ConnectorService {
|
||||
mock := &ConnectorService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,19 +1,32 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
connector "github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector"
|
||||
|
||||
http "net/http"
|
||||
|
||||
io "io"
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NewContentConnectorService creates a new instance of ContentConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewContentConnectorService(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ContentConnectorService {
|
||||
mock := &ContentConnectorService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// ContentConnectorService is an autogenerated mock type for the ContentConnectorService type
|
||||
type ContentConnectorService struct {
|
||||
mock.Mock
|
||||
@@ -27,21 +40,20 @@ func (_m *ContentConnectorService) EXPECT() *ContentConnectorService_Expecter {
|
||||
return &ContentConnectorService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetFile provides a mock function with given fields: ctx, w
|
||||
func (_m *ContentConnectorService) GetFile(ctx context.Context, w http.ResponseWriter) error {
|
||||
ret := _m.Called(ctx, w)
|
||||
// GetFile provides a mock function for the type ContentConnectorService
|
||||
func (_mock *ContentConnectorService) GetFile(ctx context.Context, w http.ResponseWriter) error {
|
||||
ret := _mock.Called(ctx, w)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetFile")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, http.ResponseWriter) error); ok {
|
||||
r0 = rf(ctx, w)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, http.ResponseWriter) error); ok {
|
||||
r0 = returnFunc(ctx, w)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -59,24 +71,35 @@ func (_e *ContentConnectorService_Expecter) GetFile(ctx interface{}, w interface
|
||||
|
||||
func (_c *ContentConnectorService_GetFile_Call) Run(run func(ctx context.Context, w http.ResponseWriter)) *ContentConnectorService_GetFile_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(http.ResponseWriter))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 http.ResponseWriter
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(http.ResponseWriter)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ContentConnectorService_GetFile_Call) Return(_a0 error) *ContentConnectorService_GetFile_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *ContentConnectorService_GetFile_Call) Return(err error) *ContentConnectorService_GetFile_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ContentConnectorService_GetFile_Call) RunAndReturn(run func(context.Context, http.ResponseWriter) error) *ContentConnectorService_GetFile_Call {
|
||||
func (_c *ContentConnectorService_GetFile_Call) RunAndReturn(run func(ctx context.Context, w http.ResponseWriter) error) *ContentConnectorService_GetFile_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// PutFile provides a mock function with given fields: ctx, stream, streamLength, lockID
|
||||
func (_m *ContentConnectorService) PutFile(ctx context.Context, stream io.Reader, streamLength int64, lockID string) (*connector.ConnectorResponse, error) {
|
||||
ret := _m.Called(ctx, stream, streamLength, lockID)
|
||||
// PutFile provides a mock function for the type ContentConnectorService
|
||||
func (_mock *ContentConnectorService) PutFile(ctx context.Context, stream io.Reader, streamLength int64, lockID string) (*connector.ConnectorResponse, error) {
|
||||
ret := _mock.Called(ctx, stream, streamLength, lockID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PutFile")
|
||||
@@ -84,23 +107,21 @@ func (_m *ContentConnectorService) PutFile(ctx context.Context, stream io.Reader
|
||||
|
||||
var r0 *connector.ConnectorResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return rf(ctx, stream, streamLength, lockID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return returnFunc(ctx, stream, streamLength, lockID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, io.Reader, int64, string) *connector.ConnectorResponse); ok {
|
||||
r0 = rf(ctx, stream, streamLength, lockID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, io.Reader, int64, string) *connector.ConnectorResponse); ok {
|
||||
r0 = returnFunc(ctx, stream, streamLength, lockID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*connector.ConnectorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, io.Reader, int64, string) error); ok {
|
||||
r1 = rf(ctx, stream, streamLength, lockID)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, io.Reader, int64, string) error); ok {
|
||||
r1 = returnFunc(ctx, stream, streamLength, lockID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -120,31 +141,38 @@ func (_e *ContentConnectorService_Expecter) PutFile(ctx interface{}, stream inte
|
||||
|
||||
func (_c *ContentConnectorService_PutFile_Call) Run(run func(ctx context.Context, stream io.Reader, streamLength int64, lockID string)) *ContentConnectorService_PutFile_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(io.Reader), args[2].(int64), args[3].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 io.Reader
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(io.Reader)
|
||||
}
|
||||
var arg2 int64
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(int64)
|
||||
}
|
||||
var arg3 string
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ContentConnectorService_PutFile_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *ContentConnectorService_PutFile_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *ContentConnectorService_PutFile_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *ContentConnectorService_PutFile_Call {
|
||||
_c.Call.Return(connectorResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ContentConnectorService_PutFile_Call) RunAndReturn(run func(context.Context, io.Reader, int64, string) (*connector.ConnectorResponse, error)) *ContentConnectorService_PutFile_Call {
|
||||
func (_c *ContentConnectorService_PutFile_Call) RunAndReturn(run func(ctx context.Context, stream io.Reader, streamLength int64, lockID string) (*connector.ConnectorResponse, error)) *ContentConnectorService_PutFile_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewContentConnectorService creates a new instance of ContentConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewContentConnectorService(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ContentConnectorService {
|
||||
mock := &ContentConnectorService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
connector "github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector"
|
||||
|
||||
io "io"
|
||||
"context"
|
||||
"io"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/services/collaboration/pkg/connector"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NewFileConnectorService creates a new instance of FileConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewFileConnectorService(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *FileConnectorService {
|
||||
mock := &FileConnectorService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// FileConnectorService is an autogenerated mock type for the FileConnectorService type
|
||||
type FileConnectorService struct {
|
||||
mock.Mock
|
||||
@@ -25,9 +39,9 @@ func (_m *FileConnectorService) EXPECT() *FileConnectorService_Expecter {
|
||||
return &FileConnectorService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// CheckFileInfo provides a mock function with given fields: ctx
|
||||
func (_m *FileConnectorService) CheckFileInfo(ctx context.Context) (*connector.ConnectorResponse, error) {
|
||||
ret := _m.Called(ctx)
|
||||
// CheckFileInfo provides a mock function for the type FileConnectorService
|
||||
func (_mock *FileConnectorService) CheckFileInfo(ctx context.Context) (*connector.ConnectorResponse, error) {
|
||||
ret := _mock.Called(ctx)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CheckFileInfo")
|
||||
@@ -35,23 +49,21 @@ func (_m *FileConnectorService) CheckFileInfo(ctx context.Context) (*connector.C
|
||||
|
||||
var r0 *connector.ConnectorResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context) (*connector.ConnectorResponse, error)); ok {
|
||||
return rf(ctx)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context) (*connector.ConnectorResponse, error)); ok {
|
||||
return returnFunc(ctx)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context) *connector.ConnectorResponse); ok {
|
||||
r0 = rf(ctx)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context) *connector.ConnectorResponse); ok {
|
||||
r0 = returnFunc(ctx)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*connector.ConnectorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
||||
r1 = rf(ctx)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
|
||||
r1 = returnFunc(ctx)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -68,24 +80,30 @@ func (_e *FileConnectorService_Expecter) CheckFileInfo(ctx interface{}) *FileCon
|
||||
|
||||
func (_c *FileConnectorService_CheckFileInfo_Call) Run(run func(ctx context.Context)) *FileConnectorService_CheckFileInfo_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_CheckFileInfo_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_CheckFileInfo_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *FileConnectorService_CheckFileInfo_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_CheckFileInfo_Call {
|
||||
_c.Call.Return(connectorResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_CheckFileInfo_Call) RunAndReturn(run func(context.Context) (*connector.ConnectorResponse, error)) *FileConnectorService_CheckFileInfo_Call {
|
||||
func (_c *FileConnectorService_CheckFileInfo_Call) RunAndReturn(run func(ctx context.Context) (*connector.ConnectorResponse, error)) *FileConnectorService_CheckFileInfo_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// DeleteFile provides a mock function with given fields: ctx, lockID
|
||||
func (_m *FileConnectorService) DeleteFile(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) {
|
||||
ret := _m.Called(ctx, lockID)
|
||||
// DeleteFile provides a mock function for the type FileConnectorService
|
||||
func (_mock *FileConnectorService) DeleteFile(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) {
|
||||
ret := _mock.Called(ctx, lockID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteFile")
|
||||
@@ -93,23 +111,21 @@ func (_m *FileConnectorService) DeleteFile(ctx context.Context, lockID string) (
|
||||
|
||||
var r0 *connector.ConnectorResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return rf(ctx, lockID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return returnFunc(ctx, lockID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok {
|
||||
r0 = rf(ctx, lockID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok {
|
||||
r0 = returnFunc(ctx, lockID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*connector.ConnectorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, lockID)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = returnFunc(ctx, lockID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -127,24 +143,35 @@ func (_e *FileConnectorService_Expecter) DeleteFile(ctx interface{}, lockID inte
|
||||
|
||||
func (_c *FileConnectorService_DeleteFile_Call) Run(run func(ctx context.Context, lockID string)) *FileConnectorService_DeleteFile_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_DeleteFile_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_DeleteFile_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *FileConnectorService_DeleteFile_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_DeleteFile_Call {
|
||||
_c.Call.Return(connectorResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_DeleteFile_Call) RunAndReturn(run func(context.Context, string) (*connector.ConnectorResponse, error)) *FileConnectorService_DeleteFile_Call {
|
||||
func (_c *FileConnectorService_DeleteFile_Call) RunAndReturn(run func(ctx context.Context, lockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_DeleteFile_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetLock provides a mock function with given fields: ctx
|
||||
func (_m *FileConnectorService) GetLock(ctx context.Context) (*connector.ConnectorResponse, error) {
|
||||
ret := _m.Called(ctx)
|
||||
// GetLock provides a mock function for the type FileConnectorService
|
||||
func (_mock *FileConnectorService) GetLock(ctx context.Context) (*connector.ConnectorResponse, error) {
|
||||
ret := _mock.Called(ctx)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetLock")
|
||||
@@ -152,23 +179,21 @@ func (_m *FileConnectorService) GetLock(ctx context.Context) (*connector.Connect
|
||||
|
||||
var r0 *connector.ConnectorResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context) (*connector.ConnectorResponse, error)); ok {
|
||||
return rf(ctx)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context) (*connector.ConnectorResponse, error)); ok {
|
||||
return returnFunc(ctx)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context) *connector.ConnectorResponse); ok {
|
||||
r0 = rf(ctx)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context) *connector.ConnectorResponse); ok {
|
||||
r0 = returnFunc(ctx)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*connector.ConnectorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
||||
r1 = rf(ctx)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
|
||||
r1 = returnFunc(ctx)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -185,24 +210,30 @@ func (_e *FileConnectorService_Expecter) GetLock(ctx interface{}) *FileConnector
|
||||
|
||||
func (_c *FileConnectorService_GetLock_Call) Run(run func(ctx context.Context)) *FileConnectorService_GetLock_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_GetLock_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_GetLock_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *FileConnectorService_GetLock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_GetLock_Call {
|
||||
_c.Call.Return(connectorResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_GetLock_Call) RunAndReturn(run func(context.Context) (*connector.ConnectorResponse, error)) *FileConnectorService_GetLock_Call {
|
||||
func (_c *FileConnectorService_GetLock_Call) RunAndReturn(run func(ctx context.Context) (*connector.ConnectorResponse, error)) *FileConnectorService_GetLock_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Lock provides a mock function with given fields: ctx, lockID, oldLockID
|
||||
func (_m *FileConnectorService) Lock(ctx context.Context, lockID string, oldLockID string) (*connector.ConnectorResponse, error) {
|
||||
ret := _m.Called(ctx, lockID, oldLockID)
|
||||
// Lock provides a mock function for the type FileConnectorService
|
||||
func (_mock *FileConnectorService) Lock(ctx context.Context, lockID string, oldLockID string) (*connector.ConnectorResponse, error) {
|
||||
ret := _mock.Called(ctx, lockID, oldLockID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Lock")
|
||||
@@ -210,23 +241,21 @@ func (_m *FileConnectorService) Lock(ctx context.Context, lockID string, oldLock
|
||||
|
||||
var r0 *connector.ConnectorResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return rf(ctx, lockID, oldLockID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return returnFunc(ctx, lockID, oldLockID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) *connector.ConnectorResponse); ok {
|
||||
r0 = rf(ctx, lockID, oldLockID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *connector.ConnectorResponse); ok {
|
||||
r0 = returnFunc(ctx, lockID, oldLockID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*connector.ConnectorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
|
||||
r1 = rf(ctx, lockID, oldLockID)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
|
||||
r1 = returnFunc(ctx, lockID, oldLockID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -245,24 +274,40 @@ func (_e *FileConnectorService_Expecter) Lock(ctx interface{}, lockID interface{
|
||||
|
||||
func (_c *FileConnectorService_Lock_Call) Run(run func(ctx context.Context, lockID string, oldLockID string)) *FileConnectorService_Lock_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_Lock_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_Lock_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *FileConnectorService_Lock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_Lock_Call {
|
||||
_c.Call.Return(connectorResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_Lock_Call) RunAndReturn(run func(context.Context, string, string) (*connector.ConnectorResponse, error)) *FileConnectorService_Lock_Call {
|
||||
func (_c *FileConnectorService_Lock_Call) RunAndReturn(run func(ctx context.Context, lockID string, oldLockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_Lock_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// PutRelativeFileRelative provides a mock function with given fields: ctx, ccs, stream, streamLength, target
|
||||
func (_m *FileConnectorService) PutRelativeFileRelative(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error) {
|
||||
ret := _m.Called(ctx, ccs, stream, streamLength, target)
|
||||
// PutRelativeFileRelative provides a mock function for the type FileConnectorService
|
||||
func (_mock *FileConnectorService) PutRelativeFileRelative(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error) {
|
||||
ret := _mock.Called(ctx, ccs, stream, streamLength, target)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PutRelativeFileRelative")
|
||||
@@ -270,23 +315,21 @@ func (_m *FileConnectorService) PutRelativeFileRelative(ctx context.Context, ccs
|
||||
|
||||
var r0 *connector.ConnectorResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return rf(ctx, ccs, stream, streamLength, target)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return returnFunc(ctx, ccs, stream, streamLength, target)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) *connector.ConnectorResponse); ok {
|
||||
r0 = rf(ctx, ccs, stream, streamLength, target)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) *connector.ConnectorResponse); ok {
|
||||
r0 = returnFunc(ctx, ccs, stream, streamLength, target)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*connector.ConnectorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) error); ok {
|
||||
r1 = rf(ctx, ccs, stream, streamLength, target)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) error); ok {
|
||||
r1 = returnFunc(ctx, ccs, stream, streamLength, target)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -307,24 +350,50 @@ func (_e *FileConnectorService_Expecter) PutRelativeFileRelative(ctx interface{}
|
||||
|
||||
func (_c *FileConnectorService_PutRelativeFileRelative_Call) Run(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string)) *FileConnectorService_PutRelativeFileRelative_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(connector.ContentConnectorService), args[2].(io.Reader), args[3].(int64), args[4].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 connector.ContentConnectorService
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(connector.ContentConnectorService)
|
||||
}
|
||||
var arg2 io.Reader
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(io.Reader)
|
||||
}
|
||||
var arg3 int64
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(int64)
|
||||
}
|
||||
var arg4 string
|
||||
if args[4] != nil {
|
||||
arg4 = args[4].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
arg4,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_PutRelativeFileRelative_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_PutRelativeFileRelative_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *FileConnectorService_PutRelativeFileRelative_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_PutRelativeFileRelative_Call {
|
||||
_c.Call.Return(connectorResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_PutRelativeFileRelative_Call) RunAndReturn(run func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)) *FileConnectorService_PutRelativeFileRelative_Call {
|
||||
func (_c *FileConnectorService_PutRelativeFileRelative_Call) RunAndReturn(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error)) *FileConnectorService_PutRelativeFileRelative_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// PutRelativeFileSuggested provides a mock function with given fields: ctx, ccs, stream, streamLength, target
|
||||
func (_m *FileConnectorService) PutRelativeFileSuggested(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error) {
|
||||
ret := _m.Called(ctx, ccs, stream, streamLength, target)
|
||||
// PutRelativeFileSuggested provides a mock function for the type FileConnectorService
|
||||
func (_mock *FileConnectorService) PutRelativeFileSuggested(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error) {
|
||||
ret := _mock.Called(ctx, ccs, stream, streamLength, target)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for PutRelativeFileSuggested")
|
||||
@@ -332,23 +401,21 @@ func (_m *FileConnectorService) PutRelativeFileSuggested(ctx context.Context, cc
|
||||
|
||||
var r0 *connector.ConnectorResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return rf(ctx, ccs, stream, streamLength, target)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return returnFunc(ctx, ccs, stream, streamLength, target)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) *connector.ConnectorResponse); ok {
|
||||
r0 = rf(ctx, ccs, stream, streamLength, target)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) *connector.ConnectorResponse); ok {
|
||||
r0 = returnFunc(ctx, ccs, stream, streamLength, target)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*connector.ConnectorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) error); ok {
|
||||
r1 = rf(ctx, ccs, stream, streamLength, target)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) error); ok {
|
||||
r1 = returnFunc(ctx, ccs, stream, streamLength, target)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -369,24 +436,50 @@ func (_e *FileConnectorService_Expecter) PutRelativeFileSuggested(ctx interface{
|
||||
|
||||
func (_c *FileConnectorService_PutRelativeFileSuggested_Call) Run(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string)) *FileConnectorService_PutRelativeFileSuggested_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(connector.ContentConnectorService), args[2].(io.Reader), args[3].(int64), args[4].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 connector.ContentConnectorService
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(connector.ContentConnectorService)
|
||||
}
|
||||
var arg2 io.Reader
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(io.Reader)
|
||||
}
|
||||
var arg3 int64
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(int64)
|
||||
}
|
||||
var arg4 string
|
||||
if args[4] != nil {
|
||||
arg4 = args[4].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
arg4,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_PutRelativeFileSuggested_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_PutRelativeFileSuggested_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *FileConnectorService_PutRelativeFileSuggested_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_PutRelativeFileSuggested_Call {
|
||||
_c.Call.Return(connectorResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_PutRelativeFileSuggested_Call) RunAndReturn(run func(context.Context, connector.ContentConnectorService, io.Reader, int64, string) (*connector.ConnectorResponse, error)) *FileConnectorService_PutRelativeFileSuggested_Call {
|
||||
func (_c *FileConnectorService_PutRelativeFileSuggested_Call) RunAndReturn(run func(ctx context.Context, ccs connector.ContentConnectorService, stream io.Reader, streamLength int64, target string) (*connector.ConnectorResponse, error)) *FileConnectorService_PutRelativeFileSuggested_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// RefreshLock provides a mock function with given fields: ctx, lockID
|
||||
func (_m *FileConnectorService) RefreshLock(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) {
|
||||
ret := _m.Called(ctx, lockID)
|
||||
// RefreshLock provides a mock function for the type FileConnectorService
|
||||
func (_mock *FileConnectorService) RefreshLock(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) {
|
||||
ret := _mock.Called(ctx, lockID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RefreshLock")
|
||||
@@ -394,23 +487,21 @@ func (_m *FileConnectorService) RefreshLock(ctx context.Context, lockID string)
|
||||
|
||||
var r0 *connector.ConnectorResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return rf(ctx, lockID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return returnFunc(ctx, lockID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok {
|
||||
r0 = rf(ctx, lockID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok {
|
||||
r0 = returnFunc(ctx, lockID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*connector.ConnectorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, lockID)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = returnFunc(ctx, lockID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -428,24 +519,35 @@ func (_e *FileConnectorService_Expecter) RefreshLock(ctx interface{}, lockID int
|
||||
|
||||
func (_c *FileConnectorService_RefreshLock_Call) Run(run func(ctx context.Context, lockID string)) *FileConnectorService_RefreshLock_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_RefreshLock_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_RefreshLock_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *FileConnectorService_RefreshLock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_RefreshLock_Call {
|
||||
_c.Call.Return(connectorResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_RefreshLock_Call) RunAndReturn(run func(context.Context, string) (*connector.ConnectorResponse, error)) *FileConnectorService_RefreshLock_Call {
|
||||
func (_c *FileConnectorService_RefreshLock_Call) RunAndReturn(run func(ctx context.Context, lockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_RefreshLock_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// RenameFile provides a mock function with given fields: ctx, lockID, target
|
||||
func (_m *FileConnectorService) RenameFile(ctx context.Context, lockID string, target string) (*connector.ConnectorResponse, error) {
|
||||
ret := _m.Called(ctx, lockID, target)
|
||||
// RenameFile provides a mock function for the type FileConnectorService
|
||||
func (_mock *FileConnectorService) RenameFile(ctx context.Context, lockID string, target string) (*connector.ConnectorResponse, error) {
|
||||
ret := _mock.Called(ctx, lockID, target)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RenameFile")
|
||||
@@ -453,23 +555,21 @@ func (_m *FileConnectorService) RenameFile(ctx context.Context, lockID string, t
|
||||
|
||||
var r0 *connector.ConnectorResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return rf(ctx, lockID, target)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return returnFunc(ctx, lockID, target)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) *connector.ConnectorResponse); ok {
|
||||
r0 = rf(ctx, lockID, target)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *connector.ConnectorResponse); ok {
|
||||
r0 = returnFunc(ctx, lockID, target)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*connector.ConnectorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
|
||||
r1 = rf(ctx, lockID, target)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
|
||||
r1 = returnFunc(ctx, lockID, target)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -488,24 +588,40 @@ func (_e *FileConnectorService_Expecter) RenameFile(ctx interface{}, lockID inte
|
||||
|
||||
func (_c *FileConnectorService_RenameFile_Call) Run(run func(ctx context.Context, lockID string, target string)) *FileConnectorService_RenameFile_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_RenameFile_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_RenameFile_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *FileConnectorService_RenameFile_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_RenameFile_Call {
|
||||
_c.Call.Return(connectorResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_RenameFile_Call) RunAndReturn(run func(context.Context, string, string) (*connector.ConnectorResponse, error)) *FileConnectorService_RenameFile_Call {
|
||||
func (_c *FileConnectorService_RenameFile_Call) RunAndReturn(run func(ctx context.Context, lockID string, target string) (*connector.ConnectorResponse, error)) *FileConnectorService_RenameFile_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UnLock provides a mock function with given fields: ctx, lockID
|
||||
func (_m *FileConnectorService) UnLock(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) {
|
||||
ret := _m.Called(ctx, lockID)
|
||||
// UnLock provides a mock function for the type FileConnectorService
|
||||
func (_mock *FileConnectorService) UnLock(ctx context.Context, lockID string) (*connector.ConnectorResponse, error) {
|
||||
ret := _mock.Called(ctx, lockID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UnLock")
|
||||
@@ -513,23 +629,21 @@ func (_m *FileConnectorService) UnLock(ctx context.Context, lockID string) (*con
|
||||
|
||||
var r0 *connector.ConnectorResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return rf(ctx, lockID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*connector.ConnectorResponse, error)); ok {
|
||||
return returnFunc(ctx, lockID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok {
|
||||
r0 = rf(ctx, lockID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) *connector.ConnectorResponse); ok {
|
||||
r0 = returnFunc(ctx, lockID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*connector.ConnectorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, lockID)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = returnFunc(ctx, lockID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -547,31 +661,28 @@ func (_e *FileConnectorService_Expecter) UnLock(ctx interface{}, lockID interfac
|
||||
|
||||
func (_c *FileConnectorService_UnLock_Call) Run(run func(ctx context.Context, lockID string)) *FileConnectorService_UnLock_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_UnLock_Call) Return(_a0 *connector.ConnectorResponse, _a1 error) *FileConnectorService_UnLock_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *FileConnectorService_UnLock_Call) Return(connectorResponse *connector.ConnectorResponse, err error) *FileConnectorService_UnLock_Call {
|
||||
_c.Call.Return(connectorResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *FileConnectorService_UnLock_Call) RunAndReturn(run func(context.Context, string) (*connector.ConnectorResponse, error)) *FileConnectorService_UnLock_Call {
|
||||
func (_c *FileConnectorService_UnLock_Call) RunAndReturn(run func(ctx context.Context, lockID string) (*connector.ConnectorResponse, error)) *FileConnectorService_UnLock_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewFileConnectorService creates a new instance of FileConnectorService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewFileConnectorService(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *FileConnectorService {
|
||||
mock := &FileConnectorService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
pool "github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NewSelectable creates a new instance of Selectable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSelectable[T any](t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Selectable[T] {
|
||||
mock := &Selectable[T]{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// Selectable is an autogenerated mock type for the Selectable type
|
||||
type Selectable[T any] struct {
|
||||
mock.Mock
|
||||
@@ -20,15 +36,15 @@ func (_m *Selectable[T]) EXPECT() *Selectable_Expecter[T] {
|
||||
return &Selectable_Expecter[T]{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Next provides a mock function with given fields: opts
|
||||
func (_m *Selectable[T]) Next(opts ...pool.Option) (T, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
// Next provides a mock function for the type Selectable
|
||||
func (_mock *Selectable[T]) Next(opts ...pool.Option) (T, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called()
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Next")
|
||||
@@ -36,23 +52,21 @@ func (_m *Selectable[T]) Next(opts ...pool.Option) (T, error) {
|
||||
|
||||
var r0 T
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(...pool.Option) (T, error)); ok {
|
||||
return rf(opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(...pool.Option) (T, error)); ok {
|
||||
return returnFunc(opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(...pool.Option) T); ok {
|
||||
r0 = rf(opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(...pool.Option) T); ok {
|
||||
r0 = returnFunc(opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(T)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(...pool.Option) error); ok {
|
||||
r1 = rf(opts...)
|
||||
if returnFunc, ok := ret.Get(1).(func(...pool.Option) error); ok {
|
||||
r1 = returnFunc(opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -70,37 +84,25 @@ func (_e *Selectable_Expecter[T]) Next(opts ...interface{}) *Selectable_Next_Cal
|
||||
|
||||
func (_c *Selectable_Next_Call[T]) Run(run func(opts ...pool.Option)) *Selectable_Next_Call[T] {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]pool.Option, len(args)-0)
|
||||
for i, a := range args[0:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(pool.Option)
|
||||
}
|
||||
var arg0 []pool.Option
|
||||
var variadicArgs []pool.Option
|
||||
if len(args) > 0 {
|
||||
variadicArgs = args[0].([]pool.Option)
|
||||
}
|
||||
run(variadicArgs...)
|
||||
arg0 = variadicArgs
|
||||
run(
|
||||
arg0...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Selectable_Next_Call[T]) Return(_a0 T, _a1 error) *Selectable_Next_Call[T] {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Selectable_Next_Call[T]) Return(v T, err error) *Selectable_Next_Call[T] {
|
||||
_c.Call.Return(v, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Selectable_Next_Call[T]) RunAndReturn(run func(...pool.Option) (T, error)) *Selectable_Next_Call[T] {
|
||||
func (_c *Selectable_Next_Call[T]) RunAndReturn(run func(opts ...pool.Option) (T, error)) *Selectable_Next_Call[T] {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewSelectable creates a new instance of Selectable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSelectable[T any](t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Selectable[T] {
|
||||
mock := &Selectable[T]{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,8 +1,26 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import mock "github.com/stretchr/testify/mock"
|
||||
import (
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NewLockParser creates a new instance of LockParser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewLockParser(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *LockParser {
|
||||
mock := &LockParser{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// LockParser is an autogenerated mock type for the LockParser type
|
||||
type LockParser struct {
|
||||
@@ -17,21 +35,20 @@ func (_m *LockParser) EXPECT() *LockParser_Expecter {
|
||||
return &LockParser_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// ParseLock provides a mock function with given fields: id
|
||||
func (_m *LockParser) ParseLock(id string) string {
|
||||
ret := _m.Called(id)
|
||||
// ParseLock provides a mock function for the type LockParser
|
||||
func (_mock *LockParser) ParseLock(id string) string {
|
||||
ret := _mock.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ParseLock")
|
||||
}
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func(string) string); ok {
|
||||
r0 = rf(id)
|
||||
if returnFunc, ok := ret.Get(0).(func(string) string); ok {
|
||||
r0 = returnFunc(id)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -48,31 +65,23 @@ func (_e *LockParser_Expecter) ParseLock(id interface{}) *LockParser_ParseLock_C
|
||||
|
||||
func (_c *LockParser_ParseLock_Call) Run(run func(id string)) *LockParser_ParseLock_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *LockParser_ParseLock_Call) Return(_a0 string) *LockParser_ParseLock_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *LockParser_ParseLock_Call) Return(s string) *LockParser_ParseLock_Call {
|
||||
_c.Call.Return(s)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *LockParser_ParseLock_Call) RunAndReturn(run func(string) string) *LockParser_ParseLock_Call {
|
||||
func (_c *LockParser_ParseLock_Call) RunAndReturn(run func(id string) string) *LockParser_ParseLock_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewLockParser creates a new instance of LockParser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewLockParser(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *LockParser {
|
||||
mock := &LockParser{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,49 +1,47 @@
|
||||
issue-845-fix: True
|
||||
resolve-type-alias: False
|
||||
with-expecter: true
|
||||
disable-version-string: True
|
||||
# maintain v2 separate mocks dir
|
||||
dir: "{{.InterfaceDir}}/mocks"
|
||||
structname: "{{.InterfaceName}}"
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
pkgname: mocks
|
||||
|
||||
template: testify
|
||||
packages:
|
||||
github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0:
|
||||
github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0:
|
||||
config:
|
||||
dir: mocks
|
||||
interfaces:
|
||||
BaseGraphProvider: {}
|
||||
DrivesDriveItemProvider: {}
|
||||
DriveItemPermissionsProvider: {}
|
||||
HTTPClient: {}
|
||||
Permissions: {}
|
||||
RoleService: {}
|
||||
UsersUserProfilePhotoProvider: {}
|
||||
github.com/opencloud-eu/reva/v2/pkg/events:
|
||||
config:
|
||||
dir: mocks
|
||||
interfaces:
|
||||
Publisher: {}
|
||||
github.com/opencloud-eu/reva/v2/pkg/storage/utils/metadata:
|
||||
config:
|
||||
dir: mocks
|
||||
interfaces:
|
||||
Storage: {}
|
||||
github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool:
|
||||
config:
|
||||
dir: mocks
|
||||
interfaces:
|
||||
Selectable:
|
||||
config:
|
||||
dir: "mocks"
|
||||
interfaces:
|
||||
BaseGraphProvider:
|
||||
DrivesDriveItemProvider:
|
||||
DriveItemPermissionsProvider:
|
||||
HTTPClient:
|
||||
Permissions:
|
||||
RoleService:
|
||||
UsersUserProfilePhotoProvider:
|
||||
github.com/opencloud-eu/reva/v2/pkg/events:
|
||||
filename: gateway_selector.go
|
||||
github.com/opencloud-eu/opencloud/services/graph/pkg/identity:
|
||||
interfaces:
|
||||
Backend: {}
|
||||
EducationBackend: {}
|
||||
github.com/go-ldap/ldap/v3:
|
||||
config:
|
||||
dir: pkg/identity/mocks
|
||||
interfaces:
|
||||
Client:
|
||||
config:
|
||||
dir: "mocks"
|
||||
interfaces:
|
||||
Publisher:
|
||||
github.com/opencloud-eu/reva/v2/pkg/storage/utils/metadata:
|
||||
config:
|
||||
dir: "mocks"
|
||||
interfaces:
|
||||
Storage:
|
||||
github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool:
|
||||
config:
|
||||
dir: "mocks"
|
||||
interfaces:
|
||||
Selectable:
|
||||
config:
|
||||
filename: "gateway_selector.go"
|
||||
github.com/opencloud-eu/opencloud/services/graph/pkg/identity:
|
||||
config:
|
||||
dir: "pkg/identity/mocks"
|
||||
interfaces:
|
||||
Backend:
|
||||
EducationBackend:
|
||||
github.com/go-ldap/ldap/v3:
|
||||
config:
|
||||
dir: "pkg/identity/mocks"
|
||||
interfaces:
|
||||
Client:
|
||||
config:
|
||||
filename: "ldapclient.go"
|
||||
filename: ldapclient.go
|
||||
|
||||
@@ -1,19 +1,32 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
collaborationv1beta1 "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1"
|
||||
|
||||
libregraph "github.com/opencloud-eu/libre-graph-api-go"
|
||||
"context"
|
||||
|
||||
"github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1"
|
||||
"github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1"
|
||||
"github.com/opencloud-eu/libre-graph-api-go"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
ocmv1beta1 "github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1"
|
||||
)
|
||||
|
||||
// NewBaseGraphProvider creates a new instance of BaseGraphProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewBaseGraphProvider(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *BaseGraphProvider {
|
||||
mock := &BaseGraphProvider{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// BaseGraphProvider is an autogenerated mock type for the BaseGraphProvider type
|
||||
type BaseGraphProvider struct {
|
||||
mock.Mock
|
||||
@@ -27,9 +40,9 @@ func (_m *BaseGraphProvider) EXPECT() *BaseGraphProvider_Expecter {
|
||||
return &BaseGraphProvider_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// CS3ReceivedOCMSharesToDriveItems provides a mock function with given fields: ctx, receivedOCMShares
|
||||
func (_m *BaseGraphProvider) CS3ReceivedOCMSharesToDriveItems(ctx context.Context, receivedOCMShares []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error) {
|
||||
ret := _m.Called(ctx, receivedOCMShares)
|
||||
// CS3ReceivedOCMSharesToDriveItems provides a mock function for the type BaseGraphProvider
|
||||
func (_mock *BaseGraphProvider) CS3ReceivedOCMSharesToDriveItems(ctx context.Context, receivedOCMShares []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error) {
|
||||
ret := _mock.Called(ctx, receivedOCMShares)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CS3ReceivedOCMSharesToDriveItems")
|
||||
@@ -37,23 +50,21 @@ func (_m *BaseGraphProvider) CS3ReceivedOCMSharesToDriveItems(ctx context.Contex
|
||||
|
||||
var r0 []libregraph.DriveItem
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)); ok {
|
||||
return rf(ctx, receivedOCMShares)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)); ok {
|
||||
return returnFunc(ctx, receivedOCMShares)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, []*ocmv1beta1.ReceivedShare) []libregraph.DriveItem); ok {
|
||||
r0 = rf(ctx, receivedOCMShares)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, []*ocmv1beta1.ReceivedShare) []libregraph.DriveItem); ok {
|
||||
r0 = returnFunc(ctx, receivedOCMShares)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]libregraph.DriveItem)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, []*ocmv1beta1.ReceivedShare) error); ok {
|
||||
r1 = rf(ctx, receivedOCMShares)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, []*ocmv1beta1.ReceivedShare) error); ok {
|
||||
r1 = returnFunc(ctx, receivedOCMShares)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -71,24 +82,35 @@ func (_e *BaseGraphProvider_Expecter) CS3ReceivedOCMSharesToDriveItems(ctx inter
|
||||
|
||||
func (_c *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call) Run(run func(ctx context.Context, receivedOCMShares []*ocmv1beta1.ReceivedShare)) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].([]*ocmv1beta1.ReceivedShare))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 []*ocmv1beta1.ReceivedShare
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].([]*ocmv1beta1.ReceivedShare)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call) Return(_a0 []libregraph.DriveItem, _a1 error) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call) Return(driveItems []libregraph.DriveItem, err error) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call {
|
||||
_c.Call.Return(driveItems, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call) RunAndReturn(run func(context.Context, []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call {
|
||||
func (_c *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call) RunAndReturn(run func(ctx context.Context, receivedOCMShares []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// CS3ReceivedSharesToDriveItems provides a mock function with given fields: ctx, receivedShares
|
||||
func (_m *BaseGraphProvider) CS3ReceivedSharesToDriveItems(ctx context.Context, receivedShares []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error) {
|
||||
ret := _m.Called(ctx, receivedShares)
|
||||
// CS3ReceivedSharesToDriveItems provides a mock function for the type BaseGraphProvider
|
||||
func (_mock *BaseGraphProvider) CS3ReceivedSharesToDriveItems(ctx context.Context, receivedShares []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error) {
|
||||
ret := _mock.Called(ctx, receivedShares)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CS3ReceivedSharesToDriveItems")
|
||||
@@ -96,23 +118,21 @@ func (_m *BaseGraphProvider) CS3ReceivedSharesToDriveItems(ctx context.Context,
|
||||
|
||||
var r0 []libregraph.DriveItem
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)); ok {
|
||||
return rf(ctx, receivedShares)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)); ok {
|
||||
return returnFunc(ctx, receivedShares)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare) []libregraph.DriveItem); ok {
|
||||
r0 = rf(ctx, receivedShares)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare) []libregraph.DriveItem); ok {
|
||||
r0 = returnFunc(ctx, receivedShares)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]libregraph.DriveItem)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, []*collaborationv1beta1.ReceivedShare) error); ok {
|
||||
r1 = rf(ctx, receivedShares)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, []*collaborationv1beta1.ReceivedShare) error); ok {
|
||||
r1 = returnFunc(ctx, receivedShares)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -130,31 +150,28 @@ func (_e *BaseGraphProvider_Expecter) CS3ReceivedSharesToDriveItems(ctx interfac
|
||||
|
||||
func (_c *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call) Run(run func(ctx context.Context, receivedShares []*collaborationv1beta1.ReceivedShare)) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].([]*collaborationv1beta1.ReceivedShare))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 []*collaborationv1beta1.ReceivedShare
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].([]*collaborationv1beta1.ReceivedShare)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call) Return(_a0 []libregraph.DriveItem, _a1 error) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call) Return(driveItems []libregraph.DriveItem, err error) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call {
|
||||
_c.Call.Return(driveItems, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call) RunAndReturn(run func(context.Context, []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call {
|
||||
func (_c *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call) RunAndReturn(run func(ctx context.Context, receivedShares []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewBaseGraphProvider creates a new instance of BaseGraphProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewBaseGraphProvider(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *BaseGraphProvider {
|
||||
mock := &BaseGraphProvider{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,18 +1,32 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"context"
|
||||
|
||||
libregraph "github.com/opencloud-eu/libre-graph-api-go"
|
||||
"github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
"github.com/opencloud-eu/libre-graph-api-go"
|
||||
"github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
|
||||
svc "github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0"
|
||||
)
|
||||
|
||||
// NewDriveItemPermissionsProvider creates a new instance of DriveItemPermissionsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewDriveItemPermissionsProvider(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *DriveItemPermissionsProvider {
|
||||
mock := &DriveItemPermissionsProvider{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// DriveItemPermissionsProvider is an autogenerated mock type for the DriveItemPermissionsProvider type
|
||||
type DriveItemPermissionsProvider struct {
|
||||
mock.Mock
|
||||
@@ -26,9 +40,9 @@ func (_m *DriveItemPermissionsProvider) EXPECT() *DriveItemPermissionsProvider_E
|
||||
return &DriveItemPermissionsProvider_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// CreateLink provides a mock function with given fields: ctx, driveItemID, createLink
|
||||
func (_m *DriveItemPermissionsProvider) CreateLink(ctx context.Context, driveItemID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error) {
|
||||
ret := _m.Called(ctx, driveItemID, createLink)
|
||||
// CreateLink provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) CreateLink(ctx context.Context, driveItemID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error) {
|
||||
ret := _mock.Called(ctx, driveItemID, createLink)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CreateLink")
|
||||
@@ -36,21 +50,19 @@ func (_m *DriveItemPermissionsProvider) CreateLink(ctx context.Context, driveIte
|
||||
|
||||
var r0 libregraph.Permission
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)); ok {
|
||||
return rf(ctx, driveItemID, createLink)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)); ok {
|
||||
return returnFunc(ctx, driveItemID, createLink)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) libregraph.Permission); ok {
|
||||
r0 = rf(ctx, driveItemID, createLink)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) libregraph.Permission); ok {
|
||||
r0 = returnFunc(ctx, driveItemID, createLink)
|
||||
} else {
|
||||
r0 = ret.Get(0).(libregraph.Permission)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) error); ok {
|
||||
r1 = rf(ctx, driveItemID, createLink)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) error); ok {
|
||||
r1 = returnFunc(ctx, driveItemID, createLink)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -69,24 +81,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) CreateLink(ctx interface{}, dri
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_CreateLink_Call) Run(run func(ctx context.Context, driveItemID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink)) *DriveItemPermissionsProvider_CreateLink_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(libregraph.DriveItemCreateLink))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 libregraph.DriveItemCreateLink
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(libregraph.DriveItemCreateLink)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_CreateLink_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_CreateLink_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DriveItemPermissionsProvider_CreateLink_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_CreateLink_Call {
|
||||
_c.Call.Return(permission, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_CreateLink_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)) *DriveItemPermissionsProvider_CreateLink_Call {
|
||||
func (_c *DriveItemPermissionsProvider_CreateLink_Call) RunAndReturn(run func(ctx context.Context, driveItemID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error)) *DriveItemPermissionsProvider_CreateLink_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// CreateSpaceRootLink provides a mock function with given fields: ctx, driveID, createLink
|
||||
func (_m *DriveItemPermissionsProvider) CreateSpaceRootLink(ctx context.Context, driveID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error) {
|
||||
ret := _m.Called(ctx, driveID, createLink)
|
||||
// CreateSpaceRootLink provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) CreateSpaceRootLink(ctx context.Context, driveID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error) {
|
||||
ret := _mock.Called(ctx, driveID, createLink)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CreateSpaceRootLink")
|
||||
@@ -94,21 +122,19 @@ func (_m *DriveItemPermissionsProvider) CreateSpaceRootLink(ctx context.Context,
|
||||
|
||||
var r0 libregraph.Permission
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)); ok {
|
||||
return rf(ctx, driveID, createLink)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)); ok {
|
||||
return returnFunc(ctx, driveID, createLink)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) libregraph.Permission); ok {
|
||||
r0 = rf(ctx, driveID, createLink)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) libregraph.Permission); ok {
|
||||
r0 = returnFunc(ctx, driveID, createLink)
|
||||
} else {
|
||||
r0 = ret.Get(0).(libregraph.Permission)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) error); ok {
|
||||
r1 = rf(ctx, driveID, createLink)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) error); ok {
|
||||
r1 = returnFunc(ctx, driveID, createLink)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -127,36 +153,51 @@ func (_e *DriveItemPermissionsProvider_Expecter) CreateSpaceRootLink(ctx interfa
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_CreateSpaceRootLink_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink)) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(libregraph.DriveItemCreateLink))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 libregraph.DriveItemCreateLink
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(libregraph.DriveItemCreateLink)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_CreateSpaceRootLink_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DriveItemPermissionsProvider_CreateSpaceRootLink_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call {
|
||||
_c.Call.Return(permission, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_CreateSpaceRootLink_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call {
|
||||
func (_c *DriveItemPermissionsProvider_CreateSpaceRootLink_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, createLink libregraph.DriveItemCreateLink) (libregraph.Permission, error)) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// DeletePermission provides a mock function with given fields: ctx, itemID, permissionID
|
||||
func (_m *DriveItemPermissionsProvider) DeletePermission(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string) error {
|
||||
ret := _m.Called(ctx, itemID, permissionID)
|
||||
// DeletePermission provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) DeletePermission(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string) error {
|
||||
ret := _mock.Called(ctx, itemID, permissionID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeletePermission")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok {
|
||||
r0 = rf(ctx, itemID, permissionID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok {
|
||||
r0 = returnFunc(ctx, itemID, permissionID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -175,36 +216,51 @@ func (_e *DriveItemPermissionsProvider_Expecter) DeletePermission(ctx interface{
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_DeletePermission_Call) Run(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string)) *DriveItemPermissionsProvider_DeletePermission_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_DeletePermission_Call) Return(_a0 error) *DriveItemPermissionsProvider_DeletePermission_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *DriveItemPermissionsProvider_DeletePermission_Call) Return(err error) *DriveItemPermissionsProvider_DeletePermission_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_DeletePermission_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string) error) *DriveItemPermissionsProvider_DeletePermission_Call {
|
||||
func (_c *DriveItemPermissionsProvider_DeletePermission_Call) RunAndReturn(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string) error) *DriveItemPermissionsProvider_DeletePermission_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// DeleteSpaceRootPermission provides a mock function with given fields: ctx, driveID, permissionID
|
||||
func (_m *DriveItemPermissionsProvider) DeleteSpaceRootPermission(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string) error {
|
||||
ret := _m.Called(ctx, driveID, permissionID)
|
||||
// DeleteSpaceRootPermission provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) DeleteSpaceRootPermission(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string) error {
|
||||
ret := _mock.Called(ctx, driveID, permissionID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteSpaceRootPermission")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok {
|
||||
r0 = rf(ctx, driveID, permissionID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok {
|
||||
r0 = returnFunc(ctx, driveID, permissionID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -223,24 +279,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) DeleteSpaceRootPermission(ctx i
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string)) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call) Return(_a0 error) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call) Return(err error) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string) error) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call {
|
||||
func (_c *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string) error) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Invite provides a mock function with given fields: ctx, resourceId, invite
|
||||
func (_m *DriveItemPermissionsProvider) Invite(ctx context.Context, resourceId *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error) {
|
||||
ret := _m.Called(ctx, resourceId, invite)
|
||||
// Invite provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) Invite(ctx context.Context, resourceId *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error) {
|
||||
ret := _mock.Called(ctx, resourceId, invite)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Invite")
|
||||
@@ -248,21 +320,19 @@ func (_m *DriveItemPermissionsProvider) Invite(ctx context.Context, resourceId *
|
||||
|
||||
var r0 libregraph.Permission
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)); ok {
|
||||
return rf(ctx, resourceId, invite)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)); ok {
|
||||
return returnFunc(ctx, resourceId, invite)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) libregraph.Permission); ok {
|
||||
r0 = rf(ctx, resourceId, invite)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) libregraph.Permission); ok {
|
||||
r0 = returnFunc(ctx, resourceId, invite)
|
||||
} else {
|
||||
r0 = ret.Get(0).(libregraph.Permission)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) error); ok {
|
||||
r1 = rf(ctx, resourceId, invite)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) error); ok {
|
||||
r1 = returnFunc(ctx, resourceId, invite)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -281,24 +351,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) Invite(ctx interface{}, resourc
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_Invite_Call) Run(run func(ctx context.Context, resourceId *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite)) *DriveItemPermissionsProvider_Invite_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(libregraph.DriveItemInvite))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 libregraph.DriveItemInvite
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(libregraph.DriveItemInvite)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_Invite_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_Invite_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DriveItemPermissionsProvider_Invite_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_Invite_Call {
|
||||
_c.Call.Return(permission, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_Invite_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)) *DriveItemPermissionsProvider_Invite_Call {
|
||||
func (_c *DriveItemPermissionsProvider_Invite_Call) RunAndReturn(run func(ctx context.Context, resourceId *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error)) *DriveItemPermissionsProvider_Invite_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListPermissions provides a mock function with given fields: ctx, itemID, queryOptions
|
||||
func (_m *DriveItemPermissionsProvider) ListPermissions(ctx context.Context, itemID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error) {
|
||||
ret := _m.Called(ctx, itemID, queryOptions)
|
||||
// ListPermissions provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) ListPermissions(ctx context.Context, itemID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error) {
|
||||
ret := _mock.Called(ctx, itemID, queryOptions)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListPermissions")
|
||||
@@ -306,21 +392,19 @@ func (_m *DriveItemPermissionsProvider) ListPermissions(ctx context.Context, ite
|
||||
|
||||
var r0 libregraph.CollectionOfPermissionsWithAllowedValues
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)); ok {
|
||||
return rf(ctx, itemID, queryOptions)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)); ok {
|
||||
return returnFunc(ctx, itemID, queryOptions)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) libregraph.CollectionOfPermissionsWithAllowedValues); ok {
|
||||
r0 = rf(ctx, itemID, queryOptions)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) libregraph.CollectionOfPermissionsWithAllowedValues); ok {
|
||||
r0 = returnFunc(ctx, itemID, queryOptions)
|
||||
} else {
|
||||
r0 = ret.Get(0).(libregraph.CollectionOfPermissionsWithAllowedValues)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) error); ok {
|
||||
r1 = rf(ctx, itemID, queryOptions)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) error); ok {
|
||||
r1 = returnFunc(ctx, itemID, queryOptions)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -339,24 +423,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) ListPermissions(ctx interface{}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_ListPermissions_Call) Run(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions)) *DriveItemPermissionsProvider_ListPermissions_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(svc.ListPermissionsQueryOptions))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 svc.ListPermissionsQueryOptions
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(svc.ListPermissionsQueryOptions)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_ListPermissions_Call) Return(_a0 libregraph.CollectionOfPermissionsWithAllowedValues, _a1 error) *DriveItemPermissionsProvider_ListPermissions_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DriveItemPermissionsProvider_ListPermissions_Call) Return(collectionOfPermissionsWithAllowedValues libregraph.CollectionOfPermissionsWithAllowedValues, err error) *DriveItemPermissionsProvider_ListPermissions_Call {
|
||||
_c.Call.Return(collectionOfPermissionsWithAllowedValues, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_ListPermissions_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)) *DriveItemPermissionsProvider_ListPermissions_Call {
|
||||
func (_c *DriveItemPermissionsProvider_ListPermissions_Call) RunAndReturn(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)) *DriveItemPermissionsProvider_ListPermissions_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListSpaceRootPermissions provides a mock function with given fields: ctx, driveID, queryOptions
|
||||
func (_m *DriveItemPermissionsProvider) ListSpaceRootPermissions(ctx context.Context, driveID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error) {
|
||||
ret := _m.Called(ctx, driveID, queryOptions)
|
||||
// ListSpaceRootPermissions provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) ListSpaceRootPermissions(ctx context.Context, driveID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error) {
|
||||
ret := _mock.Called(ctx, driveID, queryOptions)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListSpaceRootPermissions")
|
||||
@@ -364,21 +464,19 @@ func (_m *DriveItemPermissionsProvider) ListSpaceRootPermissions(ctx context.Con
|
||||
|
||||
var r0 libregraph.CollectionOfPermissionsWithAllowedValues
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)); ok {
|
||||
return rf(ctx, driveID, queryOptions)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)); ok {
|
||||
return returnFunc(ctx, driveID, queryOptions)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) libregraph.CollectionOfPermissionsWithAllowedValues); ok {
|
||||
r0 = rf(ctx, driveID, queryOptions)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) libregraph.CollectionOfPermissionsWithAllowedValues); ok {
|
||||
r0 = returnFunc(ctx, driveID, queryOptions)
|
||||
} else {
|
||||
r0 = ret.Get(0).(libregraph.CollectionOfPermissionsWithAllowedValues)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) error); ok {
|
||||
r1 = rf(ctx, driveID, queryOptions)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) error); ok {
|
||||
r1 = returnFunc(ctx, driveID, queryOptions)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -397,24 +495,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) ListSpaceRootPermissions(ctx in
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions)) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(svc.ListPermissionsQueryOptions))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 svc.ListPermissionsQueryOptions
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(svc.ListPermissionsQueryOptions)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call) Return(_a0 libregraph.CollectionOfPermissionsWithAllowedValues, _a1 error) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call) Return(collectionOfPermissionsWithAllowedValues libregraph.CollectionOfPermissionsWithAllowedValues, err error) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call {
|
||||
_c.Call.Return(collectionOfPermissionsWithAllowedValues, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call {
|
||||
func (_c *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, queryOptions svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetPublicLinkPassword provides a mock function with given fields: ctx, driveItemID, permissionID, password
|
||||
func (_m *DriveItemPermissionsProvider) SetPublicLinkPassword(ctx context.Context, driveItemID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error) {
|
||||
ret := _m.Called(ctx, driveItemID, permissionID, password)
|
||||
// SetPublicLinkPassword provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) SetPublicLinkPassword(ctx context.Context, driveItemID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error) {
|
||||
ret := _mock.Called(ctx, driveItemID, permissionID, password)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetPublicLinkPassword")
|
||||
@@ -422,21 +536,19 @@ func (_m *DriveItemPermissionsProvider) SetPublicLinkPassword(ctx context.Contex
|
||||
|
||||
var r0 libregraph.Permission
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)); ok {
|
||||
return rf(ctx, driveItemID, permissionID, password)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)); ok {
|
||||
return returnFunc(ctx, driveItemID, permissionID, password)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) libregraph.Permission); ok {
|
||||
r0 = rf(ctx, driveItemID, permissionID, password)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) libregraph.Permission); ok {
|
||||
r0 = returnFunc(ctx, driveItemID, permissionID, password)
|
||||
} else {
|
||||
r0 = ret.Get(0).(libregraph.Permission)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, string) error); ok {
|
||||
r1 = rf(ctx, driveItemID, permissionID, password)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, string) error); ok {
|
||||
r1 = returnFunc(ctx, driveItemID, permissionID, password)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -456,24 +568,45 @@ func (_e *DriveItemPermissionsProvider_Expecter) SetPublicLinkPassword(ctx inter
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_SetPublicLinkPassword_Call) Run(run func(ctx context.Context, driveItemID *providerv1beta1.ResourceId, permissionID string, password string)) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string), args[3].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
var arg3 string
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_SetPublicLinkPassword_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DriveItemPermissionsProvider_SetPublicLinkPassword_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call {
|
||||
_c.Call.Return(permission, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_SetPublicLinkPassword_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call {
|
||||
func (_c *DriveItemPermissionsProvider_SetPublicLinkPassword_Call) RunAndReturn(run func(ctx context.Context, driveItemID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetPublicLinkPasswordOnSpaceRoot provides a mock function with given fields: ctx, driveID, permissionID, password
|
||||
func (_m *DriveItemPermissionsProvider) SetPublicLinkPasswordOnSpaceRoot(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error) {
|
||||
ret := _m.Called(ctx, driveID, permissionID, password)
|
||||
// SetPublicLinkPasswordOnSpaceRoot provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) SetPublicLinkPasswordOnSpaceRoot(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error) {
|
||||
ret := _mock.Called(ctx, driveID, permissionID, password)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetPublicLinkPasswordOnSpaceRoot")
|
||||
@@ -481,21 +614,19 @@ func (_m *DriveItemPermissionsProvider) SetPublicLinkPasswordOnSpaceRoot(ctx con
|
||||
|
||||
var r0 libregraph.Permission
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)); ok {
|
||||
return rf(ctx, driveID, permissionID, password)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)); ok {
|
||||
return returnFunc(ctx, driveID, permissionID, password)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) libregraph.Permission); ok {
|
||||
r0 = rf(ctx, driveID, permissionID, password)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) libregraph.Permission); ok {
|
||||
r0 = returnFunc(ctx, driveID, permissionID, password)
|
||||
} else {
|
||||
r0 = ret.Get(0).(libregraph.Permission)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, string) error); ok {
|
||||
r1 = rf(ctx, driveID, permissionID, password)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, string) error); ok {
|
||||
r1 = returnFunc(ctx, driveID, permissionID, password)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -515,24 +646,45 @@ func (_e *DriveItemPermissionsProvider_Expecter) SetPublicLinkPasswordOnSpaceRoo
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, password string)) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string), args[3].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
var arg3 string
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call {
|
||||
_c.Call.Return(permission, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call {
|
||||
func (_c *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, password string) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SpaceRootInvite provides a mock function with given fields: ctx, driveID, invite
|
||||
func (_m *DriveItemPermissionsProvider) SpaceRootInvite(ctx context.Context, driveID *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error) {
|
||||
ret := _m.Called(ctx, driveID, invite)
|
||||
// SpaceRootInvite provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) SpaceRootInvite(ctx context.Context, driveID *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error) {
|
||||
ret := _mock.Called(ctx, driveID, invite)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SpaceRootInvite")
|
||||
@@ -540,21 +692,19 @@ func (_m *DriveItemPermissionsProvider) SpaceRootInvite(ctx context.Context, dri
|
||||
|
||||
var r0 libregraph.Permission
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)); ok {
|
||||
return rf(ctx, driveID, invite)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)); ok {
|
||||
return returnFunc(ctx, driveID, invite)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) libregraph.Permission); ok {
|
||||
r0 = rf(ctx, driveID, invite)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) libregraph.Permission); ok {
|
||||
r0 = returnFunc(ctx, driveID, invite)
|
||||
} else {
|
||||
r0 = ret.Get(0).(libregraph.Permission)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) error); ok {
|
||||
r1 = rf(ctx, driveID, invite)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) error); ok {
|
||||
r1 = returnFunc(ctx, driveID, invite)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -573,24 +723,40 @@ func (_e *DriveItemPermissionsProvider_Expecter) SpaceRootInvite(ctx interface{}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_SpaceRootInvite_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite)) *DriveItemPermissionsProvider_SpaceRootInvite_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(libregraph.DriveItemInvite))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 libregraph.DriveItemInvite
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(libregraph.DriveItemInvite)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_SpaceRootInvite_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_SpaceRootInvite_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DriveItemPermissionsProvider_SpaceRootInvite_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_SpaceRootInvite_Call {
|
||||
_c.Call.Return(permission, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_SpaceRootInvite_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SpaceRootInvite_Call {
|
||||
func (_c *DriveItemPermissionsProvider_SpaceRootInvite_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, invite libregraph.DriveItemInvite) (libregraph.Permission, error)) *DriveItemPermissionsProvider_SpaceRootInvite_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UpdatePermission provides a mock function with given fields: ctx, itemID, permissionID, newPermission
|
||||
func (_m *DriveItemPermissionsProvider) UpdatePermission(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error) {
|
||||
ret := _m.Called(ctx, itemID, permissionID, newPermission)
|
||||
// UpdatePermission provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) UpdatePermission(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error) {
|
||||
ret := _mock.Called(ctx, itemID, permissionID, newPermission)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdatePermission")
|
||||
@@ -598,21 +764,19 @@ func (_m *DriveItemPermissionsProvider) UpdatePermission(ctx context.Context, it
|
||||
|
||||
var r0 libregraph.Permission
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)); ok {
|
||||
return rf(ctx, itemID, permissionID, newPermission)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)); ok {
|
||||
return returnFunc(ctx, itemID, permissionID, newPermission)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) libregraph.Permission); ok {
|
||||
r0 = rf(ctx, itemID, permissionID, newPermission)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) libregraph.Permission); ok {
|
||||
r0 = returnFunc(ctx, itemID, permissionID, newPermission)
|
||||
} else {
|
||||
r0 = ret.Get(0).(libregraph.Permission)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) error); ok {
|
||||
r1 = rf(ctx, itemID, permissionID, newPermission)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) error); ok {
|
||||
r1 = returnFunc(ctx, itemID, permissionID, newPermission)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -632,24 +796,45 @@ func (_e *DriveItemPermissionsProvider_Expecter) UpdatePermission(ctx interface{
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_UpdatePermission_Call) Run(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission)) *DriveItemPermissionsProvider_UpdatePermission_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string), args[3].(libregraph.Permission))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
var arg3 libregraph.Permission
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(libregraph.Permission)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_UpdatePermission_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_UpdatePermission_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DriveItemPermissionsProvider_UpdatePermission_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_UpdatePermission_Call {
|
||||
_c.Call.Return(permission, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_UpdatePermission_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)) *DriveItemPermissionsProvider_UpdatePermission_Call {
|
||||
func (_c *DriveItemPermissionsProvider_UpdatePermission_Call) RunAndReturn(run func(ctx context.Context, itemID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error)) *DriveItemPermissionsProvider_UpdatePermission_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UpdateSpaceRootPermission provides a mock function with given fields: ctx, driveID, permissionID, newPermission
|
||||
func (_m *DriveItemPermissionsProvider) UpdateSpaceRootPermission(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error) {
|
||||
ret := _m.Called(ctx, driveID, permissionID, newPermission)
|
||||
// UpdateSpaceRootPermission provides a mock function for the type DriveItemPermissionsProvider
|
||||
func (_mock *DriveItemPermissionsProvider) UpdateSpaceRootPermission(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error) {
|
||||
ret := _mock.Called(ctx, driveID, permissionID, newPermission)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateSpaceRootPermission")
|
||||
@@ -657,21 +842,19 @@ func (_m *DriveItemPermissionsProvider) UpdateSpaceRootPermission(ctx context.Co
|
||||
|
||||
var r0 libregraph.Permission
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)); ok {
|
||||
return rf(ctx, driveID, permissionID, newPermission)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)); ok {
|
||||
return returnFunc(ctx, driveID, permissionID, newPermission)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) libregraph.Permission); ok {
|
||||
r0 = rf(ctx, driveID, permissionID, newPermission)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) libregraph.Permission); ok {
|
||||
r0 = returnFunc(ctx, driveID, permissionID, newPermission)
|
||||
} else {
|
||||
r0 = ret.Get(0).(libregraph.Permission)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) error); ok {
|
||||
r1 = rf(ctx, driveID, permissionID, newPermission)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) error); ok {
|
||||
r1 = returnFunc(ctx, driveID, permissionID, newPermission)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -691,31 +874,38 @@ func (_e *DriveItemPermissionsProvider_Expecter) UpdateSpaceRootPermission(ctx i
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call) Run(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission)) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string), args[3].(libregraph.Permission))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
var arg3 libregraph.Permission
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(libregraph.Permission)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call) Return(_a0 libregraph.Permission, _a1 error) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call) Return(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call {
|
||||
_c.Call.Return(permission, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string, libregraph.Permission) (libregraph.Permission, error)) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call {
|
||||
func (_c *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call) RunAndReturn(run func(ctx context.Context, driveID *providerv1beta1.ResourceId, permissionID string, newPermission libregraph.Permission) (libregraph.Permission, error)) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewDriveItemPermissionsProvider creates a new instance of DriveItemPermissionsProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewDriveItemPermissionsProvider(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *DriveItemPermissionsProvider {
|
||||
mock := &DriveItemPermissionsProvider{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,21 +1,33 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
collaborationv1beta1 "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1"
|
||||
"context"
|
||||
|
||||
"github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1"
|
||||
"github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1"
|
||||
"github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
"github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
ocmv1beta1 "github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1"
|
||||
|
||||
providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
|
||||
svc "github.com/opencloud-eu/opencloud/services/graph/pkg/service/v0"
|
||||
)
|
||||
|
||||
// NewDrivesDriveItemProvider creates a new instance of DrivesDriveItemProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewDrivesDriveItemProvider(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *DrivesDriveItemProvider {
|
||||
mock := &DrivesDriveItemProvider{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// DrivesDriveItemProvider is an autogenerated mock type for the DrivesDriveItemProvider type
|
||||
type DrivesDriveItemProvider struct {
|
||||
mock.Mock
|
||||
@@ -29,9 +41,9 @@ func (_m *DrivesDriveItemProvider) EXPECT() *DrivesDriveItemProvider_Expecter {
|
||||
return &DrivesDriveItemProvider_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetShare provides a mock function with given fields: ctx, shareID
|
||||
func (_m *DrivesDriveItemProvider) GetShare(ctx context.Context, shareID *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error) {
|
||||
ret := _m.Called(ctx, shareID)
|
||||
// GetShare provides a mock function for the type DrivesDriveItemProvider
|
||||
func (_mock *DrivesDriveItemProvider) GetShare(ctx context.Context, shareID *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error) {
|
||||
ret := _mock.Called(ctx, shareID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetShare")
|
||||
@@ -39,23 +51,21 @@ func (_m *DrivesDriveItemProvider) GetShare(ctx context.Context, shareID *collab
|
||||
|
||||
var r0 *collaborationv1beta1.ReceivedShare
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error)); ok {
|
||||
return rf(ctx, shareID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error)); ok {
|
||||
return returnFunc(ctx, shareID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) *collaborationv1beta1.ReceivedShare); ok {
|
||||
r0 = rf(ctx, shareID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) *collaborationv1beta1.ReceivedShare); ok {
|
||||
r0 = returnFunc(ctx, shareID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*collaborationv1beta1.ReceivedShare)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *collaborationv1beta1.ShareId) error); ok {
|
||||
r1 = rf(ctx, shareID)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *collaborationv1beta1.ShareId) error); ok {
|
||||
r1 = returnFunc(ctx, shareID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -73,24 +83,35 @@ func (_e *DrivesDriveItemProvider_Expecter) GetShare(ctx interface{}, shareID in
|
||||
|
||||
func (_c *DrivesDriveItemProvider_GetShare_Call) Run(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId)) *DrivesDriveItemProvider_GetShare_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*collaborationv1beta1.ShareId))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *collaborationv1beta1.ShareId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*collaborationv1beta1.ShareId)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_GetShare_Call) Return(_a0 *collaborationv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_GetShare_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DrivesDriveItemProvider_GetShare_Call) Return(receivedShare *collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_GetShare_Call {
|
||||
_c.Call.Return(receivedShare, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_GetShare_Call) RunAndReturn(run func(context.Context, *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_GetShare_Call {
|
||||
func (_c *DrivesDriveItemProvider_GetShare_Call) RunAndReturn(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_GetShare_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetSharesForResource provides a mock function with given fields: ctx, resourceID, filters
|
||||
func (_m *DrivesDriveItemProvider) GetSharesForResource(ctx context.Context, resourceID *providerv1beta1.ResourceId, filters []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error) {
|
||||
ret := _m.Called(ctx, resourceID, filters)
|
||||
// GetSharesForResource provides a mock function for the type DrivesDriveItemProvider
|
||||
func (_mock *DrivesDriveItemProvider) GetSharesForResource(ctx context.Context, resourceID *providerv1beta1.ResourceId, filters []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error) {
|
||||
ret := _mock.Called(ctx, resourceID, filters)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetSharesForResource")
|
||||
@@ -98,23 +119,21 @@ func (_m *DrivesDriveItemProvider) GetSharesForResource(ctx context.Context, res
|
||||
|
||||
var r0 []*collaborationv1beta1.ReceivedShare
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)); ok {
|
||||
return rf(ctx, resourceID, filters)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)); ok {
|
||||
return returnFunc(ctx, resourceID, filters)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) []*collaborationv1beta1.ReceivedShare); ok {
|
||||
r0 = rf(ctx, resourceID, filters)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) []*collaborationv1beta1.ReceivedShare); ok {
|
||||
r0 = returnFunc(ctx, resourceID, filters)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*collaborationv1beta1.ReceivedShare)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) error); ok {
|
||||
r1 = rf(ctx, resourceID, filters)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) error); ok {
|
||||
r1 = returnFunc(ctx, resourceID, filters)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -133,24 +152,40 @@ func (_e *DrivesDriveItemProvider_Expecter) GetSharesForResource(ctx interface{}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) Run(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId, filters []*collaborationv1beta1.Filter)) *DrivesDriveItemProvider_GetSharesForResource_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].([]*collaborationv1beta1.Filter))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 []*collaborationv1beta1.Filter
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].([]*collaborationv1beta1.Filter)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) Return(_a0 []*collaborationv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_GetSharesForResource_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) Return(receivedShares []*collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_GetSharesForResource_Call {
|
||||
_c.Call.Return(receivedShares, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_GetSharesForResource_Call {
|
||||
func (_c *DrivesDriveItemProvider_GetSharesForResource_Call) RunAndReturn(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId, filters []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_GetSharesForResource_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// MountOCMShare provides a mock function with given fields: ctx, resourceID
|
||||
func (_m *DrivesDriveItemProvider) MountOCMShare(ctx context.Context, resourceID *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error) {
|
||||
ret := _m.Called(ctx, resourceID)
|
||||
// MountOCMShare provides a mock function for the type DrivesDriveItemProvider
|
||||
func (_mock *DrivesDriveItemProvider) MountOCMShare(ctx context.Context, resourceID *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error) {
|
||||
ret := _mock.Called(ctx, resourceID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MountOCMShare")
|
||||
@@ -158,23 +193,21 @@ func (_m *DrivesDriveItemProvider) MountOCMShare(ctx context.Context, resourceID
|
||||
|
||||
var r0 []*ocmv1beta1.ReceivedShare
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error)); ok {
|
||||
return rf(ctx, resourceID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error)); ok {
|
||||
return returnFunc(ctx, resourceID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) []*ocmv1beta1.ReceivedShare); ok {
|
||||
r0 = rf(ctx, resourceID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) []*ocmv1beta1.ReceivedShare); ok {
|
||||
r0 = returnFunc(ctx, resourceID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*ocmv1beta1.ReceivedShare)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId) error); ok {
|
||||
r1 = rf(ctx, resourceID)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId) error); ok {
|
||||
r1 = returnFunc(ctx, resourceID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -192,24 +225,35 @@ func (_e *DrivesDriveItemProvider_Expecter) MountOCMShare(ctx interface{}, resou
|
||||
|
||||
func (_c *DrivesDriveItemProvider_MountOCMShare_Call) Run(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId)) *DrivesDriveItemProvider_MountOCMShare_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_MountOCMShare_Call) Return(_a0 []*ocmv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_MountOCMShare_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DrivesDriveItemProvider_MountOCMShare_Call) Return(receivedShares []*ocmv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_MountOCMShare_Call {
|
||||
_c.Call.Return(receivedShares, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_MountOCMShare_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_MountOCMShare_Call {
|
||||
func (_c *DrivesDriveItemProvider_MountOCMShare_Call) RunAndReturn(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_MountOCMShare_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// MountShare provides a mock function with given fields: ctx, resourceID, name
|
||||
func (_m *DrivesDriveItemProvider) MountShare(ctx context.Context, resourceID *providerv1beta1.ResourceId, name string) ([]*collaborationv1beta1.ReceivedShare, error) {
|
||||
ret := _m.Called(ctx, resourceID, name)
|
||||
// MountShare provides a mock function for the type DrivesDriveItemProvider
|
||||
func (_mock *DrivesDriveItemProvider) MountShare(ctx context.Context, resourceID *providerv1beta1.ResourceId, name string) ([]*collaborationv1beta1.ReceivedShare, error) {
|
||||
ret := _mock.Called(ctx, resourceID, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MountShare")
|
||||
@@ -217,23 +261,21 @@ func (_m *DrivesDriveItemProvider) MountShare(ctx context.Context, resourceID *p
|
||||
|
||||
var r0 []*collaborationv1beta1.ReceivedShare
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) ([]*collaborationv1beta1.ReceivedShare, error)); ok {
|
||||
return rf(ctx, resourceID, name)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) ([]*collaborationv1beta1.ReceivedShare, error)); ok {
|
||||
return returnFunc(ctx, resourceID, name)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) []*collaborationv1beta1.ReceivedShare); ok {
|
||||
r0 = rf(ctx, resourceID, name)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) []*collaborationv1beta1.ReceivedShare); ok {
|
||||
r0 = returnFunc(ctx, resourceID, name)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*collaborationv1beta1.ReceivedShare)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok {
|
||||
r1 = rf(ctx, resourceID, name)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId, string) error); ok {
|
||||
r1 = returnFunc(ctx, resourceID, name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -252,36 +294,51 @@ func (_e *DrivesDriveItemProvider_Expecter) MountShare(ctx interface{}, resource
|
||||
|
||||
func (_c *DrivesDriveItemProvider_MountShare_Call) Run(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId, name string)) *DrivesDriveItemProvider_MountShare_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_MountShare_Call) Return(_a0 []*collaborationv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_MountShare_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DrivesDriveItemProvider_MountShare_Call) Return(receivedShares []*collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_MountShare_Call {
|
||||
_c.Call.Return(receivedShares, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_MountShare_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId, string) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_MountShare_Call {
|
||||
func (_c *DrivesDriveItemProvider_MountShare_Call) RunAndReturn(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId, name string) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_MountShare_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UnmountShare provides a mock function with given fields: ctx, shareID
|
||||
func (_m *DrivesDriveItemProvider) UnmountShare(ctx context.Context, shareID *collaborationv1beta1.ShareId) error {
|
||||
ret := _m.Called(ctx, shareID)
|
||||
// UnmountShare provides a mock function for the type DrivesDriveItemProvider
|
||||
func (_mock *DrivesDriveItemProvider) UnmountShare(ctx context.Context, shareID *collaborationv1beta1.ShareId) error {
|
||||
ret := _mock.Called(ctx, shareID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UnmountShare")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) error); ok {
|
||||
r0 = rf(ctx, shareID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) error); ok {
|
||||
r0 = returnFunc(ctx, shareID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -299,24 +356,35 @@ func (_e *DrivesDriveItemProvider_Expecter) UnmountShare(ctx interface{}, shareI
|
||||
|
||||
func (_c *DrivesDriveItemProvider_UnmountShare_Call) Run(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId)) *DrivesDriveItemProvider_UnmountShare_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*collaborationv1beta1.ShareId))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *collaborationv1beta1.ShareId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*collaborationv1beta1.ShareId)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_UnmountShare_Call) Return(_a0 error) *DrivesDriveItemProvider_UnmountShare_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *DrivesDriveItemProvider_UnmountShare_Call) Return(err error) *DrivesDriveItemProvider_UnmountShare_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_UnmountShare_Call) RunAndReturn(run func(context.Context, *collaborationv1beta1.ShareId) error) *DrivesDriveItemProvider_UnmountShare_Call {
|
||||
func (_c *DrivesDriveItemProvider_UnmountShare_Call) RunAndReturn(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId) error) *DrivesDriveItemProvider_UnmountShare_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UpdateShares provides a mock function with given fields: ctx, shares, updater
|
||||
func (_m *DrivesDriveItemProvider) UpdateShares(ctx context.Context, shares []*collaborationv1beta1.ReceivedShare, updater svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error) {
|
||||
ret := _m.Called(ctx, shares, updater)
|
||||
// UpdateShares provides a mock function for the type DrivesDriveItemProvider
|
||||
func (_mock *DrivesDriveItemProvider) UpdateShares(ctx context.Context, shares []*collaborationv1beta1.ReceivedShare, updater svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error) {
|
||||
ret := _mock.Called(ctx, shares, updater)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateShares")
|
||||
@@ -324,23 +392,21 @@ func (_m *DrivesDriveItemProvider) UpdateShares(ctx context.Context, shares []*c
|
||||
|
||||
var r0 []*collaborationv1beta1.ReceivedShare
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error)); ok {
|
||||
return rf(ctx, shares, updater)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error)); ok {
|
||||
return returnFunc(ctx, shares, updater)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) []*collaborationv1beta1.ReceivedShare); ok {
|
||||
r0 = rf(ctx, shares, updater)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) []*collaborationv1beta1.ReceivedShare); ok {
|
||||
r0 = returnFunc(ctx, shares, updater)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*collaborationv1beta1.ReceivedShare)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) error); ok {
|
||||
r1 = rf(ctx, shares, updater)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) error); ok {
|
||||
r1 = returnFunc(ctx, shares, updater)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -359,31 +425,33 @@ func (_e *DrivesDriveItemProvider_Expecter) UpdateShares(ctx interface{}, shares
|
||||
|
||||
func (_c *DrivesDriveItemProvider_UpdateShares_Call) Run(run func(ctx context.Context, shares []*collaborationv1beta1.ReceivedShare, updater svc.UpdateShareClosure)) *DrivesDriveItemProvider_UpdateShares_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].([]*collaborationv1beta1.ReceivedShare), args[2].(svc.UpdateShareClosure))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 []*collaborationv1beta1.ReceivedShare
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].([]*collaborationv1beta1.ReceivedShare)
|
||||
}
|
||||
var arg2 svc.UpdateShareClosure
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(svc.UpdateShareClosure)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_UpdateShares_Call) Return(_a0 []*collaborationv1beta1.ReceivedShare, _a1 error) *DrivesDriveItemProvider_UpdateShares_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *DrivesDriveItemProvider_UpdateShares_Call) Return(receivedShares []*collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_UpdateShares_Call {
|
||||
_c.Call.Return(receivedShares, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *DrivesDriveItemProvider_UpdateShares_Call) RunAndReturn(run func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_UpdateShares_Call {
|
||||
func (_c *DrivesDriveItemProvider_UpdateShares_Call) RunAndReturn(run func(ctx context.Context, shares []*collaborationv1beta1.ReceivedShare, updater svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error)) *DrivesDriveItemProvider_UpdateShares_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewDrivesDriveItemProvider creates a new instance of DrivesDriveItemProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewDrivesDriveItemProvider(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *DrivesDriveItemProvider {
|
||||
mock := &DrivesDriveItemProvider{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
pool "github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NewSelectable creates a new instance of Selectable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSelectable[T any](t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Selectable[T] {
|
||||
mock := &Selectable[T]{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// Selectable is an autogenerated mock type for the Selectable type
|
||||
type Selectable[T any] struct {
|
||||
mock.Mock
|
||||
@@ -20,15 +36,15 @@ func (_m *Selectable[T]) EXPECT() *Selectable_Expecter[T] {
|
||||
return &Selectable_Expecter[T]{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Next provides a mock function with given fields: opts
|
||||
func (_m *Selectable[T]) Next(opts ...pool.Option) (T, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
// Next provides a mock function for the type Selectable
|
||||
func (_mock *Selectable[T]) Next(opts ...pool.Option) (T, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called()
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Next")
|
||||
@@ -36,23 +52,21 @@ func (_m *Selectable[T]) Next(opts ...pool.Option) (T, error) {
|
||||
|
||||
var r0 T
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(...pool.Option) (T, error)); ok {
|
||||
return rf(opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(...pool.Option) (T, error)); ok {
|
||||
return returnFunc(opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(...pool.Option) T); ok {
|
||||
r0 = rf(opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(...pool.Option) T); ok {
|
||||
r0 = returnFunc(opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(T)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(...pool.Option) error); ok {
|
||||
r1 = rf(opts...)
|
||||
if returnFunc, ok := ret.Get(1).(func(...pool.Option) error); ok {
|
||||
r1 = returnFunc(opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -70,37 +84,25 @@ func (_e *Selectable_Expecter[T]) Next(opts ...interface{}) *Selectable_Next_Cal
|
||||
|
||||
func (_c *Selectable_Next_Call[T]) Run(run func(opts ...pool.Option)) *Selectable_Next_Call[T] {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]pool.Option, len(args)-0)
|
||||
for i, a := range args[0:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(pool.Option)
|
||||
}
|
||||
var arg0 []pool.Option
|
||||
var variadicArgs []pool.Option
|
||||
if len(args) > 0 {
|
||||
variadicArgs = args[0].([]pool.Option)
|
||||
}
|
||||
run(variadicArgs...)
|
||||
arg0 = variadicArgs
|
||||
run(
|
||||
arg0...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Selectable_Next_Call[T]) Return(_a0 T, _a1 error) *Selectable_Next_Call[T] {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Selectable_Next_Call[T]) Return(v T, err error) *Selectable_Next_Call[T] {
|
||||
_c.Call.Return(v, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Selectable_Next_Call[T]) RunAndReturn(run func(...pool.Option) (T, error)) *Selectable_Next_Call[T] {
|
||||
func (_c *Selectable_Next_Call[T]) RunAndReturn(run func(opts ...pool.Option) (T, error)) *Selectable_Next_Call[T] {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewSelectable creates a new instance of Selectable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSelectable[T any](t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Selectable[T] {
|
||||
mock := &Selectable[T]{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,13 +1,29 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
http "net/http"
|
||||
"net/http"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NewHTTPClient creates a new instance of HTTPClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewHTTPClient(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *HTTPClient {
|
||||
mock := &HTTPClient{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// HTTPClient is an autogenerated mock type for the HTTPClient type
|
||||
type HTTPClient struct {
|
||||
mock.Mock
|
||||
@@ -21,9 +37,9 @@ func (_m *HTTPClient) EXPECT() *HTTPClient_Expecter {
|
||||
return &HTTPClient_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Do provides a mock function with given fields: req
|
||||
func (_m *HTTPClient) Do(req *http.Request) (*http.Response, error) {
|
||||
ret := _m.Called(req)
|
||||
// Do provides a mock function for the type HTTPClient
|
||||
func (_mock *HTTPClient) Do(req *http.Request) (*http.Response, error) {
|
||||
ret := _mock.Called(req)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Do")
|
||||
@@ -31,23 +47,21 @@ func (_m *HTTPClient) Do(req *http.Request) (*http.Response, error) {
|
||||
|
||||
var r0 *http.Response
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*http.Request) (*http.Response, error)); ok {
|
||||
return rf(req)
|
||||
if returnFunc, ok := ret.Get(0).(func(*http.Request) (*http.Response, error)); ok {
|
||||
return returnFunc(req)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*http.Request) *http.Response); ok {
|
||||
r0 = rf(req)
|
||||
if returnFunc, ok := ret.Get(0).(func(*http.Request) *http.Response); ok {
|
||||
r0 = returnFunc(req)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*http.Response)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*http.Request) error); ok {
|
||||
r1 = rf(req)
|
||||
if returnFunc, ok := ret.Get(1).(func(*http.Request) error); ok {
|
||||
r1 = returnFunc(req)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -64,31 +78,23 @@ func (_e *HTTPClient_Expecter) Do(req interface{}) *HTTPClient_Do_Call {
|
||||
|
||||
func (_c *HTTPClient_Do_Call) Run(run func(req *http.Request)) *HTTPClient_Do_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(*http.Request))
|
||||
var arg0 *http.Request
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(*http.Request)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *HTTPClient_Do_Call) Return(_a0 *http.Response, _a1 error) *HTTPClient_Do_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *HTTPClient_Do_Call) Return(response *http.Response, err error) *HTTPClient_Do_Call {
|
||||
_c.Call.Return(response, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *HTTPClient_Do_Call) RunAndReturn(run func(*http.Request) (*http.Response, error)) *HTTPClient_Do_Call {
|
||||
func (_c *HTTPClient_Do_Call) RunAndReturn(run func(req *http.Request) (*http.Response, error)) *HTTPClient_Do_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewHTTPClient creates a new instance of HTTPClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewHTTPClient(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *HTTPClient {
|
||||
mock := &HTTPClient{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
client "go-micro.dev/v4/client"
|
||||
"context"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0"
|
||||
"go-micro.dev/v4/client"
|
||||
)
|
||||
|
||||
// NewPermissions creates a new instance of Permissions. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewPermissions(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Permissions {
|
||||
mock := &Permissions{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// Permissions is an autogenerated mock type for the Permissions type
|
||||
type Permissions struct {
|
||||
mock.Mock
|
||||
@@ -25,16 +39,15 @@ func (_m *Permissions) EXPECT() *Permissions_Expecter {
|
||||
return &Permissions_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetPermissionByID provides a mock function with given fields: ctx, request, opts
|
||||
func (_m *Permissions) GetPermissionByID(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption) (*v0.GetPermissionByIDResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
// GetPermissionByID provides a mock function for the type Permissions
|
||||
func (_mock *Permissions) GetPermissionByID(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption) (*v0.GetPermissionByIDResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, request, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, request)
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, request)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetPermissionByID")
|
||||
@@ -42,23 +55,21 @@ func (_m *Permissions) GetPermissionByID(ctx context.Context, request *v0.GetPer
|
||||
|
||||
var r0 *v0.GetPermissionByIDResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) (*v0.GetPermissionByIDResponse, error)); ok {
|
||||
return rf(ctx, request, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) (*v0.GetPermissionByIDResponse, error)); ok {
|
||||
return returnFunc(ctx, request, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) *v0.GetPermissionByIDResponse); ok {
|
||||
r0 = rf(ctx, request, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) *v0.GetPermissionByIDResponse); ok {
|
||||
r0 = returnFunc(ctx, request, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetPermissionByIDResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, request, opts...)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, request, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -78,37 +89,48 @@ func (_e *Permissions_Expecter) GetPermissionByID(ctx interface{}, request inter
|
||||
|
||||
func (_c *Permissions_GetPermissionByID_Call) Run(run func(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption)) *Permissions_GetPermissionByID_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.GetPermissionByIDRequest), variadicArgs...)
|
||||
var arg1 *v0.GetPermissionByIDRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.GetPermissionByIDRequest)
|
||||
}
|
||||
var arg2 []client.CallOption
|
||||
var variadicArgs []client.CallOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]client.CallOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Permissions_GetPermissionByID_Call) Return(_a0 *v0.GetPermissionByIDResponse, _a1 error) *Permissions_GetPermissionByID_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Permissions_GetPermissionByID_Call) Return(getPermissionByIDResponse *v0.GetPermissionByIDResponse, err error) *Permissions_GetPermissionByID_Call {
|
||||
_c.Call.Return(getPermissionByIDResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Permissions_GetPermissionByID_Call) RunAndReturn(run func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) (*v0.GetPermissionByIDResponse, error)) *Permissions_GetPermissionByID_Call {
|
||||
func (_c *Permissions_GetPermissionByID_Call) RunAndReturn(run func(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption) (*v0.GetPermissionByIDResponse, error)) *Permissions_GetPermissionByID_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListPermissions provides a mock function with given fields: ctx, req, opts
|
||||
func (_m *Permissions) ListPermissions(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption) (*v0.ListPermissionsResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
// ListPermissions provides a mock function for the type Permissions
|
||||
func (_mock *Permissions) ListPermissions(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption) (*v0.ListPermissionsResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, req, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, req)
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, req)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListPermissions")
|
||||
@@ -116,23 +138,21 @@ func (_m *Permissions) ListPermissions(ctx context.Context, req *v0.ListPermissi
|
||||
|
||||
var r0 *v0.ListPermissionsResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) (*v0.ListPermissionsResponse, error)); ok {
|
||||
return rf(ctx, req, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) (*v0.ListPermissionsResponse, error)); ok {
|
||||
return returnFunc(ctx, req, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) *v0.ListPermissionsResponse); ok {
|
||||
r0 = rf(ctx, req, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) *v0.ListPermissionsResponse); ok {
|
||||
r0 = returnFunc(ctx, req, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.ListPermissionsResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, req, opts...)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, req, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -152,37 +172,48 @@ func (_e *Permissions_Expecter) ListPermissions(ctx interface{}, req interface{}
|
||||
|
||||
func (_c *Permissions_ListPermissions_Call) Run(run func(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption)) *Permissions_ListPermissions_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.ListPermissionsRequest), variadicArgs...)
|
||||
var arg1 *v0.ListPermissionsRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.ListPermissionsRequest)
|
||||
}
|
||||
var arg2 []client.CallOption
|
||||
var variadicArgs []client.CallOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]client.CallOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Permissions_ListPermissions_Call) Return(_a0 *v0.ListPermissionsResponse, _a1 error) *Permissions_ListPermissions_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Permissions_ListPermissions_Call) Return(listPermissionsResponse *v0.ListPermissionsResponse, err error) *Permissions_ListPermissions_Call {
|
||||
_c.Call.Return(listPermissionsResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Permissions_ListPermissions_Call) RunAndReturn(run func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) (*v0.ListPermissionsResponse, error)) *Permissions_ListPermissions_Call {
|
||||
func (_c *Permissions_ListPermissions_Call) RunAndReturn(run func(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption) (*v0.ListPermissionsResponse, error)) *Permissions_ListPermissions_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListPermissionsByResource provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *Permissions) ListPermissionsByResource(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
// ListPermissionsByResource provides a mock function for the type Permissions
|
||||
func (_mock *Permissions) ListPermissionsByResource(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListPermissionsByResource")
|
||||
@@ -190,23 +221,21 @@ func (_m *Permissions) ListPermissionsByResource(ctx context.Context, in *v0.Lis
|
||||
|
||||
var r0 *v0.ListPermissionsByResourceResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) *v0.ListPermissionsByResourceResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) *v0.ListPermissionsByResourceResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.ListPermissionsByResourceResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -226,37 +255,35 @@ func (_e *Permissions_Expecter) ListPermissionsByResource(ctx interface{}, in in
|
||||
|
||||
func (_c *Permissions_ListPermissionsByResource_Call) Run(run func(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption)) *Permissions_ListPermissionsByResource_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.ListPermissionsByResourceRequest), variadicArgs...)
|
||||
var arg1 *v0.ListPermissionsByResourceRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.ListPermissionsByResourceRequest)
|
||||
}
|
||||
var arg2 []client.CallOption
|
||||
var variadicArgs []client.CallOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]client.CallOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Permissions_ListPermissionsByResource_Call) Return(_a0 *v0.ListPermissionsByResourceResponse, _a1 error) *Permissions_ListPermissionsByResource_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Permissions_ListPermissionsByResource_Call) Return(listPermissionsByResourceResponse *v0.ListPermissionsByResourceResponse, err error) *Permissions_ListPermissionsByResource_Call {
|
||||
_c.Call.Return(listPermissionsByResourceResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Permissions_ListPermissionsByResource_Call) RunAndReturn(run func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)) *Permissions_ListPermissionsByResource_Call {
|
||||
func (_c *Permissions_ListPermissionsByResource_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)) *Permissions_ListPermissionsByResource_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewPermissions creates a new instance of Permissions. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewPermissions(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Permissions {
|
||||
mock := &Permissions{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,87 +1,14 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
events "go-micro.dev/v4/events"
|
||||
"go-micro.dev/v4/events"
|
||||
)
|
||||
|
||||
// Publisher is an autogenerated mock type for the Publisher type
|
||||
type Publisher struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type Publisher_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *Publisher) EXPECT() *Publisher_Expecter {
|
||||
return &Publisher_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Publish provides a mock function with given fields: _a0, _a1, _a2
|
||||
func (_m *Publisher) Publish(_a0 string, _a1 interface{}, _a2 ...events.PublishOption) error {
|
||||
_va := make([]interface{}, len(_a2))
|
||||
for _i := range _a2 {
|
||||
_va[_i] = _a2[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, _a0, _a1)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Publish")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, interface{}, ...events.PublishOption) error); ok {
|
||||
r0 = rf(_a0, _a1, _a2...)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Publisher_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish'
|
||||
type Publisher_Publish_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// Publish is a helper method to define mock.On call
|
||||
// - _a0 string
|
||||
// - _a1 interface{}
|
||||
// - _a2 ...events.PublishOption
|
||||
func (_e *Publisher_Expecter) Publish(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *Publisher_Publish_Call {
|
||||
return &Publisher_Publish_Call{Call: _e.mock.On("Publish",
|
||||
append([]interface{}{_a0, _a1}, _a2...)...)}
|
||||
}
|
||||
|
||||
func (_c *Publisher_Publish_Call) Run(run func(_a0 string, _a1 interface{}, _a2 ...events.PublishOption)) *Publisher_Publish_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]events.PublishOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(events.PublishOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(string), args[1].(interface{}), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Publisher_Publish_Call) Return(_a0 error) *Publisher_Publish_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Publisher_Publish_Call) RunAndReturn(run func(string, interface{}, ...events.PublishOption) error) *Publisher_Publish_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewPublisher creates a new instance of Publisher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewPublisher(t interface {
|
||||
@@ -95,3 +22,88 @@ func NewPublisher(t interface {
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// Publisher is an autogenerated mock type for the Publisher type
|
||||
type Publisher struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type Publisher_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *Publisher) EXPECT() *Publisher_Expecter {
|
||||
return &Publisher_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Publish provides a mock function for the type Publisher
|
||||
func (_mock *Publisher) Publish(s string, ifaceVal interface{}, publishOptions ...events.PublishOption) error {
|
||||
var tmpRet mock.Arguments
|
||||
if len(publishOptions) > 0 {
|
||||
tmpRet = _mock.Called(s, ifaceVal, publishOptions)
|
||||
} else {
|
||||
tmpRet = _mock.Called(s, ifaceVal)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Publish")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if returnFunc, ok := ret.Get(0).(func(string, interface{}, ...events.PublishOption) error); ok {
|
||||
r0 = returnFunc(s, ifaceVal, publishOptions...)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
return r0
|
||||
}
|
||||
|
||||
// Publisher_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish'
|
||||
type Publisher_Publish_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// Publish is a helper method to define mock.On call
|
||||
// - s string
|
||||
// - ifaceVal interface{}
|
||||
// - publishOptions ...events.PublishOption
|
||||
func (_e *Publisher_Expecter) Publish(s interface{}, ifaceVal interface{}, publishOptions ...interface{}) *Publisher_Publish_Call {
|
||||
return &Publisher_Publish_Call{Call: _e.mock.On("Publish",
|
||||
append([]interface{}{s, ifaceVal}, publishOptions...)...)}
|
||||
}
|
||||
|
||||
func (_c *Publisher_Publish_Call) Run(run func(s string, ifaceVal interface{}, publishOptions ...events.PublishOption)) *Publisher_Publish_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
var arg1 interface{}
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(interface{})
|
||||
}
|
||||
var arg2 []events.PublishOption
|
||||
var variadicArgs []events.PublishOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]events.PublishOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Publisher_Publish_Call) Return(err error) *Publisher_Publish_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Publisher_Publish_Call) RunAndReturn(run func(s string, ifaceVal interface{}, publishOptions ...events.PublishOption) error) *Publisher_Publish_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
@@ -1,19 +1,32 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
client "go-micro.dev/v4/client"
|
||||
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
"context"
|
||||
|
||||
"github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0"
|
||||
"go-micro.dev/v4/client"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// NewRoleService creates a new instance of RoleService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewRoleService(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *RoleService {
|
||||
mock := &RoleService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// RoleService is an autogenerated mock type for the RoleService type
|
||||
type RoleService struct {
|
||||
mock.Mock
|
||||
@@ -27,16 +40,15 @@ func (_m *RoleService) EXPECT() *RoleService_Expecter {
|
||||
return &RoleService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// AssignRoleToUser provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *RoleService) AssignRoleToUser(ctx context.Context, in *v0.AssignRoleToUserRequest, opts ...client.CallOption) (*v0.AssignRoleToUserResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
// AssignRoleToUser provides a mock function for the type RoleService
|
||||
func (_mock *RoleService) AssignRoleToUser(ctx context.Context, in *v0.AssignRoleToUserRequest, opts ...client.CallOption) (*v0.AssignRoleToUserResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AssignRoleToUser")
|
||||
@@ -44,23 +56,21 @@ func (_m *RoleService) AssignRoleToUser(ctx context.Context, in *v0.AssignRoleTo
|
||||
|
||||
var r0 *v0.AssignRoleToUserResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) (*v0.AssignRoleToUserResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) (*v0.AssignRoleToUserResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) *v0.AssignRoleToUserResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) *v0.AssignRoleToUserResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.AssignRoleToUserResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -80,37 +90,48 @@ func (_e *RoleService_Expecter) AssignRoleToUser(ctx interface{}, in interface{}
|
||||
|
||||
func (_c *RoleService_AssignRoleToUser_Call) Run(run func(ctx context.Context, in *v0.AssignRoleToUserRequest, opts ...client.CallOption)) *RoleService_AssignRoleToUser_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.AssignRoleToUserRequest), variadicArgs...)
|
||||
var arg1 *v0.AssignRoleToUserRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.AssignRoleToUserRequest)
|
||||
}
|
||||
var arg2 []client.CallOption
|
||||
var variadicArgs []client.CallOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]client.CallOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *RoleService_AssignRoleToUser_Call) Return(_a0 *v0.AssignRoleToUserResponse, _a1 error) *RoleService_AssignRoleToUser_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *RoleService_AssignRoleToUser_Call) Return(assignRoleToUserResponse *v0.AssignRoleToUserResponse, err error) *RoleService_AssignRoleToUser_Call {
|
||||
_c.Call.Return(assignRoleToUserResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *RoleService_AssignRoleToUser_Call) RunAndReturn(run func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) (*v0.AssignRoleToUserResponse, error)) *RoleService_AssignRoleToUser_Call {
|
||||
func (_c *RoleService_AssignRoleToUser_Call) RunAndReturn(run func(ctx context.Context, in *v0.AssignRoleToUserRequest, opts ...client.CallOption) (*v0.AssignRoleToUserResponse, error)) *RoleService_AssignRoleToUser_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListRoleAssignments provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *RoleService) ListRoleAssignments(ctx context.Context, in *v0.ListRoleAssignmentsRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
// ListRoleAssignments provides a mock function for the type RoleService
|
||||
func (_mock *RoleService) ListRoleAssignments(ctx context.Context, in *v0.ListRoleAssignmentsRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListRoleAssignments")
|
||||
@@ -118,23 +139,21 @@ func (_m *RoleService) ListRoleAssignments(ctx context.Context, in *v0.ListRoleA
|
||||
|
||||
var r0 *v0.ListRoleAssignmentsResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) *v0.ListRoleAssignmentsResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) *v0.ListRoleAssignmentsResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.ListRoleAssignmentsResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -154,37 +173,48 @@ func (_e *RoleService_Expecter) ListRoleAssignments(ctx interface{}, in interfac
|
||||
|
||||
func (_c *RoleService_ListRoleAssignments_Call) Run(run func(ctx context.Context, in *v0.ListRoleAssignmentsRequest, opts ...client.CallOption)) *RoleService_ListRoleAssignments_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.ListRoleAssignmentsRequest), variadicArgs...)
|
||||
var arg1 *v0.ListRoleAssignmentsRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.ListRoleAssignmentsRequest)
|
||||
}
|
||||
var arg2 []client.CallOption
|
||||
var variadicArgs []client.CallOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]client.CallOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *RoleService_ListRoleAssignments_Call) Return(_a0 *v0.ListRoleAssignmentsResponse, _a1 error) *RoleService_ListRoleAssignments_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *RoleService_ListRoleAssignments_Call) Return(listRoleAssignmentsResponse *v0.ListRoleAssignmentsResponse, err error) *RoleService_ListRoleAssignments_Call {
|
||||
_c.Call.Return(listRoleAssignmentsResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *RoleService_ListRoleAssignments_Call) RunAndReturn(run func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)) *RoleService_ListRoleAssignments_Call {
|
||||
func (_c *RoleService_ListRoleAssignments_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListRoleAssignmentsRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)) *RoleService_ListRoleAssignments_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListRoleAssignmentsFiltered provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *RoleService) ListRoleAssignmentsFiltered(ctx context.Context, in *v0.ListRoleAssignmentsFilteredRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
// ListRoleAssignmentsFiltered provides a mock function for the type RoleService
|
||||
func (_mock *RoleService) ListRoleAssignmentsFiltered(ctx context.Context, in *v0.ListRoleAssignmentsFilteredRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListRoleAssignmentsFiltered")
|
||||
@@ -192,23 +222,21 @@ func (_m *RoleService) ListRoleAssignmentsFiltered(ctx context.Context, in *v0.L
|
||||
|
||||
var r0 *v0.ListRoleAssignmentsResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) *v0.ListRoleAssignmentsResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) *v0.ListRoleAssignmentsResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.ListRoleAssignmentsResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -228,37 +256,48 @@ func (_e *RoleService_Expecter) ListRoleAssignmentsFiltered(ctx interface{}, in
|
||||
|
||||
func (_c *RoleService_ListRoleAssignmentsFiltered_Call) Run(run func(ctx context.Context, in *v0.ListRoleAssignmentsFilteredRequest, opts ...client.CallOption)) *RoleService_ListRoleAssignmentsFiltered_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.ListRoleAssignmentsFilteredRequest), variadicArgs...)
|
||||
var arg1 *v0.ListRoleAssignmentsFilteredRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.ListRoleAssignmentsFilteredRequest)
|
||||
}
|
||||
var arg2 []client.CallOption
|
||||
var variadicArgs []client.CallOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]client.CallOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *RoleService_ListRoleAssignmentsFiltered_Call) Return(_a0 *v0.ListRoleAssignmentsResponse, _a1 error) *RoleService_ListRoleAssignmentsFiltered_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *RoleService_ListRoleAssignmentsFiltered_Call) Return(listRoleAssignmentsResponse *v0.ListRoleAssignmentsResponse, err error) *RoleService_ListRoleAssignmentsFiltered_Call {
|
||||
_c.Call.Return(listRoleAssignmentsResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *RoleService_ListRoleAssignmentsFiltered_Call) RunAndReturn(run func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)) *RoleService_ListRoleAssignmentsFiltered_Call {
|
||||
func (_c *RoleService_ListRoleAssignmentsFiltered_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListRoleAssignmentsFilteredRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)) *RoleService_ListRoleAssignmentsFiltered_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListRoles provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *RoleService) ListRoles(ctx context.Context, in *v0.ListBundlesRequest, opts ...client.CallOption) (*v0.ListBundlesResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
// ListRoles provides a mock function for the type RoleService
|
||||
func (_mock *RoleService) ListRoles(ctx context.Context, in *v0.ListBundlesRequest, opts ...client.CallOption) (*v0.ListBundlesResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListRoles")
|
||||
@@ -266,23 +305,21 @@ func (_m *RoleService) ListRoles(ctx context.Context, in *v0.ListBundlesRequest,
|
||||
|
||||
var r0 *v0.ListBundlesResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) (*v0.ListBundlesResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) (*v0.ListBundlesResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) *v0.ListBundlesResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) *v0.ListBundlesResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.ListBundlesResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -302,37 +339,48 @@ func (_e *RoleService_Expecter) ListRoles(ctx interface{}, in interface{}, opts
|
||||
|
||||
func (_c *RoleService_ListRoles_Call) Run(run func(ctx context.Context, in *v0.ListBundlesRequest, opts ...client.CallOption)) *RoleService_ListRoles_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.ListBundlesRequest), variadicArgs...)
|
||||
var arg1 *v0.ListBundlesRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.ListBundlesRequest)
|
||||
}
|
||||
var arg2 []client.CallOption
|
||||
var variadicArgs []client.CallOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]client.CallOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *RoleService_ListRoles_Call) Return(_a0 *v0.ListBundlesResponse, _a1 error) *RoleService_ListRoles_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *RoleService_ListRoles_Call) Return(listBundlesResponse *v0.ListBundlesResponse, err error) *RoleService_ListRoles_Call {
|
||||
_c.Call.Return(listBundlesResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *RoleService_ListRoles_Call) RunAndReturn(run func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) (*v0.ListBundlesResponse, error)) *RoleService_ListRoles_Call {
|
||||
func (_c *RoleService_ListRoles_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListBundlesRequest, opts ...client.CallOption) (*v0.ListBundlesResponse, error)) *RoleService_ListRoles_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// RemoveRoleFromUser provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *RoleService) RemoveRoleFromUser(ctx context.Context, in *v0.RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
// RemoveRoleFromUser provides a mock function for the type RoleService
|
||||
func (_mock *RoleService) RemoveRoleFromUser(ctx context.Context, in *v0.RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveRoleFromUser")
|
||||
@@ -340,23 +388,21 @@ func (_m *RoleService) RemoveRoleFromUser(ctx context.Context, in *v0.RemoveRole
|
||||
|
||||
var r0 *emptypb.Empty
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) (*emptypb.Empty, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) (*emptypb.Empty, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) *emptypb.Empty); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) *emptypb.Empty); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*emptypb.Empty)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -376,37 +422,35 @@ func (_e *RoleService_Expecter) RemoveRoleFromUser(ctx interface{}, in interface
|
||||
|
||||
func (_c *RoleService_RemoveRoleFromUser_Call) Run(run func(ctx context.Context, in *v0.RemoveRoleFromUserRequest, opts ...client.CallOption)) *RoleService_RemoveRoleFromUser_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.RemoveRoleFromUserRequest), variadicArgs...)
|
||||
var arg1 *v0.RemoveRoleFromUserRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.RemoveRoleFromUserRequest)
|
||||
}
|
||||
var arg2 []client.CallOption
|
||||
var variadicArgs []client.CallOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]client.CallOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *RoleService_RemoveRoleFromUser_Call) Return(_a0 *emptypb.Empty, _a1 error) *RoleService_RemoveRoleFromUser_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *RoleService_RemoveRoleFromUser_Call) Return(empty *emptypb.Empty, err error) *RoleService_RemoveRoleFromUser_Call {
|
||||
_c.Call.Return(empty, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *RoleService_RemoveRoleFromUser_Call) RunAndReturn(run func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) (*emptypb.Empty, error)) *RoleService_RemoveRoleFromUser_Call {
|
||||
func (_c *RoleService_RemoveRoleFromUser_Call) RunAndReturn(run func(ctx context.Context, in *v0.RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error)) *RoleService_RemoveRoleFromUser_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewRoleService creates a new instance of RoleService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewRoleService(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *RoleService {
|
||||
mock := &RoleService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"context"
|
||||
|
||||
metadata "github.com/opencloud-eu/reva/v2/pkg/storage/utils/metadata"
|
||||
"github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/storage/utils/metadata"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
)
|
||||
|
||||
// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewStorage(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Storage {
|
||||
mock := &Storage{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// Storage is an autogenerated mock type for the Storage type
|
||||
type Storage struct {
|
||||
mock.Mock
|
||||
@@ -24,21 +39,20 @@ func (_m *Storage) EXPECT() *Storage_Expecter {
|
||||
return &Storage_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Backend provides a mock function with no fields
|
||||
func (_m *Storage) Backend() string {
|
||||
ret := _m.Called()
|
||||
// Backend provides a mock function for the type Storage
|
||||
func (_mock *Storage) Backend() string {
|
||||
ret := _mock.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Backend")
|
||||
}
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func() string); ok {
|
||||
r0 = rf()
|
||||
if returnFunc, ok := ret.Get(0).(func() string); ok {
|
||||
r0 = returnFunc()
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -59,8 +73,8 @@ func (_c *Storage_Backend_Call) Run(run func()) *Storage_Backend_Call {
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_Backend_Call) Return(_a0 string) *Storage_Backend_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Storage_Backend_Call) Return(s string) *Storage_Backend_Call {
|
||||
_c.Call.Return(s)
|
||||
return _c
|
||||
}
|
||||
|
||||
@@ -69,21 +83,20 @@ func (_c *Storage_Backend_Call) RunAndReturn(run func() string) *Storage_Backend
|
||||
return _c
|
||||
}
|
||||
|
||||
// CreateSymlink provides a mock function with given fields: ctx, oldname, newname
|
||||
func (_m *Storage) CreateSymlink(ctx context.Context, oldname string, newname string) error {
|
||||
ret := _m.Called(ctx, oldname, newname)
|
||||
// CreateSymlink provides a mock function for the type Storage
|
||||
func (_mock *Storage) CreateSymlink(ctx context.Context, oldname string, newname string) error {
|
||||
ret := _mock.Called(ctx, oldname, newname)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CreateSymlink")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
|
||||
r0 = rf(ctx, oldname, newname)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
|
||||
r0 = returnFunc(ctx, oldname, newname)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -102,36 +115,51 @@ func (_e *Storage_Expecter) CreateSymlink(ctx interface{}, oldname interface{},
|
||||
|
||||
func (_c *Storage_CreateSymlink_Call) Run(run func(ctx context.Context, oldname string, newname string)) *Storage_CreateSymlink_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_CreateSymlink_Call) Return(_a0 error) *Storage_CreateSymlink_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Storage_CreateSymlink_Call) Return(err error) *Storage_CreateSymlink_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_CreateSymlink_Call) RunAndReturn(run func(context.Context, string, string) error) *Storage_CreateSymlink_Call {
|
||||
func (_c *Storage_CreateSymlink_Call) RunAndReturn(run func(ctx context.Context, oldname string, newname string) error) *Storage_CreateSymlink_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: ctx, path
|
||||
func (_m *Storage) Delete(ctx context.Context, path string) error {
|
||||
ret := _m.Called(ctx, path)
|
||||
// Delete provides a mock function for the type Storage
|
||||
func (_mock *Storage) Delete(ctx context.Context, path string) error {
|
||||
ret := _mock.Called(ctx, path)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = returnFunc(ctx, path)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -149,24 +177,35 @@ func (_e *Storage_Expecter) Delete(ctx interface{}, path interface{}) *Storage_D
|
||||
|
||||
func (_c *Storage_Delete_Call) Run(run func(ctx context.Context, path string)) *Storage_Delete_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_Delete_Call) Return(_a0 error) *Storage_Delete_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Storage_Delete_Call) Return(err error) *Storage_Delete_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_Delete_Call) RunAndReturn(run func(context.Context, string) error) *Storage_Delete_Call {
|
||||
func (_c *Storage_Delete_Call) RunAndReturn(run func(ctx context.Context, path string) error) *Storage_Delete_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Download provides a mock function with given fields: ctx, req
|
||||
func (_m *Storage) Download(ctx context.Context, req metadata.DownloadRequest) (*metadata.DownloadResponse, error) {
|
||||
ret := _m.Called(ctx, req)
|
||||
// Download provides a mock function for the type Storage
|
||||
func (_mock *Storage) Download(ctx context.Context, req metadata.DownloadRequest) (*metadata.DownloadResponse, error) {
|
||||
ret := _mock.Called(ctx, req)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Download")
|
||||
@@ -174,23 +213,21 @@ func (_m *Storage) Download(ctx context.Context, req metadata.DownloadRequest) (
|
||||
|
||||
var r0 *metadata.DownloadResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) (*metadata.DownloadResponse, error)); ok {
|
||||
return rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) (*metadata.DownloadResponse, error)); ok {
|
||||
return returnFunc(ctx, req)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) *metadata.DownloadResponse); ok {
|
||||
r0 = rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) *metadata.DownloadResponse); ok {
|
||||
r0 = returnFunc(ctx, req)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*metadata.DownloadResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, metadata.DownloadRequest) error); ok {
|
||||
r1 = rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, metadata.DownloadRequest) error); ok {
|
||||
r1 = returnFunc(ctx, req)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -208,36 +245,46 @@ func (_e *Storage_Expecter) Download(ctx interface{}, req interface{}) *Storage_
|
||||
|
||||
func (_c *Storage_Download_Call) Run(run func(ctx context.Context, req metadata.DownloadRequest)) *Storage_Download_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(metadata.DownloadRequest))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 metadata.DownloadRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(metadata.DownloadRequest)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_Download_Call) Return(_a0 *metadata.DownloadResponse, _a1 error) *Storage_Download_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Storage_Download_Call) Return(downloadResponse *metadata.DownloadResponse, err error) *Storage_Download_Call {
|
||||
_c.Call.Return(downloadResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_Download_Call) RunAndReturn(run func(context.Context, metadata.DownloadRequest) (*metadata.DownloadResponse, error)) *Storage_Download_Call {
|
||||
func (_c *Storage_Download_Call) RunAndReturn(run func(ctx context.Context, req metadata.DownloadRequest) (*metadata.DownloadResponse, error)) *Storage_Download_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Init provides a mock function with given fields: ctx, name
|
||||
func (_m *Storage) Init(ctx context.Context, name string) error {
|
||||
ret := _m.Called(ctx, name)
|
||||
// Init provides a mock function for the type Storage
|
||||
func (_mock *Storage) Init(ctx context.Context, name string) error {
|
||||
ret := _mock.Called(ctx, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Init")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = rf(ctx, name)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = returnFunc(ctx, name)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -255,7 +302,18 @@ func (_e *Storage_Expecter) Init(ctx interface{}, name interface{}) *Storage_Ini
|
||||
|
||||
func (_c *Storage_Init_Call) Run(run func(ctx context.Context, name string)) *Storage_Init_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
@@ -265,14 +323,14 @@ func (_c *Storage_Init_Call) Return(err error) *Storage_Init_Call {
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_Init_Call) RunAndReturn(run func(context.Context, string) error) *Storage_Init_Call {
|
||||
func (_c *Storage_Init_Call) RunAndReturn(run func(ctx context.Context, name string) error) *Storage_Init_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListDir provides a mock function with given fields: ctx, path
|
||||
func (_m *Storage) ListDir(ctx context.Context, path string) ([]*providerv1beta1.ResourceInfo, error) {
|
||||
ret := _m.Called(ctx, path)
|
||||
// ListDir provides a mock function for the type Storage
|
||||
func (_mock *Storage) ListDir(ctx context.Context, path string) ([]*providerv1beta1.ResourceInfo, error) {
|
||||
ret := _mock.Called(ctx, path)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListDir")
|
||||
@@ -280,23 +338,21 @@ func (_m *Storage) ListDir(ctx context.Context, path string) ([]*providerv1beta1
|
||||
|
||||
var r0 []*providerv1beta1.ResourceInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) ([]*providerv1beta1.ResourceInfo, error)); ok {
|
||||
return rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*providerv1beta1.ResourceInfo, error)); ok {
|
||||
return returnFunc(ctx, path)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) []*providerv1beta1.ResourceInfo); ok {
|
||||
r0 = rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*providerv1beta1.ResourceInfo); ok {
|
||||
r0 = returnFunc(ctx, path)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*providerv1beta1.ResourceInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = returnFunc(ctx, path)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -314,36 +370,46 @@ func (_e *Storage_Expecter) ListDir(ctx interface{}, path interface{}) *Storage_
|
||||
|
||||
func (_c *Storage_ListDir_Call) Run(run func(ctx context.Context, path string)) *Storage_ListDir_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_ListDir_Call) Return(_a0 []*providerv1beta1.ResourceInfo, _a1 error) *Storage_ListDir_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Storage_ListDir_Call) Return(resourceInfos []*providerv1beta1.ResourceInfo, err error) *Storage_ListDir_Call {
|
||||
_c.Call.Return(resourceInfos, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_ListDir_Call) RunAndReturn(run func(context.Context, string) ([]*providerv1beta1.ResourceInfo, error)) *Storage_ListDir_Call {
|
||||
func (_c *Storage_ListDir_Call) RunAndReturn(run func(ctx context.Context, path string) ([]*providerv1beta1.ResourceInfo, error)) *Storage_ListDir_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// MakeDirIfNotExist provides a mock function with given fields: ctx, name
|
||||
func (_m *Storage) MakeDirIfNotExist(ctx context.Context, name string) error {
|
||||
ret := _m.Called(ctx, name)
|
||||
// MakeDirIfNotExist provides a mock function for the type Storage
|
||||
func (_mock *Storage) MakeDirIfNotExist(ctx context.Context, name string) error {
|
||||
ret := _mock.Called(ctx, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for MakeDirIfNotExist")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = rf(ctx, name)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = returnFunc(ctx, name)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -361,24 +427,35 @@ func (_e *Storage_Expecter) MakeDirIfNotExist(ctx interface{}, name interface{})
|
||||
|
||||
func (_c *Storage_MakeDirIfNotExist_Call) Run(run func(ctx context.Context, name string)) *Storage_MakeDirIfNotExist_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_MakeDirIfNotExist_Call) Return(_a0 error) *Storage_MakeDirIfNotExist_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Storage_MakeDirIfNotExist_Call) Return(err error) *Storage_MakeDirIfNotExist_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_MakeDirIfNotExist_Call) RunAndReturn(run func(context.Context, string) error) *Storage_MakeDirIfNotExist_Call {
|
||||
func (_c *Storage_MakeDirIfNotExist_Call) RunAndReturn(run func(ctx context.Context, name string) error) *Storage_MakeDirIfNotExist_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ReadDir provides a mock function with given fields: ctx, path
|
||||
func (_m *Storage) ReadDir(ctx context.Context, path string) ([]string, error) {
|
||||
ret := _m.Called(ctx, path)
|
||||
// ReadDir provides a mock function for the type Storage
|
||||
func (_mock *Storage) ReadDir(ctx context.Context, path string) ([]string, error) {
|
||||
ret := _mock.Called(ctx, path)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ReadDir")
|
||||
@@ -386,23 +463,21 @@ func (_m *Storage) ReadDir(ctx context.Context, path string) ([]string, error) {
|
||||
|
||||
var r0 []string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) ([]string, error)); ok {
|
||||
return rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]string, error)); ok {
|
||||
return returnFunc(ctx, path)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) []string); ok {
|
||||
r0 = rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) []string); ok {
|
||||
r0 = returnFunc(ctx, path)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = returnFunc(ctx, path)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -420,24 +495,35 @@ func (_e *Storage_Expecter) ReadDir(ctx interface{}, path interface{}) *Storage_
|
||||
|
||||
func (_c *Storage_ReadDir_Call) Run(run func(ctx context.Context, path string)) *Storage_ReadDir_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_ReadDir_Call) Return(_a0 []string, _a1 error) *Storage_ReadDir_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Storage_ReadDir_Call) Return(strings []string, err error) *Storage_ReadDir_Call {
|
||||
_c.Call.Return(strings, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_ReadDir_Call) RunAndReturn(run func(context.Context, string) ([]string, error)) *Storage_ReadDir_Call {
|
||||
func (_c *Storage_ReadDir_Call) RunAndReturn(run func(ctx context.Context, path string) ([]string, error)) *Storage_ReadDir_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ResolveSymlink provides a mock function with given fields: ctx, name
|
||||
func (_m *Storage) ResolveSymlink(ctx context.Context, name string) (string, error) {
|
||||
ret := _m.Called(ctx, name)
|
||||
// ResolveSymlink provides a mock function for the type Storage
|
||||
func (_mock *Storage) ResolveSymlink(ctx context.Context, name string) (string, error) {
|
||||
ret := _mock.Called(ctx, name)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ResolveSymlink")
|
||||
@@ -445,21 +531,19 @@ func (_m *Storage) ResolveSymlink(ctx context.Context, name string) (string, err
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok {
|
||||
return rf(ctx, name)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok {
|
||||
return returnFunc(ctx, name)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) string); ok {
|
||||
r0 = rf(ctx, name)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) string); ok {
|
||||
r0 = returnFunc(ctx, name)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, name)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = returnFunc(ctx, name)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -477,24 +561,35 @@ func (_e *Storage_Expecter) ResolveSymlink(ctx interface{}, name interface{}) *S
|
||||
|
||||
func (_c *Storage_ResolveSymlink_Call) Run(run func(ctx context.Context, name string)) *Storage_ResolveSymlink_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_ResolveSymlink_Call) Return(_a0 string, _a1 error) *Storage_ResolveSymlink_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Storage_ResolveSymlink_Call) Return(s string, err error) *Storage_ResolveSymlink_Call {
|
||||
_c.Call.Return(s, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_ResolveSymlink_Call) RunAndReturn(run func(context.Context, string) (string, error)) *Storage_ResolveSymlink_Call {
|
||||
func (_c *Storage_ResolveSymlink_Call) RunAndReturn(run func(ctx context.Context, name string) (string, error)) *Storage_ResolveSymlink_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SimpleDownload provides a mock function with given fields: ctx, path
|
||||
func (_m *Storage) SimpleDownload(ctx context.Context, path string) ([]byte, error) {
|
||||
ret := _m.Called(ctx, path)
|
||||
// SimpleDownload provides a mock function for the type Storage
|
||||
func (_mock *Storage) SimpleDownload(ctx context.Context, path string) ([]byte, error) {
|
||||
ret := _mock.Called(ctx, path)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SimpleDownload")
|
||||
@@ -502,23 +597,21 @@ func (_m *Storage) SimpleDownload(ctx context.Context, path string) ([]byte, err
|
||||
|
||||
var r0 []byte
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok {
|
||||
return rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok {
|
||||
return returnFunc(ctx, path)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) []byte); ok {
|
||||
r0 = rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) []byte); ok {
|
||||
r0 = returnFunc(ctx, path)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]byte)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = returnFunc(ctx, path)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -536,36 +629,46 @@ func (_e *Storage_Expecter) SimpleDownload(ctx interface{}, path interface{}) *S
|
||||
|
||||
func (_c *Storage_SimpleDownload_Call) Run(run func(ctx context.Context, path string)) *Storage_SimpleDownload_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_SimpleDownload_Call) Return(_a0 []byte, _a1 error) *Storage_SimpleDownload_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Storage_SimpleDownload_Call) Return(bytes []byte, err error) *Storage_SimpleDownload_Call {
|
||||
_c.Call.Return(bytes, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_SimpleDownload_Call) RunAndReturn(run func(context.Context, string) ([]byte, error)) *Storage_SimpleDownload_Call {
|
||||
func (_c *Storage_SimpleDownload_Call) RunAndReturn(run func(ctx context.Context, path string) ([]byte, error)) *Storage_SimpleDownload_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SimpleUpload provides a mock function with given fields: ctx, uploadpath, content
|
||||
func (_m *Storage) SimpleUpload(ctx context.Context, uploadpath string, content []byte) error {
|
||||
ret := _m.Called(ctx, uploadpath, content)
|
||||
// SimpleUpload provides a mock function for the type Storage
|
||||
func (_mock *Storage) SimpleUpload(ctx context.Context, uploadpath string, content []byte) error {
|
||||
ret := _mock.Called(ctx, uploadpath, content)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SimpleUpload")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok {
|
||||
r0 = rf(ctx, uploadpath, content)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok {
|
||||
r0 = returnFunc(ctx, uploadpath, content)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -584,24 +687,40 @@ func (_e *Storage_Expecter) SimpleUpload(ctx interface{}, uploadpath interface{}
|
||||
|
||||
func (_c *Storage_SimpleUpload_Call) Run(run func(ctx context.Context, uploadpath string, content []byte)) *Storage_SimpleUpload_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].([]byte))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 []byte
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].([]byte)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_SimpleUpload_Call) Return(_a0 error) *Storage_SimpleUpload_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Storage_SimpleUpload_Call) Return(err error) *Storage_SimpleUpload_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_SimpleUpload_Call) RunAndReturn(run func(context.Context, string, []byte) error) *Storage_SimpleUpload_Call {
|
||||
func (_c *Storage_SimpleUpload_Call) RunAndReturn(run func(ctx context.Context, uploadpath string, content []byte) error) *Storage_SimpleUpload_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Stat provides a mock function with given fields: ctx, path
|
||||
func (_m *Storage) Stat(ctx context.Context, path string) (*providerv1beta1.ResourceInfo, error) {
|
||||
ret := _m.Called(ctx, path)
|
||||
// Stat provides a mock function for the type Storage
|
||||
func (_mock *Storage) Stat(ctx context.Context, path string) (*providerv1beta1.ResourceInfo, error) {
|
||||
ret := _mock.Called(ctx, path)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Stat")
|
||||
@@ -609,23 +728,21 @@ func (_m *Storage) Stat(ctx context.Context, path string) (*providerv1beta1.Reso
|
||||
|
||||
var r0 *providerv1beta1.ResourceInfo
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) (*providerv1beta1.ResourceInfo, error)); ok {
|
||||
return rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*providerv1beta1.ResourceInfo, error)); ok {
|
||||
return returnFunc(ctx, path)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) *providerv1beta1.ResourceInfo); ok {
|
||||
r0 = rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) *providerv1beta1.ResourceInfo); ok {
|
||||
r0 = returnFunc(ctx, path)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*providerv1beta1.ResourceInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, path)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = returnFunc(ctx, path)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -643,24 +760,35 @@ func (_e *Storage_Expecter) Stat(ctx interface{}, path interface{}) *Storage_Sta
|
||||
|
||||
func (_c *Storage_Stat_Call) Run(run func(ctx context.Context, path string)) *Storage_Stat_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_Stat_Call) Return(_a0 *providerv1beta1.ResourceInfo, _a1 error) *Storage_Stat_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Storage_Stat_Call) Return(resourceInfo *providerv1beta1.ResourceInfo, err error) *Storage_Stat_Call {
|
||||
_c.Call.Return(resourceInfo, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_Stat_Call) RunAndReturn(run func(context.Context, string) (*providerv1beta1.ResourceInfo, error)) *Storage_Stat_Call {
|
||||
func (_c *Storage_Stat_Call) RunAndReturn(run func(ctx context.Context, path string) (*providerv1beta1.ResourceInfo, error)) *Storage_Stat_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Upload provides a mock function with given fields: ctx, req
|
||||
func (_m *Storage) Upload(ctx context.Context, req metadata.UploadRequest) (*metadata.UploadResponse, error) {
|
||||
ret := _m.Called(ctx, req)
|
||||
// Upload provides a mock function for the type Storage
|
||||
func (_mock *Storage) Upload(ctx context.Context, req metadata.UploadRequest) (*metadata.UploadResponse, error) {
|
||||
ret := _mock.Called(ctx, req)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Upload")
|
||||
@@ -668,23 +796,21 @@ func (_m *Storage) Upload(ctx context.Context, req metadata.UploadRequest) (*met
|
||||
|
||||
var r0 *metadata.UploadResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) (*metadata.UploadResponse, error)); ok {
|
||||
return rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) (*metadata.UploadResponse, error)); ok {
|
||||
return returnFunc(ctx, req)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) *metadata.UploadResponse); ok {
|
||||
r0 = rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) *metadata.UploadResponse); ok {
|
||||
r0 = returnFunc(ctx, req)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*metadata.UploadResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, metadata.UploadRequest) error); ok {
|
||||
r1 = rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, metadata.UploadRequest) error); ok {
|
||||
r1 = returnFunc(ctx, req)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -702,31 +828,28 @@ func (_e *Storage_Expecter) Upload(ctx interface{}, req interface{}) *Storage_Up
|
||||
|
||||
func (_c *Storage_Upload_Call) Run(run func(ctx context.Context, req metadata.UploadRequest)) *Storage_Upload_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(metadata.UploadRequest))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 metadata.UploadRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(metadata.UploadRequest)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_Upload_Call) Return(_a0 *metadata.UploadResponse, _a1 error) *Storage_Upload_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Storage_Upload_Call) Return(uploadResponse *metadata.UploadResponse, err error) *Storage_Upload_Call {
|
||||
_c.Call.Return(uploadResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Storage_Upload_Call) RunAndReturn(run func(context.Context, metadata.UploadRequest) (*metadata.UploadResponse, error)) *Storage_Upload_Call {
|
||||
func (_c *Storage_Upload_Call) RunAndReturn(run func(ctx context.Context, req metadata.UploadRequest) (*metadata.UploadResponse, error)) *Storage_Upload_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewStorage creates a new instance of Storage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewStorage(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Storage {
|
||||
mock := &Storage{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,14 +1,30 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
io "io"
|
||||
"context"
|
||||
"io"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NewUsersUserProfilePhotoProvider creates a new instance of UsersUserProfilePhotoProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewUsersUserProfilePhotoProvider(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *UsersUserProfilePhotoProvider {
|
||||
mock := &UsersUserProfilePhotoProvider{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// UsersUserProfilePhotoProvider is an autogenerated mock type for the UsersUserProfilePhotoProvider type
|
||||
type UsersUserProfilePhotoProvider struct {
|
||||
mock.Mock
|
||||
@@ -22,21 +38,20 @@ func (_m *UsersUserProfilePhotoProvider) EXPECT() *UsersUserProfilePhotoProvider
|
||||
return &UsersUserProfilePhotoProvider_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// DeletePhoto provides a mock function with given fields: ctx, id
|
||||
func (_m *UsersUserProfilePhotoProvider) DeletePhoto(ctx context.Context, id string) error {
|
||||
ret := _m.Called(ctx, id)
|
||||
// DeletePhoto provides a mock function for the type UsersUserProfilePhotoProvider
|
||||
func (_mock *UsersUserProfilePhotoProvider) DeletePhoto(ctx context.Context, id string) error {
|
||||
ret := _mock.Called(ctx, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeletePhoto")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = rf(ctx, id)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = returnFunc(ctx, id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -54,24 +69,35 @@ func (_e *UsersUserProfilePhotoProvider_Expecter) DeletePhoto(ctx interface{}, i
|
||||
|
||||
func (_c *UsersUserProfilePhotoProvider_DeletePhoto_Call) Run(run func(ctx context.Context, id string)) *UsersUserProfilePhotoProvider_DeletePhoto_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UsersUserProfilePhotoProvider_DeletePhoto_Call) Return(_a0 error) *UsersUserProfilePhotoProvider_DeletePhoto_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *UsersUserProfilePhotoProvider_DeletePhoto_Call) Return(err error) *UsersUserProfilePhotoProvider_DeletePhoto_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UsersUserProfilePhotoProvider_DeletePhoto_Call) RunAndReturn(run func(context.Context, string) error) *UsersUserProfilePhotoProvider_DeletePhoto_Call {
|
||||
func (_c *UsersUserProfilePhotoProvider_DeletePhoto_Call) RunAndReturn(run func(ctx context.Context, id string) error) *UsersUserProfilePhotoProvider_DeletePhoto_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetPhoto provides a mock function with given fields: ctx, id
|
||||
func (_m *UsersUserProfilePhotoProvider) GetPhoto(ctx context.Context, id string) ([]byte, error) {
|
||||
ret := _m.Called(ctx, id)
|
||||
// GetPhoto provides a mock function for the type UsersUserProfilePhotoProvider
|
||||
func (_mock *UsersUserProfilePhotoProvider) GetPhoto(ctx context.Context, id string) ([]byte, error) {
|
||||
ret := _mock.Called(ctx, id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetPhoto")
|
||||
@@ -79,23 +105,21 @@ func (_m *UsersUserProfilePhotoProvider) GetPhoto(ctx context.Context, id string
|
||||
|
||||
var r0 []byte
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok {
|
||||
return rf(ctx, id)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok {
|
||||
return returnFunc(ctx, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) []byte); ok {
|
||||
r0 = rf(ctx, id)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) []byte); ok {
|
||||
r0 = returnFunc(ctx, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]byte)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, id)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = returnFunc(ctx, id)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -113,36 +137,46 @@ func (_e *UsersUserProfilePhotoProvider_Expecter) GetPhoto(ctx interface{}, id i
|
||||
|
||||
func (_c *UsersUserProfilePhotoProvider_GetPhoto_Call) Run(run func(ctx context.Context, id string)) *UsersUserProfilePhotoProvider_GetPhoto_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UsersUserProfilePhotoProvider_GetPhoto_Call) Return(_a0 []byte, _a1 error) *UsersUserProfilePhotoProvider_GetPhoto_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *UsersUserProfilePhotoProvider_GetPhoto_Call) Return(bytes []byte, err error) *UsersUserProfilePhotoProvider_GetPhoto_Call {
|
||||
_c.Call.Return(bytes, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UsersUserProfilePhotoProvider_GetPhoto_Call) RunAndReturn(run func(context.Context, string) ([]byte, error)) *UsersUserProfilePhotoProvider_GetPhoto_Call {
|
||||
func (_c *UsersUserProfilePhotoProvider_GetPhoto_Call) RunAndReturn(run func(ctx context.Context, id string) ([]byte, error)) *UsersUserProfilePhotoProvider_GetPhoto_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UpdatePhoto provides a mock function with given fields: ctx, id, r
|
||||
func (_m *UsersUserProfilePhotoProvider) UpdatePhoto(ctx context.Context, id string, r io.Reader) error {
|
||||
ret := _m.Called(ctx, id, r)
|
||||
// UpdatePhoto provides a mock function for the type UsersUserProfilePhotoProvider
|
||||
func (_mock *UsersUserProfilePhotoProvider) UpdatePhoto(ctx context.Context, id string, r io.Reader) error {
|
||||
ret := _mock.Called(ctx, id, r)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdatePhoto")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, io.Reader) error); ok {
|
||||
r0 = rf(ctx, id, r)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, io.Reader) error); ok {
|
||||
r0 = returnFunc(ctx, id, r)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -161,31 +195,33 @@ func (_e *UsersUserProfilePhotoProvider_Expecter) UpdatePhoto(ctx interface{}, i
|
||||
|
||||
func (_c *UsersUserProfilePhotoProvider_UpdatePhoto_Call) Run(run func(ctx context.Context, id string, r io.Reader)) *UsersUserProfilePhotoProvider_UpdatePhoto_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(io.Reader))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 io.Reader
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(io.Reader)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UsersUserProfilePhotoProvider_UpdatePhoto_Call) Return(_a0 error) *UsersUserProfilePhotoProvider_UpdatePhoto_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *UsersUserProfilePhotoProvider_UpdatePhoto_Call) Return(err error) *UsersUserProfilePhotoProvider_UpdatePhoto_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UsersUserProfilePhotoProvider_UpdatePhoto_Call) RunAndReturn(run func(context.Context, string, io.Reader) error) *UsersUserProfilePhotoProvider_UpdatePhoto_Call {
|
||||
func (_c *UsersUserProfilePhotoProvider_UpdatePhoto_Call) RunAndReturn(run func(ctx context.Context, id string, r io.Reader) error) *UsersUserProfilePhotoProvider_UpdatePhoto_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewUsersUserProfilePhotoProvider creates a new instance of UsersUserProfilePhotoProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewUsersUserProfilePhotoProvider(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *UsersUserProfilePhotoProvider {
|
||||
mock := &UsersUserProfilePhotoProvider{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,13 @@
|
||||
issue-845-fix: True
|
||||
resolve-type-alias: False
|
||||
with-expecter: true
|
||||
disable-version-string: True
|
||||
# maintain v2 separate mocks dir
|
||||
dir: "{{.InterfaceDir}}/mocks"
|
||||
structname: "{{.InterfaceName}}"
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
pkgname: mocks
|
||||
|
||||
template: testify
|
||||
packages:
|
||||
github.com/opencloud-eu/opencloud/pkg/keycloak:
|
||||
config:
|
||||
dir: "pkg/backends/keycloak/mocks"
|
||||
interfaces:
|
||||
Client:
|
||||
github.com/opencloud-eu/opencloud/pkg/keycloak:
|
||||
config:
|
||||
dir: pkg/backends/keycloak/mocks
|
||||
interfaces:
|
||||
Client: {}
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
keycloak "github.com/opencloud-eu/opencloud/pkg/keycloak"
|
||||
libregraph "github.com/opencloud-eu/libre-graph-api-go"
|
||||
"context"
|
||||
|
||||
"github.com/opencloud-eu/libre-graph-api-go"
|
||||
"github.com/opencloud-eu/opencloud/pkg/keycloak"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewClient(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Client {
|
||||
mock := &Client{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// Client is an autogenerated mock type for the Client type
|
||||
type Client struct {
|
||||
mock.Mock
|
||||
@@ -24,9 +39,9 @@ func (_m *Client) EXPECT() *Client_Expecter {
|
||||
return &Client_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// CreateUser provides a mock function with given fields: ctx, realm, user, userActions
|
||||
func (_m *Client) CreateUser(ctx context.Context, realm string, user *libregraph.User, userActions []keycloak.UserAction) (string, error) {
|
||||
ret := _m.Called(ctx, realm, user, userActions)
|
||||
// CreateUser provides a mock function for the type Client
|
||||
func (_mock *Client) CreateUser(ctx context.Context, realm string, user *libregraph.User, userActions []keycloak.UserAction) (string, error) {
|
||||
ret := _mock.Called(ctx, realm, user, userActions)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CreateUser")
|
||||
@@ -34,21 +49,19 @@ func (_m *Client) CreateUser(ctx context.Context, realm string, user *libregraph
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) (string, error)); ok {
|
||||
return rf(ctx, realm, user, userActions)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) (string, error)); ok {
|
||||
return returnFunc(ctx, realm, user, userActions)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) string); ok {
|
||||
r0 = rf(ctx, realm, user, userActions)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) string); ok {
|
||||
r0 = returnFunc(ctx, realm, user, userActions)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) error); ok {
|
||||
r1 = rf(ctx, realm, user, userActions)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string, *libregraph.User, []keycloak.UserAction) error); ok {
|
||||
r1 = returnFunc(ctx, realm, user, userActions)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -68,24 +81,45 @@ func (_e *Client_Expecter) CreateUser(ctx interface{}, realm interface{}, user i
|
||||
|
||||
func (_c *Client_CreateUser_Call) Run(run func(ctx context.Context, realm string, user *libregraph.User, userActions []keycloak.UserAction)) *Client_CreateUser_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(*libregraph.User), args[3].([]keycloak.UserAction))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 *libregraph.User
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(*libregraph.User)
|
||||
}
|
||||
var arg3 []keycloak.UserAction
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].([]keycloak.UserAction)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Client_CreateUser_Call) Return(_a0 string, _a1 error) *Client_CreateUser_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Client_CreateUser_Call) Return(s string, err error) *Client_CreateUser_Call {
|
||||
_c.Call.Return(s, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Client_CreateUser_Call) RunAndReturn(run func(context.Context, string, *libregraph.User, []keycloak.UserAction) (string, error)) *Client_CreateUser_Call {
|
||||
func (_c *Client_CreateUser_Call) RunAndReturn(run func(ctx context.Context, realm string, user *libregraph.User, userActions []keycloak.UserAction) (string, error)) *Client_CreateUser_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetPIIReport provides a mock function with given fields: ctx, realm, username
|
||||
func (_m *Client) GetPIIReport(ctx context.Context, realm string, username string) (*keycloak.PIIReport, error) {
|
||||
ret := _m.Called(ctx, realm, username)
|
||||
// GetPIIReport provides a mock function for the type Client
|
||||
func (_mock *Client) GetPIIReport(ctx context.Context, realm string, username string) (*keycloak.PIIReport, error) {
|
||||
ret := _mock.Called(ctx, realm, username)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetPIIReport")
|
||||
@@ -93,23 +127,21 @@ func (_m *Client) GetPIIReport(ctx context.Context, realm string, username strin
|
||||
|
||||
var r0 *keycloak.PIIReport
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*keycloak.PIIReport, error)); ok {
|
||||
return rf(ctx, realm, username)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*keycloak.PIIReport, error)); ok {
|
||||
return returnFunc(ctx, realm, username)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) *keycloak.PIIReport); ok {
|
||||
r0 = rf(ctx, realm, username)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *keycloak.PIIReport); ok {
|
||||
r0 = returnFunc(ctx, realm, username)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*keycloak.PIIReport)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
|
||||
r1 = rf(ctx, realm, username)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
|
||||
r1 = returnFunc(ctx, realm, username)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -128,24 +160,40 @@ func (_e *Client_Expecter) GetPIIReport(ctx interface{}, realm interface{}, user
|
||||
|
||||
func (_c *Client_GetPIIReport_Call) Run(run func(ctx context.Context, realm string, username string)) *Client_GetPIIReport_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Client_GetPIIReport_Call) Return(_a0 *keycloak.PIIReport, _a1 error) *Client_GetPIIReport_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Client_GetPIIReport_Call) Return(pIIReport *keycloak.PIIReport, err error) *Client_GetPIIReport_Call {
|
||||
_c.Call.Return(pIIReport, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Client_GetPIIReport_Call) RunAndReturn(run func(context.Context, string, string) (*keycloak.PIIReport, error)) *Client_GetPIIReport_Call {
|
||||
func (_c *Client_GetPIIReport_Call) RunAndReturn(run func(ctx context.Context, realm string, username string) (*keycloak.PIIReport, error)) *Client_GetPIIReport_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetUserByUsername provides a mock function with given fields: ctx, realm, username
|
||||
func (_m *Client) GetUserByUsername(ctx context.Context, realm string, username string) (*libregraph.User, error) {
|
||||
ret := _m.Called(ctx, realm, username)
|
||||
// GetUserByUsername provides a mock function for the type Client
|
||||
func (_mock *Client) GetUserByUsername(ctx context.Context, realm string, username string) (*libregraph.User, error) {
|
||||
ret := _mock.Called(ctx, realm, username)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUserByUsername")
|
||||
@@ -153,23 +201,21 @@ func (_m *Client) GetUserByUsername(ctx context.Context, realm string, username
|
||||
|
||||
var r0 *libregraph.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*libregraph.User, error)); ok {
|
||||
return rf(ctx, realm, username)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*libregraph.User, error)); ok {
|
||||
return returnFunc(ctx, realm, username)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) *libregraph.User); ok {
|
||||
r0 = rf(ctx, realm, username)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *libregraph.User); ok {
|
||||
r0 = returnFunc(ctx, realm, username)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*libregraph.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
|
||||
r1 = rf(ctx, realm, username)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
|
||||
r1 = returnFunc(ctx, realm, username)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -188,36 +234,51 @@ func (_e *Client_Expecter) GetUserByUsername(ctx interface{}, realm interface{},
|
||||
|
||||
func (_c *Client_GetUserByUsername_Call) Run(run func(ctx context.Context, realm string, username string)) *Client_GetUserByUsername_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Client_GetUserByUsername_Call) Return(_a0 *libregraph.User, _a1 error) *Client_GetUserByUsername_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Client_GetUserByUsername_Call) Return(user *libregraph.User, err error) *Client_GetUserByUsername_Call {
|
||||
_c.Call.Return(user, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Client_GetUserByUsername_Call) RunAndReturn(run func(context.Context, string, string) (*libregraph.User, error)) *Client_GetUserByUsername_Call {
|
||||
func (_c *Client_GetUserByUsername_Call) RunAndReturn(run func(ctx context.Context, realm string, username string) (*libregraph.User, error)) *Client_GetUserByUsername_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SendActionsMail provides a mock function with given fields: ctx, realm, userID, userActions
|
||||
func (_m *Client) SendActionsMail(ctx context.Context, realm string, userID string, userActions []keycloak.UserAction) error {
|
||||
ret := _m.Called(ctx, realm, userID, userActions)
|
||||
// SendActionsMail provides a mock function for the type Client
|
||||
func (_mock *Client) SendActionsMail(ctx context.Context, realm string, userID string, userActions []keycloak.UserAction) error {
|
||||
ret := _mock.Called(ctx, realm, userID, userActions)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SendActionsMail")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string, []keycloak.UserAction) error); ok {
|
||||
r0 = rf(ctx, realm, userID, userActions)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, []keycloak.UserAction) error); ok {
|
||||
r0 = returnFunc(ctx, realm, userID, userActions)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -237,31 +298,38 @@ func (_e *Client_Expecter) SendActionsMail(ctx interface{}, realm interface{}, u
|
||||
|
||||
func (_c *Client_SendActionsMail_Call) Run(run func(ctx context.Context, realm string, userID string, userActions []keycloak.UserAction)) *Client_SendActionsMail_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].([]keycloak.UserAction))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
var arg3 []keycloak.UserAction
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].([]keycloak.UserAction)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Client_SendActionsMail_Call) Return(_a0 error) *Client_SendActionsMail_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Client_SendActionsMail_Call) Return(err error) *Client_SendActionsMail_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Client_SendActionsMail_Call) RunAndReturn(run func(context.Context, string, string, []keycloak.UserAction) error) *Client_SendActionsMail_Call {
|
||||
func (_c *Client_SendActionsMail_Call) RunAndReturn(run func(ctx context.Context, realm string, userID string, userActions []keycloak.UserAction) error) *Client_SendActionsMail_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewClient(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Client {
|
||||
mock := &Client{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
issue-845-fix: True
|
||||
resolve-type-alias: False
|
||||
with-expecter: true
|
||||
disable-version-string: True
|
||||
# maintain v2 separate mocks dir
|
||||
dir: "{{.InterfaceDir}}/mocks"
|
||||
structname: "{{.InterfaceName}}"
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
pkgname: mocks
|
||||
|
||||
template: testify
|
||||
packages:
|
||||
github.com/opencloud-eu/opencloud/services/proxy/pkg/user/backend:
|
||||
config:
|
||||
dir: "pkg/user/backend/mocks"
|
||||
interfaces:
|
||||
UserBackend:
|
||||
github.com/opencloud-eu/opencloud/services/proxy/pkg/userroles:
|
||||
config:
|
||||
dir: "pkg/userroles/mocks"
|
||||
interfaces:
|
||||
UserRoleAssigner:
|
||||
github.com/opencloud-eu/opencloud/services/proxy/pkg/user/backend:
|
||||
interfaces:
|
||||
UserBackend: {}
|
||||
github.com/opencloud-eu/opencloud/services/proxy/pkg/userroles:
|
||||
interfaces:
|
||||
UserRoleAssigner: {}
|
||||
|
||||
@@ -1,14 +1,30 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"context"
|
||||
|
||||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
"github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// NewUserBackend creates a new instance of UserBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewUserBackend(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *UserBackend {
|
||||
mock := &UserBackend{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// UserBackend is an autogenerated mock type for the UserBackend type
|
||||
type UserBackend struct {
|
||||
mock.Mock
|
||||
@@ -22,9 +38,9 @@ func (_m *UserBackend) EXPECT() *UserBackend_Expecter {
|
||||
return &UserBackend_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Authenticate provides a mock function with given fields: ctx, username, password
|
||||
func (_m *UserBackend) Authenticate(ctx context.Context, username string, password string) (*userv1beta1.User, string, error) {
|
||||
ret := _m.Called(ctx, username, password)
|
||||
// Authenticate provides a mock function for the type UserBackend
|
||||
func (_mock *UserBackend) Authenticate(ctx context.Context, username string, password string) (*userv1beta1.User, string, error) {
|
||||
ret := _mock.Called(ctx, username, password)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Authenticate")
|
||||
@@ -33,29 +49,26 @@ func (_m *UserBackend) Authenticate(ctx context.Context, username string, passwo
|
||||
var r0 *userv1beta1.User
|
||||
var r1 string
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*userv1beta1.User, string, error)); ok {
|
||||
return rf(ctx, username, password)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*userv1beta1.User, string, error)); ok {
|
||||
return returnFunc(ctx, username, password)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, username, password)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok {
|
||||
r0 = returnFunc(ctx, username, password)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, string) string); ok {
|
||||
r1 = rf(ctx, username, password)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) string); ok {
|
||||
r1 = returnFunc(ctx, username, password)
|
||||
} else {
|
||||
r1 = ret.Get(1).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok {
|
||||
r2 = rf(ctx, username, password)
|
||||
if returnFunc, ok := ret.Get(2).(func(context.Context, string, string) error); ok {
|
||||
r2 = returnFunc(ctx, username, password)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
@@ -74,24 +87,40 @@ func (_e *UserBackend_Expecter) Authenticate(ctx interface{}, username interface
|
||||
|
||||
func (_c *UserBackend_Authenticate_Call) Run(run func(ctx context.Context, username string, password string)) *UserBackend_Authenticate_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_Authenticate_Call) Return(_a0 *userv1beta1.User, _a1 string, _a2 error) *UserBackend_Authenticate_Call {
|
||||
_c.Call.Return(_a0, _a1, _a2)
|
||||
func (_c *UserBackend_Authenticate_Call) Return(user *userv1beta1.User, s string, err error) *UserBackend_Authenticate_Call {
|
||||
_c.Call.Return(user, s, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_Authenticate_Call) RunAndReturn(run func(context.Context, string, string) (*userv1beta1.User, string, error)) *UserBackend_Authenticate_Call {
|
||||
func (_c *UserBackend_Authenticate_Call) RunAndReturn(run func(ctx context.Context, username string, password string) (*userv1beta1.User, string, error)) *UserBackend_Authenticate_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// CreateUserFromClaims provides a mock function with given fields: ctx, claims
|
||||
func (_m *UserBackend) CreateUserFromClaims(ctx context.Context, claims map[string]interface{}) (*userv1beta1.User, error) {
|
||||
ret := _m.Called(ctx, claims)
|
||||
// CreateUserFromClaims provides a mock function for the type UserBackend
|
||||
func (_mock *UserBackend) CreateUserFromClaims(ctx context.Context, claims map[string]interface{}) (*userv1beta1.User, error) {
|
||||
ret := _mock.Called(ctx, claims)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CreateUserFromClaims")
|
||||
@@ -99,23 +128,21 @@ func (_m *UserBackend) CreateUserFromClaims(ctx context.Context, claims map[stri
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*userv1beta1.User, error)); ok {
|
||||
return rf(ctx, claims)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*userv1beta1.User, error)); ok {
|
||||
return returnFunc(ctx, claims)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, claims)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *userv1beta1.User); ok {
|
||||
r0 = returnFunc(ctx, claims)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok {
|
||||
r1 = rf(ctx, claims)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok {
|
||||
r1 = returnFunc(ctx, claims)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -133,24 +160,35 @@ func (_e *UserBackend_Expecter) CreateUserFromClaims(ctx interface{}, claims int
|
||||
|
||||
func (_c *UserBackend_CreateUserFromClaims_Call) Run(run func(ctx context.Context, claims map[string]interface{})) *UserBackend_CreateUserFromClaims_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(map[string]interface{}))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 map[string]interface{}
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(map[string]interface{})
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_CreateUserFromClaims_Call) Return(_a0 *userv1beta1.User, _a1 error) *UserBackend_CreateUserFromClaims_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *UserBackend_CreateUserFromClaims_Call) Return(user *userv1beta1.User, err error) *UserBackend_CreateUserFromClaims_Call {
|
||||
_c.Call.Return(user, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_CreateUserFromClaims_Call) RunAndReturn(run func(context.Context, map[string]interface{}) (*userv1beta1.User, error)) *UserBackend_CreateUserFromClaims_Call {
|
||||
func (_c *UserBackend_CreateUserFromClaims_Call) RunAndReturn(run func(ctx context.Context, claims map[string]interface{}) (*userv1beta1.User, error)) *UserBackend_CreateUserFromClaims_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetUserByClaims provides a mock function with given fields: ctx, claim, value
|
||||
func (_m *UserBackend) GetUserByClaims(ctx context.Context, claim string, value string) (*userv1beta1.User, string, error) {
|
||||
ret := _m.Called(ctx, claim, value)
|
||||
// GetUserByClaims provides a mock function for the type UserBackend
|
||||
func (_mock *UserBackend) GetUserByClaims(ctx context.Context, claim string, value string) (*userv1beta1.User, string, error) {
|
||||
ret := _mock.Called(ctx, claim, value)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUserByClaims")
|
||||
@@ -159,29 +197,26 @@ func (_m *UserBackend) GetUserByClaims(ctx context.Context, claim string, value
|
||||
var r0 *userv1beta1.User
|
||||
var r1 string
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*userv1beta1.User, string, error)); ok {
|
||||
return rf(ctx, claim, value)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*userv1beta1.User, string, error)); ok {
|
||||
return returnFunc(ctx, claim, value)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, claim, value)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok {
|
||||
r0 = returnFunc(ctx, claim, value)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, string) string); ok {
|
||||
r1 = rf(ctx, claim, value)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) string); ok {
|
||||
r1 = returnFunc(ctx, claim, value)
|
||||
} else {
|
||||
r1 = ret.Get(1).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok {
|
||||
r2 = rf(ctx, claim, value)
|
||||
if returnFunc, ok := ret.Get(2).(func(context.Context, string, string) error); ok {
|
||||
r2 = returnFunc(ctx, claim, value)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
@@ -200,36 +235,51 @@ func (_e *UserBackend_Expecter) GetUserByClaims(ctx interface{}, claim interface
|
||||
|
||||
func (_c *UserBackend_GetUserByClaims_Call) Run(run func(ctx context.Context, claim string, value string)) *UserBackend_GetUserByClaims_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_GetUserByClaims_Call) Return(_a0 *userv1beta1.User, _a1 string, _a2 error) *UserBackend_GetUserByClaims_Call {
|
||||
_c.Call.Return(_a0, _a1, _a2)
|
||||
func (_c *UserBackend_GetUserByClaims_Call) Return(user *userv1beta1.User, s string, err error) *UserBackend_GetUserByClaims_Call {
|
||||
_c.Call.Return(user, s, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_GetUserByClaims_Call) RunAndReturn(run func(context.Context, string, string) (*userv1beta1.User, string, error)) *UserBackend_GetUserByClaims_Call {
|
||||
func (_c *UserBackend_GetUserByClaims_Call) RunAndReturn(run func(ctx context.Context, claim string, value string) (*userv1beta1.User, string, error)) *UserBackend_GetUserByClaims_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SyncGroupMemberships provides a mock function with given fields: ctx, user, claims
|
||||
func (_m *UserBackend) SyncGroupMemberships(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error {
|
||||
ret := _m.Called(ctx, user, claims)
|
||||
// SyncGroupMemberships provides a mock function for the type UserBackend
|
||||
func (_mock *UserBackend) SyncGroupMemberships(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error {
|
||||
ret := _mock.Called(ctx, user, claims)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SyncGroupMemberships")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok {
|
||||
r0 = rf(ctx, user, claims)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok {
|
||||
r0 = returnFunc(ctx, user, claims)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -248,36 +298,51 @@ func (_e *UserBackend_Expecter) SyncGroupMemberships(ctx interface{}, user inter
|
||||
|
||||
func (_c *UserBackend_SyncGroupMemberships_Call) Run(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{})) *UserBackend_SyncGroupMemberships_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*userv1beta1.User), args[2].(map[string]interface{}))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *userv1beta1.User
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*userv1beta1.User)
|
||||
}
|
||||
var arg2 map[string]interface{}
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(map[string]interface{})
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_SyncGroupMemberships_Call) Return(_a0 error) *UserBackend_SyncGroupMemberships_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *UserBackend_SyncGroupMemberships_Call) Return(err error) *UserBackend_SyncGroupMemberships_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_SyncGroupMemberships_Call) RunAndReturn(run func(context.Context, *userv1beta1.User, map[string]interface{}) error) *UserBackend_SyncGroupMemberships_Call {
|
||||
func (_c *UserBackend_SyncGroupMemberships_Call) RunAndReturn(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error) *UserBackend_SyncGroupMemberships_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UpdateUserIfNeeded provides a mock function with given fields: ctx, user, claims
|
||||
func (_m *UserBackend) UpdateUserIfNeeded(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error {
|
||||
ret := _m.Called(ctx, user, claims)
|
||||
// UpdateUserIfNeeded provides a mock function for the type UserBackend
|
||||
func (_mock *UserBackend) UpdateUserIfNeeded(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error {
|
||||
ret := _mock.Called(ctx, user, claims)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateUserIfNeeded")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok {
|
||||
r0 = rf(ctx, user, claims)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok {
|
||||
r0 = returnFunc(ctx, user, claims)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -296,31 +361,33 @@ func (_e *UserBackend_Expecter) UpdateUserIfNeeded(ctx interface{}, user interfa
|
||||
|
||||
func (_c *UserBackend_UpdateUserIfNeeded_Call) Run(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{})) *UserBackend_UpdateUserIfNeeded_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*userv1beta1.User), args[2].(map[string]interface{}))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *userv1beta1.User
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*userv1beta1.User)
|
||||
}
|
||||
var arg2 map[string]interface{}
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(map[string]interface{})
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_UpdateUserIfNeeded_Call) Return(_a0 error) *UserBackend_UpdateUserIfNeeded_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *UserBackend_UpdateUserIfNeeded_Call) Return(err error) *UserBackend_UpdateUserIfNeeded_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_UpdateUserIfNeeded_Call) RunAndReturn(run func(context.Context, *userv1beta1.User, map[string]interface{}) error) *UserBackend_UpdateUserIfNeeded_Call {
|
||||
func (_c *UserBackend_UpdateUserIfNeeded_Call) RunAndReturn(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) error) *UserBackend_UpdateUserIfNeeded_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewUserBackend creates a new instance of UserBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewUserBackend(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *UserBackend {
|
||||
mock := &UserBackend{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,15 +1,30 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"context"
|
||||
|
||||
"github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
)
|
||||
|
||||
// NewUserRoleAssigner creates a new instance of UserRoleAssigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewUserRoleAssigner(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *UserRoleAssigner {
|
||||
mock := &UserRoleAssigner{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// UserRoleAssigner is an autogenerated mock type for the UserRoleAssigner type
|
||||
type UserRoleAssigner struct {
|
||||
mock.Mock
|
||||
@@ -23,9 +38,9 @@ func (_m *UserRoleAssigner) EXPECT() *UserRoleAssigner_Expecter {
|
||||
return &UserRoleAssigner_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// ApplyUserRole provides a mock function with given fields: ctx, user
|
||||
func (_m *UserRoleAssigner) ApplyUserRole(ctx context.Context, user *userv1beta1.User) (*userv1beta1.User, error) {
|
||||
ret := _m.Called(ctx, user)
|
||||
// ApplyUserRole provides a mock function for the type UserRoleAssigner
|
||||
func (_mock *UserRoleAssigner) ApplyUserRole(ctx context.Context, user *userv1beta1.User) (*userv1beta1.User, error) {
|
||||
ret := _mock.Called(ctx, user)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ApplyUserRole")
|
||||
@@ -33,23 +48,21 @@ func (_m *UserRoleAssigner) ApplyUserRole(ctx context.Context, user *userv1beta1
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) (*userv1beta1.User, error)); ok {
|
||||
return rf(ctx, user)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) (*userv1beta1.User, error)); ok {
|
||||
return returnFunc(ctx, user)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, user)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) *userv1beta1.User); ok {
|
||||
r0 = returnFunc(ctx, user)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *userv1beta1.User) error); ok {
|
||||
r1 = rf(ctx, user)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *userv1beta1.User) error); ok {
|
||||
r1 = returnFunc(ctx, user)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -67,24 +80,35 @@ func (_e *UserRoleAssigner_Expecter) ApplyUserRole(ctx interface{}, user interfa
|
||||
|
||||
func (_c *UserRoleAssigner_ApplyUserRole_Call) Run(run func(ctx context.Context, user *userv1beta1.User)) *UserRoleAssigner_ApplyUserRole_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*userv1beta1.User))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *userv1beta1.User
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*userv1beta1.User)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserRoleAssigner_ApplyUserRole_Call) Return(_a0 *userv1beta1.User, _a1 error) *UserRoleAssigner_ApplyUserRole_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *UserRoleAssigner_ApplyUserRole_Call) Return(user1 *userv1beta1.User, err error) *UserRoleAssigner_ApplyUserRole_Call {
|
||||
_c.Call.Return(user1, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserRoleAssigner_ApplyUserRole_Call) RunAndReturn(run func(context.Context, *userv1beta1.User) (*userv1beta1.User, error)) *UserRoleAssigner_ApplyUserRole_Call {
|
||||
func (_c *UserRoleAssigner_ApplyUserRole_Call) RunAndReturn(run func(ctx context.Context, user *userv1beta1.User) (*userv1beta1.User, error)) *UserRoleAssigner_ApplyUserRole_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UpdateUserRoleAssignment provides a mock function with given fields: ctx, user, claims
|
||||
func (_m *UserRoleAssigner) UpdateUserRoleAssignment(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) (*userv1beta1.User, error) {
|
||||
ret := _m.Called(ctx, user, claims)
|
||||
// UpdateUserRoleAssignment provides a mock function for the type UserRoleAssigner
|
||||
func (_mock *UserRoleAssigner) UpdateUserRoleAssignment(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) (*userv1beta1.User, error) {
|
||||
ret := _mock.Called(ctx, user, claims)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateUserRoleAssignment")
|
||||
@@ -92,23 +116,21 @@ func (_m *UserRoleAssigner) UpdateUserRoleAssignment(ctx context.Context, user *
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) (*userv1beta1.User, error)); ok {
|
||||
return rf(ctx, user, claims)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) (*userv1beta1.User, error)); ok {
|
||||
return returnFunc(ctx, user, claims)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, user, claims)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) *userv1beta1.User); ok {
|
||||
r0 = returnFunc(ctx, user, claims)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok {
|
||||
r1 = rf(ctx, user, claims)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok {
|
||||
r1 = returnFunc(ctx, user, claims)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -127,31 +149,33 @@ func (_e *UserRoleAssigner_Expecter) UpdateUserRoleAssignment(ctx interface{}, u
|
||||
|
||||
func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) Run(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{})) *UserRoleAssigner_UpdateUserRoleAssignment_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*userv1beta1.User), args[2].(map[string]interface{}))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *userv1beta1.User
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*userv1beta1.User)
|
||||
}
|
||||
var arg2 map[string]interface{}
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(map[string]interface{})
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) Return(_a0 *userv1beta1.User, _a1 error) *UserRoleAssigner_UpdateUserRoleAssignment_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) Return(user1 *userv1beta1.User, err error) *UserRoleAssigner_UpdateUserRoleAssignment_Call {
|
||||
_c.Call.Return(user1, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) RunAndReturn(run func(context.Context, *userv1beta1.User, map[string]interface{}) (*userv1beta1.User, error)) *UserRoleAssigner_UpdateUserRoleAssignment_Call {
|
||||
func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) RunAndReturn(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) (*userv1beta1.User, error)) *UserRoleAssigner_UpdateUserRoleAssignment_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewUserRoleAssigner creates a new instance of UserRoleAssigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewUserRoleAssigner(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *UserRoleAssigner {
|
||||
mock := &UserRoleAssigner{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
issue-845-fix: True
|
||||
resolve-type-alias: False
|
||||
with-expecter: true
|
||||
disable-version-string: True
|
||||
# maintain v2 separate mocks dir
|
||||
dir: "{{.InterfaceDir}}/mocks"
|
||||
structname: "{{.InterfaceName}}"
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
dir: "pkg/{{.PackageName}}/mocks"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
pkgname: mocks
|
||||
|
||||
template: testify
|
||||
packages:
|
||||
github.com/opencloud-eu/opencloud/services/search/pkg/engine:
|
||||
interfaces:
|
||||
Engine:
|
||||
github.com/opencloud-eu/opencloud/services/search/pkg/content:
|
||||
interfaces:
|
||||
Extractor:
|
||||
Retriever:
|
||||
github.com/opencloud-eu/opencloud/services/search/pkg/search:
|
||||
interfaces:
|
||||
Searcher:
|
||||
github.com/opencloud-eu/opencloud/services/search/pkg/engine:
|
||||
interfaces:
|
||||
Engine: {}
|
||||
github.com/opencloud-eu/opencloud/services/search/pkg/content:
|
||||
interfaces:
|
||||
Extractor: {}
|
||||
Retriever: {}
|
||||
github.com/opencloud-eu/opencloud/services/search/pkg/search:
|
||||
interfaces:
|
||||
Searcher: {}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
content "github.com/opencloud-eu/opencloud/services/search/pkg/content"
|
||||
"context"
|
||||
|
||||
"github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
"github.com/opencloud-eu/opencloud/services/search/pkg/content"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
)
|
||||
|
||||
// NewExtractor creates a new instance of Extractor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewExtractor(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Extractor {
|
||||
mock := &Extractor{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// Extractor is an autogenerated mock type for the Extractor type
|
||||
type Extractor struct {
|
||||
mock.Mock
|
||||
@@ -25,9 +39,9 @@ func (_m *Extractor) EXPECT() *Extractor_Expecter {
|
||||
return &Extractor_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Extract provides a mock function with given fields: ctx, ri
|
||||
func (_m *Extractor) Extract(ctx context.Context, ri *providerv1beta1.ResourceInfo) (content.Document, error) {
|
||||
ret := _m.Called(ctx, ri)
|
||||
// Extract provides a mock function for the type Extractor
|
||||
func (_mock *Extractor) Extract(ctx context.Context, ri *providerv1beta1.ResourceInfo) (content.Document, error) {
|
||||
ret := _mock.Called(ctx, ri)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Extract")
|
||||
@@ -35,21 +49,19 @@ func (_m *Extractor) Extract(ctx context.Context, ri *providerv1beta1.ResourceIn
|
||||
|
||||
var r0 content.Document
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceInfo) (content.Document, error)); ok {
|
||||
return rf(ctx, ri)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceInfo) (content.Document, error)); ok {
|
||||
return returnFunc(ctx, ri)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceInfo) content.Document); ok {
|
||||
r0 = rf(ctx, ri)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceInfo) content.Document); ok {
|
||||
r0 = returnFunc(ctx, ri)
|
||||
} else {
|
||||
r0 = ret.Get(0).(content.Document)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceInfo) error); ok {
|
||||
r1 = rf(ctx, ri)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceInfo) error); ok {
|
||||
r1 = returnFunc(ctx, ri)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -67,31 +79,28 @@ func (_e *Extractor_Expecter) Extract(ctx interface{}, ri interface{}) *Extracto
|
||||
|
||||
func (_c *Extractor_Extract_Call) Run(run func(ctx context.Context, ri *providerv1beta1.ResourceInfo)) *Extractor_Extract_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceInfo))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceInfo
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceInfo)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Extractor_Extract_Call) Return(_a0 content.Document, _a1 error) *Extractor_Extract_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Extractor_Extract_Call) Return(document content.Document, err error) *Extractor_Extract_Call {
|
||||
_c.Call.Return(document, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Extractor_Extract_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceInfo) (content.Document, error)) *Extractor_Extract_Call {
|
||||
func (_c *Extractor_Extract_Call) RunAndReturn(run func(ctx context.Context, ri *providerv1beta1.ResourceInfo) (content.Document, error)) *Extractor_Extract_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewExtractor creates a new instance of Extractor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewExtractor(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Extractor {
|
||||
mock := &Extractor{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
io "io"
|
||||
"context"
|
||||
"io"
|
||||
|
||||
"github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
)
|
||||
|
||||
// NewRetriever creates a new instance of Retriever. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewRetriever(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Retriever {
|
||||
mock := &Retriever{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// Retriever is an autogenerated mock type for the Retriever type
|
||||
type Retriever struct {
|
||||
mock.Mock
|
||||
@@ -24,9 +39,9 @@ func (_m *Retriever) EXPECT() *Retriever_Expecter {
|
||||
return &Retriever_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Retrieve provides a mock function with given fields: ctx, rID
|
||||
func (_m *Retriever) Retrieve(ctx context.Context, rID *providerv1beta1.ResourceId) (io.ReadCloser, error) {
|
||||
ret := _m.Called(ctx, rID)
|
||||
// Retrieve provides a mock function for the type Retriever
|
||||
func (_mock *Retriever) Retrieve(ctx context.Context, rID *providerv1beta1.ResourceId) (io.ReadCloser, error) {
|
||||
ret := _mock.Called(ctx, rID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Retrieve")
|
||||
@@ -34,23 +49,21 @@ func (_m *Retriever) Retrieve(ctx context.Context, rID *providerv1beta1.Resource
|
||||
|
||||
var r0 io.ReadCloser
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) (io.ReadCloser, error)); ok {
|
||||
return rf(ctx, rID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) (io.ReadCloser, error)); ok {
|
||||
return returnFunc(ctx, rID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) io.ReadCloser); ok {
|
||||
r0 = rf(ctx, rID)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) io.ReadCloser); ok {
|
||||
r0 = returnFunc(ctx, rID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(io.ReadCloser)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId) error); ok {
|
||||
r1 = rf(ctx, rID)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId) error); ok {
|
||||
r1 = returnFunc(ctx, rID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -68,31 +81,28 @@ func (_e *Retriever_Expecter) Retrieve(ctx interface{}, rID interface{}) *Retrie
|
||||
|
||||
func (_c *Retriever_Retrieve_Call) Run(run func(ctx context.Context, rID *providerv1beta1.ResourceId)) *Retriever_Retrieve_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*providerv1beta1.ResourceId))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *providerv1beta1.ResourceId
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Retriever_Retrieve_Call) Return(_a0 io.ReadCloser, _a1 error) *Retriever_Retrieve_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Retriever_Retrieve_Call) Return(readCloser io.ReadCloser, err error) *Retriever_Retrieve_Call {
|
||||
_c.Call.Return(readCloser, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Retriever_Retrieve_Call) RunAndReturn(run func(context.Context, *providerv1beta1.ResourceId) (io.ReadCloser, error)) *Retriever_Retrieve_Call {
|
||||
func (_c *Retriever_Retrieve_Call) RunAndReturn(run func(ctx context.Context, rID *providerv1beta1.ResourceId) (io.ReadCloser, error)) *Retriever_Retrieve_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewRetriever creates a new instance of Retriever. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewRetriever(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Retriever {
|
||||
mock := &Retriever{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"context"
|
||||
|
||||
engine "github.com/opencloud-eu/opencloud/services/search/pkg/engine"
|
||||
"github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0"
|
||||
"github.com/opencloud-eu/opencloud/services/search/pkg/engine"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0"
|
||||
)
|
||||
|
||||
// NewEngine creates a new instance of Engine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewEngine(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Engine {
|
||||
mock := &Engine{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// Engine is an autogenerated mock type for the Engine type
|
||||
type Engine struct {
|
||||
mock.Mock
|
||||
@@ -24,21 +39,20 @@ func (_m *Engine) EXPECT() *Engine_Expecter {
|
||||
return &Engine_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: id
|
||||
func (_m *Engine) Delete(id string) error {
|
||||
ret := _m.Called(id)
|
||||
// Delete provides a mock function for the type Engine
|
||||
func (_mock *Engine) Delete(id string) error {
|
||||
ret := _mock.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Delete")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(id)
|
||||
if returnFunc, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = returnFunc(id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -55,24 +69,30 @@ func (_e *Engine_Expecter) Delete(id interface{}) *Engine_Delete_Call {
|
||||
|
||||
func (_c *Engine_Delete_Call) Run(run func(id string)) *Engine_Delete_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Delete_Call) Return(_a0 error) *Engine_Delete_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Engine_Delete_Call) Return(err error) *Engine_Delete_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Delete_Call) RunAndReturn(run func(string) error) *Engine_Delete_Call {
|
||||
func (_c *Engine_Delete_Call) RunAndReturn(run func(id string) error) *Engine_Delete_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// DocCount provides a mock function with no fields
|
||||
func (_m *Engine) DocCount() (uint64, error) {
|
||||
ret := _m.Called()
|
||||
// DocCount provides a mock function for the type Engine
|
||||
func (_mock *Engine) DocCount() (uint64, error) {
|
||||
ret := _mock.Called()
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DocCount")
|
||||
@@ -80,21 +100,19 @@ func (_m *Engine) DocCount() (uint64, error) {
|
||||
|
||||
var r0 uint64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func() (uint64, error)); ok {
|
||||
return rf()
|
||||
if returnFunc, ok := ret.Get(0).(func() (uint64, error)); ok {
|
||||
return returnFunc()
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func() uint64); ok {
|
||||
r0 = rf()
|
||||
if returnFunc, ok := ret.Get(0).(func() uint64); ok {
|
||||
r0 = returnFunc()
|
||||
} else {
|
||||
r0 = ret.Get(0).(uint64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
if returnFunc, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = returnFunc()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -115,8 +133,8 @@ func (_c *Engine_DocCount_Call) Run(run func()) *Engine_DocCount_Call {
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_DocCount_Call) Return(_a0 uint64, _a1 error) *Engine_DocCount_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Engine_DocCount_Call) Return(v uint64, err error) *Engine_DocCount_Call {
|
||||
_c.Call.Return(v, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
@@ -125,21 +143,20 @@ func (_c *Engine_DocCount_Call) RunAndReturn(run func() (uint64, error)) *Engine
|
||||
return _c
|
||||
}
|
||||
|
||||
// Move provides a mock function with given fields: id, parentid, target
|
||||
func (_m *Engine) Move(id string, parentid string, target string) error {
|
||||
ret := _m.Called(id, parentid, target)
|
||||
// Move provides a mock function for the type Engine
|
||||
func (_mock *Engine) Move(id string, parentid string, target string) error {
|
||||
ret := _mock.Called(id, parentid, target)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Move")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) error); ok {
|
||||
r0 = rf(id, parentid, target)
|
||||
if returnFunc, ok := ret.Get(0).(func(string, string, string) error); ok {
|
||||
r0 = returnFunc(id, parentid, target)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -158,36 +175,51 @@ func (_e *Engine_Expecter) Move(id interface{}, parentid interface{}, target int
|
||||
|
||||
func (_c *Engine_Move_Call) Run(run func(id string, parentid string, target string)) *Engine_Move_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(string), args[2].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Move_Call) Return(_a0 error) *Engine_Move_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Engine_Move_Call) Return(err error) *Engine_Move_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Move_Call) RunAndReturn(run func(string, string, string) error) *Engine_Move_Call {
|
||||
func (_c *Engine_Move_Call) RunAndReturn(run func(id string, parentid string, target string) error) *Engine_Move_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Purge provides a mock function with given fields: id
|
||||
func (_m *Engine) Purge(id string) error {
|
||||
ret := _m.Called(id)
|
||||
// Purge provides a mock function for the type Engine
|
||||
func (_mock *Engine) Purge(id string) error {
|
||||
ret := _mock.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Purge")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(id)
|
||||
if returnFunc, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = returnFunc(id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -204,36 +236,41 @@ func (_e *Engine_Expecter) Purge(id interface{}) *Engine_Purge_Call {
|
||||
|
||||
func (_c *Engine_Purge_Call) Run(run func(id string)) *Engine_Purge_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Purge_Call) Return(_a0 error) *Engine_Purge_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Engine_Purge_Call) Return(err error) *Engine_Purge_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Purge_Call) RunAndReturn(run func(string) error) *Engine_Purge_Call {
|
||||
func (_c *Engine_Purge_Call) RunAndReturn(run func(id string) error) *Engine_Purge_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Restore provides a mock function with given fields: id
|
||||
func (_m *Engine) Restore(id string) error {
|
||||
ret := _m.Called(id)
|
||||
// Restore provides a mock function for the type Engine
|
||||
func (_mock *Engine) Restore(id string) error {
|
||||
ret := _mock.Called(id)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Restore")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(id)
|
||||
if returnFunc, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = returnFunc(id)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -250,24 +287,30 @@ func (_e *Engine_Expecter) Restore(id interface{}) *Engine_Restore_Call {
|
||||
|
||||
func (_c *Engine_Restore_Call) Run(run func(id string)) *Engine_Restore_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Restore_Call) Return(_a0 error) *Engine_Restore_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Engine_Restore_Call) Return(err error) *Engine_Restore_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Restore_Call) RunAndReturn(run func(string) error) *Engine_Restore_Call {
|
||||
func (_c *Engine_Restore_Call) RunAndReturn(run func(id string) error) *Engine_Restore_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Search provides a mock function with given fields: ctx, req
|
||||
func (_m *Engine) Search(ctx context.Context, req *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error) {
|
||||
ret := _m.Called(ctx, req)
|
||||
// Search provides a mock function for the type Engine
|
||||
func (_mock *Engine) Search(ctx context.Context, req *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error) {
|
||||
ret := _mock.Called(ctx, req)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Search")
|
||||
@@ -275,23 +318,21 @@ func (_m *Engine) Search(ctx context.Context, req *v0.SearchIndexRequest) (*v0.S
|
||||
|
||||
var r0 *v0.SearchIndexResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)); ok {
|
||||
return rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)); ok {
|
||||
return returnFunc(ctx, req)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) *v0.SearchIndexResponse); ok {
|
||||
r0 = rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) *v0.SearchIndexResponse); ok {
|
||||
r0 = returnFunc(ctx, req)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.SearchIndexResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.SearchIndexRequest) error); ok {
|
||||
r1 = rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SearchIndexRequest) error); ok {
|
||||
r1 = returnFunc(ctx, req)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -309,36 +350,46 @@ func (_e *Engine_Expecter) Search(ctx interface{}, req interface{}) *Engine_Sear
|
||||
|
||||
func (_c *Engine_Search_Call) Run(run func(ctx context.Context, req *v0.SearchIndexRequest)) *Engine_Search_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*v0.SearchIndexRequest))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *v0.SearchIndexRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.SearchIndexRequest)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Search_Call) Return(_a0 *v0.SearchIndexResponse, _a1 error) *Engine_Search_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Engine_Search_Call) Return(searchIndexResponse *v0.SearchIndexResponse, err error) *Engine_Search_Call {
|
||||
_c.Call.Return(searchIndexResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Search_Call) RunAndReturn(run func(context.Context, *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)) *Engine_Search_Call {
|
||||
func (_c *Engine_Search_Call) RunAndReturn(run func(ctx context.Context, req *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)) *Engine_Search_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Upsert provides a mock function with given fields: id, r
|
||||
func (_m *Engine) Upsert(id string, r engine.Resource) error {
|
||||
ret := _m.Called(id, r)
|
||||
// Upsert provides a mock function for the type Engine
|
||||
func (_mock *Engine) Upsert(id string, r engine.Resource) error {
|
||||
ret := _mock.Called(id, r)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Upsert")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, engine.Resource) error); ok {
|
||||
r0 = rf(id, r)
|
||||
if returnFunc, ok := ret.Get(0).(func(string, engine.Resource) error); ok {
|
||||
r0 = returnFunc(id, r)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -356,31 +407,28 @@ func (_e *Engine_Expecter) Upsert(id interface{}, r interface{}) *Engine_Upsert_
|
||||
|
||||
func (_c *Engine_Upsert_Call) Run(run func(id string, r engine.Resource)) *Engine_Upsert_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(engine.Resource))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
var arg1 engine.Resource
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(engine.Resource)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Upsert_Call) Return(_a0 error) *Engine_Upsert_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Engine_Upsert_Call) Return(err error) *Engine_Upsert_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Engine_Upsert_Call) RunAndReturn(run func(string, engine.Resource) error) *Engine_Upsert_Call {
|
||||
func (_c *Engine_Upsert_Call) RunAndReturn(run func(id string, r engine.Resource) error) *Engine_Upsert_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewEngine creates a new instance of Engine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewEngine(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Engine {
|
||||
mock := &Engine{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
// Code generated by mockery. DO NOT EDIT.
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"context"
|
||||
|
||||
providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
"github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
"github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0"
|
||||
)
|
||||
|
||||
// NewSearcher creates a new instance of Searcher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSearcher(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Searcher {
|
||||
mock := &Searcher{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// Searcher is an autogenerated mock type for the Searcher type
|
||||
type Searcher struct {
|
||||
mock.Mock
|
||||
@@ -24,21 +39,20 @@ func (_m *Searcher) EXPECT() *Searcher_Expecter {
|
||||
return &Searcher_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// IndexSpace provides a mock function with given fields: rID
|
||||
func (_m *Searcher) IndexSpace(rID *providerv1beta1.StorageSpaceId) error {
|
||||
ret := _m.Called(rID)
|
||||
// IndexSpace provides a mock function for the type Searcher
|
||||
func (_mock *Searcher) IndexSpace(rID *providerv1beta1.StorageSpaceId) error {
|
||||
ret := _mock.Called(rID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for IndexSpace")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*providerv1beta1.StorageSpaceId) error); ok {
|
||||
r0 = rf(rID)
|
||||
if returnFunc, ok := ret.Get(0).(func(*providerv1beta1.StorageSpaceId) error); ok {
|
||||
r0 = returnFunc(rID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
@@ -55,24 +69,31 @@ func (_e *Searcher_Expecter) IndexSpace(rID interface{}) *Searcher_IndexSpace_Ca
|
||||
|
||||
func (_c *Searcher_IndexSpace_Call) Run(run func(rID *providerv1beta1.StorageSpaceId)) *Searcher_IndexSpace_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(*providerv1beta1.StorageSpaceId))
|
||||
var arg0 *providerv1beta1.StorageSpaceId
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(*providerv1beta1.StorageSpaceId)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Searcher_IndexSpace_Call) Return(_a0 error) *Searcher_IndexSpace_Call {
|
||||
_c.Call.Return(_a0)
|
||||
func (_c *Searcher_IndexSpace_Call) Return(err error) *Searcher_IndexSpace_Call {
|
||||
_c.Call.Return(err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Searcher_IndexSpace_Call) RunAndReturn(run func(*providerv1beta1.StorageSpaceId) error) *Searcher_IndexSpace_Call {
|
||||
func (_c *Searcher_IndexSpace_Call) RunAndReturn(run func(rID *providerv1beta1.StorageSpaceId) error) *Searcher_IndexSpace_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// MoveItem provides a mock function with given fields: ref
|
||||
func (_m *Searcher) MoveItem(ref *providerv1beta1.Reference) {
|
||||
_m.Called(ref)
|
||||
// MoveItem provides a mock function for the type Searcher
|
||||
func (_mock *Searcher) MoveItem(ref *providerv1beta1.Reference) {
|
||||
_mock.Called(ref)
|
||||
return
|
||||
}
|
||||
|
||||
// Searcher_MoveItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MoveItem'
|
||||
@@ -88,7 +109,13 @@ func (_e *Searcher_Expecter) MoveItem(ref interface{}) *Searcher_MoveItem_Call {
|
||||
|
||||
func (_c *Searcher_MoveItem_Call) Run(run func(ref *providerv1beta1.Reference)) *Searcher_MoveItem_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(*providerv1beta1.Reference))
|
||||
var arg0 *providerv1beta1.Reference
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(*providerv1beta1.Reference)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
@@ -98,14 +125,15 @@ func (_c *Searcher_MoveItem_Call) Return() *Searcher_MoveItem_Call {
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Searcher_MoveItem_Call) RunAndReturn(run func(*providerv1beta1.Reference)) *Searcher_MoveItem_Call {
|
||||
func (_c *Searcher_MoveItem_Call) RunAndReturn(run func(ref *providerv1beta1.Reference)) *Searcher_MoveItem_Call {
|
||||
_c.Run(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// RestoreItem provides a mock function with given fields: ref
|
||||
func (_m *Searcher) RestoreItem(ref *providerv1beta1.Reference) {
|
||||
_m.Called(ref)
|
||||
// RestoreItem provides a mock function for the type Searcher
|
||||
func (_mock *Searcher) RestoreItem(ref *providerv1beta1.Reference) {
|
||||
_mock.Called(ref)
|
||||
return
|
||||
}
|
||||
|
||||
// Searcher_RestoreItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestoreItem'
|
||||
@@ -121,7 +149,13 @@ func (_e *Searcher_Expecter) RestoreItem(ref interface{}) *Searcher_RestoreItem_
|
||||
|
||||
func (_c *Searcher_RestoreItem_Call) Run(run func(ref *providerv1beta1.Reference)) *Searcher_RestoreItem_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(*providerv1beta1.Reference))
|
||||
var arg0 *providerv1beta1.Reference
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(*providerv1beta1.Reference)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
@@ -131,14 +165,14 @@ func (_c *Searcher_RestoreItem_Call) Return() *Searcher_RestoreItem_Call {
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Searcher_RestoreItem_Call) RunAndReturn(run func(*providerv1beta1.Reference)) *Searcher_RestoreItem_Call {
|
||||
func (_c *Searcher_RestoreItem_Call) RunAndReturn(run func(ref *providerv1beta1.Reference)) *Searcher_RestoreItem_Call {
|
||||
_c.Run(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// Search provides a mock function with given fields: ctx, req
|
||||
func (_m *Searcher) Search(ctx context.Context, req *v0.SearchRequest) (*v0.SearchResponse, error) {
|
||||
ret := _m.Called(ctx, req)
|
||||
// Search provides a mock function for the type Searcher
|
||||
func (_mock *Searcher) Search(ctx context.Context, req *v0.SearchRequest) (*v0.SearchResponse, error) {
|
||||
ret := _mock.Called(ctx, req)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Search")
|
||||
@@ -146,23 +180,21 @@ func (_m *Searcher) Search(ctx context.Context, req *v0.SearchRequest) (*v0.Sear
|
||||
|
||||
var r0 *v0.SearchResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest) (*v0.SearchResponse, error)); ok {
|
||||
return rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest) (*v0.SearchResponse, error)); ok {
|
||||
return returnFunc(ctx, req)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest) *v0.SearchResponse); ok {
|
||||
r0 = rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchRequest) *v0.SearchResponse); ok {
|
||||
r0 = returnFunc(ctx, req)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.SearchResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.SearchRequest) error); ok {
|
||||
r1 = rf(ctx, req)
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SearchRequest) error); ok {
|
||||
r1 = returnFunc(ctx, req)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
@@ -180,24 +212,36 @@ func (_e *Searcher_Expecter) Search(ctx interface{}, req interface{}) *Searcher_
|
||||
|
||||
func (_c *Searcher_Search_Call) Run(run func(ctx context.Context, req *v0.SearchRequest)) *Searcher_Search_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*v0.SearchRequest))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *v0.SearchRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.SearchRequest)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Searcher_Search_Call) Return(_a0 *v0.SearchResponse, _a1 error) *Searcher_Search_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
func (_c *Searcher_Search_Call) Return(searchResponse *v0.SearchResponse, err error) *Searcher_Search_Call {
|
||||
_c.Call.Return(searchResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Searcher_Search_Call) RunAndReturn(run func(context.Context, *v0.SearchRequest) (*v0.SearchResponse, error)) *Searcher_Search_Call {
|
||||
func (_c *Searcher_Search_Call) RunAndReturn(run func(ctx context.Context, req *v0.SearchRequest) (*v0.SearchResponse, error)) *Searcher_Search_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// TrashItem provides a mock function with given fields: rID
|
||||
func (_m *Searcher) TrashItem(rID *providerv1beta1.ResourceId) {
|
||||
_m.Called(rID)
|
||||
// TrashItem provides a mock function for the type Searcher
|
||||
func (_mock *Searcher) TrashItem(rID *providerv1beta1.ResourceId) {
|
||||
_mock.Called(rID)
|
||||
return
|
||||
}
|
||||
|
||||
// Searcher_TrashItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TrashItem'
|
||||
@@ -213,7 +257,13 @@ func (_e *Searcher_Expecter) TrashItem(rID interface{}) *Searcher_TrashItem_Call
|
||||
|
||||
func (_c *Searcher_TrashItem_Call) Run(run func(rID *providerv1beta1.ResourceId)) *Searcher_TrashItem_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(*providerv1beta1.ResourceId))
|
||||
var arg0 *providerv1beta1.ResourceId
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(*providerv1beta1.ResourceId)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
@@ -223,14 +273,15 @@ func (_c *Searcher_TrashItem_Call) Return() *Searcher_TrashItem_Call {
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Searcher_TrashItem_Call) RunAndReturn(run func(*providerv1beta1.ResourceId)) *Searcher_TrashItem_Call {
|
||||
func (_c *Searcher_TrashItem_Call) RunAndReturn(run func(rID *providerv1beta1.ResourceId)) *Searcher_TrashItem_Call {
|
||||
_c.Run(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UpsertItem provides a mock function with given fields: ref
|
||||
func (_m *Searcher) UpsertItem(ref *providerv1beta1.Reference) {
|
||||
_m.Called(ref)
|
||||
// UpsertItem provides a mock function for the type Searcher
|
||||
func (_mock *Searcher) UpsertItem(ref *providerv1beta1.Reference) {
|
||||
_mock.Called(ref)
|
||||
return
|
||||
}
|
||||
|
||||
// Searcher_UpsertItem_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpsertItem'
|
||||
@@ -246,7 +297,13 @@ func (_e *Searcher_Expecter) UpsertItem(ref interface{}) *Searcher_UpsertItem_Ca
|
||||
|
||||
func (_c *Searcher_UpsertItem_Call) Run(run func(ref *providerv1beta1.Reference)) *Searcher_UpsertItem_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(*providerv1beta1.Reference))
|
||||
var arg0 *providerv1beta1.Reference
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(*providerv1beta1.Reference)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
@@ -256,21 +313,7 @@ func (_c *Searcher_UpsertItem_Call) Return() *Searcher_UpsertItem_Call {
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Searcher_UpsertItem_Call) RunAndReturn(run func(*providerv1beta1.Reference)) *Searcher_UpsertItem_Call {
|
||||
func (_c *Searcher_UpsertItem_Call) RunAndReturn(run func(ref *providerv1beta1.Reference)) *Searcher_UpsertItem_Call {
|
||||
_c.Run(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewSearcher creates a new instance of Searcher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewSearcher(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Searcher {
|
||||
mock := &Searcher{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
issue-845-fix: True
|
||||
resolve-type-alias: False
|
||||
with-expecter: true
|
||||
disable-version-string: True
|
||||
# maintain v2 separate mocks dir
|
||||
dir: "{{.InterfaceDir}}/mocks"
|
||||
structname: "{{.InterfaceName}}"
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
pkgname: mocks
|
||||
|
||||
template: testify
|
||||
packages:
|
||||
github.com/opencloud-eu/opencloud/services/settings/pkg/settings:
|
||||
config:
|
||||
dir: "pkg/settings/mocks"
|
||||
interfaces:
|
||||
Manager:
|
||||
github.com/opencloud-eu/opencloud/services/settings/pkg/settings:
|
||||
interfaces:
|
||||
Manager: {}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user