mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 07:40:17 +00:00
8f9a496ed6
* Update Makefile Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Update SMQ dependencies Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Fix Makefile Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Update CI linter Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Update Codecov version Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> * Update Mockery version Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com> --------- Signed-off-by: Dusan Borovcanin <borovcanindusan1@gmail.com>
355 lines
9.9 KiB
Go
355 lines
9.9 KiB
Go
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
|
|
|
// Copyright (c) Abstract Machines
|
|
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
|
|
bootstrap "github.com/absmach/magistrala/bootstrap"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// ConfigRepository is an autogenerated mock type for the ConfigRepository type
|
|
type ConfigRepository struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// ChangeState provides a mock function with given fields: ctx, domainID, id, state
|
|
func (_m *ConfigRepository) ChangeState(ctx context.Context, domainID string, id string, state bootstrap.State) error {
|
|
ret := _m.Called(ctx, domainID, id, state)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ChangeState")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, bootstrap.State) error); ok {
|
|
r0 = rf(ctx, domainID, id, state)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// ConnectClient provides a mock function with given fields: ctx, channelID, clientID
|
|
func (_m *ConfigRepository) ConnectClient(ctx context.Context, channelID string, clientID string) error {
|
|
ret := _m.Called(ctx, channelID, clientID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ConnectClient")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
|
|
r0 = rf(ctx, channelID, clientID)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// DisconnectClient provides a mock function with given fields: ctx, channelID, clientID
|
|
func (_m *ConfigRepository) DisconnectClient(ctx context.Context, channelID string, clientID string) error {
|
|
ret := _m.Called(ctx, channelID, clientID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DisconnectClient")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
|
|
r0 = rf(ctx, channelID, clientID)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// ListExisting provides a mock function with given fields: ctx, domainID, ids
|
|
func (_m *ConfigRepository) ListExisting(ctx context.Context, domainID string, ids []string) ([]bootstrap.Channel, error) {
|
|
ret := _m.Called(ctx, domainID, ids)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ListExisting")
|
|
}
|
|
|
|
var r0 []bootstrap.Channel
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, []string) ([]bootstrap.Channel, error)); ok {
|
|
return rf(ctx, domainID, ids)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, []string) []bootstrap.Channel); ok {
|
|
r0 = rf(ctx, domainID, ids)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]bootstrap.Channel)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, []string) error); ok {
|
|
r1 = rf(ctx, domainID, ids)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Remove provides a mock function with given fields: ctx, domainID, id
|
|
func (_m *ConfigRepository) Remove(ctx context.Context, domainID string, id string) error {
|
|
ret := _m.Called(ctx, domainID, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Remove")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
|
|
r0 = rf(ctx, domainID, id)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// RemoveChannel provides a mock function with given fields: ctx, id
|
|
func (_m *ConfigRepository) RemoveChannel(ctx context.Context, id string) error {
|
|
ret := _m.Called(ctx, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RemoveChannel")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// RemoveClient provides a mock function with given fields: ctx, id
|
|
func (_m *ConfigRepository) RemoveClient(ctx context.Context, id string) error {
|
|
ret := _m.Called(ctx, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RemoveClient")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// RetrieveAll provides a mock function with given fields: ctx, domainID, clientIDs, filter, offset, limit
|
|
func (_m *ConfigRepository) RetrieveAll(ctx context.Context, domainID string, clientIDs []string, filter bootstrap.Filter, offset uint64, limit uint64) bootstrap.ConfigsPage {
|
|
ret := _m.Called(ctx, domainID, clientIDs, filter, offset, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RetrieveAll")
|
|
}
|
|
|
|
var r0 bootstrap.ConfigsPage
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, []string, bootstrap.Filter, uint64, uint64) bootstrap.ConfigsPage); ok {
|
|
r0 = rf(ctx, domainID, clientIDs, filter, offset, limit)
|
|
} else {
|
|
r0 = ret.Get(0).(bootstrap.ConfigsPage)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// RetrieveByExternalID provides a mock function with given fields: ctx, externalID
|
|
func (_m *ConfigRepository) RetrieveByExternalID(ctx context.Context, externalID string) (bootstrap.Config, error) {
|
|
ret := _m.Called(ctx, externalID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RetrieveByExternalID")
|
|
}
|
|
|
|
var r0 bootstrap.Config
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) (bootstrap.Config, error)); ok {
|
|
return rf(ctx, externalID)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) bootstrap.Config); ok {
|
|
r0 = rf(ctx, externalID)
|
|
} else {
|
|
r0 = ret.Get(0).(bootstrap.Config)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, externalID)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// RetrieveByID provides a mock function with given fields: ctx, domainID, id
|
|
func (_m *ConfigRepository) RetrieveByID(ctx context.Context, domainID string, id string) (bootstrap.Config, error) {
|
|
ret := _m.Called(ctx, domainID, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RetrieveByID")
|
|
}
|
|
|
|
var r0 bootstrap.Config
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) (bootstrap.Config, error)); ok {
|
|
return rf(ctx, domainID, id)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) bootstrap.Config); ok {
|
|
r0 = rf(ctx, domainID, id)
|
|
} else {
|
|
r0 = ret.Get(0).(bootstrap.Config)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
|
|
r1 = rf(ctx, domainID, id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Save provides a mock function with given fields: ctx, cfg, chsConnIDs
|
|
func (_m *ConfigRepository) Save(ctx context.Context, cfg bootstrap.Config, chsConnIDs []string) (string, error) {
|
|
ret := _m.Called(ctx, cfg, chsConnIDs)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Save")
|
|
}
|
|
|
|
var r0 string
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, bootstrap.Config, []string) (string, error)); ok {
|
|
return rf(ctx, cfg, chsConnIDs)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, bootstrap.Config, []string) string); ok {
|
|
r0 = rf(ctx, cfg, chsConnIDs)
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, bootstrap.Config, []string) error); ok {
|
|
r1 = rf(ctx, cfg, chsConnIDs)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Update provides a mock function with given fields: ctx, cfg
|
|
func (_m *ConfigRepository) Update(ctx context.Context, cfg bootstrap.Config) error {
|
|
ret := _m.Called(ctx, cfg)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Update")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, bootstrap.Config) error); ok {
|
|
r0 = rf(ctx, cfg)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// UpdateCert provides a mock function with given fields: ctx, domainID, clientID, clientCert, clientKey, caCert
|
|
func (_m *ConfigRepository) UpdateCert(ctx context.Context, domainID string, clientID string, clientCert string, clientKey string, caCert string) (bootstrap.Config, error) {
|
|
ret := _m.Called(ctx, domainID, clientID, clientCert, clientKey, caCert)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UpdateCert")
|
|
}
|
|
|
|
var r0 bootstrap.Config
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string) (bootstrap.Config, error)); ok {
|
|
return rf(ctx, domainID, clientID, clientCert, clientKey, caCert)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string) bootstrap.Config); ok {
|
|
r0 = rf(ctx, domainID, clientID, clientCert, clientKey, caCert)
|
|
} else {
|
|
r0 = ret.Get(0).(bootstrap.Config)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, string) error); ok {
|
|
r1 = rf(ctx, domainID, clientID, clientCert, clientKey, caCert)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UpdateChannel provides a mock function with given fields: ctx, c
|
|
func (_m *ConfigRepository) UpdateChannel(ctx context.Context, c bootstrap.Channel) error {
|
|
ret := _m.Called(ctx, c)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UpdateChannel")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, bootstrap.Channel) error); ok {
|
|
r0 = rf(ctx, c)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// UpdateConnections provides a mock function with given fields: ctx, domainID, id, channels, connections
|
|
func (_m *ConfigRepository) UpdateConnections(ctx context.Context, domainID string, id string, channels []bootstrap.Channel, connections []string) error {
|
|
ret := _m.Called(ctx, domainID, id, channels, connections)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UpdateConnections")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string, []bootstrap.Channel, []string) error); ok {
|
|
r0 = rf(ctx, domainID, id, channels, connections)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// NewConfigRepository creates a new instance of ConfigRepository. 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 NewConfigRepository(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *ConfigRepository {
|
|
mock := &ConfigRepository{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|