Files
Dušan Borovčanin 61d0427898 NOISSUE - Rename to Magistrala (#3427)
Signed-off-by: dusan <borovcanindusan1@gmail.com>
2026-04-06 15:23:42 +02:00

246 lines
7.2 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/journal"
"github.com/absmach/magistrala/pkg/authn"
mock "github.com/stretchr/testify/mock"
)
// NewService creates a new instance of Service. 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 NewService(t interface {
mock.TestingT
Cleanup(func())
}) *Service {
mock := &Service{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Service is an autogenerated mock type for the Service type
type Service struct {
mock.Mock
}
type Service_Expecter struct {
mock *mock.Mock
}
func (_m *Service) EXPECT() *Service_Expecter {
return &Service_Expecter{mock: &_m.Mock}
}
// RetrieveAll provides a mock function for the type Service
func (_mock *Service) RetrieveAll(ctx context.Context, session authn.Session, page journal.Page) (journal.JournalsPage, error) {
ret := _mock.Called(ctx, session, page)
if len(ret) == 0 {
panic("no return value specified for RetrieveAll")
}
var r0 journal.JournalsPage
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, journal.Page) (journal.JournalsPage, error)); ok {
return returnFunc(ctx, session, page)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, journal.Page) journal.JournalsPage); ok {
r0 = returnFunc(ctx, session, page)
} else {
r0 = ret.Get(0).(journal.JournalsPage)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, authn.Session, journal.Page) error); ok {
r1 = returnFunc(ctx, session, page)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Service_RetrieveAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveAll'
type Service_RetrieveAll_Call struct {
*mock.Call
}
// RetrieveAll is a helper method to define mock.On call
// - ctx context.Context
// - session authn.Session
// - page journal.Page
func (_e *Service_Expecter) RetrieveAll(ctx interface{}, session interface{}, page interface{}) *Service_RetrieveAll_Call {
return &Service_RetrieveAll_Call{Call: _e.mock.On("RetrieveAll", ctx, session, page)}
}
func (_c *Service_RetrieveAll_Call) Run(run func(ctx context.Context, session authn.Session, page journal.Page)) *Service_RetrieveAll_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 authn.Session
if args[1] != nil {
arg1 = args[1].(authn.Session)
}
var arg2 journal.Page
if args[2] != nil {
arg2 = args[2].(journal.Page)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Service_RetrieveAll_Call) Return(journalsPage journal.JournalsPage, err error) *Service_RetrieveAll_Call {
_c.Call.Return(journalsPage, err)
return _c
}
func (_c *Service_RetrieveAll_Call) RunAndReturn(run func(ctx context.Context, session authn.Session, page journal.Page) (journal.JournalsPage, error)) *Service_RetrieveAll_Call {
_c.Call.Return(run)
return _c
}
// RetrieveClientTelemetry provides a mock function for the type Service
func (_mock *Service) RetrieveClientTelemetry(ctx context.Context, session authn.Session, clientID string) (journal.ClientTelemetry, error) {
ret := _mock.Called(ctx, session, clientID)
if len(ret) == 0 {
panic("no return value specified for RetrieveClientTelemetry")
}
var r0 journal.ClientTelemetry
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, string) (journal.ClientTelemetry, error)); ok {
return returnFunc(ctx, session, clientID)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, authn.Session, string) journal.ClientTelemetry); ok {
r0 = returnFunc(ctx, session, clientID)
} else {
r0 = ret.Get(0).(journal.ClientTelemetry)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, authn.Session, string) error); ok {
r1 = returnFunc(ctx, session, clientID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Service_RetrieveClientTelemetry_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveClientTelemetry'
type Service_RetrieveClientTelemetry_Call struct {
*mock.Call
}
// RetrieveClientTelemetry is a helper method to define mock.On call
// - ctx context.Context
// - session authn.Session
// - clientID string
func (_e *Service_Expecter) RetrieveClientTelemetry(ctx interface{}, session interface{}, clientID interface{}) *Service_RetrieveClientTelemetry_Call {
return &Service_RetrieveClientTelemetry_Call{Call: _e.mock.On("RetrieveClientTelemetry", ctx, session, clientID)}
}
func (_c *Service_RetrieveClientTelemetry_Call) Run(run func(ctx context.Context, session authn.Session, clientID string)) *Service_RetrieveClientTelemetry_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 authn.Session
if args[1] != nil {
arg1 = args[1].(authn.Session)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *Service_RetrieveClientTelemetry_Call) Return(clientTelemetry journal.ClientTelemetry, err error) *Service_RetrieveClientTelemetry_Call {
_c.Call.Return(clientTelemetry, err)
return _c
}
func (_c *Service_RetrieveClientTelemetry_Call) RunAndReturn(run func(ctx context.Context, session authn.Session, clientID string) (journal.ClientTelemetry, error)) *Service_RetrieveClientTelemetry_Call {
_c.Call.Return(run)
return _c
}
// Save provides a mock function for the type Service
func (_mock *Service) Save(ctx context.Context, journal1 journal.Journal) error {
ret := _mock.Called(ctx, journal1)
if len(ret) == 0 {
panic("no return value specified for Save")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, journal.Journal) error); ok {
r0 = returnFunc(ctx, journal1)
} else {
r0 = ret.Error(0)
}
return r0
}
// Service_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save'
type Service_Save_Call struct {
*mock.Call
}
// Save is a helper method to define mock.On call
// - ctx context.Context
// - journal1 journal.Journal
func (_e *Service_Expecter) Save(ctx interface{}, journal1 interface{}) *Service_Save_Call {
return &Service_Save_Call{Call: _e.mock.On("Save", ctx, journal1)}
}
func (_c *Service_Save_Call) Run(run func(ctx context.Context, journal1 journal.Journal)) *Service_Save_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 journal.Journal
if args[1] != nil {
arg1 = args[1].(journal.Journal)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *Service_Save_Call) Return(err error) *Service_Save_Call {
_c.Call.Return(err)
return _c
}
func (_c *Service_Save_Call) RunAndReturn(run func(ctx context.Context, journal1 journal.Journal) error) *Service_Save_Call {
_c.Call.Return(run)
return _c
}