mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-31 01:10:20 -06:00
Fix some fallout of recent mockery changes (#8341)
* Fix mockery setup for graph service Add missing interfaces to .mockery.yaml. Use existing mocks from protogen where possible. Remove remaining //go:generate call. * Add mockery config for settings service * Add mockery config for proxy service
This commit is contained in:
@@ -3,6 +3,14 @@ filename: "{{.InterfaceName | snakecase }}.go"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
packages:
|
||||
github.com/owncloud/ocis/v2/services/graph/pkg/service/v0:
|
||||
config:
|
||||
dir: "mocks"
|
||||
interfaces:
|
||||
HTTPClient:
|
||||
Permissions:
|
||||
Publisher:
|
||||
RoleService:
|
||||
github.com/owncloud/ocis/v2/services/graph/pkg/identity:
|
||||
config:
|
||||
dir: "pkg/identity/mocks"
|
||||
@@ -15,4 +23,4 @@ packages:
|
||||
interfaces:
|
||||
Client:
|
||||
config:
|
||||
filename: "ldapclient.go"
|
||||
filename: "ldapclient.go"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,336 +0,0 @@
|
||||
// Code generated by mockery v2.40.1. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
client "go-micro.dev/v4/client"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0"
|
||||
)
|
||||
|
||||
// ValueService is an autogenerated mock type for the ValueService type
|
||||
type ValueService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type ValueService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *ValueService) EXPECT() *ValueService_Expecter {
|
||||
return &ValueService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetValue provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *ValueService) GetValue(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetValue")
|
||||
}
|
||||
|
||||
var r0 *v0.GetValueResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) *v0.GetValueResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetValueResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.GetValueRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_GetValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValue'
|
||||
type ValueService_GetValue_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetValue is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.GetValueRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *ValueService_Expecter) GetValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValue_Call {
|
||||
return &ValueService_GetValue_Call{Call: _e.mock.On("GetValue",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValue_Call) Run(run func(ctx context.Context, in *v0.GetValueRequest, opts ...client.CallOption)) *ValueService_GetValue_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.GetValueRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValue_Call) Return(_a0 *v0.GetValueResponse, _a1 error) *ValueService_GetValue_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValue_Call) RunAndReturn(run func(context.Context, *v0.GetValueRequest, ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValue_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetValueByUniqueIdentifiers provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *ValueService) GetValueByUniqueIdentifiers(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*v0.GetValueResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetValueByUniqueIdentifiers")
|
||||
}
|
||||
|
||||
var r0 *v0.GetValueResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) (*v0.GetValueResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) *v0.GetValueResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetValueResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_GetValueByUniqueIdentifiers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValueByUniqueIdentifiers'
|
||||
type ValueService_GetValueByUniqueIdentifiers_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetValueByUniqueIdentifiers is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.GetValueByUniqueIdentifiersRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *ValueService_Expecter) GetValueByUniqueIdentifiers(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
return &ValueService_GetValueByUniqueIdentifiers_Call{Call: _e.mock.On("GetValueByUniqueIdentifiers",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Run(run func(ctx context.Context, in *v0.GetValueByUniqueIdentifiersRequest, opts ...client.CallOption)) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.GetValueByUniqueIdentifiersRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) Return(_a0 *v0.GetValueResponse, _a1 error) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_GetValueByUniqueIdentifiers_Call) RunAndReturn(run func(context.Context, *v0.GetValueByUniqueIdentifiersRequest, ...client.CallOption) (*v0.GetValueResponse, error)) *ValueService_GetValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListValues provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *ValueService) ListValues(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption) (*v0.ListValuesResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListValues")
|
||||
}
|
||||
|
||||
var r0 *v0.ListValuesResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) (*v0.ListValuesResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) *v0.ListValuesResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.ListValuesResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.ListValuesRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_ListValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListValues'
|
||||
type ValueService_ListValues_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ListValues is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.ListValuesRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *ValueService_Expecter) ListValues(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_ListValues_Call {
|
||||
return &ValueService_ListValues_Call{Call: _e.mock.On("ListValues",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_ListValues_Call) Run(run func(ctx context.Context, in *v0.ListValuesRequest, opts ...client.CallOption)) *ValueService_ListValues_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.ListValuesRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_ListValues_Call) Return(_a0 *v0.ListValuesResponse, _a1 error) *ValueService_ListValues_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_ListValues_Call) RunAndReturn(run func(context.Context, *v0.ListValuesRequest, ...client.CallOption) (*v0.ListValuesResponse, error)) *ValueService_ListValues_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SaveValue provides a mock function with given fields: ctx, in, opts
|
||||
func (_m *ValueService) SaveValue(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption) (*v0.SaveValueResponse, error) {
|
||||
_va := make([]interface{}, len(opts))
|
||||
for _i := range opts {
|
||||
_va[_i] = opts[_i]
|
||||
}
|
||||
var _ca []interface{}
|
||||
_ca = append(_ca, ctx, in)
|
||||
_ca = append(_ca, _va...)
|
||||
ret := _m.Called(_ca...)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SaveValue")
|
||||
}
|
||||
|
||||
var r0 *v0.SaveValueResponse
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) (*v0.SaveValueResponse, error)); ok {
|
||||
return rf(ctx, in, opts...)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) *v0.SaveValueResponse); ok {
|
||||
r0 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.SaveValueResponse)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *v0.SaveValueRequest, ...client.CallOption) error); ok {
|
||||
r1 = rf(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ValueService_SaveValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveValue'
|
||||
type ValueService_SaveValue_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// SaveValue is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.SaveValueRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *ValueService_Expecter) SaveValue(ctx interface{}, in interface{}, opts ...interface{}) *ValueService_SaveValue_Call {
|
||||
return &ValueService_SaveValue_Call{Call: _e.mock.On("SaveValue",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ValueService_SaveValue_Call) Run(run func(ctx context.Context, in *v0.SaveValueRequest, opts ...client.CallOption)) *ValueService_SaveValue_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
variadicArgs := make([]client.CallOption, len(args)-2)
|
||||
for i, a := range args[2:] {
|
||||
if a != nil {
|
||||
variadicArgs[i] = a.(client.CallOption)
|
||||
}
|
||||
}
|
||||
run(args[0].(context.Context), args[1].(*v0.SaveValueRequest), variadicArgs...)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_SaveValue_Call) Return(_a0 *v0.SaveValueResponse, _a1 error) *ValueService_SaveValue_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ValueService_SaveValue_Call) RunAndReturn(run func(context.Context, *v0.SaveValueRequest, ...client.CallOption) (*v0.SaveValueResponse, error)) *ValueService_SaveValue_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewValueService creates a new instance of ValueService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewValueService(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ValueService {
|
||||
mock := &ValueService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
libregraph "github.com/owncloud/libre-graph-api-go"
|
||||
"github.com/owncloud/ocis/v2/services/graph/mocks"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/identity/mocks"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
libregraph "github.com/owncloud/libre-graph-api-go"
|
||||
"github.com/owncloud/ocis/v2/services/graph/mocks"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/config"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/errorcode"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/identity/mocks"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
libregraph "github.com/owncloud/libre-graph-api-go"
|
||||
"github.com/owncloud/ocis/v2/services/graph/mocks"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/identity/mocks"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/CiscoM31/godata"
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
"github.com/owncloud/ocis/v2/services/graph/mocks"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/identity/mocks"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
libregraph "github.com/owncloud/libre-graph-api-go"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/v2/services/graph/mocks"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/config"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/identity/mocks"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
@@ -31,8 +31,6 @@ import (
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/identity"
|
||||
)
|
||||
|
||||
//go:generate make -C ../../.. generate
|
||||
|
||||
// Publisher is the interface for events publisher
|
||||
type Publisher interface {
|
||||
Publish(string, interface{}, ...mevents.PublishOption) error
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/config"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/config/defaults"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/identity"
|
||||
identitymocks "github.com/owncloud/ocis/v2/services/graph/pkg/identity/mocks"
|
||||
service "github.com/owncloud/ocis/v2/services/graph/pkg/service/v0"
|
||||
"github.com/stretchr/testify/mock"
|
||||
"google.golang.org/grpc"
|
||||
@@ -34,7 +35,7 @@ var _ = Describe("Users changing their own password", func() {
|
||||
svc service.Service
|
||||
gatewayClient *cs3mocks.GatewayAPIClient
|
||||
gatewaySelector pool.Selectable[gateway.GatewayAPIClient]
|
||||
ldapClient *mocks.Client
|
||||
ldapClient *identitymocks.Client
|
||||
ldapConfig config.LDAP
|
||||
identityBackend identity.Backend
|
||||
eventsPublisher mocks.Publisher
|
||||
@@ -135,8 +136,8 @@ var _ = Describe("Users changing their own password", func() {
|
||||
)
|
||||
})
|
||||
|
||||
func mockedLDAPClient() *mocks.Client {
|
||||
lm := &mocks.Client{}
|
||||
func mockedLDAPClient() *identitymocks.Client {
|
||||
lm := &identitymocks.Client{}
|
||||
|
||||
userEntry := ldap.NewEntry("uid=test", map[string][]string{
|
||||
"uid": {"test"},
|
||||
|
||||
@@ -28,6 +28,7 @@ import (
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
|
||||
settingsmsg "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/settings/v0"
|
||||
settings "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0"
|
||||
settingsmocks "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0/mocks"
|
||||
"github.com/owncloud/ocis/v2/services/graph/mocks"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/config"
|
||||
"github.com/owncloud/ocis/v2/services/graph/pkg/config/defaults"
|
||||
@@ -48,7 +49,7 @@ var _ = Describe("Users", func() {
|
||||
gatewaySelector pool.Selectable[gateway.GatewayAPIClient]
|
||||
eventsPublisher mocks.Publisher
|
||||
roleService *mocks.RoleService
|
||||
valueService *mocks.ValueService
|
||||
valueService *settingsmocks.ValueService
|
||||
permissionService *mocks.Permissions
|
||||
identityBackend *identitymocks.Backend
|
||||
|
||||
@@ -76,7 +77,7 @@ var _ = Describe("Users", func() {
|
||||
|
||||
identityBackend = &identitymocks.Backend{}
|
||||
roleService = &mocks.RoleService{}
|
||||
valueService = &mocks.ValueService{}
|
||||
valueService = &settingsmocks.ValueService{}
|
||||
permissionService = &mocks.Permissions{}
|
||||
|
||||
rr = httptest.NewRecorder()
|
||||
|
||||
15
services/proxy/.mockery.yaml
Normal file
15
services/proxy/.mockery.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
with-expecter: true
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
packages:
|
||||
github.com/owncloud/ocis/v2/services/proxy/pkg/user/backend:
|
||||
config:
|
||||
dir: "pkg/user/backend/mocks"
|
||||
interfaces:
|
||||
UserBackend:
|
||||
github.com/owncloud/ocis/v2/services/proxy/pkg/userroles:
|
||||
config:
|
||||
dir: "pkg/userroles/mocks"
|
||||
interfaces:
|
||||
UserRoleAssigner:
|
||||
@@ -24,7 +24,8 @@ docs-generate: config-docs-generate
|
||||
include ../../.make/generate.mk
|
||||
|
||||
.PHONY: ci-go-generate
|
||||
ci-go-generate: # CI runs ci-node-generate automatically before this target
|
||||
ci-go-generate: $(MOCKERY) # CI runs ci-node-generate automatically before this target
|
||||
$(MOCKERY)
|
||||
|
||||
.PHONY: ci-node-generate
|
||||
ci-node-generate:
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
// Code generated by mockery v2.14.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// UserBackend is an autogenerated mock type for the UserBackend type
|
||||
type UserBackend struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Authenticate provides a mock function with given fields: ctx, username, password
|
||||
func (_m *UserBackend) Authenticate(ctx context.Context, username string, password string) (*userv1beta1.User, string, error) {
|
||||
ret := _m.Called(ctx, username, password)
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, username, password)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 string
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, string) string); ok {
|
||||
r1 = rf(ctx, username, password)
|
||||
} else {
|
||||
r1 = ret.Get(1).(string)
|
||||
}
|
||||
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok {
|
||||
r2 = rf(ctx, username, password)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// CreateUserFromClaims provides a mock function with given fields: ctx, claims
|
||||
func (_m *UserBackend) CreateUserFromClaims(ctx context.Context, claims map[string]interface{}) (*userv1beta1.User, error) {
|
||||
ret := _m.Called(ctx, claims)
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, claims)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok {
|
||||
r1 = rf(ctx, claims)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetUserByClaims provides a mock function with given fields: ctx, claim, value
|
||||
func (_m *UserBackend) GetUserByClaims(ctx context.Context, claim string, value string) (*userv1beta1.User, string, error) {
|
||||
ret := _m.Called(ctx, claim, value)
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, claim, value)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 string
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, string) string); ok {
|
||||
r1 = rf(ctx, claim, value)
|
||||
} else {
|
||||
r1 = ret.Get(1).(string)
|
||||
}
|
||||
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok {
|
||||
r2 = rf(ctx, claim, value)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
type mockConstructorTestingTNewUserBackend interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}
|
||||
|
||||
// NewUserBackend creates a new instance of UserBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
func NewUserBackend(t mockConstructorTestingTNewUserBackend) *UserBackend {
|
||||
mock := &UserBackend{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
230
services/proxy/pkg/user/backend/mocks/user_backend.go
Normal file
230
services/proxy/pkg/user/backend/mocks/user_backend.go
Normal file
@@ -0,0 +1,230 @@
|
||||
// Code generated by mockery v2.40.1. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
)
|
||||
|
||||
// UserBackend is an autogenerated mock type for the UserBackend type
|
||||
type UserBackend struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type UserBackend_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *UserBackend) EXPECT() *UserBackend_Expecter {
|
||||
return &UserBackend_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// Authenticate provides a mock function with given fields: ctx, username, password
|
||||
func (_m *UserBackend) Authenticate(ctx context.Context, username string, password string) (*userv1beta1.User, string, error) {
|
||||
ret := _m.Called(ctx, username, password)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Authenticate")
|
||||
}
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
var r1 string
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*userv1beta1.User, string, error)); ok {
|
||||
return rf(ctx, username, password)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, username, password)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, string) string); ok {
|
||||
r1 = rf(ctx, username, password)
|
||||
} else {
|
||||
r1 = ret.Get(1).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok {
|
||||
r2 = rf(ctx, username, password)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// UserBackend_Authenticate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Authenticate'
|
||||
type UserBackend_Authenticate_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// Authenticate is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - username string
|
||||
// - password string
|
||||
func (_e *UserBackend_Expecter) Authenticate(ctx interface{}, username interface{}, password interface{}) *UserBackend_Authenticate_Call {
|
||||
return &UserBackend_Authenticate_Call{Call: _e.mock.On("Authenticate", ctx, username, password)}
|
||||
}
|
||||
|
||||
func (_c *UserBackend_Authenticate_Call) Run(run func(ctx context.Context, username string, password string)) *UserBackend_Authenticate_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_Authenticate_Call) Return(_a0 *userv1beta1.User, _a1 string, _a2 error) *UserBackend_Authenticate_Call {
|
||||
_c.Call.Return(_a0, _a1, _a2)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_Authenticate_Call) RunAndReturn(run func(context.Context, string, string) (*userv1beta1.User, string, error)) *UserBackend_Authenticate_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// CreateUserFromClaims provides a mock function with given fields: ctx, claims
|
||||
func (_m *UserBackend) CreateUserFromClaims(ctx context.Context, claims map[string]interface{}) (*userv1beta1.User, error) {
|
||||
ret := _m.Called(ctx, claims)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CreateUserFromClaims")
|
||||
}
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*userv1beta1.User, error)); ok {
|
||||
return rf(ctx, claims)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, claims)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) error); ok {
|
||||
r1 = rf(ctx, claims)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UserBackend_CreateUserFromClaims_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUserFromClaims'
|
||||
type UserBackend_CreateUserFromClaims_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// CreateUserFromClaims is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - claims map[string]interface{}
|
||||
func (_e *UserBackend_Expecter) CreateUserFromClaims(ctx interface{}, claims interface{}) *UserBackend_CreateUserFromClaims_Call {
|
||||
return &UserBackend_CreateUserFromClaims_Call{Call: _e.mock.On("CreateUserFromClaims", ctx, claims)}
|
||||
}
|
||||
|
||||
func (_c *UserBackend_CreateUserFromClaims_Call) Run(run func(ctx context.Context, claims map[string]interface{})) *UserBackend_CreateUserFromClaims_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(map[string]interface{}))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_CreateUserFromClaims_Call) Return(_a0 *userv1beta1.User, _a1 error) *UserBackend_CreateUserFromClaims_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_CreateUserFromClaims_Call) RunAndReturn(run func(context.Context, map[string]interface{}) (*userv1beta1.User, error)) *UserBackend_CreateUserFromClaims_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// GetUserByClaims provides a mock function with given fields: ctx, claim, value
|
||||
func (_m *UserBackend) GetUserByClaims(ctx context.Context, claim string, value string) (*userv1beta1.User, string, error) {
|
||||
ret := _m.Called(ctx, claim, value)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetUserByClaims")
|
||||
}
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
var r1 string
|
||||
var r2 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*userv1beta1.User, string, error)); ok {
|
||||
return rf(ctx, claim, value)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, string) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, claim, value)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, string) string); ok {
|
||||
r1 = rf(ctx, claim, value)
|
||||
} else {
|
||||
r1 = ret.Get(1).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(2).(func(context.Context, string, string) error); ok {
|
||||
r2 = rf(ctx, claim, value)
|
||||
} else {
|
||||
r2 = ret.Error(2)
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// UserBackend_GetUserByClaims_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByClaims'
|
||||
type UserBackend_GetUserByClaims_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetUserByClaims is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - claim string
|
||||
// - value string
|
||||
func (_e *UserBackend_Expecter) GetUserByClaims(ctx interface{}, claim interface{}, value interface{}) *UserBackend_GetUserByClaims_Call {
|
||||
return &UserBackend_GetUserByClaims_Call{Call: _e.mock.On("GetUserByClaims", ctx, claim, value)}
|
||||
}
|
||||
|
||||
func (_c *UserBackend_GetUserByClaims_Call) Run(run func(ctx context.Context, claim string, value string)) *UserBackend_GetUserByClaims_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_GetUserByClaims_Call) Return(_a0 *userv1beta1.User, _a1 string, _a2 error) *UserBackend_GetUserByClaims_Call {
|
||||
_c.Call.Return(_a0, _a1, _a2)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserBackend_GetUserByClaims_Call) RunAndReturn(run func(context.Context, string, string) (*userv1beta1.User, string, error)) *UserBackend_GetUserByClaims_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewUserBackend creates a new instance of UserBackend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewUserBackend(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *UserBackend {
|
||||
mock := &UserBackend{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
// Code generated by mockery v2.14.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
)
|
||||
|
||||
// UserRoleAssigner is an autogenerated mock type for the UserRoleAssigner type
|
||||
type UserRoleAssigner struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// ApplyUserRole provides a mock function with given fields: ctx, user
|
||||
func (_m *UserRoleAssigner) ApplyUserRole(ctx context.Context, user *userv1beta1.User) (*userv1beta1.User, error) {
|
||||
ret := _m.Called(ctx, user)
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, user)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *userv1beta1.User) error); ok {
|
||||
r1 = rf(ctx, user)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateUserRoleAssignment provides a mock function with given fields: ctx, user, claims
|
||||
func (_m *UserRoleAssigner) UpdateUserRoleAssignment(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) (*userv1beta1.User, error) {
|
||||
ret := _m.Called(ctx, user, claims)
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, user, claims)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok {
|
||||
r1 = rf(ctx, user, claims)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
type mockConstructorTestingTNewUserRoleAssigner interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}
|
||||
|
||||
// NewUserRoleAssigner creates a new instance of UserRoleAssigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
func NewUserRoleAssigner(t mockConstructorTestingTNewUserRoleAssigner) *UserRoleAssigner {
|
||||
mock := &UserRoleAssigner{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
157
services/proxy/pkg/userroles/mocks/user_role_assigner.go
Normal file
157
services/proxy/pkg/userroles/mocks/user_role_assigner.go
Normal file
@@ -0,0 +1,157 @@
|
||||
// Code generated by mockery v2.40.1. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
)
|
||||
|
||||
// UserRoleAssigner is an autogenerated mock type for the UserRoleAssigner type
|
||||
type UserRoleAssigner struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type UserRoleAssigner_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *UserRoleAssigner) EXPECT() *UserRoleAssigner_Expecter {
|
||||
return &UserRoleAssigner_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// ApplyUserRole provides a mock function with given fields: ctx, user
|
||||
func (_m *UserRoleAssigner) ApplyUserRole(ctx context.Context, user *userv1beta1.User) (*userv1beta1.User, error) {
|
||||
ret := _m.Called(ctx, user)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ApplyUserRole")
|
||||
}
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) (*userv1beta1.User, error)); ok {
|
||||
return rf(ctx, user)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, user)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *userv1beta1.User) error); ok {
|
||||
r1 = rf(ctx, user)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UserRoleAssigner_ApplyUserRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyUserRole'
|
||||
type UserRoleAssigner_ApplyUserRole_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ApplyUserRole is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - user *userv1beta1.User
|
||||
func (_e *UserRoleAssigner_Expecter) ApplyUserRole(ctx interface{}, user interface{}) *UserRoleAssigner_ApplyUserRole_Call {
|
||||
return &UserRoleAssigner_ApplyUserRole_Call{Call: _e.mock.On("ApplyUserRole", ctx, user)}
|
||||
}
|
||||
|
||||
func (_c *UserRoleAssigner_ApplyUserRole_Call) Run(run func(ctx context.Context, user *userv1beta1.User)) *UserRoleAssigner_ApplyUserRole_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*userv1beta1.User))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserRoleAssigner_ApplyUserRole_Call) Return(_a0 *userv1beta1.User, _a1 error) *UserRoleAssigner_ApplyUserRole_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserRoleAssigner_ApplyUserRole_Call) RunAndReturn(run func(context.Context, *userv1beta1.User) (*userv1beta1.User, error)) *UserRoleAssigner_ApplyUserRole_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// UpdateUserRoleAssignment provides a mock function with given fields: ctx, user, claims
|
||||
func (_m *UserRoleAssigner) UpdateUserRoleAssignment(ctx context.Context, user *userv1beta1.User, claims map[string]interface{}) (*userv1beta1.User, error) {
|
||||
ret := _m.Called(ctx, user, claims)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateUserRoleAssignment")
|
||||
}
|
||||
|
||||
var r0 *userv1beta1.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) (*userv1beta1.User, error)); ok {
|
||||
return rf(ctx, user, claims)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, *userv1beta1.User, map[string]interface{}) *userv1beta1.User); ok {
|
||||
r0 = rf(ctx, user, claims)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*userv1beta1.User)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, *userv1beta1.User, map[string]interface{}) error); ok {
|
||||
r1 = rf(ctx, user, claims)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UserRoleAssigner_UpdateUserRoleAssignment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUserRoleAssignment'
|
||||
type UserRoleAssigner_UpdateUserRoleAssignment_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// UpdateUserRoleAssignment is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - user *userv1beta1.User
|
||||
// - claims map[string]interface{}
|
||||
func (_e *UserRoleAssigner_Expecter) UpdateUserRoleAssignment(ctx interface{}, user interface{}, claims interface{}) *UserRoleAssigner_UpdateUserRoleAssignment_Call {
|
||||
return &UserRoleAssigner_UpdateUserRoleAssignment_Call{Call: _e.mock.On("UpdateUserRoleAssignment", ctx, user, claims)}
|
||||
}
|
||||
|
||||
func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) Run(run func(ctx context.Context, user *userv1beta1.User, claims map[string]interface{})) *UserRoleAssigner_UpdateUserRoleAssignment_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*userv1beta1.User), args[2].(map[string]interface{}))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) Return(_a0 *userv1beta1.User, _a1 error) *UserRoleAssigner_UpdateUserRoleAssignment_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *UserRoleAssigner_UpdateUserRoleAssignment_Call) RunAndReturn(run func(context.Context, *userv1beta1.User, map[string]interface{}) (*userv1beta1.User, error)) *UserRoleAssigner_UpdateUserRoleAssignment_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewUserRoleAssigner creates a new instance of UserRoleAssigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewUserRoleAssigner(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *UserRoleAssigner {
|
||||
mock := &UserRoleAssigner{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
10
services/settings/.mockery.yaml
Normal file
10
services/settings/.mockery.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
with-expecter: true
|
||||
filename: "{{.InterfaceName | snakecase }}.go"
|
||||
mockname: "{{.InterfaceName}}"
|
||||
outpkg: "mocks"
|
||||
packages:
|
||||
github.com/owncloud/ocis/v2/services/settings/pkg/settings:
|
||||
config:
|
||||
dir: "pkg/settings/mocks"
|
||||
interfaces:
|
||||
Manager:
|
||||
@@ -26,7 +26,8 @@ docs-generate: config-docs-generate \
|
||||
include ../../.make/generate.mk
|
||||
|
||||
.PHONY: ci-go-generate
|
||||
ci-go-generate: protobuf # CI runs ci-node-generate automatically before this target
|
||||
ci-go-generate: $(MOCKERY) protobuf # CI runs ci-node-generate automatically before this target
|
||||
$(MOCKERY)
|
||||
|
||||
.PHONY: ci-node-generate
|
||||
ci-node-generate:
|
||||
|
||||
@@ -1,379 +0,0 @@
|
||||
// Code generated by mockery v2.14.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/settings/v0"
|
||||
)
|
||||
|
||||
// Manager is an autogenerated mock type for the Manager type
|
||||
type Manager struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// AddSettingToBundle provides a mock function with given fields: bundleID, setting
|
||||
func (_m *Manager) AddSettingToBundle(bundleID string, setting *v0.Setting) (*v0.Setting, error) {
|
||||
ret := _m.Called(bundleID, setting)
|
||||
|
||||
var r0 *v0.Setting
|
||||
if rf, ok := ret.Get(0).(func(string, *v0.Setting) *v0.Setting); ok {
|
||||
r0 = rf(bundleID, setting)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Setting)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, *v0.Setting) error); ok {
|
||||
r1 = rf(bundleID, setting)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ListBundles provides a mock function with given fields: bundleType, bundleIDs
|
||||
func (_m *Manager) ListBundles(bundleType v0.Bundle_Type, bundleIDs []string) ([]*v0.Bundle, error) {
|
||||
ret := _m.Called(bundleType, bundleIDs)
|
||||
|
||||
var r0 []*v0.Bundle
|
||||
if rf, ok := ret.Get(0).(func(v0.Bundle_Type, []string) []*v0.Bundle); ok {
|
||||
r0 = rf(bundleType, bundleIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*v0.Bundle)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(v0.Bundle_Type, []string) error); ok {
|
||||
r1 = rf(bundleType, bundleIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ListPermissionsByResource provides a mock function with given fields: resource, roleIDs
|
||||
func (_m *Manager) ListPermissionsByResource(resource *v0.Resource, roleIDs []string) ([]*v0.Permission, error) {
|
||||
ret := _m.Called(resource, roleIDs)
|
||||
|
||||
var r0 []*v0.Permission
|
||||
if rf, ok := ret.Get(0).(func(*v0.Resource, []string) []*v0.Permission); ok {
|
||||
r0 = rf(resource, roleIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*v0.Permission)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*v0.Resource, []string) error); ok {
|
||||
r1 = rf(resource, roleIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ListRoleAssignments provides a mock function with given fields: accountUUID
|
||||
func (_m *Manager) ListRoleAssignments(accountUUID string) ([]*v0.UserRoleAssignment, error) {
|
||||
ret := _m.Called(accountUUID)
|
||||
|
||||
var r0 []*v0.UserRoleAssignment
|
||||
if rf, ok := ret.Get(0).(func(string) []*v0.UserRoleAssignment); ok {
|
||||
r0 = rf(accountUUID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*v0.UserRoleAssignment)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(accountUUID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ListValues provides a mock function with given fields: bundleID, accountUUID
|
||||
func (_m *Manager) ListValues(bundleID string, accountUUID string) ([]*v0.Value, error) {
|
||||
ret := _m.Called(bundleID, accountUUID)
|
||||
|
||||
var r0 []*v0.Value
|
||||
if rf, ok := ret.Get(0).(func(string, string) []*v0.Value); ok {
|
||||
r0 = rf(bundleID, accountUUID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*v0.Value)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(bundleID, accountUUID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ReadBundle provides a mock function with given fields: bundleID
|
||||
func (_m *Manager) ReadBundle(bundleID string) (*v0.Bundle, error) {
|
||||
ret := _m.Called(bundleID)
|
||||
|
||||
var r0 *v0.Bundle
|
||||
if rf, ok := ret.Get(0).(func(string) *v0.Bundle); ok {
|
||||
r0 = rf(bundleID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Bundle)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(bundleID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ReadPermissionByID provides a mock function with given fields: permissionID, roleIDs
|
||||
func (_m *Manager) ReadPermissionByID(permissionID string, roleIDs []string) (*v0.Permission, error) {
|
||||
ret := _m.Called(permissionID, roleIDs)
|
||||
|
||||
var r0 *v0.Permission
|
||||
if rf, ok := ret.Get(0).(func(string, []string) *v0.Permission); ok {
|
||||
r0 = rf(permissionID, roleIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Permission)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, []string) error); ok {
|
||||
r1 = rf(permissionID, roleIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ReadPermissionByName provides a mock function with given fields: name, roleIDs
|
||||
func (_m *Manager) ReadPermissionByName(name string, roleIDs []string) (*v0.Permission, error) {
|
||||
ret := _m.Called(name, roleIDs)
|
||||
|
||||
var r0 *v0.Permission
|
||||
if rf, ok := ret.Get(0).(func(string, []string) *v0.Permission); ok {
|
||||
r0 = rf(name, roleIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Permission)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, []string) error); ok {
|
||||
r1 = rf(name, roleIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ReadSetting provides a mock function with given fields: settingID
|
||||
func (_m *Manager) ReadSetting(settingID string) (*v0.Setting, error) {
|
||||
ret := _m.Called(settingID)
|
||||
|
||||
var r0 *v0.Setting
|
||||
if rf, ok := ret.Get(0).(func(string) *v0.Setting); ok {
|
||||
r0 = rf(settingID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Setting)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(settingID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ReadValue provides a mock function with given fields: valueID
|
||||
func (_m *Manager) ReadValue(valueID string) (*v0.Value, error) {
|
||||
ret := _m.Called(valueID)
|
||||
|
||||
var r0 *v0.Value
|
||||
if rf, ok := ret.Get(0).(func(string) *v0.Value); ok {
|
||||
r0 = rf(valueID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Value)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(valueID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ReadValueByUniqueIdentifiers provides a mock function with given fields: accountUUID, settingID
|
||||
func (_m *Manager) ReadValueByUniqueIdentifiers(accountUUID string, settingID string) (*v0.Value, error) {
|
||||
ret := _m.Called(accountUUID, settingID)
|
||||
|
||||
var r0 *v0.Value
|
||||
if rf, ok := ret.Get(0).(func(string, string) *v0.Value); ok {
|
||||
r0 = rf(accountUUID, settingID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Value)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(accountUUID, settingID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// RemoveRoleAssignment provides a mock function with given fields: assignmentID
|
||||
func (_m *Manager) RemoveRoleAssignment(assignmentID string) error {
|
||||
ret := _m.Called(assignmentID)
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(assignmentID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RemoveSettingFromBundle provides a mock function with given fields: bundleID, settingID
|
||||
func (_m *Manager) RemoveSettingFromBundle(bundleID string, settingID string) error {
|
||||
ret := _m.Called(bundleID, settingID)
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(bundleID, settingID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// WriteBundle provides a mock function with given fields: bundle
|
||||
func (_m *Manager) WriteBundle(bundle *v0.Bundle) (*v0.Bundle, error) {
|
||||
ret := _m.Called(bundle)
|
||||
|
||||
var r0 *v0.Bundle
|
||||
if rf, ok := ret.Get(0).(func(*v0.Bundle) *v0.Bundle); ok {
|
||||
r0 = rf(bundle)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Bundle)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*v0.Bundle) error); ok {
|
||||
r1 = rf(bundle)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// WriteRoleAssignment provides a mock function with given fields: accountUUID, roleID
|
||||
func (_m *Manager) WriteRoleAssignment(accountUUID string, roleID string) (*v0.UserRoleAssignment, error) {
|
||||
ret := _m.Called(accountUUID, roleID)
|
||||
|
||||
var r0 *v0.UserRoleAssignment
|
||||
if rf, ok := ret.Get(0).(func(string, string) *v0.UserRoleAssignment); ok {
|
||||
r0 = rf(accountUUID, roleID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.UserRoleAssignment)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(accountUUID, roleID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// WriteValue provides a mock function with given fields: value
|
||||
func (_m *Manager) WriteValue(value *v0.Value) (*v0.Value, error) {
|
||||
ret := _m.Called(value)
|
||||
|
||||
var r0 *v0.Value
|
||||
if rf, ok := ret.Get(0).(func(*v0.Value) *v0.Value); ok {
|
||||
r0 = rf(value)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Value)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*v0.Value) error); ok {
|
||||
r1 = rf(value)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
type mockConstructorTestingTNewManager interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}
|
||||
|
||||
// NewManager creates a new instance of Manager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
func NewManager(t mockConstructorTestingTNewManager) *Manager {
|
||||
mock := &Manager{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
949
services/settings/pkg/settings/mocks/manager.go
Normal file
949
services/settings/pkg/settings/mocks/manager.go
Normal file
@@ -0,0 +1,949 @@
|
||||
// Code generated by mockery v2.40.1. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
v0 "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/settings/v0"
|
||||
)
|
||||
|
||||
// Manager is an autogenerated mock type for the Manager type
|
||||
type Manager struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type Manager_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *Manager) EXPECT() *Manager_Expecter {
|
||||
return &Manager_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// AddSettingToBundle provides a mock function with given fields: bundleID, setting
|
||||
func (_m *Manager) AddSettingToBundle(bundleID string, setting *v0.Setting) (*v0.Setting, error) {
|
||||
ret := _m.Called(bundleID, setting)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AddSettingToBundle")
|
||||
}
|
||||
|
||||
var r0 *v0.Setting
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, *v0.Setting) (*v0.Setting, error)); ok {
|
||||
return rf(bundleID, setting)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, *v0.Setting) *v0.Setting); ok {
|
||||
r0 = rf(bundleID, setting)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Setting)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, *v0.Setting) error); ok {
|
||||
r1 = rf(bundleID, setting)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_AddSettingToBundle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddSettingToBundle'
|
||||
type Manager_AddSettingToBundle_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// AddSettingToBundle is a helper method to define mock.On call
|
||||
// - bundleID string
|
||||
// - setting *v0.Setting
|
||||
func (_e *Manager_Expecter) AddSettingToBundle(bundleID interface{}, setting interface{}) *Manager_AddSettingToBundle_Call {
|
||||
return &Manager_AddSettingToBundle_Call{Call: _e.mock.On("AddSettingToBundle", bundleID, setting)}
|
||||
}
|
||||
|
||||
func (_c *Manager_AddSettingToBundle_Call) Run(run func(bundleID string, setting *v0.Setting)) *Manager_AddSettingToBundle_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(*v0.Setting))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_AddSettingToBundle_Call) Return(_a0 *v0.Setting, _a1 error) *Manager_AddSettingToBundle_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_AddSettingToBundle_Call) RunAndReturn(run func(string, *v0.Setting) (*v0.Setting, error)) *Manager_AddSettingToBundle_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListBundles provides a mock function with given fields: bundleType, bundleIDs
|
||||
func (_m *Manager) ListBundles(bundleType v0.Bundle_Type, bundleIDs []string) ([]*v0.Bundle, error) {
|
||||
ret := _m.Called(bundleType, bundleIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListBundles")
|
||||
}
|
||||
|
||||
var r0 []*v0.Bundle
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(v0.Bundle_Type, []string) ([]*v0.Bundle, error)); ok {
|
||||
return rf(bundleType, bundleIDs)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(v0.Bundle_Type, []string) []*v0.Bundle); ok {
|
||||
r0 = rf(bundleType, bundleIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*v0.Bundle)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(v0.Bundle_Type, []string) error); ok {
|
||||
r1 = rf(bundleType, bundleIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_ListBundles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListBundles'
|
||||
type Manager_ListBundles_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ListBundles is a helper method to define mock.On call
|
||||
// - bundleType v0.Bundle_Type
|
||||
// - bundleIDs []string
|
||||
func (_e *Manager_Expecter) ListBundles(bundleType interface{}, bundleIDs interface{}) *Manager_ListBundles_Call {
|
||||
return &Manager_ListBundles_Call{Call: _e.mock.On("ListBundles", bundleType, bundleIDs)}
|
||||
}
|
||||
|
||||
func (_c *Manager_ListBundles_Call) Run(run func(bundleType v0.Bundle_Type, bundleIDs []string)) *Manager_ListBundles_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(v0.Bundle_Type), args[1].([]string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ListBundles_Call) Return(_a0 []*v0.Bundle, _a1 error) *Manager_ListBundles_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ListBundles_Call) RunAndReturn(run func(v0.Bundle_Type, []string) ([]*v0.Bundle, error)) *Manager_ListBundles_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListPermissionsByResource provides a mock function with given fields: resource, roleIDs
|
||||
func (_m *Manager) ListPermissionsByResource(resource *v0.Resource, roleIDs []string) ([]*v0.Permission, error) {
|
||||
ret := _m.Called(resource, roleIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListPermissionsByResource")
|
||||
}
|
||||
|
||||
var r0 []*v0.Permission
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*v0.Resource, []string) ([]*v0.Permission, error)); ok {
|
||||
return rf(resource, roleIDs)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*v0.Resource, []string) []*v0.Permission); ok {
|
||||
r0 = rf(resource, roleIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*v0.Permission)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*v0.Resource, []string) error); ok {
|
||||
r1 = rf(resource, roleIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_ListPermissionsByResource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPermissionsByResource'
|
||||
type Manager_ListPermissionsByResource_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ListPermissionsByResource is a helper method to define mock.On call
|
||||
// - resource *v0.Resource
|
||||
// - roleIDs []string
|
||||
func (_e *Manager_Expecter) ListPermissionsByResource(resource interface{}, roleIDs interface{}) *Manager_ListPermissionsByResource_Call {
|
||||
return &Manager_ListPermissionsByResource_Call{Call: _e.mock.On("ListPermissionsByResource", resource, roleIDs)}
|
||||
}
|
||||
|
||||
func (_c *Manager_ListPermissionsByResource_Call) Run(run func(resource *v0.Resource, roleIDs []string)) *Manager_ListPermissionsByResource_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(*v0.Resource), args[1].([]string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ListPermissionsByResource_Call) Return(_a0 []*v0.Permission, _a1 error) *Manager_ListPermissionsByResource_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ListPermissionsByResource_Call) RunAndReturn(run func(*v0.Resource, []string) ([]*v0.Permission, error)) *Manager_ListPermissionsByResource_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListRoleAssignments provides a mock function with given fields: accountUUID
|
||||
func (_m *Manager) ListRoleAssignments(accountUUID string) ([]*v0.UserRoleAssignment, error) {
|
||||
ret := _m.Called(accountUUID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListRoleAssignments")
|
||||
}
|
||||
|
||||
var r0 []*v0.UserRoleAssignment
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) ([]*v0.UserRoleAssignment, error)); ok {
|
||||
return rf(accountUUID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) []*v0.UserRoleAssignment); ok {
|
||||
r0 = rf(accountUUID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*v0.UserRoleAssignment)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(accountUUID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_ListRoleAssignments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRoleAssignments'
|
||||
type Manager_ListRoleAssignments_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ListRoleAssignments is a helper method to define mock.On call
|
||||
// - accountUUID string
|
||||
func (_e *Manager_Expecter) ListRoleAssignments(accountUUID interface{}) *Manager_ListRoleAssignments_Call {
|
||||
return &Manager_ListRoleAssignments_Call{Call: _e.mock.On("ListRoleAssignments", accountUUID)}
|
||||
}
|
||||
|
||||
func (_c *Manager_ListRoleAssignments_Call) Run(run func(accountUUID string)) *Manager_ListRoleAssignments_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ListRoleAssignments_Call) Return(_a0 []*v0.UserRoleAssignment, _a1 error) *Manager_ListRoleAssignments_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ListRoleAssignments_Call) RunAndReturn(run func(string) ([]*v0.UserRoleAssignment, error)) *Manager_ListRoleAssignments_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ListValues provides a mock function with given fields: bundleID, accountUUID
|
||||
func (_m *Manager) ListValues(bundleID string, accountUUID string) ([]*v0.Value, error) {
|
||||
ret := _m.Called(bundleID, accountUUID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListValues")
|
||||
}
|
||||
|
||||
var r0 []*v0.Value
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) ([]*v0.Value, error)); ok {
|
||||
return rf(bundleID, accountUUID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) []*v0.Value); ok {
|
||||
r0 = rf(bundleID, accountUUID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*v0.Value)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(bundleID, accountUUID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_ListValues_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListValues'
|
||||
type Manager_ListValues_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ListValues is a helper method to define mock.On call
|
||||
// - bundleID string
|
||||
// - accountUUID string
|
||||
func (_e *Manager_Expecter) ListValues(bundleID interface{}, accountUUID interface{}) *Manager_ListValues_Call {
|
||||
return &Manager_ListValues_Call{Call: _e.mock.On("ListValues", bundleID, accountUUID)}
|
||||
}
|
||||
|
||||
func (_c *Manager_ListValues_Call) Run(run func(bundleID string, accountUUID string)) *Manager_ListValues_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ListValues_Call) Return(_a0 []*v0.Value, _a1 error) *Manager_ListValues_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ListValues_Call) RunAndReturn(run func(string, string) ([]*v0.Value, error)) *Manager_ListValues_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ReadBundle provides a mock function with given fields: bundleID
|
||||
func (_m *Manager) ReadBundle(bundleID string) (*v0.Bundle, error) {
|
||||
ret := _m.Called(bundleID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ReadBundle")
|
||||
}
|
||||
|
||||
var r0 *v0.Bundle
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*v0.Bundle, error)); ok {
|
||||
return rf(bundleID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *v0.Bundle); ok {
|
||||
r0 = rf(bundleID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Bundle)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(bundleID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_ReadBundle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadBundle'
|
||||
type Manager_ReadBundle_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ReadBundle is a helper method to define mock.On call
|
||||
// - bundleID string
|
||||
func (_e *Manager_Expecter) ReadBundle(bundleID interface{}) *Manager_ReadBundle_Call {
|
||||
return &Manager_ReadBundle_Call{Call: _e.mock.On("ReadBundle", bundleID)}
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadBundle_Call) Run(run func(bundleID string)) *Manager_ReadBundle_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadBundle_Call) Return(_a0 *v0.Bundle, _a1 error) *Manager_ReadBundle_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadBundle_Call) RunAndReturn(run func(string) (*v0.Bundle, error)) *Manager_ReadBundle_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ReadPermissionByID provides a mock function with given fields: permissionID, roleIDs
|
||||
func (_m *Manager) ReadPermissionByID(permissionID string, roleIDs []string) (*v0.Permission, error) {
|
||||
ret := _m.Called(permissionID, roleIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ReadPermissionByID")
|
||||
}
|
||||
|
||||
var r0 *v0.Permission
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) (*v0.Permission, error)); ok {
|
||||
return rf(permissionID, roleIDs)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []string) *v0.Permission); ok {
|
||||
r0 = rf(permissionID, roleIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Permission)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, []string) error); ok {
|
||||
r1 = rf(permissionID, roleIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_ReadPermissionByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadPermissionByID'
|
||||
type Manager_ReadPermissionByID_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ReadPermissionByID is a helper method to define mock.On call
|
||||
// - permissionID string
|
||||
// - roleIDs []string
|
||||
func (_e *Manager_Expecter) ReadPermissionByID(permissionID interface{}, roleIDs interface{}) *Manager_ReadPermissionByID_Call {
|
||||
return &Manager_ReadPermissionByID_Call{Call: _e.mock.On("ReadPermissionByID", permissionID, roleIDs)}
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadPermissionByID_Call) Run(run func(permissionID string, roleIDs []string)) *Manager_ReadPermissionByID_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].([]string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadPermissionByID_Call) Return(_a0 *v0.Permission, _a1 error) *Manager_ReadPermissionByID_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadPermissionByID_Call) RunAndReturn(run func(string, []string) (*v0.Permission, error)) *Manager_ReadPermissionByID_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ReadPermissionByName provides a mock function with given fields: name, roleIDs
|
||||
func (_m *Manager) ReadPermissionByName(name string, roleIDs []string) (*v0.Permission, error) {
|
||||
ret := _m.Called(name, roleIDs)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ReadPermissionByName")
|
||||
}
|
||||
|
||||
var r0 *v0.Permission
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []string) (*v0.Permission, error)); ok {
|
||||
return rf(name, roleIDs)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []string) *v0.Permission); ok {
|
||||
r0 = rf(name, roleIDs)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Permission)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, []string) error); ok {
|
||||
r1 = rf(name, roleIDs)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_ReadPermissionByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadPermissionByName'
|
||||
type Manager_ReadPermissionByName_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ReadPermissionByName is a helper method to define mock.On call
|
||||
// - name string
|
||||
// - roleIDs []string
|
||||
func (_e *Manager_Expecter) ReadPermissionByName(name interface{}, roleIDs interface{}) *Manager_ReadPermissionByName_Call {
|
||||
return &Manager_ReadPermissionByName_Call{Call: _e.mock.On("ReadPermissionByName", name, roleIDs)}
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadPermissionByName_Call) Run(run func(name string, roleIDs []string)) *Manager_ReadPermissionByName_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].([]string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadPermissionByName_Call) Return(_a0 *v0.Permission, _a1 error) *Manager_ReadPermissionByName_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadPermissionByName_Call) RunAndReturn(run func(string, []string) (*v0.Permission, error)) *Manager_ReadPermissionByName_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ReadSetting provides a mock function with given fields: settingID
|
||||
func (_m *Manager) ReadSetting(settingID string) (*v0.Setting, error) {
|
||||
ret := _m.Called(settingID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ReadSetting")
|
||||
}
|
||||
|
||||
var r0 *v0.Setting
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*v0.Setting, error)); ok {
|
||||
return rf(settingID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *v0.Setting); ok {
|
||||
r0 = rf(settingID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Setting)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(settingID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_ReadSetting_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadSetting'
|
||||
type Manager_ReadSetting_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ReadSetting is a helper method to define mock.On call
|
||||
// - settingID string
|
||||
func (_e *Manager_Expecter) ReadSetting(settingID interface{}) *Manager_ReadSetting_Call {
|
||||
return &Manager_ReadSetting_Call{Call: _e.mock.On("ReadSetting", settingID)}
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadSetting_Call) Run(run func(settingID string)) *Manager_ReadSetting_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadSetting_Call) Return(_a0 *v0.Setting, _a1 error) *Manager_ReadSetting_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadSetting_Call) RunAndReturn(run func(string) (*v0.Setting, error)) *Manager_ReadSetting_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ReadValue provides a mock function with given fields: valueID
|
||||
func (_m *Manager) ReadValue(valueID string) (*v0.Value, error) {
|
||||
ret := _m.Called(valueID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ReadValue")
|
||||
}
|
||||
|
||||
var r0 *v0.Value
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string) (*v0.Value, error)); ok {
|
||||
return rf(valueID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string) *v0.Value); ok {
|
||||
r0 = rf(valueID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Value)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(valueID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_ReadValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadValue'
|
||||
type Manager_ReadValue_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ReadValue is a helper method to define mock.On call
|
||||
// - valueID string
|
||||
func (_e *Manager_Expecter) ReadValue(valueID interface{}) *Manager_ReadValue_Call {
|
||||
return &Manager_ReadValue_Call{Call: _e.mock.On("ReadValue", valueID)}
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadValue_Call) Run(run func(valueID string)) *Manager_ReadValue_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadValue_Call) Return(_a0 *v0.Value, _a1 error) *Manager_ReadValue_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadValue_Call) RunAndReturn(run func(string) (*v0.Value, error)) *Manager_ReadValue_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// ReadValueByUniqueIdentifiers provides a mock function with given fields: accountUUID, settingID
|
||||
func (_m *Manager) ReadValueByUniqueIdentifiers(accountUUID string, settingID string) (*v0.Value, error) {
|
||||
ret := _m.Called(accountUUID, settingID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ReadValueByUniqueIdentifiers")
|
||||
}
|
||||
|
||||
var r0 *v0.Value
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*v0.Value, error)); ok {
|
||||
return rf(accountUUID, settingID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *v0.Value); ok {
|
||||
r0 = rf(accountUUID, settingID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Value)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(accountUUID, settingID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_ReadValueByUniqueIdentifiers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadValueByUniqueIdentifiers'
|
||||
type Manager_ReadValueByUniqueIdentifiers_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// ReadValueByUniqueIdentifiers is a helper method to define mock.On call
|
||||
// - accountUUID string
|
||||
// - settingID string
|
||||
func (_e *Manager_Expecter) ReadValueByUniqueIdentifiers(accountUUID interface{}, settingID interface{}) *Manager_ReadValueByUniqueIdentifiers_Call {
|
||||
return &Manager_ReadValueByUniqueIdentifiers_Call{Call: _e.mock.On("ReadValueByUniqueIdentifiers", accountUUID, settingID)}
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadValueByUniqueIdentifiers_Call) Run(run func(accountUUID string, settingID string)) *Manager_ReadValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadValueByUniqueIdentifiers_Call) Return(_a0 *v0.Value, _a1 error) *Manager_ReadValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_ReadValueByUniqueIdentifiers_Call) RunAndReturn(run func(string, string) (*v0.Value, error)) *Manager_ReadValueByUniqueIdentifiers_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// RemoveRoleAssignment provides a mock function with given fields: assignmentID
|
||||
func (_m *Manager) RemoveRoleAssignment(assignmentID string) error {
|
||||
ret := _m.Called(assignmentID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveRoleAssignment")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(assignmentID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Manager_RemoveRoleAssignment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRoleAssignment'
|
||||
type Manager_RemoveRoleAssignment_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// RemoveRoleAssignment is a helper method to define mock.On call
|
||||
// - assignmentID string
|
||||
func (_e *Manager_Expecter) RemoveRoleAssignment(assignmentID interface{}) *Manager_RemoveRoleAssignment_Call {
|
||||
return &Manager_RemoveRoleAssignment_Call{Call: _e.mock.On("RemoveRoleAssignment", assignmentID)}
|
||||
}
|
||||
|
||||
func (_c *Manager_RemoveRoleAssignment_Call) Run(run func(assignmentID string)) *Manager_RemoveRoleAssignment_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_RemoveRoleAssignment_Call) Return(_a0 error) *Manager_RemoveRoleAssignment_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_RemoveRoleAssignment_Call) RunAndReturn(run func(string) error) *Manager_RemoveRoleAssignment_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// RemoveSettingFromBundle provides a mock function with given fields: bundleID, settingID
|
||||
func (_m *Manager) RemoveSettingFromBundle(bundleID string, settingID string) error {
|
||||
ret := _m.Called(bundleID, settingID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveSettingFromBundle")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
||||
r0 = rf(bundleID, settingID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Manager_RemoveSettingFromBundle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSettingFromBundle'
|
||||
type Manager_RemoveSettingFromBundle_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// RemoveSettingFromBundle is a helper method to define mock.On call
|
||||
// - bundleID string
|
||||
// - settingID string
|
||||
func (_e *Manager_Expecter) RemoveSettingFromBundle(bundleID interface{}, settingID interface{}) *Manager_RemoveSettingFromBundle_Call {
|
||||
return &Manager_RemoveSettingFromBundle_Call{Call: _e.mock.On("RemoveSettingFromBundle", bundleID, settingID)}
|
||||
}
|
||||
|
||||
func (_c *Manager_RemoveSettingFromBundle_Call) Run(run func(bundleID string, settingID string)) *Manager_RemoveSettingFromBundle_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_RemoveSettingFromBundle_Call) Return(_a0 error) *Manager_RemoveSettingFromBundle_Call {
|
||||
_c.Call.Return(_a0)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_RemoveSettingFromBundle_Call) RunAndReturn(run func(string, string) error) *Manager_RemoveSettingFromBundle_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// WriteBundle provides a mock function with given fields: bundle
|
||||
func (_m *Manager) WriteBundle(bundle *v0.Bundle) (*v0.Bundle, error) {
|
||||
ret := _m.Called(bundle)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for WriteBundle")
|
||||
}
|
||||
|
||||
var r0 *v0.Bundle
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*v0.Bundle) (*v0.Bundle, error)); ok {
|
||||
return rf(bundle)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*v0.Bundle) *v0.Bundle); ok {
|
||||
r0 = rf(bundle)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Bundle)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*v0.Bundle) error); ok {
|
||||
r1 = rf(bundle)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_WriteBundle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteBundle'
|
||||
type Manager_WriteBundle_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// WriteBundle is a helper method to define mock.On call
|
||||
// - bundle *v0.Bundle
|
||||
func (_e *Manager_Expecter) WriteBundle(bundle interface{}) *Manager_WriteBundle_Call {
|
||||
return &Manager_WriteBundle_Call{Call: _e.mock.On("WriteBundle", bundle)}
|
||||
}
|
||||
|
||||
func (_c *Manager_WriteBundle_Call) Run(run func(bundle *v0.Bundle)) *Manager_WriteBundle_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(*v0.Bundle))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_WriteBundle_Call) Return(_a0 *v0.Bundle, _a1 error) *Manager_WriteBundle_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_WriteBundle_Call) RunAndReturn(run func(*v0.Bundle) (*v0.Bundle, error)) *Manager_WriteBundle_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// WriteRoleAssignment provides a mock function with given fields: accountUUID, roleID
|
||||
func (_m *Manager) WriteRoleAssignment(accountUUID string, roleID string) (*v0.UserRoleAssignment, error) {
|
||||
ret := _m.Called(accountUUID, roleID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for WriteRoleAssignment")
|
||||
}
|
||||
|
||||
var r0 *v0.UserRoleAssignment
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (*v0.UserRoleAssignment, error)); ok {
|
||||
return rf(accountUUID, roleID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) *v0.UserRoleAssignment); ok {
|
||||
r0 = rf(accountUUID, roleID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.UserRoleAssignment)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(accountUUID, roleID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_WriteRoleAssignment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteRoleAssignment'
|
||||
type Manager_WriteRoleAssignment_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// WriteRoleAssignment is a helper method to define mock.On call
|
||||
// - accountUUID string
|
||||
// - roleID string
|
||||
func (_e *Manager_Expecter) WriteRoleAssignment(accountUUID interface{}, roleID interface{}) *Manager_WriteRoleAssignment_Call {
|
||||
return &Manager_WriteRoleAssignment_Call{Call: _e.mock.On("WriteRoleAssignment", accountUUID, roleID)}
|
||||
}
|
||||
|
||||
func (_c *Manager_WriteRoleAssignment_Call) Run(run func(accountUUID string, roleID string)) *Manager_WriteRoleAssignment_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(string))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_WriteRoleAssignment_Call) Return(_a0 *v0.UserRoleAssignment, _a1 error) *Manager_WriteRoleAssignment_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_WriteRoleAssignment_Call) RunAndReturn(run func(string, string) (*v0.UserRoleAssignment, error)) *Manager_WriteRoleAssignment_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// WriteValue provides a mock function with given fields: value
|
||||
func (_m *Manager) WriteValue(value *v0.Value) (*v0.Value, error) {
|
||||
ret := _m.Called(value)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for WriteValue")
|
||||
}
|
||||
|
||||
var r0 *v0.Value
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*v0.Value) (*v0.Value, error)); ok {
|
||||
return rf(value)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*v0.Value) *v0.Value); ok {
|
||||
r0 = rf(value)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.Value)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*v0.Value) error); ok {
|
||||
r1 = rf(value)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Manager_WriteValue_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteValue'
|
||||
type Manager_WriteValue_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// WriteValue is a helper method to define mock.On call
|
||||
// - value *v0.Value
|
||||
func (_e *Manager_Expecter) WriteValue(value interface{}) *Manager_WriteValue_Call {
|
||||
return &Manager_WriteValue_Call{Call: _e.mock.On("WriteValue", value)}
|
||||
}
|
||||
|
||||
func (_c *Manager_WriteValue_Call) Run(run func(value *v0.Value)) *Manager_WriteValue_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(*v0.Value))
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_WriteValue_Call) Return(_a0 *v0.Value, _a1 error) *Manager_WriteValue_Call {
|
||||
_c.Call.Return(_a0, _a1)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *Manager_WriteValue_Call) RunAndReturn(run func(*v0.Value) (*v0.Value, error)) *Manager_WriteValue_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
||||
// NewManager creates a new instance of Manager. 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 NewManager(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *Manager {
|
||||
mock := &Manager{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
Reference in New Issue
Block a user