Select Git revision
Collections.go 5.43 KiB
// Code generated by mockery v2.33.3. DO NOT EDIT.
package mocks
import (
context "context"
collections "git.perx.ru/perxis/perxis-go/pkg/collections"
mock "github.com/stretchr/testify/mock"
schema "git.perx.ru/perxis/perxis-go/pkg/schema"
)
// Collections is an autogenerated mock type for the Collections type
type Collections struct {
mock.Mock
}
// Create provides a mock function with given fields: ctx, collection
func (_m *Collections) Create(ctx context.Context, collection *collections.Collection) (*collections.Collection, error) {
ret := _m.Called(ctx, collection)
var r0 *collections.Collection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) (*collections.Collection, error)); ok {
return rf(ctx, collection)
}
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) *collections.Collection); ok {
r0 = rf(ctx, collection)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*collections.Collection)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection) error); ok {
r1 = rf(ctx, collection)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Delete provides a mock function with given fields: ctx, spaceId, envId, collectionId
func (_m *Collections) Delete(ctx context.Context, spaceId string, envId string, collectionId string) error {
ret := _m.Called(ctx, spaceId, envId, collectionId)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok {
r0 = rf(ctx, spaceId, envId, collectionId)
} else {
r0 = ret.Error(0)
}
return r0
}
// Get provides a mock function with given fields: ctx, spaceId, envId, collectionId, options
func (_m *Collections) Get(ctx context.Context, spaceId string, envId string, collectionId string, options ...*collections.GetOptions) (*collections.Collection, error) {
_va := make([]interface{}, len(options))
for _i := range options {
_va[_i] = options[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, spaceId, envId, collectionId)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *collections.Collection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...*collections.GetOptions) (*collections.Collection, error)); ok {
return rf(ctx, spaceId, envId, collectionId, options...)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, ...*collections.GetOptions) *collections.Collection); ok {
r0 = rf(ctx, spaceId, envId, collectionId, options...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*collections.Collection)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, ...*collections.GetOptions) error); ok {
r1 = rf(ctx, spaceId, envId, collectionId, options...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// List provides a mock function with given fields: ctx, spaceId, envId, filter
func (_m *Collections) List(ctx context.Context, spaceId string, envId string, filter *collections.Filter) ([]*collections.Collection, error) {
ret := _m.Called(ctx, spaceId, envId, filter)
var r0 []*collections.Collection
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, *collections.Filter) ([]*collections.Collection, error)); ok {
return rf(ctx, spaceId, envId, filter)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, *collections.Filter) []*collections.Collection); ok {
r0 = rf(ctx, spaceId, envId, filter)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*collections.Collection)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, *collections.Filter) error); ok {
r1 = rf(ctx, spaceId, envId, filter)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SetSchema provides a mock function with given fields: ctx, spaceId, envId, collectionId, _a4
func (_m *Collections) SetSchema(ctx context.Context, spaceId string, envId string, collectionId string, _a4 *schema.Schema) error {
ret := _m.Called(ctx, spaceId, envId, collectionId, _a4)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *schema.Schema) error); ok {
r0 = rf(ctx, spaceId, envId, collectionId, _a4)
} else {
r0 = ret.Error(0)
}
return r0
}
// SetState provides a mock function with given fields: ctx, spaceId, envId, collectionId, state
func (_m *Collections) SetState(ctx context.Context, spaceId string, envId string, collectionId string, state *collections.StateInfo) error {
ret := _m.Called(ctx, spaceId, envId, collectionId, state)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *collections.StateInfo) error); ok {
r0 = rf(ctx, spaceId, envId, collectionId, state)
} else {
r0 = ret.Error(0)
}
return r0
}
// Update provides a mock function with given fields: ctx, coll
func (_m *Collections) Update(ctx context.Context, coll *collections.Collection) error {
ret := _m.Called(ctx, coll)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection) error); ok {
r0 = rf(ctx, coll)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewCollections creates a new instance of Collections. 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 NewCollections(t interface {
mock.TestingT
Cleanup(func())
}) *Collections {
mock := &Collections{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}