mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 04:20:17 +00:00
7bdf4c681e
* NOISSUE - Update dependencies Signed-off-by: dusan <borovcanindusan1@gmail.com> * Update go.mod Signed-off-by: dusan <borovcanindusan1@gmail.com> --------- Signed-off-by: dusan <borovcanindusan1@gmail.com>
299 lines
9.0 KiB
Go
299 lines
9.0 KiB
Go
// Copyright (c) Abstract Machines
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Code generated by mockery; DO NOT EDIT.
|
|
// github.com/vektra/mockery
|
|
// template: testify
|
|
|
|
package mocks
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/absmach/magistrala/consumers/notifiers"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// NewSubscriptionsRepository creates a new instance of SubscriptionsRepository. 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 NewSubscriptionsRepository(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *SubscriptionsRepository {
|
|
mock := &SubscriptionsRepository{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|
|
|
|
// SubscriptionsRepository is an autogenerated mock type for the SubscriptionsRepository type
|
|
type SubscriptionsRepository struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type SubscriptionsRepository_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *SubscriptionsRepository) EXPECT() *SubscriptionsRepository_Expecter {
|
|
return &SubscriptionsRepository_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Remove provides a mock function for the type SubscriptionsRepository
|
|
func (_mock *SubscriptionsRepository) Remove(ctx context.Context, id string) error {
|
|
ret := _mock.Called(ctx, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Remove")
|
|
}
|
|
|
|
var r0 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
|
r0 = returnFunc(ctx, id)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
return r0
|
|
}
|
|
|
|
// SubscriptionsRepository_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove'
|
|
type SubscriptionsRepository_Remove_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Remove is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - id string
|
|
func (_e *SubscriptionsRepository_Expecter) Remove(ctx interface{}, id interface{}) *SubscriptionsRepository_Remove_Call {
|
|
return &SubscriptionsRepository_Remove_Call{Call: _e.mock.On("Remove", ctx, id)}
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_Remove_Call) Run(run func(ctx context.Context, id string)) *SubscriptionsRepository_Remove_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 string
|
|
if args[1] != nil {
|
|
arg1 = args[1].(string)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_Remove_Call) Return(err error) *SubscriptionsRepository_Remove_Call {
|
|
_c.Call.Return(err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_Remove_Call) RunAndReturn(run func(ctx context.Context, id string) error) *SubscriptionsRepository_Remove_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Retrieve provides a mock function for the type SubscriptionsRepository
|
|
func (_mock *SubscriptionsRepository) Retrieve(ctx context.Context, id string) (notifiers.Subscription, error) {
|
|
ret := _mock.Called(ctx, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Retrieve")
|
|
}
|
|
|
|
var r0 notifiers.Subscription
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (notifiers.Subscription, error)); ok {
|
|
return returnFunc(ctx, id)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, string) notifiers.Subscription); ok {
|
|
r0 = returnFunc(ctx, id)
|
|
} else {
|
|
r0 = ret.Get(0).(notifiers.Subscription)
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = returnFunc(ctx, id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// SubscriptionsRepository_Retrieve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Retrieve'
|
|
type SubscriptionsRepository_Retrieve_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Retrieve is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - id string
|
|
func (_e *SubscriptionsRepository_Expecter) Retrieve(ctx interface{}, id interface{}) *SubscriptionsRepository_Retrieve_Call {
|
|
return &SubscriptionsRepository_Retrieve_Call{Call: _e.mock.On("Retrieve", ctx, id)}
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_Retrieve_Call) Run(run func(ctx context.Context, id string)) *SubscriptionsRepository_Retrieve_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 string
|
|
if args[1] != nil {
|
|
arg1 = args[1].(string)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_Retrieve_Call) Return(subscription notifiers.Subscription, err error) *SubscriptionsRepository_Retrieve_Call {
|
|
_c.Call.Return(subscription, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_Retrieve_Call) RunAndReturn(run func(ctx context.Context, id string) (notifiers.Subscription, error)) *SubscriptionsRepository_Retrieve_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// RetrieveAll provides a mock function for the type SubscriptionsRepository
|
|
func (_mock *SubscriptionsRepository) RetrieveAll(ctx context.Context, pm notifiers.PageMetadata) (notifiers.Page, error) {
|
|
ret := _mock.Called(ctx, pm)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RetrieveAll")
|
|
}
|
|
|
|
var r0 notifiers.Page
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, notifiers.PageMetadata) (notifiers.Page, error)); ok {
|
|
return returnFunc(ctx, pm)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, notifiers.PageMetadata) notifiers.Page); ok {
|
|
r0 = returnFunc(ctx, pm)
|
|
} else {
|
|
r0 = ret.Get(0).(notifiers.Page)
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, notifiers.PageMetadata) error); ok {
|
|
r1 = returnFunc(ctx, pm)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// SubscriptionsRepository_RetrieveAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveAll'
|
|
type SubscriptionsRepository_RetrieveAll_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// RetrieveAll is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - pm notifiers.PageMetadata
|
|
func (_e *SubscriptionsRepository_Expecter) RetrieveAll(ctx interface{}, pm interface{}) *SubscriptionsRepository_RetrieveAll_Call {
|
|
return &SubscriptionsRepository_RetrieveAll_Call{Call: _e.mock.On("RetrieveAll", ctx, pm)}
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_RetrieveAll_Call) Run(run func(ctx context.Context, pm notifiers.PageMetadata)) *SubscriptionsRepository_RetrieveAll_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 notifiers.PageMetadata
|
|
if args[1] != nil {
|
|
arg1 = args[1].(notifiers.PageMetadata)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_RetrieveAll_Call) Return(page notifiers.Page, err error) *SubscriptionsRepository_RetrieveAll_Call {
|
|
_c.Call.Return(page, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_RetrieveAll_Call) RunAndReturn(run func(ctx context.Context, pm notifiers.PageMetadata) (notifiers.Page, error)) *SubscriptionsRepository_RetrieveAll_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Save provides a mock function for the type SubscriptionsRepository
|
|
func (_mock *SubscriptionsRepository) Save(ctx context.Context, sub notifiers.Subscription) (string, error) {
|
|
ret := _mock.Called(ctx, sub)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Save")
|
|
}
|
|
|
|
var r0 string
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, notifiers.Subscription) (string, error)); ok {
|
|
return returnFunc(ctx, sub)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, notifiers.Subscription) string); ok {
|
|
r0 = returnFunc(ctx, sub)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, notifiers.Subscription) error); ok {
|
|
r1 = returnFunc(ctx, sub)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// SubscriptionsRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save'
|
|
type SubscriptionsRepository_Save_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Save is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - sub notifiers.Subscription
|
|
func (_e *SubscriptionsRepository_Expecter) Save(ctx interface{}, sub interface{}) *SubscriptionsRepository_Save_Call {
|
|
return &SubscriptionsRepository_Save_Call{Call: _e.mock.On("Save", ctx, sub)}
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_Save_Call) Run(run func(ctx context.Context, sub notifiers.Subscription)) *SubscriptionsRepository_Save_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 notifiers.Subscription
|
|
if args[1] != nil {
|
|
arg1 = args[1].(notifiers.Subscription)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_Save_Call) Return(s string, err error) *SubscriptionsRepository_Save_Call {
|
|
_c.Call.Return(s, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *SubscriptionsRepository_Save_Call) RunAndReturn(run func(ctx context.Context, sub notifiers.Subscription) (string, error)) *SubscriptionsRepository_Save_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|