mirror of
https://github.com/absmach/magistrala.git
synced 2026-06-23 04:10:28 +00:00
ef5c253c51
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com> Signed-off-by: dusan <borovcanindusan1@gmail.com> Co-authored-by: Steve Munene <stevenyaga2014@gmail.com>
110 lines
2.8 KiB
Go
110 lines
2.8 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 (
|
|
"github.com/absmach/supermq/bootstrap"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// NewConfigReader creates a new instance of ConfigReader. 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 NewConfigReader(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *ConfigReader {
|
|
mock := &ConfigReader{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|
|
|
|
// ConfigReader is an autogenerated mock type for the ConfigReader type
|
|
type ConfigReader struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type ConfigReader_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *ConfigReader) EXPECT() *ConfigReader_Expecter {
|
|
return &ConfigReader_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// ReadConfig provides a mock function for the type ConfigReader
|
|
func (_mock *ConfigReader) ReadConfig(config bootstrap.Config, b bool) (any, error) {
|
|
ret := _mock.Called(config, b)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ReadConfig")
|
|
}
|
|
|
|
var r0 any
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(bootstrap.Config, bool) (any, error)); ok {
|
|
return returnFunc(config, b)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(bootstrap.Config, bool) any); ok {
|
|
r0 = returnFunc(config, b)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(any)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(bootstrap.Config, bool) error); ok {
|
|
r1 = returnFunc(config, b)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// ConfigReader_ReadConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadConfig'
|
|
type ConfigReader_ReadConfig_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ReadConfig is a helper method to define mock.On call
|
|
// - config bootstrap.Config
|
|
// - b bool
|
|
func (_e *ConfigReader_Expecter) ReadConfig(config interface{}, b interface{}) *ConfigReader_ReadConfig_Call {
|
|
return &ConfigReader_ReadConfig_Call{Call: _e.mock.On("ReadConfig", config, b)}
|
|
}
|
|
|
|
func (_c *ConfigReader_ReadConfig_Call) Run(run func(config bootstrap.Config, b bool)) *ConfigReader_ReadConfig_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 bootstrap.Config
|
|
if args[0] != nil {
|
|
arg0 = args[0].(bootstrap.Config)
|
|
}
|
|
var arg1 bool
|
|
if args[1] != nil {
|
|
arg1 = args[1].(bool)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *ConfigReader_ReadConfig_Call) Return(v any, err error) *ConfigReader_ReadConfig_Call {
|
|
_c.Call.Return(v, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *ConfigReader_ReadConfig_Call) RunAndReturn(run func(config bootstrap.Config, b bool) (any, error)) *ConfigReader_ReadConfig_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|