mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-09-12 21:58:58 -04:00
Populates @microsoft.graph.downloadUrl on file driveItems when requested
via $select and implements GET .../items/{item-id}/content as a 302 to
the same URL: a by-id WebDAV URL signed with OC_URL_SIGNING_SECRET,
verified by the proxy, valid for 30 minutes. Folders answer 404 on
/content and never carry the annotation.
The annotation is available on the driveItem stat, the children and
root children listings and the share jail item endpoint.
225 lines
8.2 KiB
Go
225 lines
8.2 KiB
Go
// Code generated by mockery; DO NOT EDIT.
|
|
// github.com/vektra/mockery
|
|
// template: testify
|
|
|
|
package mocks
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"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
|
|
}
|
|
|
|
// SetDriveItemsDownloadURL provides a mock function for the type BaseGraphProvider
|
|
func (_mock *BaseGraphProvider) SetDriveItemsDownloadURL(r *http.Request, items []libregraph.DriveItem) {
|
|
_mock.Called(r, items)
|
|
return
|
|
}
|
|
|
|
// BaseGraphProvider_SetDriveItemsDownloadURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDriveItemsDownloadURL'
|
|
type BaseGraphProvider_SetDriveItemsDownloadURL_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// SetDriveItemsDownloadURL is a helper method to define mock.On call
|
|
// - r *http.Request
|
|
// - items []libregraph.DriveItem
|
|
func (_e *BaseGraphProvider_Expecter) SetDriveItemsDownloadURL(r interface{}, items interface{}) *BaseGraphProvider_SetDriveItemsDownloadURL_Call {
|
|
return &BaseGraphProvider_SetDriveItemsDownloadURL_Call{Call: _e.mock.On("SetDriveItemsDownloadURL", r, items)}
|
|
}
|
|
|
|
func (_c *BaseGraphProvider_SetDriveItemsDownloadURL_Call) Run(run func(r *http.Request, items []libregraph.DriveItem)) *BaseGraphProvider_SetDriveItemsDownloadURL_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 *http.Request
|
|
if args[0] != nil {
|
|
arg0 = args[0].(*http.Request)
|
|
}
|
|
var arg1 []libregraph.DriveItem
|
|
if args[1] != nil {
|
|
arg1 = args[1].([]libregraph.DriveItem)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *BaseGraphProvider_SetDriveItemsDownloadURL_Call) Return() *BaseGraphProvider_SetDriveItemsDownloadURL_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *BaseGraphProvider_SetDriveItemsDownloadURL_Call) RunAndReturn(run func(r *http.Request, items []libregraph.DriveItem)) *BaseGraphProvider_SetDriveItemsDownloadURL_Call {
|
|
_c.Run(run)
|
|
return _c
|
|
}
|