Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
@@ -0,0 +1,177 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"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"
)
// 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
}
type BaseGraphProvider_Expecter struct {
mock *mock.Mock
}
func (_m *BaseGraphProvider) EXPECT() *BaseGraphProvider_Expecter {
return &BaseGraphProvider_Expecter{mock: &_m.Mock}
}
// 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")
}
var r0 []libregraph.DriveItem
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, []*ocmv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, []*ocmv1beta1.ReceivedShare) error); ok {
r1 = returnFunc(ctx, receivedOCMShares)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CS3ReceivedOCMSharesToDriveItems'
type BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call struct {
*mock.Call
}
// CS3ReceivedOCMSharesToDriveItems is a helper method to define mock.On call
// - ctx context.Context
// - receivedOCMShares []*ocmv1beta1.ReceivedShare
func (_e *BaseGraphProvider_Expecter) CS3ReceivedOCMSharesToDriveItems(ctx interface{}, receivedOCMShares interface{}) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call {
return &BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call{Call: _e.mock.On("CS3ReceivedOCMSharesToDriveItems", ctx, receivedOCMShares)}
}
func (_c *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call) Run(run func(ctx context.Context, receivedOCMShares []*ocmv1beta1.ReceivedShare)) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call {
_c.Call.Run(func(args mock.Arguments) {
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(driveItems []libregraph.DriveItem, err error) *BaseGraphProvider_CS3ReceivedOCMSharesToDriveItems_Call {
_c.Call.Return(driveItems, err)
return _c
}
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 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")
}
var r0 []libregraph.DriveItem
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare) ([]libregraph.DriveItem, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, []*collaborationv1beta1.ReceivedShare) error); ok {
r1 = returnFunc(ctx, receivedShares)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CS3ReceivedSharesToDriveItems'
type BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call struct {
*mock.Call
}
// CS3ReceivedSharesToDriveItems is a helper method to define mock.On call
// - ctx context.Context
// - receivedShares []*collaborationv1beta1.ReceivedShare
func (_e *BaseGraphProvider_Expecter) CS3ReceivedSharesToDriveItems(ctx interface{}, receivedShares interface{}) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call {
return &BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call{Call: _e.mock.On("CS3ReceivedSharesToDriveItems", ctx, receivedShares)}
}
func (_c *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call) Run(run func(ctx context.Context, receivedShares []*collaborationv1beta1.ReceivedShare)) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call {
_c.Call.Run(func(args mock.Arguments) {
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(driveItems []libregraph.DriveItem, err error) *BaseGraphProvider_CS3ReceivedSharesToDriveItems_Call {
_c.Call.Return(driveItems, err)
return _c
}
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
}
@@ -0,0 +1,911 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/opencloud-eu/libre-graph-api-go"
"github.com/qsfera/server/services/graph/pkg/service/v0"
mock "github.com/stretchr/testify/mock"
)
// 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
}
type DriveItemPermissionsProvider_Expecter struct {
mock *mock.Mock
}
func (_m *DriveItemPermissionsProvider) EXPECT() *DriveItemPermissionsProvider_Expecter {
return &DriveItemPermissionsProvider_Expecter{mock: &_m.Mock}
}
// 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")
}
var r0 libregraph.Permission
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)); ok {
return returnFunc(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 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
}
// DriveItemPermissionsProvider_CreateLink_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateLink'
type DriveItemPermissionsProvider_CreateLink_Call struct {
*mock.Call
}
// CreateLink is a helper method to define mock.On call
// - ctx context.Context
// - driveItemID *providerv1beta1.ResourceId
// - createLink libregraph.DriveItemCreateLink
func (_e *DriveItemPermissionsProvider_Expecter) CreateLink(ctx interface{}, driveItemID interface{}, createLink interface{}) *DriveItemPermissionsProvider_CreateLink_Call {
return &DriveItemPermissionsProvider_CreateLink_Call{Call: _e.mock.On("CreateLink", ctx, driveItemID, createLink)}
}
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) {
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(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_CreateLink_Call {
_c.Call.Return(permission, err)
return _c
}
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 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")
}
var r0 libregraph.Permission
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemCreateLink) (libregraph.Permission, error)); ok {
return returnFunc(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 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
}
// DriveItemPermissionsProvider_CreateSpaceRootLink_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSpaceRootLink'
type DriveItemPermissionsProvider_CreateSpaceRootLink_Call struct {
*mock.Call
}
// CreateSpaceRootLink is a helper method to define mock.On call
// - ctx context.Context
// - driveID *providerv1beta1.ResourceId
// - createLink libregraph.DriveItemCreateLink
func (_e *DriveItemPermissionsProvider_Expecter) CreateSpaceRootLink(ctx interface{}, driveID interface{}, createLink interface{}) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call {
return &DriveItemPermissionsProvider_CreateSpaceRootLink_Call{Call: _e.mock.On("CreateSpaceRootLink", ctx, driveID, createLink)}
}
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) {
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(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_CreateSpaceRootLink_Call {
_c.Call.Return(permission, err)
return _c
}
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 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 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
}
// DriveItemPermissionsProvider_DeletePermission_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePermission'
type DriveItemPermissionsProvider_DeletePermission_Call struct {
*mock.Call
}
// DeletePermission is a helper method to define mock.On call
// - ctx context.Context
// - itemID *providerv1beta1.ResourceId
// - permissionID string
func (_e *DriveItemPermissionsProvider_Expecter) DeletePermission(ctx interface{}, itemID interface{}, permissionID interface{}) *DriveItemPermissionsProvider_DeletePermission_Call {
return &DriveItemPermissionsProvider_DeletePermission_Call{Call: _e.mock.On("DeletePermission", ctx, itemID, permissionID)}
}
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) {
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(err error) *DriveItemPermissionsProvider_DeletePermission_Call {
_c.Call.Return(err)
return _c
}
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 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 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
}
// DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSpaceRootPermission'
type DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call struct {
*mock.Call
}
// DeleteSpaceRootPermission is a helper method to define mock.On call
// - ctx context.Context
// - driveID *providerv1beta1.ResourceId
// - permissionID string
func (_e *DriveItemPermissionsProvider_Expecter) DeleteSpaceRootPermission(ctx interface{}, driveID interface{}, permissionID interface{}) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call {
return &DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call{Call: _e.mock.On("DeleteSpaceRootPermission", ctx, driveID, permissionID)}
}
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) {
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(err error) *DriveItemPermissionsProvider_DeleteSpaceRootPermission_Call {
_c.Call.Return(err)
return _c
}
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 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")
}
var r0 libregraph.Permission
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)); ok {
return returnFunc(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 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
}
// DriveItemPermissionsProvider_Invite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Invite'
type DriveItemPermissionsProvider_Invite_Call struct {
*mock.Call
}
// Invite is a helper method to define mock.On call
// - ctx context.Context
// - resourceId *providerv1beta1.ResourceId
// - invite libregraph.DriveItemInvite
func (_e *DriveItemPermissionsProvider_Expecter) Invite(ctx interface{}, resourceId interface{}, invite interface{}) *DriveItemPermissionsProvider_Invite_Call {
return &DriveItemPermissionsProvider_Invite_Call{Call: _e.mock.On("Invite", ctx, resourceId, invite)}
}
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) {
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(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_Invite_Call {
_c.Call.Return(permission, err)
return _c
}
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 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")
}
var r0 libregraph.CollectionOfPermissionsWithAllowedValues
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)); ok {
return returnFunc(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 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
}
// DriveItemPermissionsProvider_ListPermissions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPermissions'
type DriveItemPermissionsProvider_ListPermissions_Call struct {
*mock.Call
}
// ListPermissions is a helper method to define mock.On call
// - ctx context.Context
// - itemID *providerv1beta1.ResourceId
// - queryOptions svc.ListPermissionsQueryOptions
func (_e *DriveItemPermissionsProvider_Expecter) ListPermissions(ctx interface{}, itemID interface{}, queryOptions interface{}) *DriveItemPermissionsProvider_ListPermissions_Call {
return &DriveItemPermissionsProvider_ListPermissions_Call{Call: _e.mock.On("ListPermissions", ctx, itemID, queryOptions)}
}
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) {
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(collectionOfPermissionsWithAllowedValues libregraph.CollectionOfPermissionsWithAllowedValues, err error) *DriveItemPermissionsProvider_ListPermissions_Call {
_c.Call.Return(collectionOfPermissionsWithAllowedValues, err)
return _c
}
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 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")
}
var r0 libregraph.CollectionOfPermissionsWithAllowedValues
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, svc.ListPermissionsQueryOptions) (libregraph.CollectionOfPermissionsWithAllowedValues, error)); ok {
return returnFunc(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 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
}
// DriveItemPermissionsProvider_ListSpaceRootPermissions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSpaceRootPermissions'
type DriveItemPermissionsProvider_ListSpaceRootPermissions_Call struct {
*mock.Call
}
// ListSpaceRootPermissions is a helper method to define mock.On call
// - ctx context.Context
// - driveID *providerv1beta1.ResourceId
// - queryOptions svc.ListPermissionsQueryOptions
func (_e *DriveItemPermissionsProvider_Expecter) ListSpaceRootPermissions(ctx interface{}, driveID interface{}, queryOptions interface{}) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call {
return &DriveItemPermissionsProvider_ListSpaceRootPermissions_Call{Call: _e.mock.On("ListSpaceRootPermissions", ctx, driveID, queryOptions)}
}
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) {
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(collectionOfPermissionsWithAllowedValues libregraph.CollectionOfPermissionsWithAllowedValues, err error) *DriveItemPermissionsProvider_ListSpaceRootPermissions_Call {
_c.Call.Return(collectionOfPermissionsWithAllowedValues, err)
return _c
}
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 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")
}
var r0 libregraph.Permission
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)); ok {
return returnFunc(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 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
}
// DriveItemPermissionsProvider_SetPublicLinkPassword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPublicLinkPassword'
type DriveItemPermissionsProvider_SetPublicLinkPassword_Call struct {
*mock.Call
}
// SetPublicLinkPassword is a helper method to define mock.On call
// - ctx context.Context
// - driveItemID *providerv1beta1.ResourceId
// - permissionID string
// - password string
func (_e *DriveItemPermissionsProvider_Expecter) SetPublicLinkPassword(ctx interface{}, driveItemID interface{}, permissionID interface{}, password interface{}) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call {
return &DriveItemPermissionsProvider_SetPublicLinkPassword_Call{Call: _e.mock.On("SetPublicLinkPassword", ctx, driveItemID, permissionID, password)}
}
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) {
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(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_SetPublicLinkPassword_Call {
_c.Call.Return(permission, err)
return _c
}
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 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")
}
var r0 libregraph.Permission
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string, string) (libregraph.Permission, error)); ok {
return returnFunc(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 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
}
// DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPublicLinkPasswordOnSpaceRoot'
type DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call struct {
*mock.Call
}
// SetPublicLinkPasswordOnSpaceRoot is a helper method to define mock.On call
// - ctx context.Context
// - driveID *providerv1beta1.ResourceId
// - permissionID string
// - password string
func (_e *DriveItemPermissionsProvider_Expecter) SetPublicLinkPasswordOnSpaceRoot(ctx interface{}, driveID interface{}, permissionID interface{}, password interface{}) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call {
return &DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call{Call: _e.mock.On("SetPublicLinkPasswordOnSpaceRoot", ctx, driveID, permissionID, password)}
}
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) {
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(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_SetPublicLinkPasswordOnSpaceRoot_Call {
_c.Call.Return(permission, err)
return _c
}
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 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")
}
var r0 libregraph.Permission
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, libregraph.DriveItemInvite) (libregraph.Permission, error)); ok {
return returnFunc(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 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
}
// DriveItemPermissionsProvider_SpaceRootInvite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SpaceRootInvite'
type DriveItemPermissionsProvider_SpaceRootInvite_Call struct {
*mock.Call
}
// SpaceRootInvite is a helper method to define mock.On call
// - ctx context.Context
// - driveID *providerv1beta1.ResourceId
// - invite libregraph.DriveItemInvite
func (_e *DriveItemPermissionsProvider_Expecter) SpaceRootInvite(ctx interface{}, driveID interface{}, invite interface{}) *DriveItemPermissionsProvider_SpaceRootInvite_Call {
return &DriveItemPermissionsProvider_SpaceRootInvite_Call{Call: _e.mock.On("SpaceRootInvite", ctx, driveID, invite)}
}
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) {
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(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_SpaceRootInvite_Call {
_c.Call.Return(permission, err)
return _c
}
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 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")
}
var r0 libregraph.Permission
var r1 error
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 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 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
}
// DriveItemPermissionsProvider_UpdatePermission_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePermission'
type DriveItemPermissionsProvider_UpdatePermission_Call struct {
*mock.Call
}
// UpdatePermission is a helper method to define mock.On call
// - ctx context.Context
// - itemID *providerv1beta1.ResourceId
// - permissionID string
// - newPermission libregraph.Permission
func (_e *DriveItemPermissionsProvider_Expecter) UpdatePermission(ctx interface{}, itemID interface{}, permissionID interface{}, newPermission interface{}) *DriveItemPermissionsProvider_UpdatePermission_Call {
return &DriveItemPermissionsProvider_UpdatePermission_Call{Call: _e.mock.On("UpdatePermission", ctx, itemID, permissionID, newPermission)}
}
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) {
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(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_UpdatePermission_Call {
_c.Call.Return(permission, err)
return _c
}
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 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")
}
var r0 libregraph.Permission
var r1 error
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 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 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
}
// DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSpaceRootPermission'
type DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call struct {
*mock.Call
}
// UpdateSpaceRootPermission is a helper method to define mock.On call
// - ctx context.Context
// - driveID *providerv1beta1.ResourceId
// - permissionID string
// - newPermission libregraph.Permission
func (_e *DriveItemPermissionsProvider_Expecter) UpdateSpaceRootPermission(ctx interface{}, driveID interface{}, permissionID interface{}, newPermission interface{}) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call {
return &DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call{Call: _e.mock.On("UpdateSpaceRootPermission", ctx, driveID, permissionID, newPermission)}
}
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) {
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(permission libregraph.Permission, err error) *DriveItemPermissionsProvider_UpdateSpaceRootPermission_Call {
_c.Call.Return(permission, err)
return _c
}
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
}
@@ -0,0 +1,457 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"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/qsfera/server/services/graph/pkg/service/v0"
mock "github.com/stretchr/testify/mock"
)
// 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
}
type DrivesDriveItemProvider_Expecter struct {
mock *mock.Mock
}
func (_m *DrivesDriveItemProvider) EXPECT() *DrivesDriveItemProvider_Expecter {
return &DrivesDriveItemProvider_Expecter{mock: &_m.Mock}
}
// 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")
}
var r0 *collaborationv1beta1.ReceivedShare
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) (*collaborationv1beta1.ReceivedShare, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, *collaborationv1beta1.ShareId) error); ok {
r1 = returnFunc(ctx, shareID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DrivesDriveItemProvider_GetShare_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetShare'
type DrivesDriveItemProvider_GetShare_Call struct {
*mock.Call
}
// GetShare is a helper method to define mock.On call
// - ctx context.Context
// - shareID *collaborationv1beta1.ShareId
func (_e *DrivesDriveItemProvider_Expecter) GetShare(ctx interface{}, shareID interface{}) *DrivesDriveItemProvider_GetShare_Call {
return &DrivesDriveItemProvider_GetShare_Call{Call: _e.mock.On("GetShare", ctx, shareID)}
}
func (_c *DrivesDriveItemProvider_GetShare_Call) Run(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId)) *DrivesDriveItemProvider_GetShare_Call {
_c.Call.Run(func(args mock.Arguments) {
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(receivedShare *collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_GetShare_Call {
_c.Call.Return(receivedShare, err)
return _c
}
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 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")
}
var r0 []*collaborationv1beta1.ReceivedShare
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, []*collaborationv1beta1.Filter) ([]*collaborationv1beta1.ReceivedShare, error)); ok {
return returnFunc(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 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
}
// DrivesDriveItemProvider_GetSharesForResource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSharesForResource'
type DrivesDriveItemProvider_GetSharesForResource_Call struct {
*mock.Call
}
// GetSharesForResource is a helper method to define mock.On call
// - ctx context.Context
// - resourceID *providerv1beta1.ResourceId
// - filters []*collaborationv1beta1.Filter
func (_e *DrivesDriveItemProvider_Expecter) GetSharesForResource(ctx interface{}, resourceID interface{}, filters interface{}) *DrivesDriveItemProvider_GetSharesForResource_Call {
return &DrivesDriveItemProvider_GetSharesForResource_Call{Call: _e.mock.On("GetSharesForResource", ctx, resourceID, filters)}
}
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) {
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(receivedShares []*collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_GetSharesForResource_Call {
_c.Call.Return(receivedShares, err)
return _c
}
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 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")
}
var r0 []*ocmv1beta1.ReceivedShare
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) ([]*ocmv1beta1.ReceivedShare, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId) error); ok {
r1 = returnFunc(ctx, resourceID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DrivesDriveItemProvider_MountOCMShare_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MountOCMShare'
type DrivesDriveItemProvider_MountOCMShare_Call struct {
*mock.Call
}
// MountOCMShare is a helper method to define mock.On call
// - ctx context.Context
// - resourceID *providerv1beta1.ResourceId
func (_e *DrivesDriveItemProvider_Expecter) MountOCMShare(ctx interface{}, resourceID interface{}) *DrivesDriveItemProvider_MountOCMShare_Call {
return &DrivesDriveItemProvider_MountOCMShare_Call{Call: _e.mock.On("MountOCMShare", ctx, resourceID)}
}
func (_c *DrivesDriveItemProvider_MountOCMShare_Call) Run(run func(ctx context.Context, resourceID *providerv1beta1.ResourceId)) *DrivesDriveItemProvider_MountOCMShare_Call {
_c.Call.Run(func(args mock.Arguments) {
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(receivedShares []*ocmv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_MountOCMShare_Call {
_c.Call.Return(receivedShares, err)
return _c
}
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 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")
}
var r0 []*collaborationv1beta1.ReceivedShare
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId, string) ([]*collaborationv1beta1.ReceivedShare, error)); ok {
return returnFunc(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 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
}
// DrivesDriveItemProvider_MountShare_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MountShare'
type DrivesDriveItemProvider_MountShare_Call struct {
*mock.Call
}
// MountShare is a helper method to define mock.On call
// - ctx context.Context
// - resourceID *providerv1beta1.ResourceId
// - name string
func (_e *DrivesDriveItemProvider_Expecter) MountShare(ctx interface{}, resourceID interface{}, name interface{}) *DrivesDriveItemProvider_MountShare_Call {
return &DrivesDriveItemProvider_MountShare_Call{Call: _e.mock.On("MountShare", ctx, resourceID, name)}
}
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) {
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(receivedShares []*collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_MountShare_Call {
_c.Call.Return(receivedShares, err)
return _c
}
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 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 returnFunc, ok := ret.Get(0).(func(context.Context, *collaborationv1beta1.ShareId) error); ok {
r0 = returnFunc(ctx, shareID)
} else {
r0 = ret.Error(0)
}
return r0
}
// DrivesDriveItemProvider_UnmountShare_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnmountShare'
type DrivesDriveItemProvider_UnmountShare_Call struct {
*mock.Call
}
// UnmountShare is a helper method to define mock.On call
// - ctx context.Context
// - shareID *collaborationv1beta1.ShareId
func (_e *DrivesDriveItemProvider_Expecter) UnmountShare(ctx interface{}, shareID interface{}) *DrivesDriveItemProvider_UnmountShare_Call {
return &DrivesDriveItemProvider_UnmountShare_Call{Call: _e.mock.On("UnmountShare", ctx, shareID)}
}
func (_c *DrivesDriveItemProvider_UnmountShare_Call) Run(run func(ctx context.Context, shareID *collaborationv1beta1.ShareId)) *DrivesDriveItemProvider_UnmountShare_Call {
_c.Call.Run(func(args mock.Arguments) {
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(err error) *DrivesDriveItemProvider_UnmountShare_Call {
_c.Call.Return(err)
return _c
}
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 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")
}
var r0 []*collaborationv1beta1.ReceivedShare
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, []*collaborationv1beta1.ReceivedShare, svc.UpdateShareClosure) ([]*collaborationv1beta1.ReceivedShare, error)); ok {
return returnFunc(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 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
}
// DrivesDriveItemProvider_UpdateShares_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateShares'
type DrivesDriveItemProvider_UpdateShares_Call struct {
*mock.Call
}
// UpdateShares is a helper method to define mock.On call
// - ctx context.Context
// - shares []*collaborationv1beta1.ReceivedShare
// - updater svc.UpdateShareClosure
func (_e *DrivesDriveItemProvider_Expecter) UpdateShares(ctx interface{}, shares interface{}, updater interface{}) *DrivesDriveItemProvider_UpdateShares_Call {
return &DrivesDriveItemProvider_UpdateShares_Call{Call: _e.mock.On("UpdateShares", ctx, shares, updater)}
}
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) {
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(receivedShares []*collaborationv1beta1.ReceivedShare, err error) *DrivesDriveItemProvider_UpdateShares_Call {
_c.Call.Return(receivedShares, err)
return _c
}
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
}
@@ -0,0 +1,108 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"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
}
type Selectable_Expecter[T any] struct {
mock *mock.Mock
}
func (_m *Selectable[T]) EXPECT() *Selectable_Expecter[T] {
return &Selectable_Expecter[T]{mock: &_m.Mock}
}
// 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()
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for Next")
}
var r0 T
var r1 error
if returnFunc, ok := ret.Get(0).(func(...pool.Option) (T, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(...pool.Option) error); ok {
r1 = returnFunc(opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Selectable_Next_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Next'
type Selectable_Next_Call[T any] struct {
*mock.Call
}
// Next is a helper method to define mock.On call
// - opts ...pool.Option
func (_e *Selectable_Expecter[T]) Next(opts ...interface{}) *Selectable_Next_Call[T] {
return &Selectable_Next_Call[T]{Call: _e.mock.On("Next",
append([]interface{}{}, opts...)...)}
}
func (_c *Selectable_Next_Call[T]) Run(run func(opts ...pool.Option)) *Selectable_Next_Call[T] {
_c.Call.Run(func(args mock.Arguments) {
var arg0 []pool.Option
var variadicArgs []pool.Option
if len(args) > 0 {
variadicArgs = args[0].([]pool.Option)
}
arg0 = variadicArgs
run(
arg0...,
)
})
return _c
}
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(opts ...pool.Option) (T, error)) *Selectable_Next_Call[T] {
_c.Call.Return(run)
return _c
}
+100
View File
@@ -0,0 +1,100 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"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
}
type HTTPClient_Expecter struct {
mock *mock.Mock
}
func (_m *HTTPClient) EXPECT() *HTTPClient_Expecter {
return &HTTPClient_Expecter{mock: &_m.Mock}
}
// 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")
}
var r0 *http.Response
var r1 error
if returnFunc, ok := ret.Get(0).(func(*http.Request) (*http.Response, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(*http.Request) error); ok {
r1 = returnFunc(req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// HTTPClient_Do_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Do'
type HTTPClient_Do_Call struct {
*mock.Call
}
// Do is a helper method to define mock.On call
// - req *http.Request
func (_e *HTTPClient_Expecter) Do(req interface{}) *HTTPClient_Do_Call {
return &HTTPClient_Do_Call{Call: _e.mock.On("Do", req)}
}
func (_c *HTTPClient_Do_Call) Run(run func(req *http.Request)) *HTTPClient_Do_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 *http.Request
if args[0] != nil {
arg0 = args[0].(*http.Request)
}
run(
arg0,
)
})
return _c
}
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(req *http.Request) (*http.Response, error)) *HTTPClient_Do_Call {
_c.Call.Return(run)
return _c
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,349 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"time"
"github.com/nats-io/nats.go/jetstream"
mock "github.com/stretchr/testify/mock"
)
// NewKeyValueEntry creates a new instance of KeyValueEntry. 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 NewKeyValueEntry(t interface {
mock.TestingT
Cleanup(func())
}) *KeyValueEntry {
mock := &KeyValueEntry{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// KeyValueEntry is an autogenerated mock type for the KeyValueEntry type
type KeyValueEntry struct {
mock.Mock
}
type KeyValueEntry_Expecter struct {
mock *mock.Mock
}
func (_m *KeyValueEntry) EXPECT() *KeyValueEntry_Expecter {
return &KeyValueEntry_Expecter{mock: &_m.Mock}
}
// Bucket provides a mock function for the type KeyValueEntry
func (_mock *KeyValueEntry) Bucket() string {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Bucket")
}
var r0 string
if returnFunc, ok := ret.Get(0).(func() string); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// KeyValueEntry_Bucket_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bucket'
type KeyValueEntry_Bucket_Call struct {
*mock.Call
}
// Bucket is a helper method to define mock.On call
func (_e *KeyValueEntry_Expecter) Bucket() *KeyValueEntry_Bucket_Call {
return &KeyValueEntry_Bucket_Call{Call: _e.mock.On("Bucket")}
}
func (_c *KeyValueEntry_Bucket_Call) Run(run func()) *KeyValueEntry_Bucket_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *KeyValueEntry_Bucket_Call) Return(s string) *KeyValueEntry_Bucket_Call {
_c.Call.Return(s)
return _c
}
func (_c *KeyValueEntry_Bucket_Call) RunAndReturn(run func() string) *KeyValueEntry_Bucket_Call {
_c.Call.Return(run)
return _c
}
// Created provides a mock function for the type KeyValueEntry
func (_mock *KeyValueEntry) Created() time.Time {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Created")
}
var r0 time.Time
if returnFunc, ok := ret.Get(0).(func() time.Time); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(time.Time)
}
return r0
}
// KeyValueEntry_Created_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Created'
type KeyValueEntry_Created_Call struct {
*mock.Call
}
// Created is a helper method to define mock.On call
func (_e *KeyValueEntry_Expecter) Created() *KeyValueEntry_Created_Call {
return &KeyValueEntry_Created_Call{Call: _e.mock.On("Created")}
}
func (_c *KeyValueEntry_Created_Call) Run(run func()) *KeyValueEntry_Created_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *KeyValueEntry_Created_Call) Return(time1 time.Time) *KeyValueEntry_Created_Call {
_c.Call.Return(time1)
return _c
}
func (_c *KeyValueEntry_Created_Call) RunAndReturn(run func() time.Time) *KeyValueEntry_Created_Call {
_c.Call.Return(run)
return _c
}
// Delta provides a mock function for the type KeyValueEntry
func (_mock *KeyValueEntry) Delta() uint64 {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Delta")
}
var r0 uint64
if returnFunc, ok := ret.Get(0).(func() uint64); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(uint64)
}
return r0
}
// KeyValueEntry_Delta_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delta'
type KeyValueEntry_Delta_Call struct {
*mock.Call
}
// Delta is a helper method to define mock.On call
func (_e *KeyValueEntry_Expecter) Delta() *KeyValueEntry_Delta_Call {
return &KeyValueEntry_Delta_Call{Call: _e.mock.On("Delta")}
}
func (_c *KeyValueEntry_Delta_Call) Run(run func()) *KeyValueEntry_Delta_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *KeyValueEntry_Delta_Call) Return(v uint64) *KeyValueEntry_Delta_Call {
_c.Call.Return(v)
return _c
}
func (_c *KeyValueEntry_Delta_Call) RunAndReturn(run func() uint64) *KeyValueEntry_Delta_Call {
_c.Call.Return(run)
return _c
}
// Key provides a mock function for the type KeyValueEntry
func (_mock *KeyValueEntry) Key() string {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Key")
}
var r0 string
if returnFunc, ok := ret.Get(0).(func() string); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// KeyValueEntry_Key_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Key'
type KeyValueEntry_Key_Call struct {
*mock.Call
}
// Key is a helper method to define mock.On call
func (_e *KeyValueEntry_Expecter) Key() *KeyValueEntry_Key_Call {
return &KeyValueEntry_Key_Call{Call: _e.mock.On("Key")}
}
func (_c *KeyValueEntry_Key_Call) Run(run func()) *KeyValueEntry_Key_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *KeyValueEntry_Key_Call) Return(s string) *KeyValueEntry_Key_Call {
_c.Call.Return(s)
return _c
}
func (_c *KeyValueEntry_Key_Call) RunAndReturn(run func() string) *KeyValueEntry_Key_Call {
_c.Call.Return(run)
return _c
}
// Operation provides a mock function for the type KeyValueEntry
func (_mock *KeyValueEntry) Operation() jetstream.KeyValueOp {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Operation")
}
var r0 jetstream.KeyValueOp
if returnFunc, ok := ret.Get(0).(func() jetstream.KeyValueOp); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(jetstream.KeyValueOp)
}
return r0
}
// KeyValueEntry_Operation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Operation'
type KeyValueEntry_Operation_Call struct {
*mock.Call
}
// Operation is a helper method to define mock.On call
func (_e *KeyValueEntry_Expecter) Operation() *KeyValueEntry_Operation_Call {
return &KeyValueEntry_Operation_Call{Call: _e.mock.On("Operation")}
}
func (_c *KeyValueEntry_Operation_Call) Run(run func()) *KeyValueEntry_Operation_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *KeyValueEntry_Operation_Call) Return(keyValueOp jetstream.KeyValueOp) *KeyValueEntry_Operation_Call {
_c.Call.Return(keyValueOp)
return _c
}
func (_c *KeyValueEntry_Operation_Call) RunAndReturn(run func() jetstream.KeyValueOp) *KeyValueEntry_Operation_Call {
_c.Call.Return(run)
return _c
}
// Revision provides a mock function for the type KeyValueEntry
func (_mock *KeyValueEntry) Revision() uint64 {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Revision")
}
var r0 uint64
if returnFunc, ok := ret.Get(0).(func() uint64); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(uint64)
}
return r0
}
// KeyValueEntry_Revision_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Revision'
type KeyValueEntry_Revision_Call struct {
*mock.Call
}
// Revision is a helper method to define mock.On call
func (_e *KeyValueEntry_Expecter) Revision() *KeyValueEntry_Revision_Call {
return &KeyValueEntry_Revision_Call{Call: _e.mock.On("Revision")}
}
func (_c *KeyValueEntry_Revision_Call) Run(run func()) *KeyValueEntry_Revision_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *KeyValueEntry_Revision_Call) Return(v uint64) *KeyValueEntry_Revision_Call {
_c.Call.Return(v)
return _c
}
func (_c *KeyValueEntry_Revision_Call) RunAndReturn(run func() uint64) *KeyValueEntry_Revision_Call {
_c.Call.Return(run)
return _c
}
// Value provides a mock function for the type KeyValueEntry
func (_mock *KeyValueEntry) Value() []byte {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Value")
}
var r0 []byte
if returnFunc, ok := ret.Get(0).(func() []byte); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
return r0
}
// KeyValueEntry_Value_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Value'
type KeyValueEntry_Value_Call struct {
*mock.Call
}
// Value is a helper method to define mock.On call
func (_e *KeyValueEntry_Expecter) Value() *KeyValueEntry_Value_Call {
return &KeyValueEntry_Value_Call{Call: _e.mock.On("Value")}
}
func (_c *KeyValueEntry_Value_Call) Run(run func()) *KeyValueEntry_Value_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *KeyValueEntry_Value_Call) Return(bytes []byte) *KeyValueEntry_Value_Call {
_c.Call.Return(bytes)
return _c
}
func (_c *KeyValueEntry_Value_Call) RunAndReturn(run func() []byte) *KeyValueEntry_Value_Call {
_c.Call.Return(run)
return _c
}
+289
View File
@@ -0,0 +1,289 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/qsfera/server/protogen/gen/qsfera/services/settings/v0"
mock "github.com/stretchr/testify/mock"
"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
}
type Permissions_Expecter struct {
mock *mock.Mock
}
func (_m *Permissions) EXPECT() *Permissions_Expecter {
return &Permissions_Expecter{mock: &_m.Mock}
}
// 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)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for GetPermissionByID")
}
var r0 *v0.GetPermissionByIDResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) (*v0.GetPermissionByIDResponse, error)); ok {
return returnFunc(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 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
}
// Permissions_GetPermissionByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPermissionByID'
type Permissions_GetPermissionByID_Call struct {
*mock.Call
}
// GetPermissionByID is a helper method to define mock.On call
// - ctx context.Context
// - request *v0.GetPermissionByIDRequest
// - opts ...client.CallOption
func (_e *Permissions_Expecter) GetPermissionByID(ctx interface{}, request interface{}, opts ...interface{}) *Permissions_GetPermissionByID_Call {
return &Permissions_GetPermissionByID_Call{Call: _e.mock.On("GetPermissionByID",
append([]interface{}{ctx, request}, opts...)...)}
}
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) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
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(getPermissionByIDResponse *v0.GetPermissionByIDResponse, err error) *Permissions_GetPermissionByID_Call {
_c.Call.Return(getPermissionByIDResponse, err)
return _c
}
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 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)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for ListPermissions")
}
var r0 *v0.ListPermissionsResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) (*v0.ListPermissionsResponse, error)); ok {
return returnFunc(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 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
}
// Permissions_ListPermissions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPermissions'
type Permissions_ListPermissions_Call struct {
*mock.Call
}
// ListPermissions is a helper method to define mock.On call
// - ctx context.Context
// - req *v0.ListPermissionsRequest
// - opts ...client.CallOption
func (_e *Permissions_Expecter) ListPermissions(ctx interface{}, req interface{}, opts ...interface{}) *Permissions_ListPermissions_Call {
return &Permissions_ListPermissions_Call{Call: _e.mock.On("ListPermissions",
append([]interface{}{ctx, req}, opts...)...)}
}
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) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
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(listPermissionsResponse *v0.ListPermissionsResponse, err error) *Permissions_ListPermissions_Call {
_c.Call.Return(listPermissionsResponse, err)
return _c
}
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 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)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for ListPermissionsByResource")
}
var r0 *v0.ListPermissionsByResourceResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)); ok {
return returnFunc(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 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
}
// Permissions_ListPermissionsByResource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPermissionsByResource'
type Permissions_ListPermissionsByResource_Call struct {
*mock.Call
}
// ListPermissionsByResource is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.ListPermissionsByResourceRequest
// - opts ...client.CallOption
func (_e *Permissions_Expecter) ListPermissionsByResource(ctx interface{}, in interface{}, opts ...interface{}) *Permissions_ListPermissionsByResource_Call {
return &Permissions_ListPermissionsByResource_Call{Call: _e.mock.On("ListPermissionsByResource",
append([]interface{}{ctx, in}, opts...)...)}
}
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) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
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(listPermissionsByResourceResponse *v0.ListPermissionsByResourceResponse, err error) *Permissions_ListPermissionsByResource_Call {
_c.Call.Return(listPermissionsByResourceResponse, err)
return _c
}
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
}
+109
View File
@@ -0,0 +1,109 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
mock "github.com/stretchr/testify/mock"
"go-micro.dev/v4/events"
)
// 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 {
mock.TestingT
Cleanup(func())
}) *Publisher {
mock := &Publisher{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
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
}
+456
View File
@@ -0,0 +1,456 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/qsfera/server/protogen/gen/qsfera/services/settings/v0"
mock "github.com/stretchr/testify/mock"
"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
}
type RoleService_Expecter struct {
mock *mock.Mock
}
func (_m *RoleService) EXPECT() *RoleService_Expecter {
return &RoleService_Expecter{mock: &_m.Mock}
}
// 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)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for AssignRoleToUser")
}
var r0 *v0.AssignRoleToUserResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) (*v0.AssignRoleToUserResponse, error)); ok {
return returnFunc(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 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
}
// RoleService_AssignRoleToUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AssignRoleToUser'
type RoleService_AssignRoleToUser_Call struct {
*mock.Call
}
// AssignRoleToUser is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.AssignRoleToUserRequest
// - opts ...client.CallOption
func (_e *RoleService_Expecter) AssignRoleToUser(ctx interface{}, in interface{}, opts ...interface{}) *RoleService_AssignRoleToUser_Call {
return &RoleService_AssignRoleToUser_Call{Call: _e.mock.On("AssignRoleToUser",
append([]interface{}{ctx, in}, opts...)...)}
}
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) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
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(assignRoleToUserResponse *v0.AssignRoleToUserResponse, err error) *RoleService_AssignRoleToUser_Call {
_c.Call.Return(assignRoleToUserResponse, err)
return _c
}
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 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)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for ListRoleAssignments")
}
var r0 *v0.ListRoleAssignmentsResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok {
return returnFunc(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 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
}
// RoleService_ListRoleAssignments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRoleAssignments'
type RoleService_ListRoleAssignments_Call struct {
*mock.Call
}
// ListRoleAssignments is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.ListRoleAssignmentsRequest
// - opts ...client.CallOption
func (_e *RoleService_Expecter) ListRoleAssignments(ctx interface{}, in interface{}, opts ...interface{}) *RoleService_ListRoleAssignments_Call {
return &RoleService_ListRoleAssignments_Call{Call: _e.mock.On("ListRoleAssignments",
append([]interface{}{ctx, in}, opts...)...)}
}
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) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
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(listRoleAssignmentsResponse *v0.ListRoleAssignmentsResponse, err error) *RoleService_ListRoleAssignments_Call {
_c.Call.Return(listRoleAssignmentsResponse, err)
return _c
}
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 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)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for ListRoleAssignmentsFiltered")
}
var r0 *v0.ListRoleAssignmentsResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok {
return returnFunc(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 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
}
// RoleService_ListRoleAssignmentsFiltered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRoleAssignmentsFiltered'
type RoleService_ListRoleAssignmentsFiltered_Call struct {
*mock.Call
}
// ListRoleAssignmentsFiltered is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.ListRoleAssignmentsFilteredRequest
// - opts ...client.CallOption
func (_e *RoleService_Expecter) ListRoleAssignmentsFiltered(ctx interface{}, in interface{}, opts ...interface{}) *RoleService_ListRoleAssignmentsFiltered_Call {
return &RoleService_ListRoleAssignmentsFiltered_Call{Call: _e.mock.On("ListRoleAssignmentsFiltered",
append([]interface{}{ctx, in}, opts...)...)}
}
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) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
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(listRoleAssignmentsResponse *v0.ListRoleAssignmentsResponse, err error) *RoleService_ListRoleAssignmentsFiltered_Call {
_c.Call.Return(listRoleAssignmentsResponse, err)
return _c
}
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 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)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for ListRoles")
}
var r0 *v0.ListBundlesResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) (*v0.ListBundlesResponse, error)); ok {
return returnFunc(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 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
}
// RoleService_ListRoles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRoles'
type RoleService_ListRoles_Call struct {
*mock.Call
}
// ListRoles is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.ListBundlesRequest
// - opts ...client.CallOption
func (_e *RoleService_Expecter) ListRoles(ctx interface{}, in interface{}, opts ...interface{}) *RoleService_ListRoles_Call {
return &RoleService_ListRoles_Call{Call: _e.mock.On("ListRoles",
append([]interface{}{ctx, in}, 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) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
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(listBundlesResponse *v0.ListBundlesResponse, err error) *RoleService_ListRoles_Call {
_c.Call.Return(listBundlesResponse, err)
return _c
}
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 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)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for RemoveRoleFromUser")
}
var r0 *emptypb.Empty
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) (*emptypb.Empty, error)); ok {
return returnFunc(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 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
}
// RoleService_RemoveRoleFromUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRoleFromUser'
type RoleService_RemoveRoleFromUser_Call struct {
*mock.Call
}
// RemoveRoleFromUser is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.RemoveRoleFromUserRequest
// - opts ...client.CallOption
func (_e *RoleService_Expecter) RemoveRoleFromUser(ctx interface{}, in interface{}, opts ...interface{}) *RoleService_RemoveRoleFromUser_Call {
return &RoleService_RemoveRoleFromUser_Call{Call: _e.mock.On("RemoveRoleFromUser",
append([]interface{}{ctx, in}, opts...)...)}
}
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) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
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(empty *emptypb.Empty, err error) *RoleService_RemoveRoleFromUser_Call {
_c.Call.Return(empty, err)
return _c
}
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
}
+855
View File
@@ -0,0 +1,855 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"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"
)
// 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
}
type Storage_Expecter struct {
mock *mock.Mock
}
func (_m *Storage) EXPECT() *Storage_Expecter {
return &Storage_Expecter{mock: &_m.Mock}
}
// 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 returnFunc, ok := ret.Get(0).(func() string); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// Storage_Backend_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Backend'
type Storage_Backend_Call struct {
*mock.Call
}
// Backend is a helper method to define mock.On call
func (_e *Storage_Expecter) Backend() *Storage_Backend_Call {
return &Storage_Backend_Call{Call: _e.mock.On("Backend")}
}
func (_c *Storage_Backend_Call) Run(run func()) *Storage_Backend_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *Storage_Backend_Call) Return(s string) *Storage_Backend_Call {
_c.Call.Return(s)
return _c
}
func (_c *Storage_Backend_Call) RunAndReturn(run func() string) *Storage_Backend_Call {
_c.Call.Return(run)
return _c
}
// 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 returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
r0 = returnFunc(ctx, oldname, newname)
} else {
r0 = ret.Error(0)
}
return r0
}
// Storage_CreateSymlink_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSymlink'
type Storage_CreateSymlink_Call struct {
*mock.Call
}
// CreateSymlink is a helper method to define mock.On call
// - ctx context.Context
// - oldname string
// - newname string
func (_e *Storage_Expecter) CreateSymlink(ctx interface{}, oldname interface{}, newname interface{}) *Storage_CreateSymlink_Call {
return &Storage_CreateSymlink_Call{Call: _e.mock.On("CreateSymlink", ctx, oldname, newname)}
}
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) {
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(err error) *Storage_CreateSymlink_Call {
_c.Call.Return(err)
return _c
}
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 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 returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = returnFunc(ctx, path)
} else {
r0 = ret.Error(0)
}
return r0
}
// Storage_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
type Storage_Delete_Call struct {
*mock.Call
}
// Delete is a helper method to define mock.On call
// - ctx context.Context
// - path string
func (_e *Storage_Expecter) Delete(ctx interface{}, path interface{}) *Storage_Delete_Call {
return &Storage_Delete_Call{Call: _e.mock.On("Delete", ctx, path)}
}
func (_c *Storage_Delete_Call) Run(run func(ctx context.Context, path string)) *Storage_Delete_Call {
_c.Call.Run(func(args mock.Arguments) {
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(err error) *Storage_Delete_Call {
_c.Call.Return(err)
return _c
}
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 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")
}
var r0 *metadata.DownloadResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, metadata.DownloadRequest) (*metadata.DownloadResponse, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, metadata.DownloadRequest) error); ok {
r1 = returnFunc(ctx, req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_Download_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Download'
type Storage_Download_Call struct {
*mock.Call
}
// Download is a helper method to define mock.On call
// - ctx context.Context
// - req metadata.DownloadRequest
func (_e *Storage_Expecter) Download(ctx interface{}, req interface{}) *Storage_Download_Call {
return &Storage_Download_Call{Call: _e.mock.On("Download", ctx, req)}
}
func (_c *Storage_Download_Call) Run(run func(ctx context.Context, req metadata.DownloadRequest)) *Storage_Download_Call {
_c.Call.Run(func(args mock.Arguments) {
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(downloadResponse *metadata.DownloadResponse, err error) *Storage_Download_Call {
_c.Call.Return(downloadResponse, err)
return _c
}
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 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 returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = returnFunc(ctx, name)
} else {
r0 = ret.Error(0)
}
return r0
}
// Storage_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init'
type Storage_Init_Call struct {
*mock.Call
}
// Init is a helper method to define mock.On call
// - ctx context.Context
// - name string
func (_e *Storage_Expecter) Init(ctx interface{}, name interface{}) *Storage_Init_Call {
return &Storage_Init_Call{Call: _e.mock.On("Init", ctx, name)}
}
func (_c *Storage_Init_Call) Run(run func(ctx context.Context, name string)) *Storage_Init_Call {
_c.Call.Run(func(args mock.Arguments) {
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_Init_Call) Return(err error) *Storage_Init_Call {
_c.Call.Return(err)
return _c
}
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 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")
}
var r0 []*providerv1beta1.ResourceInfo
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*providerv1beta1.ResourceInfo, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_ListDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDir'
type Storage_ListDir_Call struct {
*mock.Call
}
// ListDir is a helper method to define mock.On call
// - ctx context.Context
// - path string
func (_e *Storage_Expecter) ListDir(ctx interface{}, path interface{}) *Storage_ListDir_Call {
return &Storage_ListDir_Call{Call: _e.mock.On("ListDir", ctx, path)}
}
func (_c *Storage_ListDir_Call) Run(run func(ctx context.Context, path string)) *Storage_ListDir_Call {
_c.Call.Run(func(args mock.Arguments) {
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(resourceInfos []*providerv1beta1.ResourceInfo, err error) *Storage_ListDir_Call {
_c.Call.Return(resourceInfos, err)
return _c
}
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 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 returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = returnFunc(ctx, name)
} else {
r0 = ret.Error(0)
}
return r0
}
// Storage_MakeDirIfNotExist_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MakeDirIfNotExist'
type Storage_MakeDirIfNotExist_Call struct {
*mock.Call
}
// MakeDirIfNotExist is a helper method to define mock.On call
// - ctx context.Context
// - name string
func (_e *Storage_Expecter) MakeDirIfNotExist(ctx interface{}, name interface{}) *Storage_MakeDirIfNotExist_Call {
return &Storage_MakeDirIfNotExist_Call{Call: _e.mock.On("MakeDirIfNotExist", ctx, name)}
}
func (_c *Storage_MakeDirIfNotExist_Call) Run(run func(ctx context.Context, name string)) *Storage_MakeDirIfNotExist_Call {
_c.Call.Run(func(args mock.Arguments) {
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(err error) *Storage_MakeDirIfNotExist_Call {
_c.Call.Return(err)
return _c
}
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 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")
}
var r0 []string
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]string, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_ReadDir_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadDir'
type Storage_ReadDir_Call struct {
*mock.Call
}
// ReadDir is a helper method to define mock.On call
// - ctx context.Context
// - path string
func (_e *Storage_Expecter) ReadDir(ctx interface{}, path interface{}) *Storage_ReadDir_Call {
return &Storage_ReadDir_Call{Call: _e.mock.On("ReadDir", ctx, path)}
}
func (_c *Storage_ReadDir_Call) Run(run func(ctx context.Context, path string)) *Storage_ReadDir_Call {
_c.Call.Run(func(args mock.Arguments) {
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(strings []string, err error) *Storage_ReadDir_Call {
_c.Call.Return(strings, err)
return _c
}
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 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")
}
var r0 string
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, name)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_ResolveSymlink_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResolveSymlink'
type Storage_ResolveSymlink_Call struct {
*mock.Call
}
// ResolveSymlink is a helper method to define mock.On call
// - ctx context.Context
// - name string
func (_e *Storage_Expecter) ResolveSymlink(ctx interface{}, name interface{}) *Storage_ResolveSymlink_Call {
return &Storage_ResolveSymlink_Call{Call: _e.mock.On("ResolveSymlink", ctx, name)}
}
func (_c *Storage_ResolveSymlink_Call) Run(run func(ctx context.Context, name string)) *Storage_ResolveSymlink_Call {
_c.Call.Run(func(args mock.Arguments) {
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(s string, err error) *Storage_ResolveSymlink_Call {
_c.Call.Return(s, err)
return _c
}
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 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")
}
var r0 []byte
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_SimpleDownload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SimpleDownload'
type Storage_SimpleDownload_Call struct {
*mock.Call
}
// SimpleDownload is a helper method to define mock.On call
// - ctx context.Context
// - path string
func (_e *Storage_Expecter) SimpleDownload(ctx interface{}, path interface{}) *Storage_SimpleDownload_Call {
return &Storage_SimpleDownload_Call{Call: _e.mock.On("SimpleDownload", ctx, path)}
}
func (_c *Storage_SimpleDownload_Call) Run(run func(ctx context.Context, path string)) *Storage_SimpleDownload_Call {
_c.Call.Run(func(args mock.Arguments) {
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(bytes []byte, err error) *Storage_SimpleDownload_Call {
_c.Call.Return(bytes, err)
return _c
}
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 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 returnFunc, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok {
r0 = returnFunc(ctx, uploadpath, content)
} else {
r0 = ret.Error(0)
}
return r0
}
// Storage_SimpleUpload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SimpleUpload'
type Storage_SimpleUpload_Call struct {
*mock.Call
}
// SimpleUpload is a helper method to define mock.On call
// - ctx context.Context
// - uploadpath string
// - content []byte
func (_e *Storage_Expecter) SimpleUpload(ctx interface{}, uploadpath interface{}, content interface{}) *Storage_SimpleUpload_Call {
return &Storage_SimpleUpload_Call{Call: _e.mock.On("SimpleUpload", ctx, uploadpath, content)}
}
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) {
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(err error) *Storage_SimpleUpload_Call {
_c.Call.Return(err)
return _c
}
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 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")
}
var r0 *providerv1beta1.ResourceInfo
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*providerv1beta1.ResourceInfo, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, path)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_Stat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stat'
type Storage_Stat_Call struct {
*mock.Call
}
// Stat is a helper method to define mock.On call
// - ctx context.Context
// - path string
func (_e *Storage_Expecter) Stat(ctx interface{}, path interface{}) *Storage_Stat_Call {
return &Storage_Stat_Call{Call: _e.mock.On("Stat", ctx, path)}
}
func (_c *Storage_Stat_Call) Run(run func(ctx context.Context, path string)) *Storage_Stat_Call {
_c.Call.Run(func(args mock.Arguments) {
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(resourceInfo *providerv1beta1.ResourceInfo, err error) *Storage_Stat_Call {
_c.Call.Return(resourceInfo, err)
return _c
}
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 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")
}
var r0 *metadata.UploadResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, metadata.UploadRequest) (*metadata.UploadResponse, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, metadata.UploadRequest) error); ok {
r1 = returnFunc(ctx, req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Storage_Upload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upload'
type Storage_Upload_Call struct {
*mock.Call
}
// Upload is a helper method to define mock.On call
// - ctx context.Context
// - req metadata.UploadRequest
func (_e *Storage_Expecter) Upload(ctx interface{}, req interface{}) *Storage_Upload_Call {
return &Storage_Upload_Call{Call: _e.mock.On("Upload", ctx, req)}
}
func (_c *Storage_Upload_Call) Run(run func(ctx context.Context, req metadata.UploadRequest)) *Storage_Upload_Call {
_c.Call.Run(func(args mock.Arguments) {
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(uploadResponse *metadata.UploadResponse, err error) *Storage_Upload_Call {
_c.Call.Return(uploadResponse, err)
return _c
}
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
}
@@ -0,0 +1,227 @@
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"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
}
type UsersUserProfilePhotoProvider_Expecter struct {
mock *mock.Mock
}
func (_m *UsersUserProfilePhotoProvider) EXPECT() *UsersUserProfilePhotoProvider_Expecter {
return &UsersUserProfilePhotoProvider_Expecter{mock: &_m.Mock}
}
// 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 returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = returnFunc(ctx, id)
} else {
r0 = ret.Error(0)
}
return r0
}
// UsersUserProfilePhotoProvider_DeletePhoto_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePhoto'
type UsersUserProfilePhotoProvider_DeletePhoto_Call struct {
*mock.Call
}
// DeletePhoto is a helper method to define mock.On call
// - ctx context.Context
// - id string
func (_e *UsersUserProfilePhotoProvider_Expecter) DeletePhoto(ctx interface{}, id interface{}) *UsersUserProfilePhotoProvider_DeletePhoto_Call {
return &UsersUserProfilePhotoProvider_DeletePhoto_Call{Call: _e.mock.On("DeletePhoto", ctx, id)}
}
func (_c *UsersUserProfilePhotoProvider_DeletePhoto_Call) Run(run func(ctx context.Context, id string)) *UsersUserProfilePhotoProvider_DeletePhoto_Call {
_c.Call.Run(func(args mock.Arguments) {
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(err error) *UsersUserProfilePhotoProvider_DeletePhoto_Call {
_c.Call.Return(err)
return _c
}
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 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")
}
var r0 []byte
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok {
return returnFunc(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 returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// UsersUserProfilePhotoProvider_GetPhoto_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPhoto'
type UsersUserProfilePhotoProvider_GetPhoto_Call struct {
*mock.Call
}
// GetPhoto is a helper method to define mock.On call
// - ctx context.Context
// - id string
func (_e *UsersUserProfilePhotoProvider_Expecter) GetPhoto(ctx interface{}, id interface{}) *UsersUserProfilePhotoProvider_GetPhoto_Call {
return &UsersUserProfilePhotoProvider_GetPhoto_Call{Call: _e.mock.On("GetPhoto", ctx, id)}
}
func (_c *UsersUserProfilePhotoProvider_GetPhoto_Call) Run(run func(ctx context.Context, id string)) *UsersUserProfilePhotoProvider_GetPhoto_Call {
_c.Call.Run(func(args mock.Arguments) {
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(bytes []byte, err error) *UsersUserProfilePhotoProvider_GetPhoto_Call {
_c.Call.Return(bytes, err)
return _c
}
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 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 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
}
// UsersUserProfilePhotoProvider_UpdatePhoto_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePhoto'
type UsersUserProfilePhotoProvider_UpdatePhoto_Call struct {
*mock.Call
}
// UpdatePhoto is a helper method to define mock.On call
// - ctx context.Context
// - id string
// - r io.Reader
func (_e *UsersUserProfilePhotoProvider_Expecter) UpdatePhoto(ctx interface{}, id interface{}, r interface{}) *UsersUserProfilePhotoProvider_UpdatePhoto_Call {
return &UsersUserProfilePhotoProvider_UpdatePhoto_Call{Call: _e.mock.On("UpdatePhoto", ctx, id, r)}
}
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) {
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(err error) *UsersUserProfilePhotoProvider_UpdatePhoto_Call {
_c.Call.Return(err)
return _c
}
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
}