build: Modify mockery config to work with v3

Maintaining the positioning of the files from v2 to reduce cognitive
load.
Indentation of yaml files now matches `.editorconfig`.
All mock files regenerated.
Added empty `{}` following convention from `mockery init` etc.
Removed directory specification where it would already match.
This commit is contained in:
06kellyjac
2025-06-19 16:25:39 +01:00
parent 0630d4552a
commit 2a3a20693a
42 changed files with 5647 additions and 4010 deletions
+145 -97
View File
@@ -1,16 +1,31 @@
// Code generated by mockery. DO NOT EDIT.
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
context "context"
"context"
engine "github.com/opencloud-eu/opencloud/services/search/pkg/engine"
"github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0"
"github.com/opencloud-eu/opencloud/services/search/pkg/engine"
mock "github.com/stretchr/testify/mock"
v0 "github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/search/v0"
)
// NewEngine creates a new instance of Engine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewEngine(t interface {
mock.TestingT
Cleanup(func())
}) *Engine {
mock := &Engine{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Engine is an autogenerated mock type for the Engine type
type Engine struct {
mock.Mock
@@ -24,21 +39,20 @@ func (_m *Engine) EXPECT() *Engine_Expecter {
return &Engine_Expecter{mock: &_m.Mock}
}
// Delete provides a mock function with given fields: id
func (_m *Engine) Delete(id string) error {
ret := _m.Called(id)
// Delete provides a mock function for the type Engine
func (_mock *Engine) Delete(id string) error {
ret := _mock.Called(id)
if len(ret) == 0 {
panic("no return value specified for Delete")
}
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(id)
if returnFunc, ok := ret.Get(0).(func(string) error); ok {
r0 = returnFunc(id)
} else {
r0 = ret.Error(0)
}
return r0
}
@@ -55,24 +69,30 @@ func (_e *Engine_Expecter) Delete(id interface{}) *Engine_Delete_Call {
func (_c *Engine_Delete_Call) Run(run func(id string)) *Engine_Delete_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string))
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
run(
arg0,
)
})
return _c
}
func (_c *Engine_Delete_Call) Return(_a0 error) *Engine_Delete_Call {
_c.Call.Return(_a0)
func (_c *Engine_Delete_Call) Return(err error) *Engine_Delete_Call {
_c.Call.Return(err)
return _c
}
func (_c *Engine_Delete_Call) RunAndReturn(run func(string) error) *Engine_Delete_Call {
func (_c *Engine_Delete_Call) RunAndReturn(run func(id string) error) *Engine_Delete_Call {
_c.Call.Return(run)
return _c
}
// DocCount provides a mock function with no fields
func (_m *Engine) DocCount() (uint64, error) {
ret := _m.Called()
// DocCount provides a mock function for the type Engine
func (_mock *Engine) DocCount() (uint64, error) {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for DocCount")
@@ -80,21 +100,19 @@ func (_m *Engine) DocCount() (uint64, error) {
var r0 uint64
var r1 error
if rf, ok := ret.Get(0).(func() (uint64, error)); ok {
return rf()
if returnFunc, ok := ret.Get(0).(func() (uint64, error)); ok {
return returnFunc()
}
if rf, ok := ret.Get(0).(func() uint64); ok {
r0 = rf()
if returnFunc, ok := ret.Get(0).(func() uint64); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(uint64)
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
if returnFunc, ok := ret.Get(1).(func() error); ok {
r1 = returnFunc()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
@@ -115,8 +133,8 @@ func (_c *Engine_DocCount_Call) Run(run func()) *Engine_DocCount_Call {
return _c
}
func (_c *Engine_DocCount_Call) Return(_a0 uint64, _a1 error) *Engine_DocCount_Call {
_c.Call.Return(_a0, _a1)
func (_c *Engine_DocCount_Call) Return(v uint64, err error) *Engine_DocCount_Call {
_c.Call.Return(v, err)
return _c
}
@@ -125,21 +143,20 @@ func (_c *Engine_DocCount_Call) RunAndReturn(run func() (uint64, error)) *Engine
return _c
}
// Move provides a mock function with given fields: id, parentid, target
func (_m *Engine) Move(id string, parentid string, target string) error {
ret := _m.Called(id, parentid, target)
// Move provides a mock function for the type Engine
func (_mock *Engine) Move(id string, parentid string, target string) error {
ret := _mock.Called(id, parentid, target)
if len(ret) == 0 {
panic("no return value specified for Move")
}
var r0 error
if rf, ok := ret.Get(0).(func(string, string, string) error); ok {
r0 = rf(id, parentid, target)
if returnFunc, ok := ret.Get(0).(func(string, string, string) error); ok {
r0 = returnFunc(id, parentid, target)
} else {
r0 = ret.Error(0)
}
return r0
}
@@ -158,36 +175,51 @@ func (_e *Engine_Expecter) Move(id interface{}, parentid interface{}, target int
func (_c *Engine_Move_Call) Run(run func(id string, parentid string, target string)) *Engine_Move_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(string), args[2].(string))
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Engine_Move_Call) Return(_a0 error) *Engine_Move_Call {
_c.Call.Return(_a0)
func (_c *Engine_Move_Call) Return(err error) *Engine_Move_Call {
_c.Call.Return(err)
return _c
}
func (_c *Engine_Move_Call) RunAndReturn(run func(string, string, string) error) *Engine_Move_Call {
func (_c *Engine_Move_Call) RunAndReturn(run func(id string, parentid string, target string) error) *Engine_Move_Call {
_c.Call.Return(run)
return _c
}
// Purge provides a mock function with given fields: id
func (_m *Engine) Purge(id string) error {
ret := _m.Called(id)
// Purge provides a mock function for the type Engine
func (_mock *Engine) Purge(id string) error {
ret := _mock.Called(id)
if len(ret) == 0 {
panic("no return value specified for Purge")
}
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(id)
if returnFunc, ok := ret.Get(0).(func(string) error); ok {
r0 = returnFunc(id)
} else {
r0 = ret.Error(0)
}
return r0
}
@@ -204,36 +236,41 @@ func (_e *Engine_Expecter) Purge(id interface{}) *Engine_Purge_Call {
func (_c *Engine_Purge_Call) Run(run func(id string)) *Engine_Purge_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string))
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
run(
arg0,
)
})
return _c
}
func (_c *Engine_Purge_Call) Return(_a0 error) *Engine_Purge_Call {
_c.Call.Return(_a0)
func (_c *Engine_Purge_Call) Return(err error) *Engine_Purge_Call {
_c.Call.Return(err)
return _c
}
func (_c *Engine_Purge_Call) RunAndReturn(run func(string) error) *Engine_Purge_Call {
func (_c *Engine_Purge_Call) RunAndReturn(run func(id string) error) *Engine_Purge_Call {
_c.Call.Return(run)
return _c
}
// Restore provides a mock function with given fields: id
func (_m *Engine) Restore(id string) error {
ret := _m.Called(id)
// Restore provides a mock function for the type Engine
func (_mock *Engine) Restore(id string) error {
ret := _mock.Called(id)
if len(ret) == 0 {
panic("no return value specified for Restore")
}
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(id)
if returnFunc, ok := ret.Get(0).(func(string) error); ok {
r0 = returnFunc(id)
} else {
r0 = ret.Error(0)
}
return r0
}
@@ -250,24 +287,30 @@ func (_e *Engine_Expecter) Restore(id interface{}) *Engine_Restore_Call {
func (_c *Engine_Restore_Call) Run(run func(id string)) *Engine_Restore_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string))
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
run(
arg0,
)
})
return _c
}
func (_c *Engine_Restore_Call) Return(_a0 error) *Engine_Restore_Call {
_c.Call.Return(_a0)
func (_c *Engine_Restore_Call) Return(err error) *Engine_Restore_Call {
_c.Call.Return(err)
return _c
}
func (_c *Engine_Restore_Call) RunAndReturn(run func(string) error) *Engine_Restore_Call {
func (_c *Engine_Restore_Call) RunAndReturn(run func(id string) error) *Engine_Restore_Call {
_c.Call.Return(run)
return _c
}
// Search provides a mock function with given fields: ctx, req
func (_m *Engine) Search(ctx context.Context, req *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error) {
ret := _m.Called(ctx, req)
// Search provides a mock function for the type Engine
func (_mock *Engine) Search(ctx context.Context, req *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error) {
ret := _mock.Called(ctx, req)
if len(ret) == 0 {
panic("no return value specified for Search")
@@ -275,23 +318,21 @@ func (_m *Engine) Search(ctx context.Context, req *v0.SearchIndexRequest) (*v0.S
var r0 *v0.SearchIndexResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)); ok {
return rf(ctx, req)
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)); ok {
return returnFunc(ctx, req)
}
if rf, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) *v0.SearchIndexResponse); ok {
r0 = rf(ctx, req)
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.SearchIndexRequest) *v0.SearchIndexResponse); ok {
r0 = returnFunc(ctx, req)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.SearchIndexResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *v0.SearchIndexRequest) error); ok {
r1 = rf(ctx, req)
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.SearchIndexRequest) error); ok {
r1 = returnFunc(ctx, req)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
@@ -309,36 +350,46 @@ func (_e *Engine_Expecter) Search(ctx interface{}, req interface{}) *Engine_Sear
func (_c *Engine_Search_Call) Run(run func(ctx context.Context, req *v0.SearchIndexRequest)) *Engine_Search_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*v0.SearchIndexRequest))
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.SearchIndexRequest
if args[1] != nil {
arg1 = args[1].(*v0.SearchIndexRequest)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *Engine_Search_Call) Return(_a0 *v0.SearchIndexResponse, _a1 error) *Engine_Search_Call {
_c.Call.Return(_a0, _a1)
func (_c *Engine_Search_Call) Return(searchIndexResponse *v0.SearchIndexResponse, err error) *Engine_Search_Call {
_c.Call.Return(searchIndexResponse, err)
return _c
}
func (_c *Engine_Search_Call) RunAndReturn(run func(context.Context, *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)) *Engine_Search_Call {
func (_c *Engine_Search_Call) RunAndReturn(run func(ctx context.Context, req *v0.SearchIndexRequest) (*v0.SearchIndexResponse, error)) *Engine_Search_Call {
_c.Call.Return(run)
return _c
}
// Upsert provides a mock function with given fields: id, r
func (_m *Engine) Upsert(id string, r engine.Resource) error {
ret := _m.Called(id, r)
// Upsert provides a mock function for the type Engine
func (_mock *Engine) Upsert(id string, r engine.Resource) error {
ret := _mock.Called(id, r)
if len(ret) == 0 {
panic("no return value specified for Upsert")
}
var r0 error
if rf, ok := ret.Get(0).(func(string, engine.Resource) error); ok {
r0 = rf(id, r)
if returnFunc, ok := ret.Get(0).(func(string, engine.Resource) error); ok {
r0 = returnFunc(id, r)
} else {
r0 = ret.Error(0)
}
return r0
}
@@ -356,31 +407,28 @@ func (_e *Engine_Expecter) Upsert(id interface{}, r interface{}) *Engine_Upsert_
func (_c *Engine_Upsert_Call) Run(run func(id string, r engine.Resource)) *Engine_Upsert_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string), args[1].(engine.Resource))
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
var arg1 engine.Resource
if args[1] != nil {
arg1 = args[1].(engine.Resource)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *Engine_Upsert_Call) Return(_a0 error) *Engine_Upsert_Call {
_c.Call.Return(_a0)
func (_c *Engine_Upsert_Call) Return(err error) *Engine_Upsert_Call {
_c.Call.Return(err)
return _c
}
func (_c *Engine_Upsert_Call) RunAndReturn(run func(string, engine.Resource) error) *Engine_Upsert_Call {
func (_c *Engine_Upsert_Call) RunAndReturn(run func(id string, r engine.Resource) error) *Engine_Upsert_Call {
_c.Call.Return(run)
return _c
}
// NewEngine creates a new instance of Engine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewEngine(t interface {
mock.TestingT
Cleanup(func())
}) *Engine {
mock := &Engine{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}