diff --git a/api/api.go b/api/api.go index 034d352..16b3fe5 100644 --- a/api/api.go +++ b/api/api.go @@ -9,57 +9,57 @@ import ( //go:generate mockery -type EventHandler interface { +type EventHandlerInterface interface { HandleEvent(EventPayload) } /* Device */ -type Device interface { +type DeviceInterface interface { Address() *model.AddressDeviceType DeviceType() *model.DeviceTypeType FeatureSet() *model.NetworkManagementFeatureSetType DestinationData() model.NodeManagementDestinationDataType } -type DeviceLocal interface { - Device +type DeviceLocalInterface interface { + DeviceInterface RemoveRemoteDeviceConnection(ski string) - AddRemoteDeviceForSki(ski string, rDevice DeviceRemote) - SetupRemoteDevice(ski string, writeI shipapi.SpineDataConnection) shipapi.SpineDataProcessing + AddRemoteDeviceForSki(ski string, rDevice DeviceRemoteInterface) + SetupRemoteDevice(ski string, writeI shipapi.ShipConnectionDataWriterInterface) shipapi.ShipConnectionDataReaderInterface RemoveRemoteDevice(ski string) - RemoteDevices() []DeviceRemote - RemoteDeviceForAddress(address model.AddressDeviceType) DeviceRemote - RemoteDeviceForSki(ski string) DeviceRemote - ProcessCmd(datagram model.DatagramType, remoteDevice DeviceRemote) error - NodeManagement() NodeManagement - SubscriptionManager() SubscriptionManager - BindingManager() BindingManager - HeartbeatManager() HeartbeatManager - AddEntity(entity EntityLocal) - RemoveEntity(entity EntityLocal) - Entities() []EntityLocal - Entity(id []model.AddressEntityType) EntityLocal - EntityForType(entityType model.EntityTypeType) EntityLocal - FeatureByAddress(address *model.FeatureAddressType) FeatureLocal + RemoteDevices() []DeviceRemoteInterface + RemoteDeviceForAddress(address model.AddressDeviceType) DeviceRemoteInterface + RemoteDeviceForSki(ski string) DeviceRemoteInterface + ProcessCmd(datagram model.DatagramType, remoteDevice DeviceRemoteInterface) error + NodeManagement() NodeManagementInterface + SubscriptionManager() SubscriptionManagerInterface + BindingManager() BindingManagerInterface + HeartbeatManager() HeartbeatManagerInterface + AddEntity(entity EntityLocalInterface) + RemoveEntity(entity EntityLocalInterface) + Entities() []EntityLocalInterface + Entity(id []model.AddressEntityType) EntityLocalInterface + EntityForType(entityType model.EntityTypeType) EntityLocalInterface + FeatureByAddress(address *model.FeatureAddressType) FeatureLocalInterface NotifySubscribers(featureAddress *model.FeatureAddressType, cmd model.CmdType) Information() *model.NodeManagementDetailedDiscoveryDeviceInformationType } -type DeviceRemote interface { - Device +type DeviceRemoteInterface interface { + DeviceInterface Ski() string SetAddress(address *model.AddressDeviceType) HandleSpineMesssage(message []byte) (*model.MsgCounterType, error) - Sender() Sender - Entity(id []model.AddressEntityType) EntityRemote - Entities() []EntityRemote - FeatureByAddress(address *model.FeatureAddressType) FeatureRemote - RemoveByAddress(addr []model.AddressEntityType) EntityRemote - FeatureByEntityTypeAndRole(entity EntityRemote, featureType model.FeatureTypeType, role model.RoleType) FeatureRemote + Sender() SenderInterface + Entity(id []model.AddressEntityType) EntityRemoteInterface + Entities() []EntityRemoteInterface + FeatureByAddress(address *model.FeatureAddressType) FeatureRemoteInterface + RemoveByAddress(addr []model.AddressEntityType) EntityRemoteInterface + FeatureByEntityTypeAndRole(entity EntityRemoteInterface, featureType model.FeatureTypeType, role model.RoleType) FeatureRemoteInterface UpdateDevice(description *model.NetworkManagementDeviceDescriptionDataType) - AddEntityAndFeatures(initialData bool, data *model.NodeManagementDetailedDiscoveryDataType) ([]EntityRemote, error) - AddEntity(entity EntityRemote) EntityRemote + AddEntityAndFeatures(initialData bool, data *model.NodeManagementDetailedDiscoveryDataType) ([]EntityRemoteInterface, error) + AddEntity(entity EntityRemoteInterface) EntityRemoteInterface UseCases() []model.UseCaseInformationDataType VerifyUseCaseScenariosAndFeaturesSupport( usecaseActor model.UseCaseActorType, @@ -72,7 +72,7 @@ type DeviceRemote interface { /* Entity */ -type Entity interface { +type EntityInterface interface { EntityType() model.EntityTypeType Address() *model.EntityAddressType Description() *model.DescriptionType @@ -80,14 +80,14 @@ type Entity interface { NextFeatureId() uint } -type EntityLocal interface { - Entity - Device() DeviceLocal - AddFeature(f FeatureLocal) - GetOrAddFeature(featureType model.FeatureTypeType, role model.RoleType) FeatureLocal - FeatureOfTypeAndRole(featureType model.FeatureTypeType, role model.RoleType) FeatureLocal - Features() []FeatureLocal - Feature(addressFeature *model.AddressFeatureType) FeatureLocal +type EntityLocalInterface interface { + EntityInterface + Device() DeviceLocalInterface + AddFeature(f FeatureLocalInterface) + GetOrAddFeature(featureType model.FeatureTypeType, role model.RoleType) FeatureLocalInterface + FeatureOfTypeAndRole(featureType model.FeatureTypeType, role model.RoleType) FeatureLocalInterface + Features() []FeatureLocalInterface + Feature(addressFeature *model.AddressFeatureType) FeatureLocalInterface Information() *model.NodeManagementDetailedDiscoveryEntityInformationType AddUseCaseSupport( actor model.UseCaseActorType, @@ -106,48 +106,48 @@ type EntityLocal interface { RemoveAllBindings() } -type EntityRemote interface { - Entity - Device() DeviceRemote - AddFeature(f FeatureRemote) - Features() []FeatureRemote - Feature(addressFeature *model.AddressFeatureType) FeatureRemote +type EntityRemoteInterface interface { + EntityInterface + Device() DeviceRemoteInterface + AddFeature(f FeatureRemoteInterface) + Features() []FeatureRemoteInterface + Feature(addressFeature *model.AddressFeatureType) FeatureRemoteInterface RemoveAllFeatures() } /* Feature */ -type Feature interface { +type FeatureInterface interface { Address() *model.FeatureAddressType Type() model.FeatureTypeType Role() model.RoleType - Operations() map[model.FunctionType]Operations + Operations() map[model.FunctionType]OperationsInterface Description() *model.DescriptionType SetDescription(desc *model.DescriptionType) SetDescriptionString(s string) String() string } -type FeatureRemote interface { - Feature +type FeatureRemoteInterface interface { + FeatureInterface DataCopy(function model.FunctionType) any SetData(function model.FunctionType, data any) UpdateData(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType) - Sender() Sender - Device() DeviceRemote - Entity() EntityRemote + Sender() SenderInterface + Device() DeviceRemoteInterface + Entity() EntityRemoteInterface SetOperations(functions []model.FunctionPropertyType) SetMaxResponseDelay(delay *model.MaxResponseDelayType) MaxResponseDelayDuration() time.Duration } -type FeatureLocal interface { - Feature - Device() DeviceLocal - Entity() EntityLocal +type FeatureLocalInterface interface { + FeatureInterface + Device() DeviceLocalInterface + Entity() EntityLocalInterface DataCopy(function model.FunctionType) any SetData(function model.FunctionType, data any) - AddResultHandler(handler FeatureResult) + AddResultHandler(handler FeatureResultInterface) AddResultCallback(msgCounterReference model.MsgCounterType, function func(msg ResultMessage)) Information() *model.NodeManagementDetailedDiscoveryFeatureInformationType AddFunctionType(function model.FunctionType, read, write bool) @@ -155,16 +155,16 @@ type FeatureLocal interface { function model.FunctionType, selector any, elements any, - destination FeatureRemote) (*model.MsgCounterType, *model.ErrorType) + destination FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) RequestDataBySenderAddress( cmd model.CmdType, - sender Sender, + sender SenderInterface, destinationSki string, destinationAddress *model.FeatureAddressType, maxDelay time.Duration) (*model.MsgCounterType, *model.ErrorType) FetchRequestData( msgCounter model.MsgCounterType, - destination FeatureRemote) (any, *model.ErrorType) + destination FeatureRemoteInterface) (any, *model.ErrorType) Subscribe(remoteAdress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) // SubscribeAndWait(remoteDevice DeviceRemote, remoteAdress *model.FeatureAddressType) *ErrorType // Subscribes the local feature to the given destination feature; the go routine will block until the response is processed RemoveSubscription(remoteAddress *model.FeatureAddressType) @@ -178,34 +178,34 @@ type FeatureLocal interface { deleteSelector, partialSelector any, partialWithoutSelector bool, deleteElements any, - destination FeatureRemote) (*model.MsgCounterType, *model.ErrorType) + destination FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) WriteData( function model.FunctionType, deleteSelector, partialSelector any, deleteElements any, - destination FeatureRemote) (*model.MsgCounterType, *model.ErrorType) + destination FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) HandleMessage(message *Message) *model.ErrorType } -type NodeManagement interface { - FeatureLocal +type NodeManagementInterface interface { + FeatureLocalInterface } -type FeatureResult interface { +type FeatureResultInterface interface { HandleResult(ResultMessage) } /* Functions */ -type FunctionDataCmd interface { - FunctionData +type FunctionDataCmdInterface interface { + FunctionDataInterface ReadCmdType(partialSelector any, elements any) model.CmdType ReplyCmdType(partial bool) model.CmdType NotifyCmdType(deleteSelector, partialSelector any, partialWithoutSelector bool, deleteElements any) model.CmdType WriteCmdType(deleteSelector, partialSelector any, deleteElements any) model.CmdType } -type FunctionData interface { +type FunctionDataInterface interface { Function() model.FunctionType DataCopyAny() any UpdateDataAny(data any, filterPartial *model.FilterType, filterDelete *model.FilterType) @@ -213,14 +213,12 @@ type FunctionData interface { /* Sender */ -type ComControl interface { +type ComControlInterface interface { // This must be connected to the correct remote device !! SendSpineMessage(datagram model.DatagramType) error } -//go:generate mockery --name=Sender - -type Sender interface { +type SenderInterface interface { // Sends a read cmd to request some data Request(cmdClassifier model.CmdClassifierType, senderAddress, destinationAddress *model.FeatureAddressType, ackRequest bool, cmd []model.CmdType) (*model.MsgCounterType, error) // Sends a result cmd with no error to indicate that a message was processed successfully @@ -247,7 +245,7 @@ type Sender interface { /* PendingRequests */ -type PendingRequests interface { +type PendingRequestsInterface interface { Add(ski string, counter model.MsgCounterType, maxDelay time.Duration) SetData(ski string, counter model.MsgCounterType, data any) *model.ErrorType SetResult(ski string, counter model.MsgCounterType, errorResult *model.ErrorType) *model.ErrorType @@ -258,38 +256,38 @@ type PendingRequests interface { /* Bindings */ // implemented by BindingManagerImpl -type BindingManager interface { - AddBinding(remoteDevice DeviceRemote, data model.BindingManagementRequestCallType) error - RemoveBinding(data model.BindingManagementDeleteCallType, remoteDevice DeviceRemote) error - RemoveBindingsForDevice(remoteDevice DeviceRemote) - RemoveBindingsForEntity(remoteEntity EntityRemote) - Bindings(remoteDevice DeviceRemote) []*BindingEntry +type BindingManagerInterface interface { + AddBinding(remoteDevice DeviceRemoteInterface, data model.BindingManagementRequestCallType) error + RemoveBinding(data model.BindingManagementDeleteCallType, remoteDevice DeviceRemoteInterface) error + RemoveBindingsForDevice(remoteDevice DeviceRemoteInterface) + RemoveBindingsForEntity(remoteEntity EntityRemoteInterface) + Bindings(remoteDevice DeviceRemoteInterface) []*BindingEntry BindingsOnFeature(featureAddress model.FeatureAddressType) []*BindingEntry HasLocalFeatureRemoteBinding(localAddress, remoteAddress *model.FeatureAddressType) bool } /* Subscription Manager */ -type SubscriptionManager interface { - AddSubscription(remoteDevice DeviceRemote, data model.SubscriptionManagementRequestCallType) error - RemoveSubscription(data model.SubscriptionManagementDeleteCallType, remoteDevice DeviceRemote) error - RemoveSubscriptionsForDevice(remoteDevice DeviceRemote) - RemoveSubscriptionsForEntity(remoteEntity EntityRemote) - Subscriptions(remoteDevice DeviceRemote) []*SubscriptionEntry +type SubscriptionManagerInterface interface { + AddSubscription(remoteDevice DeviceRemoteInterface, data model.SubscriptionManagementRequestCallType) error + RemoveSubscription(data model.SubscriptionManagementDeleteCallType, remoteDevice DeviceRemoteInterface) error + RemoveSubscriptionsForDevice(remoteDevice DeviceRemoteInterface) + RemoveSubscriptionsForEntity(remoteEntity EntityRemoteInterface) + Subscriptions(remoteDevice DeviceRemoteInterface) []*SubscriptionEntry SubscriptionsOnFeature(featureAddress model.FeatureAddressType) []*SubscriptionEntry } /* Heartbeats */ -type HeartbeatManager interface { +type HeartbeatManagerInterface interface { IsHeartbeatRunning() bool UpdateHeartbeatOnSubscriptions() - SetLocalFeature(entity EntityLocal, feature FeatureLocal) + SetLocalFeature(entity EntityLocalInterface, feature FeatureLocalInterface) StartHeartbeat() error StopHeartbeat() } -type Operations interface { +type OperationsInterface interface { Write() bool Read() bool String() string diff --git a/api/binding.go b/api/binding.go index 14a41b6..e645e46 100644 --- a/api/binding.go +++ b/api/binding.go @@ -2,6 +2,6 @@ package api type BindingEntry struct { Id uint64 - ServerFeature FeatureLocal - ClientFeature FeatureRemote + ServerFeature FeatureLocalInterface + ClientFeature FeatureRemoteInterface } diff --git a/api/events.go b/api/events.go index 76a6aeb..57a5d68 100644 --- a/api/events.go +++ b/api/events.go @@ -28,13 +28,13 @@ const ( ) type EventPayload struct { - Ski string // required - EventType EventType // required - ChangeType ElementChangeType // required - Device DeviceRemote // required for DetailedDiscovery Call - Entity EntityRemote // required for DetailedDiscovery Call and Notify - Feature FeatureRemote - LocalFeature FeatureLocal // required for write commands + Ski string // required + EventType EventType // required + ChangeType ElementChangeType // required + Device DeviceRemoteInterface // required for DetailedDiscovery Call + Entity EntityRemoteInterface // required for DetailedDiscovery Call and Notify + Feature FeatureRemoteInterface + LocalFeature FeatureLocalInterface // required for write commands Function model.FunctionType // required for write commands CmdClassifier *model.CmdClassifierType // optional, used together with EventType EventTypeDataChange Data any diff --git a/api/message.go b/api/message.go index 9ed68b3..ab20f24 100644 --- a/api/message.go +++ b/api/message.go @@ -8,16 +8,16 @@ type Message struct { Cmd model.CmdType FilterPartial *model.FilterType FilterDelete *model.FilterType - FeatureRemote FeatureRemote - EntityRemote EntityRemote - DeviceRemote DeviceRemote + FeatureRemote FeatureRemoteInterface + EntityRemote EntityRemoteInterface + DeviceRemote DeviceRemoteInterface } type ResultMessage struct { - MsgCounterReference model.MsgCounterType // required - Result *model.ResultDataType // required, may not be nil - FeatureLocal FeatureLocal // required, may not be nil - FeatureRemote FeatureRemote // required, may not be nil - EntityRemote EntityRemote // required, may not be nil - DeviceRemote DeviceRemote // required, may not be nil + MsgCounterReference model.MsgCounterType // required + Result *model.ResultDataType // required, may not be nil + FeatureLocal FeatureLocalInterface // required, may not be nil + FeatureRemote FeatureRemoteInterface // required, may not be nil + EntityRemote EntityRemoteInterface // required, may not be nil + DeviceRemote DeviceRemoteInterface // required, may not be nil } diff --git a/api/subscription.go b/api/subscription.go index bff2170..cf69fd1 100644 --- a/api/subscription.go +++ b/api/subscription.go @@ -2,6 +2,6 @@ package api type SubscriptionEntry struct { Id uint64 - ServerFeature FeatureLocal - ClientFeature FeatureRemote + ServerFeature FeatureLocalInterface + ClientFeature FeatureRemoteInterface } diff --git a/go.mod b/go.mod index f21ae08..4f70ce8 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.1 require ( github.com/ahmetb/go-linq/v3 v3.2.0 - github.com/enbility/ship-go v0.0.0-20240122172808-3c326eca22ec + github.com/enbility/ship-go v0.0.0-20240123184928-6739ac1a68c4 github.com/google/go-cmp v0.6.0 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/rickb777/date v1.20.5 diff --git a/go.sum b/go.sum index 29bf47d..aefdab8 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ github.com/ahmetb/go-linq/v3 v3.2.0/go.mod h1:haQ3JfOeWK8HpVxMtHHEMPVgBKiYyQ+f1/ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/enbility/ship-go v0.0.0-20240122172808-3c326eca22ec h1:Bu0hu9rsJIkUCtg64YJZte5OaGx0LStrmS10ufEma6o= -github.com/enbility/ship-go v0.0.0-20240122172808-3c326eca22ec/go.mod h1:6xPvus7uzBqq3p2mQRWmbjP8n1/gpMil3jikRNBDUCg= +github.com/enbility/ship-go v0.0.0-20240123184928-6739ac1a68c4 h1:I54U0+MHwtsHUS7OLEt0z5fGNZOpV7G3EgQxRvFXeKI= +github.com/enbility/ship-go v0.0.0-20240123184928-6739ac1a68c4/go.mod h1:6xPvus7uzBqq3p2mQRWmbjP8n1/gpMil3jikRNBDUCg= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= diff --git a/integration_tests/devicediagnosis_test.go b/integration_tests/devicediagnosis_test.go index b488e5e..faa2370 100644 --- a/integration_tests/devicediagnosis_test.go +++ b/integration_tests/devicediagnosis_test.go @@ -21,11 +21,11 @@ func TestDeviceDiagnosisSuite(t *testing.T) { type DeviceDiagnosisSuite struct { suite.Suite - sut api.DeviceLocal + sut api.DeviceLocalInterface remoteSki string - remoteDevice api.DeviceRemote + remoteDevice api.DeviceRemoteInterface writeHandler *WriteMessageHandler } diff --git a/integration_tests/electricalconnection_test.go b/integration_tests/electricalconnection_test.go index d909a02..b1f15a3 100644 --- a/integration_tests/electricalconnection_test.go +++ b/integration_tests/electricalconnection_test.go @@ -23,11 +23,11 @@ func TestElectricalConnectionSuite(t *testing.T) { type ElectricalConnectionSuite struct { suite.Suite - sut api.DeviceLocal + sut api.DeviceLocalInterface remoteSki string - remoteDevice api.DeviceRemote + remoteDevice api.DeviceRemoteInterface writeHandler *WriteMessageHandler } diff --git a/integration_tests/helper_test.go b/integration_tests/helper_test.go index c73ff75..fe9f4cc 100644 --- a/integration_tests/helper_test.go +++ b/integration_tests/helper_test.go @@ -25,9 +25,9 @@ type WriteMessageHandler struct { mux sync.Mutex } -var _ shipapi.SpineDataConnection = (*WriteMessageHandler)(nil) +var _ shipapi.ShipConnectionDataWriterInterface = (*WriteMessageHandler)(nil) -func (t *WriteMessageHandler) WriteSpineMessage(message []byte) { +func (t *WriteMessageHandler) WriteShipMessageWithPayload(message []byte) { t.mux.Lock() defer t.mux.Unlock() @@ -99,12 +99,12 @@ func (t *WriteMessageHandler) ResultWithReference(msgCounterReference *model.Msg func beforeTest( suiteName, testName string, fId uint, ftype model.FeatureTypeType, - frole model.RoleType) (api.DeviceLocal, string, api.DeviceRemote, *WriteMessageHandler) { - sut := spine.NewDeviceLocalImpl("TestBrandName", "TestDeviceModel", "TestSerialNumber", "TestDeviceCode", + frole model.RoleType) (api.DeviceLocalInterface, string, api.DeviceRemoteInterface, *WriteMessageHandler) { + sut := spine.NewDeviceLocal("TestBrandName", "TestDeviceModel", "TestSerialNumber", "TestDeviceCode", "TestDeviceAddress", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) - localEntity := spine.NewEntityLocalImpl(sut, model.EntityTypeTypeCEM, spine.NewAddressEntityType([]uint{1})) + localEntity := spine.NewEntityLocal(sut, model.EntityTypeTypeCEM, spine.NewAddressEntityType([]uint{1})) sut.AddEntity(localEntity) - f := spine.NewFeatureLocalImpl(fId, localEntity, ftype, frole) + f := spine.NewFeatureLocal(fId, localEntity, ftype, frole) localEntity.AddFeature(f) remoteSki := "TestRemoteSki" @@ -116,7 +116,7 @@ func beforeTest( return sut, remoteSki, remoteDevice, writeHandler } -func initialCommunication(t *testing.T, remoteDevice api.DeviceRemote, writeHandler *WriteMessageHandler) { +func initialCommunication(t *testing.T, remoteDevice api.DeviceRemoteInterface, writeHandler *WriteMessageHandler) { // Initial generic communication _, _ = remoteDevice.HandleSpineMesssage(loadFileData(t, wallbox_detaileddiscoverydata_recv_reply_file_path)) diff --git a/integration_tests/measurement_test.go b/integration_tests/measurement_test.go index 61532a0..e9d46a9 100644 --- a/integration_tests/measurement_test.go +++ b/integration_tests/measurement_test.go @@ -23,11 +23,11 @@ func TestMeasurementSuite(t *testing.T) { type MeasurementSuite struct { suite.Suite - sut api.DeviceLocal + sut api.DeviceLocalInterface remoteSki string - remoteDevice api.DeviceRemote + remoteDevice api.DeviceRemoteInterface writeHandler *WriteMessageHandler } diff --git a/mocks/BindingManager.go b/mocks/BindingManager.go deleted file mode 100644 index 66fac6d..0000000 --- a/mocks/BindingManager.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" - - model "github.com/enbility/spine-go/model" -) - -// BindingManager is an autogenerated mock type for the BindingManager type -type BindingManager struct { - mock.Mock -} - -type BindingManager_Expecter struct { - mock *mock.Mock -} - -func (_m *BindingManager) EXPECT() *BindingManager_Expecter { - return &BindingManager_Expecter{mock: &_m.Mock} -} - -// AddBinding provides a mock function with given fields: remoteDevice, data -func (_m *BindingManager) AddBinding(remoteDevice api.DeviceRemote, data model.BindingManagementRequestCallType) error { - ret := _m.Called(remoteDevice, data) - - if len(ret) == 0 { - panic("no return value specified for AddBinding") - } - - var r0 error - if rf, ok := ret.Get(0).(func(api.DeviceRemote, model.BindingManagementRequestCallType) error); ok { - r0 = rf(remoteDevice, data) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BindingManager_AddBinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddBinding' -type BindingManager_AddBinding_Call struct { - *mock.Call -} - -// AddBinding is a helper method to define mock.On call -// - remoteDevice api.DeviceRemote -// - data model.BindingManagementRequestCallType -func (_e *BindingManager_Expecter) AddBinding(remoteDevice interface{}, data interface{}) *BindingManager_AddBinding_Call { - return &BindingManager_AddBinding_Call{Call: _e.mock.On("AddBinding", remoteDevice, data)} -} - -func (_c *BindingManager_AddBinding_Call) Run(run func(remoteDevice api.DeviceRemote, data model.BindingManagementRequestCallType)) *BindingManager_AddBinding_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.DeviceRemote), args[1].(model.BindingManagementRequestCallType)) - }) - return _c -} - -func (_c *BindingManager_AddBinding_Call) Return(_a0 error) *BindingManager_AddBinding_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *BindingManager_AddBinding_Call) RunAndReturn(run func(api.DeviceRemote, model.BindingManagementRequestCallType) error) *BindingManager_AddBinding_Call { - _c.Call.Return(run) - return _c -} - -// Bindings provides a mock function with given fields: remoteDevice -func (_m *BindingManager) Bindings(remoteDevice api.DeviceRemote) []*api.BindingEntry { - ret := _m.Called(remoteDevice) - - if len(ret) == 0 { - panic("no return value specified for Bindings") - } - - var r0 []*api.BindingEntry - if rf, ok := ret.Get(0).(func(api.DeviceRemote) []*api.BindingEntry); ok { - r0 = rf(remoteDevice) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*api.BindingEntry) - } - } - - return r0 -} - -// BindingManager_Bindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bindings' -type BindingManager_Bindings_Call struct { - *mock.Call -} - -// Bindings is a helper method to define mock.On call -// - remoteDevice api.DeviceRemote -func (_e *BindingManager_Expecter) Bindings(remoteDevice interface{}) *BindingManager_Bindings_Call { - return &BindingManager_Bindings_Call{Call: _e.mock.On("Bindings", remoteDevice)} -} - -func (_c *BindingManager_Bindings_Call) Run(run func(remoteDevice api.DeviceRemote)) *BindingManager_Bindings_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.DeviceRemote)) - }) - return _c -} - -func (_c *BindingManager_Bindings_Call) Return(_a0 []*api.BindingEntry) *BindingManager_Bindings_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *BindingManager_Bindings_Call) RunAndReturn(run func(api.DeviceRemote) []*api.BindingEntry) *BindingManager_Bindings_Call { - _c.Call.Return(run) - return _c -} - -// BindingsOnFeature provides a mock function with given fields: featureAddress -func (_m *BindingManager) BindingsOnFeature(featureAddress model.FeatureAddressType) []*api.BindingEntry { - ret := _m.Called(featureAddress) - - if len(ret) == 0 { - panic("no return value specified for BindingsOnFeature") - } - - var r0 []*api.BindingEntry - if rf, ok := ret.Get(0).(func(model.FeatureAddressType) []*api.BindingEntry); ok { - r0 = rf(featureAddress) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*api.BindingEntry) - } - } - - return r0 -} - -// BindingManager_BindingsOnFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BindingsOnFeature' -type BindingManager_BindingsOnFeature_Call struct { - *mock.Call -} - -// BindingsOnFeature is a helper method to define mock.On call -// - featureAddress model.FeatureAddressType -func (_e *BindingManager_Expecter) BindingsOnFeature(featureAddress interface{}) *BindingManager_BindingsOnFeature_Call { - return &BindingManager_BindingsOnFeature_Call{Call: _e.mock.On("BindingsOnFeature", featureAddress)} -} - -func (_c *BindingManager_BindingsOnFeature_Call) Run(run func(featureAddress model.FeatureAddressType)) *BindingManager_BindingsOnFeature_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FeatureAddressType)) - }) - return _c -} - -func (_c *BindingManager_BindingsOnFeature_Call) Return(_a0 []*api.BindingEntry) *BindingManager_BindingsOnFeature_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *BindingManager_BindingsOnFeature_Call) RunAndReturn(run func(model.FeatureAddressType) []*api.BindingEntry) *BindingManager_BindingsOnFeature_Call { - _c.Call.Return(run) - return _c -} - -// RemoveBinding provides a mock function with given fields: data, remoteDevice -func (_m *BindingManager) RemoveBinding(data model.BindingManagementDeleteCallType, remoteDevice api.DeviceRemote) error { - ret := _m.Called(data, remoteDevice) - - if len(ret) == 0 { - panic("no return value specified for RemoveBinding") - } - - var r0 error - if rf, ok := ret.Get(0).(func(model.BindingManagementDeleteCallType, api.DeviceRemote) error); ok { - r0 = rf(data, remoteDevice) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BindingManager_RemoveBinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveBinding' -type BindingManager_RemoveBinding_Call struct { - *mock.Call -} - -// RemoveBinding is a helper method to define mock.On call -// - data model.BindingManagementDeleteCallType -// - remoteDevice api.DeviceRemote -func (_e *BindingManager_Expecter) RemoveBinding(data interface{}, remoteDevice interface{}) *BindingManager_RemoveBinding_Call { - return &BindingManager_RemoveBinding_Call{Call: _e.mock.On("RemoveBinding", data, remoteDevice)} -} - -func (_c *BindingManager_RemoveBinding_Call) Run(run func(data model.BindingManagementDeleteCallType, remoteDevice api.DeviceRemote)) *BindingManager_RemoveBinding_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.BindingManagementDeleteCallType), args[1].(api.DeviceRemote)) - }) - return _c -} - -func (_c *BindingManager_RemoveBinding_Call) Return(_a0 error) *BindingManager_RemoveBinding_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *BindingManager_RemoveBinding_Call) RunAndReturn(run func(model.BindingManagementDeleteCallType, api.DeviceRemote) error) *BindingManager_RemoveBinding_Call { - _c.Call.Return(run) - return _c -} - -// RemoveBindingsForDevice provides a mock function with given fields: remoteDevice -func (_m *BindingManager) RemoveBindingsForDevice(remoteDevice api.DeviceRemote) { - _m.Called(remoteDevice) -} - -// BindingManager_RemoveBindingsForDevice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveBindingsForDevice' -type BindingManager_RemoveBindingsForDevice_Call struct { - *mock.Call -} - -// RemoveBindingsForDevice is a helper method to define mock.On call -// - remoteDevice api.DeviceRemote -func (_e *BindingManager_Expecter) RemoveBindingsForDevice(remoteDevice interface{}) *BindingManager_RemoveBindingsForDevice_Call { - return &BindingManager_RemoveBindingsForDevice_Call{Call: _e.mock.On("RemoveBindingsForDevice", remoteDevice)} -} - -func (_c *BindingManager_RemoveBindingsForDevice_Call) Run(run func(remoteDevice api.DeviceRemote)) *BindingManager_RemoveBindingsForDevice_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.DeviceRemote)) - }) - return _c -} - -func (_c *BindingManager_RemoveBindingsForDevice_Call) Return() *BindingManager_RemoveBindingsForDevice_Call { - _c.Call.Return() - return _c -} - -func (_c *BindingManager_RemoveBindingsForDevice_Call) RunAndReturn(run func(api.DeviceRemote)) *BindingManager_RemoveBindingsForDevice_Call { - _c.Call.Return(run) - return _c -} - -// RemoveBindingsForEntity provides a mock function with given fields: remoteEntity -func (_m *BindingManager) RemoveBindingsForEntity(remoteEntity api.EntityRemote) { - _m.Called(remoteEntity) -} - -// BindingManager_RemoveBindingsForEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveBindingsForEntity' -type BindingManager_RemoveBindingsForEntity_Call struct { - *mock.Call -} - -// RemoveBindingsForEntity is a helper method to define mock.On call -// - remoteEntity api.EntityRemote -func (_e *BindingManager_Expecter) RemoveBindingsForEntity(remoteEntity interface{}) *BindingManager_RemoveBindingsForEntity_Call { - return &BindingManager_RemoveBindingsForEntity_Call{Call: _e.mock.On("RemoveBindingsForEntity", remoteEntity)} -} - -func (_c *BindingManager_RemoveBindingsForEntity_Call) Run(run func(remoteEntity api.EntityRemote)) *BindingManager_RemoveBindingsForEntity_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.EntityRemote)) - }) - return _c -} - -func (_c *BindingManager_RemoveBindingsForEntity_Call) Return() *BindingManager_RemoveBindingsForEntity_Call { - _c.Call.Return() - return _c -} - -func (_c *BindingManager_RemoveBindingsForEntity_Call) RunAndReturn(run func(api.EntityRemote)) *BindingManager_RemoveBindingsForEntity_Call { - _c.Call.Return(run) - return _c -} - -// NewBindingManager creates a new instance of BindingManager. 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 NewBindingManager(t interface { - mock.TestingT - Cleanup(func()) -}) *BindingManager { - mock := &BindingManager{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/BindingManagerInterface.go b/mocks/BindingManagerInterface.go new file mode 100644 index 0000000..c1cb031 --- /dev/null +++ b/mocks/BindingManagerInterface.go @@ -0,0 +1,340 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" + + model "github.com/enbility/spine-go/model" +) + +// BindingManagerInterface is an autogenerated mock type for the BindingManagerInterface type +type BindingManagerInterface struct { + mock.Mock +} + +type BindingManagerInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *BindingManagerInterface) EXPECT() *BindingManagerInterface_Expecter { + return &BindingManagerInterface_Expecter{mock: &_m.Mock} +} + +// AddBinding provides a mock function with given fields: remoteDevice, data +func (_m *BindingManagerInterface) AddBinding(remoteDevice api.DeviceRemoteInterface, data model.BindingManagementRequestCallType) error { + ret := _m.Called(remoteDevice, data) + + if len(ret) == 0 { + panic("no return value specified for AddBinding") + } + + var r0 error + if rf, ok := ret.Get(0).(func(api.DeviceRemoteInterface, model.BindingManagementRequestCallType) error); ok { + r0 = rf(remoteDevice, data) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BindingManagerInterface_AddBinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddBinding' +type BindingManagerInterface_AddBinding_Call struct { + *mock.Call +} + +// AddBinding is a helper method to define mock.On call +// - remoteDevice api.DeviceRemoteInterface +// - data model.BindingManagementRequestCallType +func (_e *BindingManagerInterface_Expecter) AddBinding(remoteDevice interface{}, data interface{}) *BindingManagerInterface_AddBinding_Call { + return &BindingManagerInterface_AddBinding_Call{Call: _e.mock.On("AddBinding", remoteDevice, data)} +} + +func (_c *BindingManagerInterface_AddBinding_Call) Run(run func(remoteDevice api.DeviceRemoteInterface, data model.BindingManagementRequestCallType)) *BindingManagerInterface_AddBinding_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.DeviceRemoteInterface), args[1].(model.BindingManagementRequestCallType)) + }) + return _c +} + +func (_c *BindingManagerInterface_AddBinding_Call) Return(_a0 error) *BindingManagerInterface_AddBinding_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BindingManagerInterface_AddBinding_Call) RunAndReturn(run func(api.DeviceRemoteInterface, model.BindingManagementRequestCallType) error) *BindingManagerInterface_AddBinding_Call { + _c.Call.Return(run) + return _c +} + +// Bindings provides a mock function with given fields: remoteDevice +func (_m *BindingManagerInterface) Bindings(remoteDevice api.DeviceRemoteInterface) []*api.BindingEntry { + ret := _m.Called(remoteDevice) + + if len(ret) == 0 { + panic("no return value specified for Bindings") + } + + var r0 []*api.BindingEntry + if rf, ok := ret.Get(0).(func(api.DeviceRemoteInterface) []*api.BindingEntry); ok { + r0 = rf(remoteDevice) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*api.BindingEntry) + } + } + + return r0 +} + +// BindingManagerInterface_Bindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bindings' +type BindingManagerInterface_Bindings_Call struct { + *mock.Call +} + +// Bindings is a helper method to define mock.On call +// - remoteDevice api.DeviceRemoteInterface +func (_e *BindingManagerInterface_Expecter) Bindings(remoteDevice interface{}) *BindingManagerInterface_Bindings_Call { + return &BindingManagerInterface_Bindings_Call{Call: _e.mock.On("Bindings", remoteDevice)} +} + +func (_c *BindingManagerInterface_Bindings_Call) Run(run func(remoteDevice api.DeviceRemoteInterface)) *BindingManagerInterface_Bindings_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.DeviceRemoteInterface)) + }) + return _c +} + +func (_c *BindingManagerInterface_Bindings_Call) Return(_a0 []*api.BindingEntry) *BindingManagerInterface_Bindings_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BindingManagerInterface_Bindings_Call) RunAndReturn(run func(api.DeviceRemoteInterface) []*api.BindingEntry) *BindingManagerInterface_Bindings_Call { + _c.Call.Return(run) + return _c +} + +// BindingsOnFeature provides a mock function with given fields: featureAddress +func (_m *BindingManagerInterface) BindingsOnFeature(featureAddress model.FeatureAddressType) []*api.BindingEntry { + ret := _m.Called(featureAddress) + + if len(ret) == 0 { + panic("no return value specified for BindingsOnFeature") + } + + var r0 []*api.BindingEntry + if rf, ok := ret.Get(0).(func(model.FeatureAddressType) []*api.BindingEntry); ok { + r0 = rf(featureAddress) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*api.BindingEntry) + } + } + + return r0 +} + +// BindingManagerInterface_BindingsOnFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BindingsOnFeature' +type BindingManagerInterface_BindingsOnFeature_Call struct { + *mock.Call +} + +// BindingsOnFeature is a helper method to define mock.On call +// - featureAddress model.FeatureAddressType +func (_e *BindingManagerInterface_Expecter) BindingsOnFeature(featureAddress interface{}) *BindingManagerInterface_BindingsOnFeature_Call { + return &BindingManagerInterface_BindingsOnFeature_Call{Call: _e.mock.On("BindingsOnFeature", featureAddress)} +} + +func (_c *BindingManagerInterface_BindingsOnFeature_Call) Run(run func(featureAddress model.FeatureAddressType)) *BindingManagerInterface_BindingsOnFeature_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FeatureAddressType)) + }) + return _c +} + +func (_c *BindingManagerInterface_BindingsOnFeature_Call) Return(_a0 []*api.BindingEntry) *BindingManagerInterface_BindingsOnFeature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BindingManagerInterface_BindingsOnFeature_Call) RunAndReturn(run func(model.FeatureAddressType) []*api.BindingEntry) *BindingManagerInterface_BindingsOnFeature_Call { + _c.Call.Return(run) + return _c +} + +// HasLocalFeatureRemoteBinding provides a mock function with given fields: localAddress, remoteAddress +func (_m *BindingManagerInterface) HasLocalFeatureRemoteBinding(localAddress *model.FeatureAddressType, remoteAddress *model.FeatureAddressType) bool { + ret := _m.Called(localAddress, remoteAddress) + + if len(ret) == 0 { + panic("no return value specified for HasLocalFeatureRemoteBinding") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(*model.FeatureAddressType, *model.FeatureAddressType) bool); ok { + r0 = rf(localAddress, remoteAddress) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// BindingManagerInterface_HasLocalFeatureRemoteBinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasLocalFeatureRemoteBinding' +type BindingManagerInterface_HasLocalFeatureRemoteBinding_Call struct { + *mock.Call +} + +// HasLocalFeatureRemoteBinding is a helper method to define mock.On call +// - localAddress *model.FeatureAddressType +// - remoteAddress *model.FeatureAddressType +func (_e *BindingManagerInterface_Expecter) HasLocalFeatureRemoteBinding(localAddress interface{}, remoteAddress interface{}) *BindingManagerInterface_HasLocalFeatureRemoteBinding_Call { + return &BindingManagerInterface_HasLocalFeatureRemoteBinding_Call{Call: _e.mock.On("HasLocalFeatureRemoteBinding", localAddress, remoteAddress)} +} + +func (_c *BindingManagerInterface_HasLocalFeatureRemoteBinding_Call) Run(run func(localAddress *model.FeatureAddressType, remoteAddress *model.FeatureAddressType)) *BindingManagerInterface_HasLocalFeatureRemoteBinding_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType), args[1].(*model.FeatureAddressType)) + }) + return _c +} + +func (_c *BindingManagerInterface_HasLocalFeatureRemoteBinding_Call) Return(_a0 bool) *BindingManagerInterface_HasLocalFeatureRemoteBinding_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BindingManagerInterface_HasLocalFeatureRemoteBinding_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType) bool) *BindingManagerInterface_HasLocalFeatureRemoteBinding_Call { + _c.Call.Return(run) + return _c +} + +// RemoveBinding provides a mock function with given fields: data, remoteDevice +func (_m *BindingManagerInterface) RemoveBinding(data model.BindingManagementDeleteCallType, remoteDevice api.DeviceRemoteInterface) error { + ret := _m.Called(data, remoteDevice) + + if len(ret) == 0 { + panic("no return value specified for RemoveBinding") + } + + var r0 error + if rf, ok := ret.Get(0).(func(model.BindingManagementDeleteCallType, api.DeviceRemoteInterface) error); ok { + r0 = rf(data, remoteDevice) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BindingManagerInterface_RemoveBinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveBinding' +type BindingManagerInterface_RemoveBinding_Call struct { + *mock.Call +} + +// RemoveBinding is a helper method to define mock.On call +// - data model.BindingManagementDeleteCallType +// - remoteDevice api.DeviceRemoteInterface +func (_e *BindingManagerInterface_Expecter) RemoveBinding(data interface{}, remoteDevice interface{}) *BindingManagerInterface_RemoveBinding_Call { + return &BindingManagerInterface_RemoveBinding_Call{Call: _e.mock.On("RemoveBinding", data, remoteDevice)} +} + +func (_c *BindingManagerInterface_RemoveBinding_Call) Run(run func(data model.BindingManagementDeleteCallType, remoteDevice api.DeviceRemoteInterface)) *BindingManagerInterface_RemoveBinding_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.BindingManagementDeleteCallType), args[1].(api.DeviceRemoteInterface)) + }) + return _c +} + +func (_c *BindingManagerInterface_RemoveBinding_Call) Return(_a0 error) *BindingManagerInterface_RemoveBinding_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BindingManagerInterface_RemoveBinding_Call) RunAndReturn(run func(model.BindingManagementDeleteCallType, api.DeviceRemoteInterface) error) *BindingManagerInterface_RemoveBinding_Call { + _c.Call.Return(run) + return _c +} + +// RemoveBindingsForDevice provides a mock function with given fields: remoteDevice +func (_m *BindingManagerInterface) RemoveBindingsForDevice(remoteDevice api.DeviceRemoteInterface) { + _m.Called(remoteDevice) +} + +// BindingManagerInterface_RemoveBindingsForDevice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveBindingsForDevice' +type BindingManagerInterface_RemoveBindingsForDevice_Call struct { + *mock.Call +} + +// RemoveBindingsForDevice is a helper method to define mock.On call +// - remoteDevice api.DeviceRemoteInterface +func (_e *BindingManagerInterface_Expecter) RemoveBindingsForDevice(remoteDevice interface{}) *BindingManagerInterface_RemoveBindingsForDevice_Call { + return &BindingManagerInterface_RemoveBindingsForDevice_Call{Call: _e.mock.On("RemoveBindingsForDevice", remoteDevice)} +} + +func (_c *BindingManagerInterface_RemoveBindingsForDevice_Call) Run(run func(remoteDevice api.DeviceRemoteInterface)) *BindingManagerInterface_RemoveBindingsForDevice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.DeviceRemoteInterface)) + }) + return _c +} + +func (_c *BindingManagerInterface_RemoveBindingsForDevice_Call) Return() *BindingManagerInterface_RemoveBindingsForDevice_Call { + _c.Call.Return() + return _c +} + +func (_c *BindingManagerInterface_RemoveBindingsForDevice_Call) RunAndReturn(run func(api.DeviceRemoteInterface)) *BindingManagerInterface_RemoveBindingsForDevice_Call { + _c.Call.Return(run) + return _c +} + +// RemoveBindingsForEntity provides a mock function with given fields: remoteEntity +func (_m *BindingManagerInterface) RemoveBindingsForEntity(remoteEntity api.EntityRemoteInterface) { + _m.Called(remoteEntity) +} + +// BindingManagerInterface_RemoveBindingsForEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveBindingsForEntity' +type BindingManagerInterface_RemoveBindingsForEntity_Call struct { + *mock.Call +} + +// RemoveBindingsForEntity is a helper method to define mock.On call +// - remoteEntity api.EntityRemoteInterface +func (_e *BindingManagerInterface_Expecter) RemoveBindingsForEntity(remoteEntity interface{}) *BindingManagerInterface_RemoveBindingsForEntity_Call { + return &BindingManagerInterface_RemoveBindingsForEntity_Call{Call: _e.mock.On("RemoveBindingsForEntity", remoteEntity)} +} + +func (_c *BindingManagerInterface_RemoveBindingsForEntity_Call) Run(run func(remoteEntity api.EntityRemoteInterface)) *BindingManagerInterface_RemoveBindingsForEntity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.EntityRemoteInterface)) + }) + return _c +} + +func (_c *BindingManagerInterface_RemoveBindingsForEntity_Call) Return() *BindingManagerInterface_RemoveBindingsForEntity_Call { + _c.Call.Return() + return _c +} + +func (_c *BindingManagerInterface_RemoveBindingsForEntity_Call) RunAndReturn(run func(api.EntityRemoteInterface)) *BindingManagerInterface_RemoveBindingsForEntity_Call { + _c.Call.Return(run) + return _c +} + +// NewBindingManagerInterface creates a new instance of BindingManagerInterface. 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 NewBindingManagerInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *BindingManagerInterface { + mock := &BindingManagerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/ComControl.go b/mocks/ComControl.go deleted file mode 100644 index 811d72e..0000000 --- a/mocks/ComControl.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - model "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" -) - -// ComControl is an autogenerated mock type for the ComControl type -type ComControl struct { - mock.Mock -} - -type ComControl_Expecter struct { - mock *mock.Mock -} - -func (_m *ComControl) EXPECT() *ComControl_Expecter { - return &ComControl_Expecter{mock: &_m.Mock} -} - -// SendSpineMessage provides a mock function with given fields: datagram -func (_m *ComControl) SendSpineMessage(datagram model.DatagramType) error { - ret := _m.Called(datagram) - - if len(ret) == 0 { - panic("no return value specified for SendSpineMessage") - } - - var r0 error - if rf, ok := ret.Get(0).(func(model.DatagramType) error); ok { - r0 = rf(datagram) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ComControl_SendSpineMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendSpineMessage' -type ComControl_SendSpineMessage_Call struct { - *mock.Call -} - -// SendSpineMessage is a helper method to define mock.On call -// - datagram model.DatagramType -func (_e *ComControl_Expecter) SendSpineMessage(datagram interface{}) *ComControl_SendSpineMessage_Call { - return &ComControl_SendSpineMessage_Call{Call: _e.mock.On("SendSpineMessage", datagram)} -} - -func (_c *ComControl_SendSpineMessage_Call) Run(run func(datagram model.DatagramType)) *ComControl_SendSpineMessage_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.DatagramType)) - }) - return _c -} - -func (_c *ComControl_SendSpineMessage_Call) Return(_a0 error) *ComControl_SendSpineMessage_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *ComControl_SendSpineMessage_Call) RunAndReturn(run func(model.DatagramType) error) *ComControl_SendSpineMessage_Call { - _c.Call.Return(run) - return _c -} - -// NewComControl creates a new instance of ComControl. 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 NewComControl(t interface { - mock.TestingT - Cleanup(func()) -}) *ComControl { - mock := &ComControl{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/ComControlInterface.go b/mocks/ComControlInterface.go new file mode 100644 index 0000000..73b6ea4 --- /dev/null +++ b/mocks/ComControlInterface.go @@ -0,0 +1,81 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + model "github.com/enbility/spine-go/model" + mock "github.com/stretchr/testify/mock" +) + +// ComControlInterface is an autogenerated mock type for the ComControlInterface type +type ComControlInterface struct { + mock.Mock +} + +type ComControlInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *ComControlInterface) EXPECT() *ComControlInterface_Expecter { + return &ComControlInterface_Expecter{mock: &_m.Mock} +} + +// SendSpineMessage provides a mock function with given fields: datagram +func (_m *ComControlInterface) SendSpineMessage(datagram model.DatagramType) error { + ret := _m.Called(datagram) + + if len(ret) == 0 { + panic("no return value specified for SendSpineMessage") + } + + var r0 error + if rf, ok := ret.Get(0).(func(model.DatagramType) error); ok { + r0 = rf(datagram) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ComControlInterface_SendSpineMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendSpineMessage' +type ComControlInterface_SendSpineMessage_Call struct { + *mock.Call +} + +// SendSpineMessage is a helper method to define mock.On call +// - datagram model.DatagramType +func (_e *ComControlInterface_Expecter) SendSpineMessage(datagram interface{}) *ComControlInterface_SendSpineMessage_Call { + return &ComControlInterface_SendSpineMessage_Call{Call: _e.mock.On("SendSpineMessage", datagram)} +} + +func (_c *ComControlInterface_SendSpineMessage_Call) Run(run func(datagram model.DatagramType)) *ComControlInterface_SendSpineMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.DatagramType)) + }) + return _c +} + +func (_c *ComControlInterface_SendSpineMessage_Call) Return(_a0 error) *ComControlInterface_SendSpineMessage_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ComControlInterface_SendSpineMessage_Call) RunAndReturn(run func(model.DatagramType) error) *ComControlInterface_SendSpineMessage_Call { + _c.Call.Return(run) + return _c +} + +// NewComControlInterface creates a new instance of ComControlInterface. 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 NewComControlInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ComControlInterface { + mock := &ComControlInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/Device.go b/mocks/Device.go deleted file mode 100644 index e0757a7..0000000 --- a/mocks/Device.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - model "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" -) - -// Device is an autogenerated mock type for the Device type -type Device struct { - mock.Mock -} - -type Device_Expecter struct { - mock *mock.Mock -} - -func (_m *Device) EXPECT() *Device_Expecter { - return &Device_Expecter{mock: &_m.Mock} -} - -// Address provides a mock function with given fields: -func (_m *Device) Address() *model.AddressDeviceType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Address") - } - - var r0 *model.AddressDeviceType - if rf, ok := ret.Get(0).(func() *model.AddressDeviceType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.AddressDeviceType) - } - } - - return r0 -} - -// Device_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' -type Device_Address_Call struct { - *mock.Call -} - -// Address is a helper method to define mock.On call -func (_e *Device_Expecter) Address() *Device_Address_Call { - return &Device_Address_Call{Call: _e.mock.On("Address")} -} - -func (_c *Device_Address_Call) Run(run func()) *Device_Address_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Device_Address_Call) Return(_a0 *model.AddressDeviceType) *Device_Address_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Device_Address_Call) RunAndReturn(run func() *model.AddressDeviceType) *Device_Address_Call { - _c.Call.Return(run) - return _c -} - -// DestinationData provides a mock function with given fields: -func (_m *Device) DestinationData() model.NodeManagementDestinationDataType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for DestinationData") - } - - var r0 model.NodeManagementDestinationDataType - if rf, ok := ret.Get(0).(func() model.NodeManagementDestinationDataType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.NodeManagementDestinationDataType) - } - - return r0 -} - -// Device_DestinationData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestinationData' -type Device_DestinationData_Call struct { - *mock.Call -} - -// DestinationData is a helper method to define mock.On call -func (_e *Device_Expecter) DestinationData() *Device_DestinationData_Call { - return &Device_DestinationData_Call{Call: _e.mock.On("DestinationData")} -} - -func (_c *Device_DestinationData_Call) Run(run func()) *Device_DestinationData_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Device_DestinationData_Call) Return(_a0 model.NodeManagementDestinationDataType) *Device_DestinationData_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Device_DestinationData_Call) RunAndReturn(run func() model.NodeManagementDestinationDataType) *Device_DestinationData_Call { - _c.Call.Return(run) - return _c -} - -// DeviceType provides a mock function with given fields: -func (_m *Device) DeviceType() *model.DeviceTypeType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for DeviceType") - } - - var r0 *model.DeviceTypeType - if rf, ok := ret.Get(0).(func() *model.DeviceTypeType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.DeviceTypeType) - } - } - - return r0 -} - -// Device_DeviceType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeviceType' -type Device_DeviceType_Call struct { - *mock.Call -} - -// DeviceType is a helper method to define mock.On call -func (_e *Device_Expecter) DeviceType() *Device_DeviceType_Call { - return &Device_DeviceType_Call{Call: _e.mock.On("DeviceType")} -} - -func (_c *Device_DeviceType_Call) Run(run func()) *Device_DeviceType_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Device_DeviceType_Call) Return(_a0 *model.DeviceTypeType) *Device_DeviceType_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Device_DeviceType_Call) RunAndReturn(run func() *model.DeviceTypeType) *Device_DeviceType_Call { - _c.Call.Return(run) - return _c -} - -// FeatureSet provides a mock function with given fields: -func (_m *Device) FeatureSet() *model.NetworkManagementFeatureSetType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for FeatureSet") - } - - var r0 *model.NetworkManagementFeatureSetType - if rf, ok := ret.Get(0).(func() *model.NetworkManagementFeatureSetType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.NetworkManagementFeatureSetType) - } - } - - return r0 -} - -// Device_FeatureSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureSet' -type Device_FeatureSet_Call struct { - *mock.Call -} - -// FeatureSet is a helper method to define mock.On call -func (_e *Device_Expecter) FeatureSet() *Device_FeatureSet_Call { - return &Device_FeatureSet_Call{Call: _e.mock.On("FeatureSet")} -} - -func (_c *Device_FeatureSet_Call) Run(run func()) *Device_FeatureSet_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Device_FeatureSet_Call) Return(_a0 *model.NetworkManagementFeatureSetType) *Device_FeatureSet_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Device_FeatureSet_Call) RunAndReturn(run func() *model.NetworkManagementFeatureSetType) *Device_FeatureSet_Call { - _c.Call.Return(run) - return _c -} - -// NewDevice creates a new instance of Device. 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 NewDevice(t interface { - mock.TestingT - Cleanup(func()) -}) *Device { - mock := &Device{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/DeviceInterface.go b/mocks/DeviceInterface.go new file mode 100644 index 0000000..fa9ae89 --- /dev/null +++ b/mocks/DeviceInterface.go @@ -0,0 +1,221 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + model "github.com/enbility/spine-go/model" + mock "github.com/stretchr/testify/mock" +) + +// DeviceInterface is an autogenerated mock type for the DeviceInterface type +type DeviceInterface struct { + mock.Mock +} + +type DeviceInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *DeviceInterface) EXPECT() *DeviceInterface_Expecter { + return &DeviceInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *DeviceInterface) Address() *model.AddressDeviceType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 *model.AddressDeviceType + if rf, ok := ret.Get(0).(func() *model.AddressDeviceType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.AddressDeviceType) + } + } + + return r0 +} + +// DeviceInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type DeviceInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *DeviceInterface_Expecter) Address() *DeviceInterface_Address_Call { + return &DeviceInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *DeviceInterface_Address_Call) Run(run func()) *DeviceInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceInterface_Address_Call) Return(_a0 *model.AddressDeviceType) *DeviceInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceInterface_Address_Call) RunAndReturn(run func() *model.AddressDeviceType) *DeviceInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// DestinationData provides a mock function with given fields: +func (_m *DeviceInterface) DestinationData() model.NodeManagementDestinationDataType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DestinationData") + } + + var r0 model.NodeManagementDestinationDataType + if rf, ok := ret.Get(0).(func() model.NodeManagementDestinationDataType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.NodeManagementDestinationDataType) + } + + return r0 +} + +// DeviceInterface_DestinationData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestinationData' +type DeviceInterface_DestinationData_Call struct { + *mock.Call +} + +// DestinationData is a helper method to define mock.On call +func (_e *DeviceInterface_Expecter) DestinationData() *DeviceInterface_DestinationData_Call { + return &DeviceInterface_DestinationData_Call{Call: _e.mock.On("DestinationData")} +} + +func (_c *DeviceInterface_DestinationData_Call) Run(run func()) *DeviceInterface_DestinationData_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceInterface_DestinationData_Call) Return(_a0 model.NodeManagementDestinationDataType) *DeviceInterface_DestinationData_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceInterface_DestinationData_Call) RunAndReturn(run func() model.NodeManagementDestinationDataType) *DeviceInterface_DestinationData_Call { + _c.Call.Return(run) + return _c +} + +// DeviceType provides a mock function with given fields: +func (_m *DeviceInterface) DeviceType() *model.DeviceTypeType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DeviceType") + } + + var r0 *model.DeviceTypeType + if rf, ok := ret.Get(0).(func() *model.DeviceTypeType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.DeviceTypeType) + } + } + + return r0 +} + +// DeviceInterface_DeviceType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeviceType' +type DeviceInterface_DeviceType_Call struct { + *mock.Call +} + +// DeviceType is a helper method to define mock.On call +func (_e *DeviceInterface_Expecter) DeviceType() *DeviceInterface_DeviceType_Call { + return &DeviceInterface_DeviceType_Call{Call: _e.mock.On("DeviceType")} +} + +func (_c *DeviceInterface_DeviceType_Call) Run(run func()) *DeviceInterface_DeviceType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceInterface_DeviceType_Call) Return(_a0 *model.DeviceTypeType) *DeviceInterface_DeviceType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceInterface_DeviceType_Call) RunAndReturn(run func() *model.DeviceTypeType) *DeviceInterface_DeviceType_Call { + _c.Call.Return(run) + return _c +} + +// FeatureSet provides a mock function with given fields: +func (_m *DeviceInterface) FeatureSet() *model.NetworkManagementFeatureSetType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for FeatureSet") + } + + var r0 *model.NetworkManagementFeatureSetType + if rf, ok := ret.Get(0).(func() *model.NetworkManagementFeatureSetType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.NetworkManagementFeatureSetType) + } + } + + return r0 +} + +// DeviceInterface_FeatureSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureSet' +type DeviceInterface_FeatureSet_Call struct { + *mock.Call +} + +// FeatureSet is a helper method to define mock.On call +func (_e *DeviceInterface_Expecter) FeatureSet() *DeviceInterface_FeatureSet_Call { + return &DeviceInterface_FeatureSet_Call{Call: _e.mock.On("FeatureSet")} +} + +func (_c *DeviceInterface_FeatureSet_Call) Run(run func()) *DeviceInterface_FeatureSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceInterface_FeatureSet_Call) Return(_a0 *model.NetworkManagementFeatureSetType) *DeviceInterface_FeatureSet_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceInterface_FeatureSet_Call) RunAndReturn(run func() *model.NetworkManagementFeatureSetType) *DeviceInterface_FeatureSet_Call { + _c.Call.Return(run) + return _c +} + +// NewDeviceInterface creates a new instance of DeviceInterface. 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 NewDeviceInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *DeviceInterface { + mock := &DeviceInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/DeviceLocal.go b/mocks/DeviceLocal.go deleted file mode 100644 index 49824ff..0000000 --- a/mocks/DeviceLocal.go +++ /dev/null @@ -1,1090 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" - - model "github.com/enbility/spine-go/model" - - ship_goapi "github.com/enbility/ship-go/api" -) - -// DeviceLocal is an autogenerated mock type for the DeviceLocal type -type DeviceLocal struct { - mock.Mock -} - -type DeviceLocal_Expecter struct { - mock *mock.Mock -} - -func (_m *DeviceLocal) EXPECT() *DeviceLocal_Expecter { - return &DeviceLocal_Expecter{mock: &_m.Mock} -} - -// AddEntity provides a mock function with given fields: entity -func (_m *DeviceLocal) AddEntity(entity api.EntityLocal) { - _m.Called(entity) -} - -// DeviceLocal_AddEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddEntity' -type DeviceLocal_AddEntity_Call struct { - *mock.Call -} - -// AddEntity is a helper method to define mock.On call -// - entity api.EntityLocal -func (_e *DeviceLocal_Expecter) AddEntity(entity interface{}) *DeviceLocal_AddEntity_Call { - return &DeviceLocal_AddEntity_Call{Call: _e.mock.On("AddEntity", entity)} -} - -func (_c *DeviceLocal_AddEntity_Call) Run(run func(entity api.EntityLocal)) *DeviceLocal_AddEntity_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.EntityLocal)) - }) - return _c -} - -func (_c *DeviceLocal_AddEntity_Call) Return() *DeviceLocal_AddEntity_Call { - _c.Call.Return() - return _c -} - -func (_c *DeviceLocal_AddEntity_Call) RunAndReturn(run func(api.EntityLocal)) *DeviceLocal_AddEntity_Call { - _c.Call.Return(run) - return _c -} - -// AddRemoteDeviceForSki provides a mock function with given fields: ski, rDevice -func (_m *DeviceLocal) AddRemoteDeviceForSki(ski string, rDevice api.DeviceRemote) { - _m.Called(ski, rDevice) -} - -// DeviceLocal_AddRemoteDeviceForSki_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddRemoteDeviceForSki' -type DeviceLocal_AddRemoteDeviceForSki_Call struct { - *mock.Call -} - -// AddRemoteDeviceForSki is a helper method to define mock.On call -// - ski string -// - rDevice api.DeviceRemote -func (_e *DeviceLocal_Expecter) AddRemoteDeviceForSki(ski interface{}, rDevice interface{}) *DeviceLocal_AddRemoteDeviceForSki_Call { - return &DeviceLocal_AddRemoteDeviceForSki_Call{Call: _e.mock.On("AddRemoteDeviceForSki", ski, rDevice)} -} - -func (_c *DeviceLocal_AddRemoteDeviceForSki_Call) Run(run func(ski string, rDevice api.DeviceRemote)) *DeviceLocal_AddRemoteDeviceForSki_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(api.DeviceRemote)) - }) - return _c -} - -func (_c *DeviceLocal_AddRemoteDeviceForSki_Call) Return() *DeviceLocal_AddRemoteDeviceForSki_Call { - _c.Call.Return() - return _c -} - -func (_c *DeviceLocal_AddRemoteDeviceForSki_Call) RunAndReturn(run func(string, api.DeviceRemote)) *DeviceLocal_AddRemoteDeviceForSki_Call { - _c.Call.Return(run) - return _c -} - -// Address provides a mock function with given fields: -func (_m *DeviceLocal) Address() *model.AddressDeviceType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Address") - } - - var r0 *model.AddressDeviceType - if rf, ok := ret.Get(0).(func() *model.AddressDeviceType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.AddressDeviceType) - } - } - - return r0 -} - -// DeviceLocal_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' -type DeviceLocal_Address_Call struct { - *mock.Call -} - -// Address is a helper method to define mock.On call -func (_e *DeviceLocal_Expecter) Address() *DeviceLocal_Address_Call { - return &DeviceLocal_Address_Call{Call: _e.mock.On("Address")} -} - -func (_c *DeviceLocal_Address_Call) Run(run func()) *DeviceLocal_Address_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceLocal_Address_Call) Return(_a0 *model.AddressDeviceType) *DeviceLocal_Address_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_Address_Call) RunAndReturn(run func() *model.AddressDeviceType) *DeviceLocal_Address_Call { - _c.Call.Return(run) - return _c -} - -// BindingManager provides a mock function with given fields: -func (_m *DeviceLocal) BindingManager() api.BindingManager { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for BindingManager") - } - - var r0 api.BindingManager - if rf, ok := ret.Get(0).(func() api.BindingManager); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.BindingManager) - } - } - - return r0 -} - -// DeviceLocal_BindingManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BindingManager' -type DeviceLocal_BindingManager_Call struct { - *mock.Call -} - -// BindingManager is a helper method to define mock.On call -func (_e *DeviceLocal_Expecter) BindingManager() *DeviceLocal_BindingManager_Call { - return &DeviceLocal_BindingManager_Call{Call: _e.mock.On("BindingManager")} -} - -func (_c *DeviceLocal_BindingManager_Call) Run(run func()) *DeviceLocal_BindingManager_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceLocal_BindingManager_Call) Return(_a0 api.BindingManager) *DeviceLocal_BindingManager_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_BindingManager_Call) RunAndReturn(run func() api.BindingManager) *DeviceLocal_BindingManager_Call { - _c.Call.Return(run) - return _c -} - -// DestinationData provides a mock function with given fields: -func (_m *DeviceLocal) DestinationData() model.NodeManagementDestinationDataType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for DestinationData") - } - - var r0 model.NodeManagementDestinationDataType - if rf, ok := ret.Get(0).(func() model.NodeManagementDestinationDataType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.NodeManagementDestinationDataType) - } - - return r0 -} - -// DeviceLocal_DestinationData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestinationData' -type DeviceLocal_DestinationData_Call struct { - *mock.Call -} - -// DestinationData is a helper method to define mock.On call -func (_e *DeviceLocal_Expecter) DestinationData() *DeviceLocal_DestinationData_Call { - return &DeviceLocal_DestinationData_Call{Call: _e.mock.On("DestinationData")} -} - -func (_c *DeviceLocal_DestinationData_Call) Run(run func()) *DeviceLocal_DestinationData_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceLocal_DestinationData_Call) Return(_a0 model.NodeManagementDestinationDataType) *DeviceLocal_DestinationData_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_DestinationData_Call) RunAndReturn(run func() model.NodeManagementDestinationDataType) *DeviceLocal_DestinationData_Call { - _c.Call.Return(run) - return _c -} - -// DeviceType provides a mock function with given fields: -func (_m *DeviceLocal) DeviceType() *model.DeviceTypeType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for DeviceType") - } - - var r0 *model.DeviceTypeType - if rf, ok := ret.Get(0).(func() *model.DeviceTypeType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.DeviceTypeType) - } - } - - return r0 -} - -// DeviceLocal_DeviceType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeviceType' -type DeviceLocal_DeviceType_Call struct { - *mock.Call -} - -// DeviceType is a helper method to define mock.On call -func (_e *DeviceLocal_Expecter) DeviceType() *DeviceLocal_DeviceType_Call { - return &DeviceLocal_DeviceType_Call{Call: _e.mock.On("DeviceType")} -} - -func (_c *DeviceLocal_DeviceType_Call) Run(run func()) *DeviceLocal_DeviceType_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceLocal_DeviceType_Call) Return(_a0 *model.DeviceTypeType) *DeviceLocal_DeviceType_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_DeviceType_Call) RunAndReturn(run func() *model.DeviceTypeType) *DeviceLocal_DeviceType_Call { - _c.Call.Return(run) - return _c -} - -// Entities provides a mock function with given fields: -func (_m *DeviceLocal) Entities() []api.EntityLocal { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Entities") - } - - var r0 []api.EntityLocal - if rf, ok := ret.Get(0).(func() []api.EntityLocal); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]api.EntityLocal) - } - } - - return r0 -} - -// DeviceLocal_Entities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entities' -type DeviceLocal_Entities_Call struct { - *mock.Call -} - -// Entities is a helper method to define mock.On call -func (_e *DeviceLocal_Expecter) Entities() *DeviceLocal_Entities_Call { - return &DeviceLocal_Entities_Call{Call: _e.mock.On("Entities")} -} - -func (_c *DeviceLocal_Entities_Call) Run(run func()) *DeviceLocal_Entities_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceLocal_Entities_Call) Return(_a0 []api.EntityLocal) *DeviceLocal_Entities_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_Entities_Call) RunAndReturn(run func() []api.EntityLocal) *DeviceLocal_Entities_Call { - _c.Call.Return(run) - return _c -} - -// Entity provides a mock function with given fields: id -func (_m *DeviceLocal) Entity(id []model.AddressEntityType) api.EntityLocal { - ret := _m.Called(id) - - if len(ret) == 0 { - panic("no return value specified for Entity") - } - - var r0 api.EntityLocal - if rf, ok := ret.Get(0).(func([]model.AddressEntityType) api.EntityLocal); ok { - r0 = rf(id) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.EntityLocal) - } - } - - return r0 -} - -// DeviceLocal_Entity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entity' -type DeviceLocal_Entity_Call struct { - *mock.Call -} - -// Entity is a helper method to define mock.On call -// - id []model.AddressEntityType -func (_e *DeviceLocal_Expecter) Entity(id interface{}) *DeviceLocal_Entity_Call { - return &DeviceLocal_Entity_Call{Call: _e.mock.On("Entity", id)} -} - -func (_c *DeviceLocal_Entity_Call) Run(run func(id []model.AddressEntityType)) *DeviceLocal_Entity_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]model.AddressEntityType)) - }) - return _c -} - -func (_c *DeviceLocal_Entity_Call) Return(_a0 api.EntityLocal) *DeviceLocal_Entity_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_Entity_Call) RunAndReturn(run func([]model.AddressEntityType) api.EntityLocal) *DeviceLocal_Entity_Call { - _c.Call.Return(run) - return _c -} - -// EntityForType provides a mock function with given fields: entityType -func (_m *DeviceLocal) EntityForType(entityType model.EntityTypeType) api.EntityLocal { - ret := _m.Called(entityType) - - if len(ret) == 0 { - panic("no return value specified for EntityForType") - } - - var r0 api.EntityLocal - if rf, ok := ret.Get(0).(func(model.EntityTypeType) api.EntityLocal); ok { - r0 = rf(entityType) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.EntityLocal) - } - } - - return r0 -} - -// DeviceLocal_EntityForType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EntityForType' -type DeviceLocal_EntityForType_Call struct { - *mock.Call -} - -// EntityForType is a helper method to define mock.On call -// - entityType model.EntityTypeType -func (_e *DeviceLocal_Expecter) EntityForType(entityType interface{}) *DeviceLocal_EntityForType_Call { - return &DeviceLocal_EntityForType_Call{Call: _e.mock.On("EntityForType", entityType)} -} - -func (_c *DeviceLocal_EntityForType_Call) Run(run func(entityType model.EntityTypeType)) *DeviceLocal_EntityForType_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.EntityTypeType)) - }) - return _c -} - -func (_c *DeviceLocal_EntityForType_Call) Return(_a0 api.EntityLocal) *DeviceLocal_EntityForType_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_EntityForType_Call) RunAndReturn(run func(model.EntityTypeType) api.EntityLocal) *DeviceLocal_EntityForType_Call { - _c.Call.Return(run) - return _c -} - -// FeatureByAddress provides a mock function with given fields: address -func (_m *DeviceLocal) FeatureByAddress(address *model.FeatureAddressType) api.FeatureLocal { - ret := _m.Called(address) - - if len(ret) == 0 { - panic("no return value specified for FeatureByAddress") - } - - var r0 api.FeatureLocal - if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) api.FeatureLocal); ok { - r0 = rf(address) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.FeatureLocal) - } - } - - return r0 -} - -// DeviceLocal_FeatureByAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureByAddress' -type DeviceLocal_FeatureByAddress_Call struct { - *mock.Call -} - -// FeatureByAddress is a helper method to define mock.On call -// - address *model.FeatureAddressType -func (_e *DeviceLocal_Expecter) FeatureByAddress(address interface{}) *DeviceLocal_FeatureByAddress_Call { - return &DeviceLocal_FeatureByAddress_Call{Call: _e.mock.On("FeatureByAddress", address)} -} - -func (_c *DeviceLocal_FeatureByAddress_Call) Run(run func(address *model.FeatureAddressType)) *DeviceLocal_FeatureByAddress_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.FeatureAddressType)) - }) - return _c -} - -func (_c *DeviceLocal_FeatureByAddress_Call) Return(_a0 api.FeatureLocal) *DeviceLocal_FeatureByAddress_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_FeatureByAddress_Call) RunAndReturn(run func(*model.FeatureAddressType) api.FeatureLocal) *DeviceLocal_FeatureByAddress_Call { - _c.Call.Return(run) - return _c -} - -// FeatureSet provides a mock function with given fields: -func (_m *DeviceLocal) FeatureSet() *model.NetworkManagementFeatureSetType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for FeatureSet") - } - - var r0 *model.NetworkManagementFeatureSetType - if rf, ok := ret.Get(0).(func() *model.NetworkManagementFeatureSetType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.NetworkManagementFeatureSetType) - } - } - - return r0 -} - -// DeviceLocal_FeatureSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureSet' -type DeviceLocal_FeatureSet_Call struct { - *mock.Call -} - -// FeatureSet is a helper method to define mock.On call -func (_e *DeviceLocal_Expecter) FeatureSet() *DeviceLocal_FeatureSet_Call { - return &DeviceLocal_FeatureSet_Call{Call: _e.mock.On("FeatureSet")} -} - -func (_c *DeviceLocal_FeatureSet_Call) Run(run func()) *DeviceLocal_FeatureSet_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceLocal_FeatureSet_Call) Return(_a0 *model.NetworkManagementFeatureSetType) *DeviceLocal_FeatureSet_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_FeatureSet_Call) RunAndReturn(run func() *model.NetworkManagementFeatureSetType) *DeviceLocal_FeatureSet_Call { - _c.Call.Return(run) - return _c -} - -// HeartbeatManager provides a mock function with given fields: -func (_m *DeviceLocal) HeartbeatManager() api.HeartbeatManager { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HeartbeatManager") - } - - var r0 api.HeartbeatManager - if rf, ok := ret.Get(0).(func() api.HeartbeatManager); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.HeartbeatManager) - } - } - - return r0 -} - -// DeviceLocal_HeartbeatManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeartbeatManager' -type DeviceLocal_HeartbeatManager_Call struct { - *mock.Call -} - -// HeartbeatManager is a helper method to define mock.On call -func (_e *DeviceLocal_Expecter) HeartbeatManager() *DeviceLocal_HeartbeatManager_Call { - return &DeviceLocal_HeartbeatManager_Call{Call: _e.mock.On("HeartbeatManager")} -} - -func (_c *DeviceLocal_HeartbeatManager_Call) Run(run func()) *DeviceLocal_HeartbeatManager_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceLocal_HeartbeatManager_Call) Return(_a0 api.HeartbeatManager) *DeviceLocal_HeartbeatManager_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_HeartbeatManager_Call) RunAndReturn(run func() api.HeartbeatManager) *DeviceLocal_HeartbeatManager_Call { - _c.Call.Return(run) - return _c -} - -// Information provides a mock function with given fields: -func (_m *DeviceLocal) Information() *model.NodeManagementDetailedDiscoveryDeviceInformationType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Information") - } - - var r0 *model.NodeManagementDetailedDiscoveryDeviceInformationType - if rf, ok := ret.Get(0).(func() *model.NodeManagementDetailedDiscoveryDeviceInformationType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.NodeManagementDetailedDiscoveryDeviceInformationType) - } - } - - return r0 -} - -// DeviceLocal_Information_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Information' -type DeviceLocal_Information_Call struct { - *mock.Call -} - -// Information is a helper method to define mock.On call -func (_e *DeviceLocal_Expecter) Information() *DeviceLocal_Information_Call { - return &DeviceLocal_Information_Call{Call: _e.mock.On("Information")} -} - -func (_c *DeviceLocal_Information_Call) Run(run func()) *DeviceLocal_Information_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceLocal_Information_Call) Return(_a0 *model.NodeManagementDetailedDiscoveryDeviceInformationType) *DeviceLocal_Information_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_Information_Call) RunAndReturn(run func() *model.NodeManagementDetailedDiscoveryDeviceInformationType) *DeviceLocal_Information_Call { - _c.Call.Return(run) - return _c -} - -// NodeManagement provides a mock function with given fields: -func (_m *DeviceLocal) NodeManagement() api.NodeManagement { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for NodeManagement") - } - - var r0 api.NodeManagement - if rf, ok := ret.Get(0).(func() api.NodeManagement); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.NodeManagement) - } - } - - return r0 -} - -// DeviceLocal_NodeManagement_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeManagement' -type DeviceLocal_NodeManagement_Call struct { - *mock.Call -} - -// NodeManagement is a helper method to define mock.On call -func (_e *DeviceLocal_Expecter) NodeManagement() *DeviceLocal_NodeManagement_Call { - return &DeviceLocal_NodeManagement_Call{Call: _e.mock.On("NodeManagement")} -} - -func (_c *DeviceLocal_NodeManagement_Call) Run(run func()) *DeviceLocal_NodeManagement_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceLocal_NodeManagement_Call) Return(_a0 api.NodeManagement) *DeviceLocal_NodeManagement_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_NodeManagement_Call) RunAndReturn(run func() api.NodeManagement) *DeviceLocal_NodeManagement_Call { - _c.Call.Return(run) - return _c -} - -// NotifySubscribers provides a mock function with given fields: featureAddress, cmd -func (_m *DeviceLocal) NotifySubscribers(featureAddress *model.FeatureAddressType, cmd model.CmdType) { - _m.Called(featureAddress, cmd) -} - -// DeviceLocal_NotifySubscribers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotifySubscribers' -type DeviceLocal_NotifySubscribers_Call struct { - *mock.Call -} - -// NotifySubscribers is a helper method to define mock.On call -// - featureAddress *model.FeatureAddressType -// - cmd model.CmdType -func (_e *DeviceLocal_Expecter) NotifySubscribers(featureAddress interface{}, cmd interface{}) *DeviceLocal_NotifySubscribers_Call { - return &DeviceLocal_NotifySubscribers_Call{Call: _e.mock.On("NotifySubscribers", featureAddress, cmd)} -} - -func (_c *DeviceLocal_NotifySubscribers_Call) Run(run func(featureAddress *model.FeatureAddressType, cmd model.CmdType)) *DeviceLocal_NotifySubscribers_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.FeatureAddressType), args[1].(model.CmdType)) - }) - return _c -} - -func (_c *DeviceLocal_NotifySubscribers_Call) Return() *DeviceLocal_NotifySubscribers_Call { - _c.Call.Return() - return _c -} - -func (_c *DeviceLocal_NotifySubscribers_Call) RunAndReturn(run func(*model.FeatureAddressType, model.CmdType)) *DeviceLocal_NotifySubscribers_Call { - _c.Call.Return(run) - return _c -} - -// ProcessCmd provides a mock function with given fields: datagram, remoteDevice -func (_m *DeviceLocal) ProcessCmd(datagram model.DatagramType, remoteDevice api.DeviceRemote) error { - ret := _m.Called(datagram, remoteDevice) - - if len(ret) == 0 { - panic("no return value specified for ProcessCmd") - } - - var r0 error - if rf, ok := ret.Get(0).(func(model.DatagramType, api.DeviceRemote) error); ok { - r0 = rf(datagram, remoteDevice) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// DeviceLocal_ProcessCmd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessCmd' -type DeviceLocal_ProcessCmd_Call struct { - *mock.Call -} - -// ProcessCmd is a helper method to define mock.On call -// - datagram model.DatagramType -// - remoteDevice api.DeviceRemote -func (_e *DeviceLocal_Expecter) ProcessCmd(datagram interface{}, remoteDevice interface{}) *DeviceLocal_ProcessCmd_Call { - return &DeviceLocal_ProcessCmd_Call{Call: _e.mock.On("ProcessCmd", datagram, remoteDevice)} -} - -func (_c *DeviceLocal_ProcessCmd_Call) Run(run func(datagram model.DatagramType, remoteDevice api.DeviceRemote)) *DeviceLocal_ProcessCmd_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.DatagramType), args[1].(api.DeviceRemote)) - }) - return _c -} - -func (_c *DeviceLocal_ProcessCmd_Call) Return(_a0 error) *DeviceLocal_ProcessCmd_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_ProcessCmd_Call) RunAndReturn(run func(model.DatagramType, api.DeviceRemote) error) *DeviceLocal_ProcessCmd_Call { - _c.Call.Return(run) - return _c -} - -// RemoteDeviceForAddress provides a mock function with given fields: address -func (_m *DeviceLocal) RemoteDeviceForAddress(address model.AddressDeviceType) api.DeviceRemote { - ret := _m.Called(address) - - if len(ret) == 0 { - panic("no return value specified for RemoteDeviceForAddress") - } - - var r0 api.DeviceRemote - if rf, ok := ret.Get(0).(func(model.AddressDeviceType) api.DeviceRemote); ok { - r0 = rf(address) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.DeviceRemote) - } - } - - return r0 -} - -// DeviceLocal_RemoteDeviceForAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoteDeviceForAddress' -type DeviceLocal_RemoteDeviceForAddress_Call struct { - *mock.Call -} - -// RemoteDeviceForAddress is a helper method to define mock.On call -// - address model.AddressDeviceType -func (_e *DeviceLocal_Expecter) RemoteDeviceForAddress(address interface{}) *DeviceLocal_RemoteDeviceForAddress_Call { - return &DeviceLocal_RemoteDeviceForAddress_Call{Call: _e.mock.On("RemoteDeviceForAddress", address)} -} - -func (_c *DeviceLocal_RemoteDeviceForAddress_Call) Run(run func(address model.AddressDeviceType)) *DeviceLocal_RemoteDeviceForAddress_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.AddressDeviceType)) - }) - return _c -} - -func (_c *DeviceLocal_RemoteDeviceForAddress_Call) Return(_a0 api.DeviceRemote) *DeviceLocal_RemoteDeviceForAddress_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_RemoteDeviceForAddress_Call) RunAndReturn(run func(model.AddressDeviceType) api.DeviceRemote) *DeviceLocal_RemoteDeviceForAddress_Call { - _c.Call.Return(run) - return _c -} - -// RemoteDeviceForSki provides a mock function with given fields: ski -func (_m *DeviceLocal) RemoteDeviceForSki(ski string) api.DeviceRemote { - ret := _m.Called(ski) - - if len(ret) == 0 { - panic("no return value specified for RemoteDeviceForSki") - } - - var r0 api.DeviceRemote - if rf, ok := ret.Get(0).(func(string) api.DeviceRemote); ok { - r0 = rf(ski) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.DeviceRemote) - } - } - - return r0 -} - -// DeviceLocal_RemoteDeviceForSki_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoteDeviceForSki' -type DeviceLocal_RemoteDeviceForSki_Call struct { - *mock.Call -} - -// RemoteDeviceForSki is a helper method to define mock.On call -// - ski string -func (_e *DeviceLocal_Expecter) RemoteDeviceForSki(ski interface{}) *DeviceLocal_RemoteDeviceForSki_Call { - return &DeviceLocal_RemoteDeviceForSki_Call{Call: _e.mock.On("RemoteDeviceForSki", ski)} -} - -func (_c *DeviceLocal_RemoteDeviceForSki_Call) Run(run func(ski string)) *DeviceLocal_RemoteDeviceForSki_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *DeviceLocal_RemoteDeviceForSki_Call) Return(_a0 api.DeviceRemote) *DeviceLocal_RemoteDeviceForSki_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_RemoteDeviceForSki_Call) RunAndReturn(run func(string) api.DeviceRemote) *DeviceLocal_RemoteDeviceForSki_Call { - _c.Call.Return(run) - return _c -} - -// RemoteDevices provides a mock function with given fields: -func (_m *DeviceLocal) RemoteDevices() []api.DeviceRemote { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for RemoteDevices") - } - - var r0 []api.DeviceRemote - if rf, ok := ret.Get(0).(func() []api.DeviceRemote); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]api.DeviceRemote) - } - } - - return r0 -} - -// DeviceLocal_RemoteDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoteDevices' -type DeviceLocal_RemoteDevices_Call struct { - *mock.Call -} - -// RemoteDevices is a helper method to define mock.On call -func (_e *DeviceLocal_Expecter) RemoteDevices() *DeviceLocal_RemoteDevices_Call { - return &DeviceLocal_RemoteDevices_Call{Call: _e.mock.On("RemoteDevices")} -} - -func (_c *DeviceLocal_RemoteDevices_Call) Run(run func()) *DeviceLocal_RemoteDevices_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceLocal_RemoteDevices_Call) Return(_a0 []api.DeviceRemote) *DeviceLocal_RemoteDevices_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_RemoteDevices_Call) RunAndReturn(run func() []api.DeviceRemote) *DeviceLocal_RemoteDevices_Call { - _c.Call.Return(run) - return _c -} - -// RemoveEntity provides a mock function with given fields: entity -func (_m *DeviceLocal) RemoveEntity(entity api.EntityLocal) { - _m.Called(entity) -} - -// DeviceLocal_RemoveEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveEntity' -type DeviceLocal_RemoveEntity_Call struct { - *mock.Call -} - -// RemoveEntity is a helper method to define mock.On call -// - entity api.EntityLocal -func (_e *DeviceLocal_Expecter) RemoveEntity(entity interface{}) *DeviceLocal_RemoveEntity_Call { - return &DeviceLocal_RemoveEntity_Call{Call: _e.mock.On("RemoveEntity", entity)} -} - -func (_c *DeviceLocal_RemoveEntity_Call) Run(run func(entity api.EntityLocal)) *DeviceLocal_RemoveEntity_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.EntityLocal)) - }) - return _c -} - -func (_c *DeviceLocal_RemoveEntity_Call) Return() *DeviceLocal_RemoveEntity_Call { - _c.Call.Return() - return _c -} - -func (_c *DeviceLocal_RemoveEntity_Call) RunAndReturn(run func(api.EntityLocal)) *DeviceLocal_RemoveEntity_Call { - _c.Call.Return(run) - return _c -} - -// RemoveRemoteDevice provides a mock function with given fields: ski -func (_m *DeviceLocal) RemoveRemoteDevice(ski string) { - _m.Called(ski) -} - -// DeviceLocal_RemoveRemoteDevice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRemoteDevice' -type DeviceLocal_RemoveRemoteDevice_Call struct { - *mock.Call -} - -// RemoveRemoteDevice is a helper method to define mock.On call -// - ski string -func (_e *DeviceLocal_Expecter) RemoveRemoteDevice(ski interface{}) *DeviceLocal_RemoveRemoteDevice_Call { - return &DeviceLocal_RemoveRemoteDevice_Call{Call: _e.mock.On("RemoveRemoteDevice", ski)} -} - -func (_c *DeviceLocal_RemoveRemoteDevice_Call) Run(run func(ski string)) *DeviceLocal_RemoveRemoteDevice_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *DeviceLocal_RemoveRemoteDevice_Call) Return() *DeviceLocal_RemoveRemoteDevice_Call { - _c.Call.Return() - return _c -} - -func (_c *DeviceLocal_RemoveRemoteDevice_Call) RunAndReturn(run func(string)) *DeviceLocal_RemoveRemoteDevice_Call { - _c.Call.Return(run) - return _c -} - -// RemoveRemoteDeviceConnection provides a mock function with given fields: ski -func (_m *DeviceLocal) RemoveRemoteDeviceConnection(ski string) { - _m.Called(ski) -} - -// DeviceLocal_RemoveRemoteDeviceConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRemoteDeviceConnection' -type DeviceLocal_RemoveRemoteDeviceConnection_Call struct { - *mock.Call -} - -// RemoveRemoteDeviceConnection is a helper method to define mock.On call -// - ski string -func (_e *DeviceLocal_Expecter) RemoveRemoteDeviceConnection(ski interface{}) *DeviceLocal_RemoveRemoteDeviceConnection_Call { - return &DeviceLocal_RemoveRemoteDeviceConnection_Call{Call: _e.mock.On("RemoveRemoteDeviceConnection", ski)} -} - -func (_c *DeviceLocal_RemoveRemoteDeviceConnection_Call) Run(run func(ski string)) *DeviceLocal_RemoveRemoteDeviceConnection_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *DeviceLocal_RemoveRemoteDeviceConnection_Call) Return() *DeviceLocal_RemoveRemoteDeviceConnection_Call { - _c.Call.Return() - return _c -} - -func (_c *DeviceLocal_RemoveRemoteDeviceConnection_Call) RunAndReturn(run func(string)) *DeviceLocal_RemoveRemoteDeviceConnection_Call { - _c.Call.Return(run) - return _c -} - -// SetupRemoteDevice provides a mock function with given fields: ski, writeI -func (_m *DeviceLocal) SetupRemoteDevice(ski string, writeI ship_goapi.SpineDataConnection) ship_goapi.SpineDataProcessing { - ret := _m.Called(ski, writeI) - - if len(ret) == 0 { - panic("no return value specified for SetupRemoteDevice") - } - - var r0 ship_goapi.SpineDataProcessing - if rf, ok := ret.Get(0).(func(string, ship_goapi.SpineDataConnection) ship_goapi.SpineDataProcessing); ok { - r0 = rf(ski, writeI) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(ship_goapi.SpineDataProcessing) - } - } - - return r0 -} - -// DeviceLocal_SetupRemoteDevice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetupRemoteDevice' -type DeviceLocal_SetupRemoteDevice_Call struct { - *mock.Call -} - -// SetupRemoteDevice is a helper method to define mock.On call -// - ski string -// - writeI ship_goapi.SpineDataConnection -func (_e *DeviceLocal_Expecter) SetupRemoteDevice(ski interface{}, writeI interface{}) *DeviceLocal_SetupRemoteDevice_Call { - return &DeviceLocal_SetupRemoteDevice_Call{Call: _e.mock.On("SetupRemoteDevice", ski, writeI)} -} - -func (_c *DeviceLocal_SetupRemoteDevice_Call) Run(run func(ski string, writeI ship_goapi.SpineDataConnection)) *DeviceLocal_SetupRemoteDevice_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(ship_goapi.SpineDataConnection)) - }) - return _c -} - -func (_c *DeviceLocal_SetupRemoteDevice_Call) Return(_a0 ship_goapi.SpineDataProcessing) *DeviceLocal_SetupRemoteDevice_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_SetupRemoteDevice_Call) RunAndReturn(run func(string, ship_goapi.SpineDataConnection) ship_goapi.SpineDataProcessing) *DeviceLocal_SetupRemoteDevice_Call { - _c.Call.Return(run) - return _c -} - -// SubscriptionManager provides a mock function with given fields: -func (_m *DeviceLocal) SubscriptionManager() api.SubscriptionManager { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for SubscriptionManager") - } - - var r0 api.SubscriptionManager - if rf, ok := ret.Get(0).(func() api.SubscriptionManager); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.SubscriptionManager) - } - } - - return r0 -} - -// DeviceLocal_SubscriptionManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscriptionManager' -type DeviceLocal_SubscriptionManager_Call struct { - *mock.Call -} - -// SubscriptionManager is a helper method to define mock.On call -func (_e *DeviceLocal_Expecter) SubscriptionManager() *DeviceLocal_SubscriptionManager_Call { - return &DeviceLocal_SubscriptionManager_Call{Call: _e.mock.On("SubscriptionManager")} -} - -func (_c *DeviceLocal_SubscriptionManager_Call) Run(run func()) *DeviceLocal_SubscriptionManager_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceLocal_SubscriptionManager_Call) Return(_a0 api.SubscriptionManager) *DeviceLocal_SubscriptionManager_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceLocal_SubscriptionManager_Call) RunAndReturn(run func() api.SubscriptionManager) *DeviceLocal_SubscriptionManager_Call { - _c.Call.Return(run) - return _c -} - -// NewDeviceLocal creates a new instance of DeviceLocal. 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 NewDeviceLocal(t interface { - mock.TestingT - Cleanup(func()) -}) *DeviceLocal { - mock := &DeviceLocal{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/DeviceLocalInterface.go b/mocks/DeviceLocalInterface.go new file mode 100644 index 0000000..9b68659 --- /dev/null +++ b/mocks/DeviceLocalInterface.go @@ -0,0 +1,1090 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" + + model "github.com/enbility/spine-go/model" + + ship_goapi "github.com/enbility/ship-go/api" +) + +// DeviceLocalInterface is an autogenerated mock type for the DeviceLocalInterface type +type DeviceLocalInterface struct { + mock.Mock +} + +type DeviceLocalInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *DeviceLocalInterface) EXPECT() *DeviceLocalInterface_Expecter { + return &DeviceLocalInterface_Expecter{mock: &_m.Mock} +} + +// AddEntity provides a mock function with given fields: entity +func (_m *DeviceLocalInterface) AddEntity(entity api.EntityLocalInterface) { + _m.Called(entity) +} + +// DeviceLocalInterface_AddEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddEntity' +type DeviceLocalInterface_AddEntity_Call struct { + *mock.Call +} + +// AddEntity is a helper method to define mock.On call +// - entity api.EntityLocalInterface +func (_e *DeviceLocalInterface_Expecter) AddEntity(entity interface{}) *DeviceLocalInterface_AddEntity_Call { + return &DeviceLocalInterface_AddEntity_Call{Call: _e.mock.On("AddEntity", entity)} +} + +func (_c *DeviceLocalInterface_AddEntity_Call) Run(run func(entity api.EntityLocalInterface)) *DeviceLocalInterface_AddEntity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.EntityLocalInterface)) + }) + return _c +} + +func (_c *DeviceLocalInterface_AddEntity_Call) Return() *DeviceLocalInterface_AddEntity_Call { + _c.Call.Return() + return _c +} + +func (_c *DeviceLocalInterface_AddEntity_Call) RunAndReturn(run func(api.EntityLocalInterface)) *DeviceLocalInterface_AddEntity_Call { + _c.Call.Return(run) + return _c +} + +// AddRemoteDeviceForSki provides a mock function with given fields: ski, rDevice +func (_m *DeviceLocalInterface) AddRemoteDeviceForSki(ski string, rDevice api.DeviceRemoteInterface) { + _m.Called(ski, rDevice) +} + +// DeviceLocalInterface_AddRemoteDeviceForSki_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddRemoteDeviceForSki' +type DeviceLocalInterface_AddRemoteDeviceForSki_Call struct { + *mock.Call +} + +// AddRemoteDeviceForSki is a helper method to define mock.On call +// - ski string +// - rDevice api.DeviceRemoteInterface +func (_e *DeviceLocalInterface_Expecter) AddRemoteDeviceForSki(ski interface{}, rDevice interface{}) *DeviceLocalInterface_AddRemoteDeviceForSki_Call { + return &DeviceLocalInterface_AddRemoteDeviceForSki_Call{Call: _e.mock.On("AddRemoteDeviceForSki", ski, rDevice)} +} + +func (_c *DeviceLocalInterface_AddRemoteDeviceForSki_Call) Run(run func(ski string, rDevice api.DeviceRemoteInterface)) *DeviceLocalInterface_AddRemoteDeviceForSki_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(api.DeviceRemoteInterface)) + }) + return _c +} + +func (_c *DeviceLocalInterface_AddRemoteDeviceForSki_Call) Return() *DeviceLocalInterface_AddRemoteDeviceForSki_Call { + _c.Call.Return() + return _c +} + +func (_c *DeviceLocalInterface_AddRemoteDeviceForSki_Call) RunAndReturn(run func(string, api.DeviceRemoteInterface)) *DeviceLocalInterface_AddRemoteDeviceForSki_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *DeviceLocalInterface) Address() *model.AddressDeviceType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 *model.AddressDeviceType + if rf, ok := ret.Get(0).(func() *model.AddressDeviceType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.AddressDeviceType) + } + } + + return r0 +} + +// DeviceLocalInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type DeviceLocalInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *DeviceLocalInterface_Expecter) Address() *DeviceLocalInterface_Address_Call { + return &DeviceLocalInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *DeviceLocalInterface_Address_Call) Run(run func()) *DeviceLocalInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceLocalInterface_Address_Call) Return(_a0 *model.AddressDeviceType) *DeviceLocalInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_Address_Call) RunAndReturn(run func() *model.AddressDeviceType) *DeviceLocalInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// BindingManager provides a mock function with given fields: +func (_m *DeviceLocalInterface) BindingManager() api.BindingManagerInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for BindingManager") + } + + var r0 api.BindingManagerInterface + if rf, ok := ret.Get(0).(func() api.BindingManagerInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.BindingManagerInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_BindingManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BindingManager' +type DeviceLocalInterface_BindingManager_Call struct { + *mock.Call +} + +// BindingManager is a helper method to define mock.On call +func (_e *DeviceLocalInterface_Expecter) BindingManager() *DeviceLocalInterface_BindingManager_Call { + return &DeviceLocalInterface_BindingManager_Call{Call: _e.mock.On("BindingManager")} +} + +func (_c *DeviceLocalInterface_BindingManager_Call) Run(run func()) *DeviceLocalInterface_BindingManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceLocalInterface_BindingManager_Call) Return(_a0 api.BindingManagerInterface) *DeviceLocalInterface_BindingManager_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_BindingManager_Call) RunAndReturn(run func() api.BindingManagerInterface) *DeviceLocalInterface_BindingManager_Call { + _c.Call.Return(run) + return _c +} + +// DestinationData provides a mock function with given fields: +func (_m *DeviceLocalInterface) DestinationData() model.NodeManagementDestinationDataType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DestinationData") + } + + var r0 model.NodeManagementDestinationDataType + if rf, ok := ret.Get(0).(func() model.NodeManagementDestinationDataType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.NodeManagementDestinationDataType) + } + + return r0 +} + +// DeviceLocalInterface_DestinationData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestinationData' +type DeviceLocalInterface_DestinationData_Call struct { + *mock.Call +} + +// DestinationData is a helper method to define mock.On call +func (_e *DeviceLocalInterface_Expecter) DestinationData() *DeviceLocalInterface_DestinationData_Call { + return &DeviceLocalInterface_DestinationData_Call{Call: _e.mock.On("DestinationData")} +} + +func (_c *DeviceLocalInterface_DestinationData_Call) Run(run func()) *DeviceLocalInterface_DestinationData_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceLocalInterface_DestinationData_Call) Return(_a0 model.NodeManagementDestinationDataType) *DeviceLocalInterface_DestinationData_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_DestinationData_Call) RunAndReturn(run func() model.NodeManagementDestinationDataType) *DeviceLocalInterface_DestinationData_Call { + _c.Call.Return(run) + return _c +} + +// DeviceType provides a mock function with given fields: +func (_m *DeviceLocalInterface) DeviceType() *model.DeviceTypeType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DeviceType") + } + + var r0 *model.DeviceTypeType + if rf, ok := ret.Get(0).(func() *model.DeviceTypeType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.DeviceTypeType) + } + } + + return r0 +} + +// DeviceLocalInterface_DeviceType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeviceType' +type DeviceLocalInterface_DeviceType_Call struct { + *mock.Call +} + +// DeviceType is a helper method to define mock.On call +func (_e *DeviceLocalInterface_Expecter) DeviceType() *DeviceLocalInterface_DeviceType_Call { + return &DeviceLocalInterface_DeviceType_Call{Call: _e.mock.On("DeviceType")} +} + +func (_c *DeviceLocalInterface_DeviceType_Call) Run(run func()) *DeviceLocalInterface_DeviceType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceLocalInterface_DeviceType_Call) Return(_a0 *model.DeviceTypeType) *DeviceLocalInterface_DeviceType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_DeviceType_Call) RunAndReturn(run func() *model.DeviceTypeType) *DeviceLocalInterface_DeviceType_Call { + _c.Call.Return(run) + return _c +} + +// Entities provides a mock function with given fields: +func (_m *DeviceLocalInterface) Entities() []api.EntityLocalInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Entities") + } + + var r0 []api.EntityLocalInterface + if rf, ok := ret.Get(0).(func() []api.EntityLocalInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]api.EntityLocalInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_Entities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entities' +type DeviceLocalInterface_Entities_Call struct { + *mock.Call +} + +// Entities is a helper method to define mock.On call +func (_e *DeviceLocalInterface_Expecter) Entities() *DeviceLocalInterface_Entities_Call { + return &DeviceLocalInterface_Entities_Call{Call: _e.mock.On("Entities")} +} + +func (_c *DeviceLocalInterface_Entities_Call) Run(run func()) *DeviceLocalInterface_Entities_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceLocalInterface_Entities_Call) Return(_a0 []api.EntityLocalInterface) *DeviceLocalInterface_Entities_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_Entities_Call) RunAndReturn(run func() []api.EntityLocalInterface) *DeviceLocalInterface_Entities_Call { + _c.Call.Return(run) + return _c +} + +// Entity provides a mock function with given fields: id +func (_m *DeviceLocalInterface) Entity(id []model.AddressEntityType) api.EntityLocalInterface { + ret := _m.Called(id) + + if len(ret) == 0 { + panic("no return value specified for Entity") + } + + var r0 api.EntityLocalInterface + if rf, ok := ret.Get(0).(func([]model.AddressEntityType) api.EntityLocalInterface); ok { + r0 = rf(id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.EntityLocalInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_Entity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entity' +type DeviceLocalInterface_Entity_Call struct { + *mock.Call +} + +// Entity is a helper method to define mock.On call +// - id []model.AddressEntityType +func (_e *DeviceLocalInterface_Expecter) Entity(id interface{}) *DeviceLocalInterface_Entity_Call { + return &DeviceLocalInterface_Entity_Call{Call: _e.mock.On("Entity", id)} +} + +func (_c *DeviceLocalInterface_Entity_Call) Run(run func(id []model.AddressEntityType)) *DeviceLocalInterface_Entity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]model.AddressEntityType)) + }) + return _c +} + +func (_c *DeviceLocalInterface_Entity_Call) Return(_a0 api.EntityLocalInterface) *DeviceLocalInterface_Entity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_Entity_Call) RunAndReturn(run func([]model.AddressEntityType) api.EntityLocalInterface) *DeviceLocalInterface_Entity_Call { + _c.Call.Return(run) + return _c +} + +// EntityForType provides a mock function with given fields: entityType +func (_m *DeviceLocalInterface) EntityForType(entityType model.EntityTypeType) api.EntityLocalInterface { + ret := _m.Called(entityType) + + if len(ret) == 0 { + panic("no return value specified for EntityForType") + } + + var r0 api.EntityLocalInterface + if rf, ok := ret.Get(0).(func(model.EntityTypeType) api.EntityLocalInterface); ok { + r0 = rf(entityType) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.EntityLocalInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_EntityForType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EntityForType' +type DeviceLocalInterface_EntityForType_Call struct { + *mock.Call +} + +// EntityForType is a helper method to define mock.On call +// - entityType model.EntityTypeType +func (_e *DeviceLocalInterface_Expecter) EntityForType(entityType interface{}) *DeviceLocalInterface_EntityForType_Call { + return &DeviceLocalInterface_EntityForType_Call{Call: _e.mock.On("EntityForType", entityType)} +} + +func (_c *DeviceLocalInterface_EntityForType_Call) Run(run func(entityType model.EntityTypeType)) *DeviceLocalInterface_EntityForType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.EntityTypeType)) + }) + return _c +} + +func (_c *DeviceLocalInterface_EntityForType_Call) Return(_a0 api.EntityLocalInterface) *DeviceLocalInterface_EntityForType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_EntityForType_Call) RunAndReturn(run func(model.EntityTypeType) api.EntityLocalInterface) *DeviceLocalInterface_EntityForType_Call { + _c.Call.Return(run) + return _c +} + +// FeatureByAddress provides a mock function with given fields: address +func (_m *DeviceLocalInterface) FeatureByAddress(address *model.FeatureAddressType) api.FeatureLocalInterface { + ret := _m.Called(address) + + if len(ret) == 0 { + panic("no return value specified for FeatureByAddress") + } + + var r0 api.FeatureLocalInterface + if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) api.FeatureLocalInterface); ok { + r0 = rf(address) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.FeatureLocalInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_FeatureByAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureByAddress' +type DeviceLocalInterface_FeatureByAddress_Call struct { + *mock.Call +} + +// FeatureByAddress is a helper method to define mock.On call +// - address *model.FeatureAddressType +func (_e *DeviceLocalInterface_Expecter) FeatureByAddress(address interface{}) *DeviceLocalInterface_FeatureByAddress_Call { + return &DeviceLocalInterface_FeatureByAddress_Call{Call: _e.mock.On("FeatureByAddress", address)} +} + +func (_c *DeviceLocalInterface_FeatureByAddress_Call) Run(run func(address *model.FeatureAddressType)) *DeviceLocalInterface_FeatureByAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType)) + }) + return _c +} + +func (_c *DeviceLocalInterface_FeatureByAddress_Call) Return(_a0 api.FeatureLocalInterface) *DeviceLocalInterface_FeatureByAddress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_FeatureByAddress_Call) RunAndReturn(run func(*model.FeatureAddressType) api.FeatureLocalInterface) *DeviceLocalInterface_FeatureByAddress_Call { + _c.Call.Return(run) + return _c +} + +// FeatureSet provides a mock function with given fields: +func (_m *DeviceLocalInterface) FeatureSet() *model.NetworkManagementFeatureSetType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for FeatureSet") + } + + var r0 *model.NetworkManagementFeatureSetType + if rf, ok := ret.Get(0).(func() *model.NetworkManagementFeatureSetType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.NetworkManagementFeatureSetType) + } + } + + return r0 +} + +// DeviceLocalInterface_FeatureSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureSet' +type DeviceLocalInterface_FeatureSet_Call struct { + *mock.Call +} + +// FeatureSet is a helper method to define mock.On call +func (_e *DeviceLocalInterface_Expecter) FeatureSet() *DeviceLocalInterface_FeatureSet_Call { + return &DeviceLocalInterface_FeatureSet_Call{Call: _e.mock.On("FeatureSet")} +} + +func (_c *DeviceLocalInterface_FeatureSet_Call) Run(run func()) *DeviceLocalInterface_FeatureSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceLocalInterface_FeatureSet_Call) Return(_a0 *model.NetworkManagementFeatureSetType) *DeviceLocalInterface_FeatureSet_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_FeatureSet_Call) RunAndReturn(run func() *model.NetworkManagementFeatureSetType) *DeviceLocalInterface_FeatureSet_Call { + _c.Call.Return(run) + return _c +} + +// HeartbeatManager provides a mock function with given fields: +func (_m *DeviceLocalInterface) HeartbeatManager() api.HeartbeatManagerInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HeartbeatManager") + } + + var r0 api.HeartbeatManagerInterface + if rf, ok := ret.Get(0).(func() api.HeartbeatManagerInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.HeartbeatManagerInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_HeartbeatManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeartbeatManager' +type DeviceLocalInterface_HeartbeatManager_Call struct { + *mock.Call +} + +// HeartbeatManager is a helper method to define mock.On call +func (_e *DeviceLocalInterface_Expecter) HeartbeatManager() *DeviceLocalInterface_HeartbeatManager_Call { + return &DeviceLocalInterface_HeartbeatManager_Call{Call: _e.mock.On("HeartbeatManager")} +} + +func (_c *DeviceLocalInterface_HeartbeatManager_Call) Run(run func()) *DeviceLocalInterface_HeartbeatManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceLocalInterface_HeartbeatManager_Call) Return(_a0 api.HeartbeatManagerInterface) *DeviceLocalInterface_HeartbeatManager_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_HeartbeatManager_Call) RunAndReturn(run func() api.HeartbeatManagerInterface) *DeviceLocalInterface_HeartbeatManager_Call { + _c.Call.Return(run) + return _c +} + +// Information provides a mock function with given fields: +func (_m *DeviceLocalInterface) Information() *model.NodeManagementDetailedDiscoveryDeviceInformationType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Information") + } + + var r0 *model.NodeManagementDetailedDiscoveryDeviceInformationType + if rf, ok := ret.Get(0).(func() *model.NodeManagementDetailedDiscoveryDeviceInformationType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.NodeManagementDetailedDiscoveryDeviceInformationType) + } + } + + return r0 +} + +// DeviceLocalInterface_Information_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Information' +type DeviceLocalInterface_Information_Call struct { + *mock.Call +} + +// Information is a helper method to define mock.On call +func (_e *DeviceLocalInterface_Expecter) Information() *DeviceLocalInterface_Information_Call { + return &DeviceLocalInterface_Information_Call{Call: _e.mock.On("Information")} +} + +func (_c *DeviceLocalInterface_Information_Call) Run(run func()) *DeviceLocalInterface_Information_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceLocalInterface_Information_Call) Return(_a0 *model.NodeManagementDetailedDiscoveryDeviceInformationType) *DeviceLocalInterface_Information_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_Information_Call) RunAndReturn(run func() *model.NodeManagementDetailedDiscoveryDeviceInformationType) *DeviceLocalInterface_Information_Call { + _c.Call.Return(run) + return _c +} + +// NodeManagement provides a mock function with given fields: +func (_m *DeviceLocalInterface) NodeManagement() api.NodeManagementInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NodeManagement") + } + + var r0 api.NodeManagementInterface + if rf, ok := ret.Get(0).(func() api.NodeManagementInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.NodeManagementInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_NodeManagement_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NodeManagement' +type DeviceLocalInterface_NodeManagement_Call struct { + *mock.Call +} + +// NodeManagement is a helper method to define mock.On call +func (_e *DeviceLocalInterface_Expecter) NodeManagement() *DeviceLocalInterface_NodeManagement_Call { + return &DeviceLocalInterface_NodeManagement_Call{Call: _e.mock.On("NodeManagement")} +} + +func (_c *DeviceLocalInterface_NodeManagement_Call) Run(run func()) *DeviceLocalInterface_NodeManagement_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceLocalInterface_NodeManagement_Call) Return(_a0 api.NodeManagementInterface) *DeviceLocalInterface_NodeManagement_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_NodeManagement_Call) RunAndReturn(run func() api.NodeManagementInterface) *DeviceLocalInterface_NodeManagement_Call { + _c.Call.Return(run) + return _c +} + +// NotifySubscribers provides a mock function with given fields: featureAddress, cmd +func (_m *DeviceLocalInterface) NotifySubscribers(featureAddress *model.FeatureAddressType, cmd model.CmdType) { + _m.Called(featureAddress, cmd) +} + +// DeviceLocalInterface_NotifySubscribers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotifySubscribers' +type DeviceLocalInterface_NotifySubscribers_Call struct { + *mock.Call +} + +// NotifySubscribers is a helper method to define mock.On call +// - featureAddress *model.FeatureAddressType +// - cmd model.CmdType +func (_e *DeviceLocalInterface_Expecter) NotifySubscribers(featureAddress interface{}, cmd interface{}) *DeviceLocalInterface_NotifySubscribers_Call { + return &DeviceLocalInterface_NotifySubscribers_Call{Call: _e.mock.On("NotifySubscribers", featureAddress, cmd)} +} + +func (_c *DeviceLocalInterface_NotifySubscribers_Call) Run(run func(featureAddress *model.FeatureAddressType, cmd model.CmdType)) *DeviceLocalInterface_NotifySubscribers_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType), args[1].(model.CmdType)) + }) + return _c +} + +func (_c *DeviceLocalInterface_NotifySubscribers_Call) Return() *DeviceLocalInterface_NotifySubscribers_Call { + _c.Call.Return() + return _c +} + +func (_c *DeviceLocalInterface_NotifySubscribers_Call) RunAndReturn(run func(*model.FeatureAddressType, model.CmdType)) *DeviceLocalInterface_NotifySubscribers_Call { + _c.Call.Return(run) + return _c +} + +// ProcessCmd provides a mock function with given fields: datagram, remoteDevice +func (_m *DeviceLocalInterface) ProcessCmd(datagram model.DatagramType, remoteDevice api.DeviceRemoteInterface) error { + ret := _m.Called(datagram, remoteDevice) + + if len(ret) == 0 { + panic("no return value specified for ProcessCmd") + } + + var r0 error + if rf, ok := ret.Get(0).(func(model.DatagramType, api.DeviceRemoteInterface) error); ok { + r0 = rf(datagram, remoteDevice) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// DeviceLocalInterface_ProcessCmd_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessCmd' +type DeviceLocalInterface_ProcessCmd_Call struct { + *mock.Call +} + +// ProcessCmd is a helper method to define mock.On call +// - datagram model.DatagramType +// - remoteDevice api.DeviceRemoteInterface +func (_e *DeviceLocalInterface_Expecter) ProcessCmd(datagram interface{}, remoteDevice interface{}) *DeviceLocalInterface_ProcessCmd_Call { + return &DeviceLocalInterface_ProcessCmd_Call{Call: _e.mock.On("ProcessCmd", datagram, remoteDevice)} +} + +func (_c *DeviceLocalInterface_ProcessCmd_Call) Run(run func(datagram model.DatagramType, remoteDevice api.DeviceRemoteInterface)) *DeviceLocalInterface_ProcessCmd_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.DatagramType), args[1].(api.DeviceRemoteInterface)) + }) + return _c +} + +func (_c *DeviceLocalInterface_ProcessCmd_Call) Return(_a0 error) *DeviceLocalInterface_ProcessCmd_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_ProcessCmd_Call) RunAndReturn(run func(model.DatagramType, api.DeviceRemoteInterface) error) *DeviceLocalInterface_ProcessCmd_Call { + _c.Call.Return(run) + return _c +} + +// RemoteDeviceForAddress provides a mock function with given fields: address +func (_m *DeviceLocalInterface) RemoteDeviceForAddress(address model.AddressDeviceType) api.DeviceRemoteInterface { + ret := _m.Called(address) + + if len(ret) == 0 { + panic("no return value specified for RemoteDeviceForAddress") + } + + var r0 api.DeviceRemoteInterface + if rf, ok := ret.Get(0).(func(model.AddressDeviceType) api.DeviceRemoteInterface); ok { + r0 = rf(address) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.DeviceRemoteInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_RemoteDeviceForAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoteDeviceForAddress' +type DeviceLocalInterface_RemoteDeviceForAddress_Call struct { + *mock.Call +} + +// RemoteDeviceForAddress is a helper method to define mock.On call +// - address model.AddressDeviceType +func (_e *DeviceLocalInterface_Expecter) RemoteDeviceForAddress(address interface{}) *DeviceLocalInterface_RemoteDeviceForAddress_Call { + return &DeviceLocalInterface_RemoteDeviceForAddress_Call{Call: _e.mock.On("RemoteDeviceForAddress", address)} +} + +func (_c *DeviceLocalInterface_RemoteDeviceForAddress_Call) Run(run func(address model.AddressDeviceType)) *DeviceLocalInterface_RemoteDeviceForAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.AddressDeviceType)) + }) + return _c +} + +func (_c *DeviceLocalInterface_RemoteDeviceForAddress_Call) Return(_a0 api.DeviceRemoteInterface) *DeviceLocalInterface_RemoteDeviceForAddress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_RemoteDeviceForAddress_Call) RunAndReturn(run func(model.AddressDeviceType) api.DeviceRemoteInterface) *DeviceLocalInterface_RemoteDeviceForAddress_Call { + _c.Call.Return(run) + return _c +} + +// RemoteDeviceForSki provides a mock function with given fields: ski +func (_m *DeviceLocalInterface) RemoteDeviceForSki(ski string) api.DeviceRemoteInterface { + ret := _m.Called(ski) + + if len(ret) == 0 { + panic("no return value specified for RemoteDeviceForSki") + } + + var r0 api.DeviceRemoteInterface + if rf, ok := ret.Get(0).(func(string) api.DeviceRemoteInterface); ok { + r0 = rf(ski) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.DeviceRemoteInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_RemoteDeviceForSki_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoteDeviceForSki' +type DeviceLocalInterface_RemoteDeviceForSki_Call struct { + *mock.Call +} + +// RemoteDeviceForSki is a helper method to define mock.On call +// - ski string +func (_e *DeviceLocalInterface_Expecter) RemoteDeviceForSki(ski interface{}) *DeviceLocalInterface_RemoteDeviceForSki_Call { + return &DeviceLocalInterface_RemoteDeviceForSki_Call{Call: _e.mock.On("RemoteDeviceForSki", ski)} +} + +func (_c *DeviceLocalInterface_RemoteDeviceForSki_Call) Run(run func(ski string)) *DeviceLocalInterface_RemoteDeviceForSki_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *DeviceLocalInterface_RemoteDeviceForSki_Call) Return(_a0 api.DeviceRemoteInterface) *DeviceLocalInterface_RemoteDeviceForSki_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_RemoteDeviceForSki_Call) RunAndReturn(run func(string) api.DeviceRemoteInterface) *DeviceLocalInterface_RemoteDeviceForSki_Call { + _c.Call.Return(run) + return _c +} + +// RemoteDevices provides a mock function with given fields: +func (_m *DeviceLocalInterface) RemoteDevices() []api.DeviceRemoteInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for RemoteDevices") + } + + var r0 []api.DeviceRemoteInterface + if rf, ok := ret.Get(0).(func() []api.DeviceRemoteInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]api.DeviceRemoteInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_RemoteDevices_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoteDevices' +type DeviceLocalInterface_RemoteDevices_Call struct { + *mock.Call +} + +// RemoteDevices is a helper method to define mock.On call +func (_e *DeviceLocalInterface_Expecter) RemoteDevices() *DeviceLocalInterface_RemoteDevices_Call { + return &DeviceLocalInterface_RemoteDevices_Call{Call: _e.mock.On("RemoteDevices")} +} + +func (_c *DeviceLocalInterface_RemoteDevices_Call) Run(run func()) *DeviceLocalInterface_RemoteDevices_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceLocalInterface_RemoteDevices_Call) Return(_a0 []api.DeviceRemoteInterface) *DeviceLocalInterface_RemoteDevices_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_RemoteDevices_Call) RunAndReturn(run func() []api.DeviceRemoteInterface) *DeviceLocalInterface_RemoteDevices_Call { + _c.Call.Return(run) + return _c +} + +// RemoveEntity provides a mock function with given fields: entity +func (_m *DeviceLocalInterface) RemoveEntity(entity api.EntityLocalInterface) { + _m.Called(entity) +} + +// DeviceLocalInterface_RemoveEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveEntity' +type DeviceLocalInterface_RemoveEntity_Call struct { + *mock.Call +} + +// RemoveEntity is a helper method to define mock.On call +// - entity api.EntityLocalInterface +func (_e *DeviceLocalInterface_Expecter) RemoveEntity(entity interface{}) *DeviceLocalInterface_RemoveEntity_Call { + return &DeviceLocalInterface_RemoveEntity_Call{Call: _e.mock.On("RemoveEntity", entity)} +} + +func (_c *DeviceLocalInterface_RemoveEntity_Call) Run(run func(entity api.EntityLocalInterface)) *DeviceLocalInterface_RemoveEntity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.EntityLocalInterface)) + }) + return _c +} + +func (_c *DeviceLocalInterface_RemoveEntity_Call) Return() *DeviceLocalInterface_RemoveEntity_Call { + _c.Call.Return() + return _c +} + +func (_c *DeviceLocalInterface_RemoveEntity_Call) RunAndReturn(run func(api.EntityLocalInterface)) *DeviceLocalInterface_RemoveEntity_Call { + _c.Call.Return(run) + return _c +} + +// RemoveRemoteDevice provides a mock function with given fields: ski +func (_m *DeviceLocalInterface) RemoveRemoteDevice(ski string) { + _m.Called(ski) +} + +// DeviceLocalInterface_RemoveRemoteDevice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRemoteDevice' +type DeviceLocalInterface_RemoveRemoteDevice_Call struct { + *mock.Call +} + +// RemoveRemoteDevice is a helper method to define mock.On call +// - ski string +func (_e *DeviceLocalInterface_Expecter) RemoveRemoteDevice(ski interface{}) *DeviceLocalInterface_RemoveRemoteDevice_Call { + return &DeviceLocalInterface_RemoveRemoteDevice_Call{Call: _e.mock.On("RemoveRemoteDevice", ski)} +} + +func (_c *DeviceLocalInterface_RemoveRemoteDevice_Call) Run(run func(ski string)) *DeviceLocalInterface_RemoveRemoteDevice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *DeviceLocalInterface_RemoveRemoteDevice_Call) Return() *DeviceLocalInterface_RemoveRemoteDevice_Call { + _c.Call.Return() + return _c +} + +func (_c *DeviceLocalInterface_RemoveRemoteDevice_Call) RunAndReturn(run func(string)) *DeviceLocalInterface_RemoveRemoteDevice_Call { + _c.Call.Return(run) + return _c +} + +// RemoveRemoteDeviceConnection provides a mock function with given fields: ski +func (_m *DeviceLocalInterface) RemoveRemoteDeviceConnection(ski string) { + _m.Called(ski) +} + +// DeviceLocalInterface_RemoveRemoteDeviceConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRemoteDeviceConnection' +type DeviceLocalInterface_RemoveRemoteDeviceConnection_Call struct { + *mock.Call +} + +// RemoveRemoteDeviceConnection is a helper method to define mock.On call +// - ski string +func (_e *DeviceLocalInterface_Expecter) RemoveRemoteDeviceConnection(ski interface{}) *DeviceLocalInterface_RemoveRemoteDeviceConnection_Call { + return &DeviceLocalInterface_RemoveRemoteDeviceConnection_Call{Call: _e.mock.On("RemoveRemoteDeviceConnection", ski)} +} + +func (_c *DeviceLocalInterface_RemoveRemoteDeviceConnection_Call) Run(run func(ski string)) *DeviceLocalInterface_RemoveRemoteDeviceConnection_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *DeviceLocalInterface_RemoveRemoteDeviceConnection_Call) Return() *DeviceLocalInterface_RemoveRemoteDeviceConnection_Call { + _c.Call.Return() + return _c +} + +func (_c *DeviceLocalInterface_RemoveRemoteDeviceConnection_Call) RunAndReturn(run func(string)) *DeviceLocalInterface_RemoveRemoteDeviceConnection_Call { + _c.Call.Return(run) + return _c +} + +// SetupRemoteDevice provides a mock function with given fields: ski, writeI +func (_m *DeviceLocalInterface) SetupRemoteDevice(ski string, writeI ship_goapi.ShipConnectionDataWriterInterface) ship_goapi.ShipConnectionDataReaderInterface { + ret := _m.Called(ski, writeI) + + if len(ret) == 0 { + panic("no return value specified for SetupRemoteDevice") + } + + var r0 ship_goapi.ShipConnectionDataReaderInterface + if rf, ok := ret.Get(0).(func(string, ship_goapi.ShipConnectionDataWriterInterface) ship_goapi.ShipConnectionDataReaderInterface); ok { + r0 = rf(ski, writeI) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(ship_goapi.ShipConnectionDataReaderInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_SetupRemoteDevice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetupRemoteDevice' +type DeviceLocalInterface_SetupRemoteDevice_Call struct { + *mock.Call +} + +// SetupRemoteDevice is a helper method to define mock.On call +// - ski string +// - writeI ship_goapi.ShipConnectionDataWriterInterface +func (_e *DeviceLocalInterface_Expecter) SetupRemoteDevice(ski interface{}, writeI interface{}) *DeviceLocalInterface_SetupRemoteDevice_Call { + return &DeviceLocalInterface_SetupRemoteDevice_Call{Call: _e.mock.On("SetupRemoteDevice", ski, writeI)} +} + +func (_c *DeviceLocalInterface_SetupRemoteDevice_Call) Run(run func(ski string, writeI ship_goapi.ShipConnectionDataWriterInterface)) *DeviceLocalInterface_SetupRemoteDevice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(ship_goapi.ShipConnectionDataWriterInterface)) + }) + return _c +} + +func (_c *DeviceLocalInterface_SetupRemoteDevice_Call) Return(_a0 ship_goapi.ShipConnectionDataReaderInterface) *DeviceLocalInterface_SetupRemoteDevice_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_SetupRemoteDevice_Call) RunAndReturn(run func(string, ship_goapi.ShipConnectionDataWriterInterface) ship_goapi.ShipConnectionDataReaderInterface) *DeviceLocalInterface_SetupRemoteDevice_Call { + _c.Call.Return(run) + return _c +} + +// SubscriptionManager provides a mock function with given fields: +func (_m *DeviceLocalInterface) SubscriptionManager() api.SubscriptionManagerInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for SubscriptionManager") + } + + var r0 api.SubscriptionManagerInterface + if rf, ok := ret.Get(0).(func() api.SubscriptionManagerInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.SubscriptionManagerInterface) + } + } + + return r0 +} + +// DeviceLocalInterface_SubscriptionManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscriptionManager' +type DeviceLocalInterface_SubscriptionManager_Call struct { + *mock.Call +} + +// SubscriptionManager is a helper method to define mock.On call +func (_e *DeviceLocalInterface_Expecter) SubscriptionManager() *DeviceLocalInterface_SubscriptionManager_Call { + return &DeviceLocalInterface_SubscriptionManager_Call{Call: _e.mock.On("SubscriptionManager")} +} + +func (_c *DeviceLocalInterface_SubscriptionManager_Call) Run(run func()) *DeviceLocalInterface_SubscriptionManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceLocalInterface_SubscriptionManager_Call) Return(_a0 api.SubscriptionManagerInterface) *DeviceLocalInterface_SubscriptionManager_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceLocalInterface_SubscriptionManager_Call) RunAndReturn(run func() api.SubscriptionManagerInterface) *DeviceLocalInterface_SubscriptionManager_Call { + _c.Call.Return(run) + return _c +} + +// NewDeviceLocalInterface creates a new instance of DeviceLocalInterface. 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 NewDeviceLocalInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *DeviceLocalInterface { + mock := &DeviceLocalInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/DeviceRemote.go b/mocks/DeviceRemote.go deleted file mode 100644 index 75f66b3..0000000 --- a/mocks/DeviceRemote.go +++ /dev/null @@ -1,930 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" - - model "github.com/enbility/spine-go/model" -) - -// DeviceRemote is an autogenerated mock type for the DeviceRemote type -type DeviceRemote struct { - mock.Mock -} - -type DeviceRemote_Expecter struct { - mock *mock.Mock -} - -func (_m *DeviceRemote) EXPECT() *DeviceRemote_Expecter { - return &DeviceRemote_Expecter{mock: &_m.Mock} -} - -// AddEntity provides a mock function with given fields: entity -func (_m *DeviceRemote) AddEntity(entity api.EntityRemote) api.EntityRemote { - ret := _m.Called(entity) - - if len(ret) == 0 { - panic("no return value specified for AddEntity") - } - - var r0 api.EntityRemote - if rf, ok := ret.Get(0).(func(api.EntityRemote) api.EntityRemote); ok { - r0 = rf(entity) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.EntityRemote) - } - } - - return r0 -} - -// DeviceRemote_AddEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddEntity' -type DeviceRemote_AddEntity_Call struct { - *mock.Call -} - -// AddEntity is a helper method to define mock.On call -// - entity api.EntityRemote -func (_e *DeviceRemote_Expecter) AddEntity(entity interface{}) *DeviceRemote_AddEntity_Call { - return &DeviceRemote_AddEntity_Call{Call: _e.mock.On("AddEntity", entity)} -} - -func (_c *DeviceRemote_AddEntity_Call) Run(run func(entity api.EntityRemote)) *DeviceRemote_AddEntity_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.EntityRemote)) - }) - return _c -} - -func (_c *DeviceRemote_AddEntity_Call) Return(_a0 api.EntityRemote) *DeviceRemote_AddEntity_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_AddEntity_Call) RunAndReturn(run func(api.EntityRemote) api.EntityRemote) *DeviceRemote_AddEntity_Call { - _c.Call.Return(run) - return _c -} - -// AddEntityAndFeatures provides a mock function with given fields: initialData, data -func (_m *DeviceRemote) AddEntityAndFeatures(initialData bool, data *model.NodeManagementDetailedDiscoveryDataType) ([]api.EntityRemote, error) { - ret := _m.Called(initialData, data) - - if len(ret) == 0 { - panic("no return value specified for AddEntityAndFeatures") - } - - var r0 []api.EntityRemote - var r1 error - if rf, ok := ret.Get(0).(func(bool, *model.NodeManagementDetailedDiscoveryDataType) ([]api.EntityRemote, error)); ok { - return rf(initialData, data) - } - if rf, ok := ret.Get(0).(func(bool, *model.NodeManagementDetailedDiscoveryDataType) []api.EntityRemote); ok { - r0 = rf(initialData, data) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]api.EntityRemote) - } - } - - if rf, ok := ret.Get(1).(func(bool, *model.NodeManagementDetailedDiscoveryDataType) error); ok { - r1 = rf(initialData, data) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DeviceRemote_AddEntityAndFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddEntityAndFeatures' -type DeviceRemote_AddEntityAndFeatures_Call struct { - *mock.Call -} - -// AddEntityAndFeatures is a helper method to define mock.On call -// - initialData bool -// - data *model.NodeManagementDetailedDiscoveryDataType -func (_e *DeviceRemote_Expecter) AddEntityAndFeatures(initialData interface{}, data interface{}) *DeviceRemote_AddEntityAndFeatures_Call { - return &DeviceRemote_AddEntityAndFeatures_Call{Call: _e.mock.On("AddEntityAndFeatures", initialData, data)} -} - -func (_c *DeviceRemote_AddEntityAndFeatures_Call) Run(run func(initialData bool, data *model.NodeManagementDetailedDiscoveryDataType)) *DeviceRemote_AddEntityAndFeatures_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(bool), args[1].(*model.NodeManagementDetailedDiscoveryDataType)) - }) - return _c -} - -func (_c *DeviceRemote_AddEntityAndFeatures_Call) Return(_a0 []api.EntityRemote, _a1 error) *DeviceRemote_AddEntityAndFeatures_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *DeviceRemote_AddEntityAndFeatures_Call) RunAndReturn(run func(bool, *model.NodeManagementDetailedDiscoveryDataType) ([]api.EntityRemote, error)) *DeviceRemote_AddEntityAndFeatures_Call { - _c.Call.Return(run) - return _c -} - -// Address provides a mock function with given fields: -func (_m *DeviceRemote) Address() *model.AddressDeviceType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Address") - } - - var r0 *model.AddressDeviceType - if rf, ok := ret.Get(0).(func() *model.AddressDeviceType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.AddressDeviceType) - } - } - - return r0 -} - -// DeviceRemote_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' -type DeviceRemote_Address_Call struct { - *mock.Call -} - -// Address is a helper method to define mock.On call -func (_e *DeviceRemote_Expecter) Address() *DeviceRemote_Address_Call { - return &DeviceRemote_Address_Call{Call: _e.mock.On("Address")} -} - -func (_c *DeviceRemote_Address_Call) Run(run func()) *DeviceRemote_Address_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceRemote_Address_Call) Return(_a0 *model.AddressDeviceType) *DeviceRemote_Address_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_Address_Call) RunAndReturn(run func() *model.AddressDeviceType) *DeviceRemote_Address_Call { - _c.Call.Return(run) - return _c -} - -// CheckEntityInformation provides a mock function with given fields: initialData, entity -func (_m *DeviceRemote) CheckEntityInformation(initialData bool, entity model.NodeManagementDetailedDiscoveryEntityInformationType) error { - ret := _m.Called(initialData, entity) - - if len(ret) == 0 { - panic("no return value specified for CheckEntityInformation") - } - - var r0 error - if rf, ok := ret.Get(0).(func(bool, model.NodeManagementDetailedDiscoveryEntityInformationType) error); ok { - r0 = rf(initialData, entity) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// DeviceRemote_CheckEntityInformation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckEntityInformation' -type DeviceRemote_CheckEntityInformation_Call struct { - *mock.Call -} - -// CheckEntityInformation is a helper method to define mock.On call -// - initialData bool -// - entity model.NodeManagementDetailedDiscoveryEntityInformationType -func (_e *DeviceRemote_Expecter) CheckEntityInformation(initialData interface{}, entity interface{}) *DeviceRemote_CheckEntityInformation_Call { - return &DeviceRemote_CheckEntityInformation_Call{Call: _e.mock.On("CheckEntityInformation", initialData, entity)} -} - -func (_c *DeviceRemote_CheckEntityInformation_Call) Run(run func(initialData bool, entity model.NodeManagementDetailedDiscoveryEntityInformationType)) *DeviceRemote_CheckEntityInformation_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(bool), args[1].(model.NodeManagementDetailedDiscoveryEntityInformationType)) - }) - return _c -} - -func (_c *DeviceRemote_CheckEntityInformation_Call) Return(_a0 error) *DeviceRemote_CheckEntityInformation_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_CheckEntityInformation_Call) RunAndReturn(run func(bool, model.NodeManagementDetailedDiscoveryEntityInformationType) error) *DeviceRemote_CheckEntityInformation_Call { - _c.Call.Return(run) - return _c -} - -// DestinationData provides a mock function with given fields: -func (_m *DeviceRemote) DestinationData() model.NodeManagementDestinationDataType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for DestinationData") - } - - var r0 model.NodeManagementDestinationDataType - if rf, ok := ret.Get(0).(func() model.NodeManagementDestinationDataType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.NodeManagementDestinationDataType) - } - - return r0 -} - -// DeviceRemote_DestinationData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestinationData' -type DeviceRemote_DestinationData_Call struct { - *mock.Call -} - -// DestinationData is a helper method to define mock.On call -func (_e *DeviceRemote_Expecter) DestinationData() *DeviceRemote_DestinationData_Call { - return &DeviceRemote_DestinationData_Call{Call: _e.mock.On("DestinationData")} -} - -func (_c *DeviceRemote_DestinationData_Call) Run(run func()) *DeviceRemote_DestinationData_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceRemote_DestinationData_Call) Return(_a0 model.NodeManagementDestinationDataType) *DeviceRemote_DestinationData_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_DestinationData_Call) RunAndReturn(run func() model.NodeManagementDestinationDataType) *DeviceRemote_DestinationData_Call { - _c.Call.Return(run) - return _c -} - -// DeviceType provides a mock function with given fields: -func (_m *DeviceRemote) DeviceType() *model.DeviceTypeType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for DeviceType") - } - - var r0 *model.DeviceTypeType - if rf, ok := ret.Get(0).(func() *model.DeviceTypeType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.DeviceTypeType) - } - } - - return r0 -} - -// DeviceRemote_DeviceType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeviceType' -type DeviceRemote_DeviceType_Call struct { - *mock.Call -} - -// DeviceType is a helper method to define mock.On call -func (_e *DeviceRemote_Expecter) DeviceType() *DeviceRemote_DeviceType_Call { - return &DeviceRemote_DeviceType_Call{Call: _e.mock.On("DeviceType")} -} - -func (_c *DeviceRemote_DeviceType_Call) Run(run func()) *DeviceRemote_DeviceType_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceRemote_DeviceType_Call) Return(_a0 *model.DeviceTypeType) *DeviceRemote_DeviceType_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_DeviceType_Call) RunAndReturn(run func() *model.DeviceTypeType) *DeviceRemote_DeviceType_Call { - _c.Call.Return(run) - return _c -} - -// Entities provides a mock function with given fields: -func (_m *DeviceRemote) Entities() []api.EntityRemote { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Entities") - } - - var r0 []api.EntityRemote - if rf, ok := ret.Get(0).(func() []api.EntityRemote); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]api.EntityRemote) - } - } - - return r0 -} - -// DeviceRemote_Entities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entities' -type DeviceRemote_Entities_Call struct { - *mock.Call -} - -// Entities is a helper method to define mock.On call -func (_e *DeviceRemote_Expecter) Entities() *DeviceRemote_Entities_Call { - return &DeviceRemote_Entities_Call{Call: _e.mock.On("Entities")} -} - -func (_c *DeviceRemote_Entities_Call) Run(run func()) *DeviceRemote_Entities_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceRemote_Entities_Call) Return(_a0 []api.EntityRemote) *DeviceRemote_Entities_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_Entities_Call) RunAndReturn(run func() []api.EntityRemote) *DeviceRemote_Entities_Call { - _c.Call.Return(run) - return _c -} - -// Entity provides a mock function with given fields: id -func (_m *DeviceRemote) Entity(id []model.AddressEntityType) api.EntityRemote { - ret := _m.Called(id) - - if len(ret) == 0 { - panic("no return value specified for Entity") - } - - var r0 api.EntityRemote - if rf, ok := ret.Get(0).(func([]model.AddressEntityType) api.EntityRemote); ok { - r0 = rf(id) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.EntityRemote) - } - } - - return r0 -} - -// DeviceRemote_Entity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entity' -type DeviceRemote_Entity_Call struct { - *mock.Call -} - -// Entity is a helper method to define mock.On call -// - id []model.AddressEntityType -func (_e *DeviceRemote_Expecter) Entity(id interface{}) *DeviceRemote_Entity_Call { - return &DeviceRemote_Entity_Call{Call: _e.mock.On("Entity", id)} -} - -func (_c *DeviceRemote_Entity_Call) Run(run func(id []model.AddressEntityType)) *DeviceRemote_Entity_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]model.AddressEntityType)) - }) - return _c -} - -func (_c *DeviceRemote_Entity_Call) Return(_a0 api.EntityRemote) *DeviceRemote_Entity_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_Entity_Call) RunAndReturn(run func([]model.AddressEntityType) api.EntityRemote) *DeviceRemote_Entity_Call { - _c.Call.Return(run) - return _c -} - -// FeatureByAddress provides a mock function with given fields: address -func (_m *DeviceRemote) FeatureByAddress(address *model.FeatureAddressType) api.FeatureRemote { - ret := _m.Called(address) - - if len(ret) == 0 { - panic("no return value specified for FeatureByAddress") - } - - var r0 api.FeatureRemote - if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) api.FeatureRemote); ok { - r0 = rf(address) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.FeatureRemote) - } - } - - return r0 -} - -// DeviceRemote_FeatureByAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureByAddress' -type DeviceRemote_FeatureByAddress_Call struct { - *mock.Call -} - -// FeatureByAddress is a helper method to define mock.On call -// - address *model.FeatureAddressType -func (_e *DeviceRemote_Expecter) FeatureByAddress(address interface{}) *DeviceRemote_FeatureByAddress_Call { - return &DeviceRemote_FeatureByAddress_Call{Call: _e.mock.On("FeatureByAddress", address)} -} - -func (_c *DeviceRemote_FeatureByAddress_Call) Run(run func(address *model.FeatureAddressType)) *DeviceRemote_FeatureByAddress_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.FeatureAddressType)) - }) - return _c -} - -func (_c *DeviceRemote_FeatureByAddress_Call) Return(_a0 api.FeatureRemote) *DeviceRemote_FeatureByAddress_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_FeatureByAddress_Call) RunAndReturn(run func(*model.FeatureAddressType) api.FeatureRemote) *DeviceRemote_FeatureByAddress_Call { - _c.Call.Return(run) - return _c -} - -// FeatureByEntityTypeAndRole provides a mock function with given fields: entity, featureType, role -func (_m *DeviceRemote) FeatureByEntityTypeAndRole(entity api.EntityRemote, featureType model.FeatureTypeType, role model.RoleType) api.FeatureRemote { - ret := _m.Called(entity, featureType, role) - - if len(ret) == 0 { - panic("no return value specified for FeatureByEntityTypeAndRole") - } - - var r0 api.FeatureRemote - if rf, ok := ret.Get(0).(func(api.EntityRemote, model.FeatureTypeType, model.RoleType) api.FeatureRemote); ok { - r0 = rf(entity, featureType, role) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.FeatureRemote) - } - } - - return r0 -} - -// DeviceRemote_FeatureByEntityTypeAndRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureByEntityTypeAndRole' -type DeviceRemote_FeatureByEntityTypeAndRole_Call struct { - *mock.Call -} - -// FeatureByEntityTypeAndRole is a helper method to define mock.On call -// - entity api.EntityRemote -// - featureType model.FeatureTypeType -// - role model.RoleType -func (_e *DeviceRemote_Expecter) FeatureByEntityTypeAndRole(entity interface{}, featureType interface{}, role interface{}) *DeviceRemote_FeatureByEntityTypeAndRole_Call { - return &DeviceRemote_FeatureByEntityTypeAndRole_Call{Call: _e.mock.On("FeatureByEntityTypeAndRole", entity, featureType, role)} -} - -func (_c *DeviceRemote_FeatureByEntityTypeAndRole_Call) Run(run func(entity api.EntityRemote, featureType model.FeatureTypeType, role model.RoleType)) *DeviceRemote_FeatureByEntityTypeAndRole_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.EntityRemote), args[1].(model.FeatureTypeType), args[2].(model.RoleType)) - }) - return _c -} - -func (_c *DeviceRemote_FeatureByEntityTypeAndRole_Call) Return(_a0 api.FeatureRemote) *DeviceRemote_FeatureByEntityTypeAndRole_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_FeatureByEntityTypeAndRole_Call) RunAndReturn(run func(api.EntityRemote, model.FeatureTypeType, model.RoleType) api.FeatureRemote) *DeviceRemote_FeatureByEntityTypeAndRole_Call { - _c.Call.Return(run) - return _c -} - -// FeatureSet provides a mock function with given fields: -func (_m *DeviceRemote) FeatureSet() *model.NetworkManagementFeatureSetType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for FeatureSet") - } - - var r0 *model.NetworkManagementFeatureSetType - if rf, ok := ret.Get(0).(func() *model.NetworkManagementFeatureSetType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.NetworkManagementFeatureSetType) - } - } - - return r0 -} - -// DeviceRemote_FeatureSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureSet' -type DeviceRemote_FeatureSet_Call struct { - *mock.Call -} - -// FeatureSet is a helper method to define mock.On call -func (_e *DeviceRemote_Expecter) FeatureSet() *DeviceRemote_FeatureSet_Call { - return &DeviceRemote_FeatureSet_Call{Call: _e.mock.On("FeatureSet")} -} - -func (_c *DeviceRemote_FeatureSet_Call) Run(run func()) *DeviceRemote_FeatureSet_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceRemote_FeatureSet_Call) Return(_a0 *model.NetworkManagementFeatureSetType) *DeviceRemote_FeatureSet_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_FeatureSet_Call) RunAndReturn(run func() *model.NetworkManagementFeatureSetType) *DeviceRemote_FeatureSet_Call { - _c.Call.Return(run) - return _c -} - -// HandleSpineMesssage provides a mock function with given fields: message -func (_m *DeviceRemote) HandleSpineMesssage(message []byte) (*model.MsgCounterType, error) { - ret := _m.Called(message) - - if len(ret) == 0 { - panic("no return value specified for HandleSpineMesssage") - } - - var r0 *model.MsgCounterType - var r1 error - if rf, ok := ret.Get(0).(func([]byte) (*model.MsgCounterType, error)); ok { - return rf(message) - } - if rf, ok := ret.Get(0).(func([]byte) *model.MsgCounterType); ok { - r0 = rf(message) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func([]byte) error); ok { - r1 = rf(message) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DeviceRemote_HandleSpineMesssage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleSpineMesssage' -type DeviceRemote_HandleSpineMesssage_Call struct { - *mock.Call -} - -// HandleSpineMesssage is a helper method to define mock.On call -// - message []byte -func (_e *DeviceRemote_Expecter) HandleSpineMesssage(message interface{}) *DeviceRemote_HandleSpineMesssage_Call { - return &DeviceRemote_HandleSpineMesssage_Call{Call: _e.mock.On("HandleSpineMesssage", message)} -} - -func (_c *DeviceRemote_HandleSpineMesssage_Call) Run(run func(message []byte)) *DeviceRemote_HandleSpineMesssage_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]byte)) - }) - return _c -} - -func (_c *DeviceRemote_HandleSpineMesssage_Call) Return(_a0 *model.MsgCounterType, _a1 error) *DeviceRemote_HandleSpineMesssage_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *DeviceRemote_HandleSpineMesssage_Call) RunAndReturn(run func([]byte) (*model.MsgCounterType, error)) *DeviceRemote_HandleSpineMesssage_Call { - _c.Call.Return(run) - return _c -} - -// RemoveByAddress provides a mock function with given fields: addr -func (_m *DeviceRemote) RemoveByAddress(addr []model.AddressEntityType) api.EntityRemote { - ret := _m.Called(addr) - - if len(ret) == 0 { - panic("no return value specified for RemoveByAddress") - } - - var r0 api.EntityRemote - if rf, ok := ret.Get(0).(func([]model.AddressEntityType) api.EntityRemote); ok { - r0 = rf(addr) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.EntityRemote) - } - } - - return r0 -} - -// DeviceRemote_RemoveByAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveByAddress' -type DeviceRemote_RemoveByAddress_Call struct { - *mock.Call -} - -// RemoveByAddress is a helper method to define mock.On call -// - addr []model.AddressEntityType -func (_e *DeviceRemote_Expecter) RemoveByAddress(addr interface{}) *DeviceRemote_RemoveByAddress_Call { - return &DeviceRemote_RemoveByAddress_Call{Call: _e.mock.On("RemoveByAddress", addr)} -} - -func (_c *DeviceRemote_RemoveByAddress_Call) Run(run func(addr []model.AddressEntityType)) *DeviceRemote_RemoveByAddress_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]model.AddressEntityType)) - }) - return _c -} - -func (_c *DeviceRemote_RemoveByAddress_Call) Return(_a0 api.EntityRemote) *DeviceRemote_RemoveByAddress_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_RemoveByAddress_Call) RunAndReturn(run func([]model.AddressEntityType) api.EntityRemote) *DeviceRemote_RemoveByAddress_Call { - _c.Call.Return(run) - return _c -} - -// Sender provides a mock function with given fields: -func (_m *DeviceRemote) Sender() api.Sender { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Sender") - } - - var r0 api.Sender - if rf, ok := ret.Get(0).(func() api.Sender); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.Sender) - } - } - - return r0 -} - -// DeviceRemote_Sender_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sender' -type DeviceRemote_Sender_Call struct { - *mock.Call -} - -// Sender is a helper method to define mock.On call -func (_e *DeviceRemote_Expecter) Sender() *DeviceRemote_Sender_Call { - return &DeviceRemote_Sender_Call{Call: _e.mock.On("Sender")} -} - -func (_c *DeviceRemote_Sender_Call) Run(run func()) *DeviceRemote_Sender_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceRemote_Sender_Call) Return(_a0 api.Sender) *DeviceRemote_Sender_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_Sender_Call) RunAndReturn(run func() api.Sender) *DeviceRemote_Sender_Call { - _c.Call.Return(run) - return _c -} - -// SetAddress provides a mock function with given fields: address -func (_m *DeviceRemote) SetAddress(address *model.AddressDeviceType) { - _m.Called(address) -} - -// DeviceRemote_SetAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAddress' -type DeviceRemote_SetAddress_Call struct { - *mock.Call -} - -// SetAddress is a helper method to define mock.On call -// - address *model.AddressDeviceType -func (_e *DeviceRemote_Expecter) SetAddress(address interface{}) *DeviceRemote_SetAddress_Call { - return &DeviceRemote_SetAddress_Call{Call: _e.mock.On("SetAddress", address)} -} - -func (_c *DeviceRemote_SetAddress_Call) Run(run func(address *model.AddressDeviceType)) *DeviceRemote_SetAddress_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.AddressDeviceType)) - }) - return _c -} - -func (_c *DeviceRemote_SetAddress_Call) Return() *DeviceRemote_SetAddress_Call { - _c.Call.Return() - return _c -} - -func (_c *DeviceRemote_SetAddress_Call) RunAndReturn(run func(*model.AddressDeviceType)) *DeviceRemote_SetAddress_Call { - _c.Call.Return(run) - return _c -} - -// Ski provides a mock function with given fields: -func (_m *DeviceRemote) Ski() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Ski") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// DeviceRemote_Ski_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ski' -type DeviceRemote_Ski_Call struct { - *mock.Call -} - -// Ski is a helper method to define mock.On call -func (_e *DeviceRemote_Expecter) Ski() *DeviceRemote_Ski_Call { - return &DeviceRemote_Ski_Call{Call: _e.mock.On("Ski")} -} - -func (_c *DeviceRemote_Ski_Call) Run(run func()) *DeviceRemote_Ski_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceRemote_Ski_Call) Return(_a0 string) *DeviceRemote_Ski_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_Ski_Call) RunAndReturn(run func() string) *DeviceRemote_Ski_Call { - _c.Call.Return(run) - return _c -} - -// UpdateDevice provides a mock function with given fields: description -func (_m *DeviceRemote) UpdateDevice(description *model.NetworkManagementDeviceDescriptionDataType) { - _m.Called(description) -} - -// DeviceRemote_UpdateDevice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDevice' -type DeviceRemote_UpdateDevice_Call struct { - *mock.Call -} - -// UpdateDevice is a helper method to define mock.On call -// - description *model.NetworkManagementDeviceDescriptionDataType -func (_e *DeviceRemote_Expecter) UpdateDevice(description interface{}) *DeviceRemote_UpdateDevice_Call { - return &DeviceRemote_UpdateDevice_Call{Call: _e.mock.On("UpdateDevice", description)} -} - -func (_c *DeviceRemote_UpdateDevice_Call) Run(run func(description *model.NetworkManagementDeviceDescriptionDataType)) *DeviceRemote_UpdateDevice_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.NetworkManagementDeviceDescriptionDataType)) - }) - return _c -} - -func (_c *DeviceRemote_UpdateDevice_Call) Return() *DeviceRemote_UpdateDevice_Call { - _c.Call.Return() - return _c -} - -func (_c *DeviceRemote_UpdateDevice_Call) RunAndReturn(run func(*model.NetworkManagementDeviceDescriptionDataType)) *DeviceRemote_UpdateDevice_Call { - _c.Call.Return(run) - return _c -} - -// UseCases provides a mock function with given fields: -func (_m *DeviceRemote) UseCases() []model.UseCaseInformationDataType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for UseCases") - } - - var r0 []model.UseCaseInformationDataType - if rf, ok := ret.Get(0).(func() []model.UseCaseInformationDataType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]model.UseCaseInformationDataType) - } - } - - return r0 -} - -// DeviceRemote_UseCases_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UseCases' -type DeviceRemote_UseCases_Call struct { - *mock.Call -} - -// UseCases is a helper method to define mock.On call -func (_e *DeviceRemote_Expecter) UseCases() *DeviceRemote_UseCases_Call { - return &DeviceRemote_UseCases_Call{Call: _e.mock.On("UseCases")} -} - -func (_c *DeviceRemote_UseCases_Call) Run(run func()) *DeviceRemote_UseCases_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *DeviceRemote_UseCases_Call) Return(_a0 []model.UseCaseInformationDataType) *DeviceRemote_UseCases_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_UseCases_Call) RunAndReturn(run func() []model.UseCaseInformationDataType) *DeviceRemote_UseCases_Call { - _c.Call.Return(run) - return _c -} - -// VerifyUseCaseScenariosAndFeaturesSupport provides a mock function with given fields: usecaseActor, usecaseName, scenarios, serverFeatures -func (_m *DeviceRemote) VerifyUseCaseScenariosAndFeaturesSupport(usecaseActor model.UseCaseActorType, usecaseName model.UseCaseNameType, scenarios []model.UseCaseScenarioSupportType, serverFeatures []model.FeatureTypeType) bool { - ret := _m.Called(usecaseActor, usecaseName, scenarios, serverFeatures) - - if len(ret) == 0 { - panic("no return value specified for VerifyUseCaseScenariosAndFeaturesSupport") - } - - var r0 bool - if rf, ok := ret.Get(0).(func(model.UseCaseActorType, model.UseCaseNameType, []model.UseCaseScenarioSupportType, []model.FeatureTypeType) bool); ok { - r0 = rf(usecaseActor, usecaseName, scenarios, serverFeatures) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// DeviceRemote_VerifyUseCaseScenariosAndFeaturesSupport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyUseCaseScenariosAndFeaturesSupport' -type DeviceRemote_VerifyUseCaseScenariosAndFeaturesSupport_Call struct { - *mock.Call -} - -// VerifyUseCaseScenariosAndFeaturesSupport is a helper method to define mock.On call -// - usecaseActor model.UseCaseActorType -// - usecaseName model.UseCaseNameType -// - scenarios []model.UseCaseScenarioSupportType -// - serverFeatures []model.FeatureTypeType -func (_e *DeviceRemote_Expecter) VerifyUseCaseScenariosAndFeaturesSupport(usecaseActor interface{}, usecaseName interface{}, scenarios interface{}, serverFeatures interface{}) *DeviceRemote_VerifyUseCaseScenariosAndFeaturesSupport_Call { - return &DeviceRemote_VerifyUseCaseScenariosAndFeaturesSupport_Call{Call: _e.mock.On("VerifyUseCaseScenariosAndFeaturesSupport", usecaseActor, usecaseName, scenarios, serverFeatures)} -} - -func (_c *DeviceRemote_VerifyUseCaseScenariosAndFeaturesSupport_Call) Run(run func(usecaseActor model.UseCaseActorType, usecaseName model.UseCaseNameType, scenarios []model.UseCaseScenarioSupportType, serverFeatures []model.FeatureTypeType)) *DeviceRemote_VerifyUseCaseScenariosAndFeaturesSupport_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.UseCaseActorType), args[1].(model.UseCaseNameType), args[2].([]model.UseCaseScenarioSupportType), args[3].([]model.FeatureTypeType)) - }) - return _c -} - -func (_c *DeviceRemote_VerifyUseCaseScenariosAndFeaturesSupport_Call) Return(_a0 bool) *DeviceRemote_VerifyUseCaseScenariosAndFeaturesSupport_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *DeviceRemote_VerifyUseCaseScenariosAndFeaturesSupport_Call) RunAndReturn(run func(model.UseCaseActorType, model.UseCaseNameType, []model.UseCaseScenarioSupportType, []model.FeatureTypeType) bool) *DeviceRemote_VerifyUseCaseScenariosAndFeaturesSupport_Call { - _c.Call.Return(run) - return _c -} - -// NewDeviceRemote creates a new instance of DeviceRemote. 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 NewDeviceRemote(t interface { - mock.TestingT - Cleanup(func()) -}) *DeviceRemote { - mock := &DeviceRemote{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/DeviceRemoteInterface.go b/mocks/DeviceRemoteInterface.go new file mode 100644 index 0000000..2ff66f5 --- /dev/null +++ b/mocks/DeviceRemoteInterface.go @@ -0,0 +1,930 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" + + model "github.com/enbility/spine-go/model" +) + +// DeviceRemoteInterface is an autogenerated mock type for the DeviceRemoteInterface type +type DeviceRemoteInterface struct { + mock.Mock +} + +type DeviceRemoteInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *DeviceRemoteInterface) EXPECT() *DeviceRemoteInterface_Expecter { + return &DeviceRemoteInterface_Expecter{mock: &_m.Mock} +} + +// AddEntity provides a mock function with given fields: entity +func (_m *DeviceRemoteInterface) AddEntity(entity api.EntityRemoteInterface) api.EntityRemoteInterface { + ret := _m.Called(entity) + + if len(ret) == 0 { + panic("no return value specified for AddEntity") + } + + var r0 api.EntityRemoteInterface + if rf, ok := ret.Get(0).(func(api.EntityRemoteInterface) api.EntityRemoteInterface); ok { + r0 = rf(entity) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.EntityRemoteInterface) + } + } + + return r0 +} + +// DeviceRemoteInterface_AddEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddEntity' +type DeviceRemoteInterface_AddEntity_Call struct { + *mock.Call +} + +// AddEntity is a helper method to define mock.On call +// - entity api.EntityRemoteInterface +func (_e *DeviceRemoteInterface_Expecter) AddEntity(entity interface{}) *DeviceRemoteInterface_AddEntity_Call { + return &DeviceRemoteInterface_AddEntity_Call{Call: _e.mock.On("AddEntity", entity)} +} + +func (_c *DeviceRemoteInterface_AddEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *DeviceRemoteInterface_AddEntity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.EntityRemoteInterface)) + }) + return _c +} + +func (_c *DeviceRemoteInterface_AddEntity_Call) Return(_a0 api.EntityRemoteInterface) *DeviceRemoteInterface_AddEntity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_AddEntity_Call) RunAndReturn(run func(api.EntityRemoteInterface) api.EntityRemoteInterface) *DeviceRemoteInterface_AddEntity_Call { + _c.Call.Return(run) + return _c +} + +// AddEntityAndFeatures provides a mock function with given fields: initialData, data +func (_m *DeviceRemoteInterface) AddEntityAndFeatures(initialData bool, data *model.NodeManagementDetailedDiscoveryDataType) ([]api.EntityRemoteInterface, error) { + ret := _m.Called(initialData, data) + + if len(ret) == 0 { + panic("no return value specified for AddEntityAndFeatures") + } + + var r0 []api.EntityRemoteInterface + var r1 error + if rf, ok := ret.Get(0).(func(bool, *model.NodeManagementDetailedDiscoveryDataType) ([]api.EntityRemoteInterface, error)); ok { + return rf(initialData, data) + } + if rf, ok := ret.Get(0).(func(bool, *model.NodeManagementDetailedDiscoveryDataType) []api.EntityRemoteInterface); ok { + r0 = rf(initialData, data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]api.EntityRemoteInterface) + } + } + + if rf, ok := ret.Get(1).(func(bool, *model.NodeManagementDetailedDiscoveryDataType) error); ok { + r1 = rf(initialData, data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DeviceRemoteInterface_AddEntityAndFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddEntityAndFeatures' +type DeviceRemoteInterface_AddEntityAndFeatures_Call struct { + *mock.Call +} + +// AddEntityAndFeatures is a helper method to define mock.On call +// - initialData bool +// - data *model.NodeManagementDetailedDiscoveryDataType +func (_e *DeviceRemoteInterface_Expecter) AddEntityAndFeatures(initialData interface{}, data interface{}) *DeviceRemoteInterface_AddEntityAndFeatures_Call { + return &DeviceRemoteInterface_AddEntityAndFeatures_Call{Call: _e.mock.On("AddEntityAndFeatures", initialData, data)} +} + +func (_c *DeviceRemoteInterface_AddEntityAndFeatures_Call) Run(run func(initialData bool, data *model.NodeManagementDetailedDiscoveryDataType)) *DeviceRemoteInterface_AddEntityAndFeatures_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(bool), args[1].(*model.NodeManagementDetailedDiscoveryDataType)) + }) + return _c +} + +func (_c *DeviceRemoteInterface_AddEntityAndFeatures_Call) Return(_a0 []api.EntityRemoteInterface, _a1 error) *DeviceRemoteInterface_AddEntityAndFeatures_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *DeviceRemoteInterface_AddEntityAndFeatures_Call) RunAndReturn(run func(bool, *model.NodeManagementDetailedDiscoveryDataType) ([]api.EntityRemoteInterface, error)) *DeviceRemoteInterface_AddEntityAndFeatures_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *DeviceRemoteInterface) Address() *model.AddressDeviceType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 *model.AddressDeviceType + if rf, ok := ret.Get(0).(func() *model.AddressDeviceType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.AddressDeviceType) + } + } + + return r0 +} + +// DeviceRemoteInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type DeviceRemoteInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *DeviceRemoteInterface_Expecter) Address() *DeviceRemoteInterface_Address_Call { + return &DeviceRemoteInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *DeviceRemoteInterface_Address_Call) Run(run func()) *DeviceRemoteInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceRemoteInterface_Address_Call) Return(_a0 *model.AddressDeviceType) *DeviceRemoteInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_Address_Call) RunAndReturn(run func() *model.AddressDeviceType) *DeviceRemoteInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// CheckEntityInformation provides a mock function with given fields: initialData, entity +func (_m *DeviceRemoteInterface) CheckEntityInformation(initialData bool, entity model.NodeManagementDetailedDiscoveryEntityInformationType) error { + ret := _m.Called(initialData, entity) + + if len(ret) == 0 { + panic("no return value specified for CheckEntityInformation") + } + + var r0 error + if rf, ok := ret.Get(0).(func(bool, model.NodeManagementDetailedDiscoveryEntityInformationType) error); ok { + r0 = rf(initialData, entity) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// DeviceRemoteInterface_CheckEntityInformation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckEntityInformation' +type DeviceRemoteInterface_CheckEntityInformation_Call struct { + *mock.Call +} + +// CheckEntityInformation is a helper method to define mock.On call +// - initialData bool +// - entity model.NodeManagementDetailedDiscoveryEntityInformationType +func (_e *DeviceRemoteInterface_Expecter) CheckEntityInformation(initialData interface{}, entity interface{}) *DeviceRemoteInterface_CheckEntityInformation_Call { + return &DeviceRemoteInterface_CheckEntityInformation_Call{Call: _e.mock.On("CheckEntityInformation", initialData, entity)} +} + +func (_c *DeviceRemoteInterface_CheckEntityInformation_Call) Run(run func(initialData bool, entity model.NodeManagementDetailedDiscoveryEntityInformationType)) *DeviceRemoteInterface_CheckEntityInformation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(bool), args[1].(model.NodeManagementDetailedDiscoveryEntityInformationType)) + }) + return _c +} + +func (_c *DeviceRemoteInterface_CheckEntityInformation_Call) Return(_a0 error) *DeviceRemoteInterface_CheckEntityInformation_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_CheckEntityInformation_Call) RunAndReturn(run func(bool, model.NodeManagementDetailedDiscoveryEntityInformationType) error) *DeviceRemoteInterface_CheckEntityInformation_Call { + _c.Call.Return(run) + return _c +} + +// DestinationData provides a mock function with given fields: +func (_m *DeviceRemoteInterface) DestinationData() model.NodeManagementDestinationDataType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DestinationData") + } + + var r0 model.NodeManagementDestinationDataType + if rf, ok := ret.Get(0).(func() model.NodeManagementDestinationDataType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.NodeManagementDestinationDataType) + } + + return r0 +} + +// DeviceRemoteInterface_DestinationData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestinationData' +type DeviceRemoteInterface_DestinationData_Call struct { + *mock.Call +} + +// DestinationData is a helper method to define mock.On call +func (_e *DeviceRemoteInterface_Expecter) DestinationData() *DeviceRemoteInterface_DestinationData_Call { + return &DeviceRemoteInterface_DestinationData_Call{Call: _e.mock.On("DestinationData")} +} + +func (_c *DeviceRemoteInterface_DestinationData_Call) Run(run func()) *DeviceRemoteInterface_DestinationData_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceRemoteInterface_DestinationData_Call) Return(_a0 model.NodeManagementDestinationDataType) *DeviceRemoteInterface_DestinationData_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_DestinationData_Call) RunAndReturn(run func() model.NodeManagementDestinationDataType) *DeviceRemoteInterface_DestinationData_Call { + _c.Call.Return(run) + return _c +} + +// DeviceType provides a mock function with given fields: +func (_m *DeviceRemoteInterface) DeviceType() *model.DeviceTypeType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DeviceType") + } + + var r0 *model.DeviceTypeType + if rf, ok := ret.Get(0).(func() *model.DeviceTypeType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.DeviceTypeType) + } + } + + return r0 +} + +// DeviceRemoteInterface_DeviceType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeviceType' +type DeviceRemoteInterface_DeviceType_Call struct { + *mock.Call +} + +// DeviceType is a helper method to define mock.On call +func (_e *DeviceRemoteInterface_Expecter) DeviceType() *DeviceRemoteInterface_DeviceType_Call { + return &DeviceRemoteInterface_DeviceType_Call{Call: _e.mock.On("DeviceType")} +} + +func (_c *DeviceRemoteInterface_DeviceType_Call) Run(run func()) *DeviceRemoteInterface_DeviceType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceRemoteInterface_DeviceType_Call) Return(_a0 *model.DeviceTypeType) *DeviceRemoteInterface_DeviceType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_DeviceType_Call) RunAndReturn(run func() *model.DeviceTypeType) *DeviceRemoteInterface_DeviceType_Call { + _c.Call.Return(run) + return _c +} + +// Entities provides a mock function with given fields: +func (_m *DeviceRemoteInterface) Entities() []api.EntityRemoteInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Entities") + } + + var r0 []api.EntityRemoteInterface + if rf, ok := ret.Get(0).(func() []api.EntityRemoteInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]api.EntityRemoteInterface) + } + } + + return r0 +} + +// DeviceRemoteInterface_Entities_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entities' +type DeviceRemoteInterface_Entities_Call struct { + *mock.Call +} + +// Entities is a helper method to define mock.On call +func (_e *DeviceRemoteInterface_Expecter) Entities() *DeviceRemoteInterface_Entities_Call { + return &DeviceRemoteInterface_Entities_Call{Call: _e.mock.On("Entities")} +} + +func (_c *DeviceRemoteInterface_Entities_Call) Run(run func()) *DeviceRemoteInterface_Entities_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceRemoteInterface_Entities_Call) Return(_a0 []api.EntityRemoteInterface) *DeviceRemoteInterface_Entities_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_Entities_Call) RunAndReturn(run func() []api.EntityRemoteInterface) *DeviceRemoteInterface_Entities_Call { + _c.Call.Return(run) + return _c +} + +// Entity provides a mock function with given fields: id +func (_m *DeviceRemoteInterface) Entity(id []model.AddressEntityType) api.EntityRemoteInterface { + ret := _m.Called(id) + + if len(ret) == 0 { + panic("no return value specified for Entity") + } + + var r0 api.EntityRemoteInterface + if rf, ok := ret.Get(0).(func([]model.AddressEntityType) api.EntityRemoteInterface); ok { + r0 = rf(id) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.EntityRemoteInterface) + } + } + + return r0 +} + +// DeviceRemoteInterface_Entity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entity' +type DeviceRemoteInterface_Entity_Call struct { + *mock.Call +} + +// Entity is a helper method to define mock.On call +// - id []model.AddressEntityType +func (_e *DeviceRemoteInterface_Expecter) Entity(id interface{}) *DeviceRemoteInterface_Entity_Call { + return &DeviceRemoteInterface_Entity_Call{Call: _e.mock.On("Entity", id)} +} + +func (_c *DeviceRemoteInterface_Entity_Call) Run(run func(id []model.AddressEntityType)) *DeviceRemoteInterface_Entity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]model.AddressEntityType)) + }) + return _c +} + +func (_c *DeviceRemoteInterface_Entity_Call) Return(_a0 api.EntityRemoteInterface) *DeviceRemoteInterface_Entity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_Entity_Call) RunAndReturn(run func([]model.AddressEntityType) api.EntityRemoteInterface) *DeviceRemoteInterface_Entity_Call { + _c.Call.Return(run) + return _c +} + +// FeatureByAddress provides a mock function with given fields: address +func (_m *DeviceRemoteInterface) FeatureByAddress(address *model.FeatureAddressType) api.FeatureRemoteInterface { + ret := _m.Called(address) + + if len(ret) == 0 { + panic("no return value specified for FeatureByAddress") + } + + var r0 api.FeatureRemoteInterface + if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) api.FeatureRemoteInterface); ok { + r0 = rf(address) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.FeatureRemoteInterface) + } + } + + return r0 +} + +// DeviceRemoteInterface_FeatureByAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureByAddress' +type DeviceRemoteInterface_FeatureByAddress_Call struct { + *mock.Call +} + +// FeatureByAddress is a helper method to define mock.On call +// - address *model.FeatureAddressType +func (_e *DeviceRemoteInterface_Expecter) FeatureByAddress(address interface{}) *DeviceRemoteInterface_FeatureByAddress_Call { + return &DeviceRemoteInterface_FeatureByAddress_Call{Call: _e.mock.On("FeatureByAddress", address)} +} + +func (_c *DeviceRemoteInterface_FeatureByAddress_Call) Run(run func(address *model.FeatureAddressType)) *DeviceRemoteInterface_FeatureByAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType)) + }) + return _c +} + +func (_c *DeviceRemoteInterface_FeatureByAddress_Call) Return(_a0 api.FeatureRemoteInterface) *DeviceRemoteInterface_FeatureByAddress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_FeatureByAddress_Call) RunAndReturn(run func(*model.FeatureAddressType) api.FeatureRemoteInterface) *DeviceRemoteInterface_FeatureByAddress_Call { + _c.Call.Return(run) + return _c +} + +// FeatureByEntityTypeAndRole provides a mock function with given fields: entity, featureType, role +func (_m *DeviceRemoteInterface) FeatureByEntityTypeAndRole(entity api.EntityRemoteInterface, featureType model.FeatureTypeType, role model.RoleType) api.FeatureRemoteInterface { + ret := _m.Called(entity, featureType, role) + + if len(ret) == 0 { + panic("no return value specified for FeatureByEntityTypeAndRole") + } + + var r0 api.FeatureRemoteInterface + if rf, ok := ret.Get(0).(func(api.EntityRemoteInterface, model.FeatureTypeType, model.RoleType) api.FeatureRemoteInterface); ok { + r0 = rf(entity, featureType, role) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.FeatureRemoteInterface) + } + } + + return r0 +} + +// DeviceRemoteInterface_FeatureByEntityTypeAndRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureByEntityTypeAndRole' +type DeviceRemoteInterface_FeatureByEntityTypeAndRole_Call struct { + *mock.Call +} + +// FeatureByEntityTypeAndRole is a helper method to define mock.On call +// - entity api.EntityRemoteInterface +// - featureType model.FeatureTypeType +// - role model.RoleType +func (_e *DeviceRemoteInterface_Expecter) FeatureByEntityTypeAndRole(entity interface{}, featureType interface{}, role interface{}) *DeviceRemoteInterface_FeatureByEntityTypeAndRole_Call { + return &DeviceRemoteInterface_FeatureByEntityTypeAndRole_Call{Call: _e.mock.On("FeatureByEntityTypeAndRole", entity, featureType, role)} +} + +func (_c *DeviceRemoteInterface_FeatureByEntityTypeAndRole_Call) Run(run func(entity api.EntityRemoteInterface, featureType model.FeatureTypeType, role model.RoleType)) *DeviceRemoteInterface_FeatureByEntityTypeAndRole_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.EntityRemoteInterface), args[1].(model.FeatureTypeType), args[2].(model.RoleType)) + }) + return _c +} + +func (_c *DeviceRemoteInterface_FeatureByEntityTypeAndRole_Call) Return(_a0 api.FeatureRemoteInterface) *DeviceRemoteInterface_FeatureByEntityTypeAndRole_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_FeatureByEntityTypeAndRole_Call) RunAndReturn(run func(api.EntityRemoteInterface, model.FeatureTypeType, model.RoleType) api.FeatureRemoteInterface) *DeviceRemoteInterface_FeatureByEntityTypeAndRole_Call { + _c.Call.Return(run) + return _c +} + +// FeatureSet provides a mock function with given fields: +func (_m *DeviceRemoteInterface) FeatureSet() *model.NetworkManagementFeatureSetType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for FeatureSet") + } + + var r0 *model.NetworkManagementFeatureSetType + if rf, ok := ret.Get(0).(func() *model.NetworkManagementFeatureSetType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.NetworkManagementFeatureSetType) + } + } + + return r0 +} + +// DeviceRemoteInterface_FeatureSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureSet' +type DeviceRemoteInterface_FeatureSet_Call struct { + *mock.Call +} + +// FeatureSet is a helper method to define mock.On call +func (_e *DeviceRemoteInterface_Expecter) FeatureSet() *DeviceRemoteInterface_FeatureSet_Call { + return &DeviceRemoteInterface_FeatureSet_Call{Call: _e.mock.On("FeatureSet")} +} + +func (_c *DeviceRemoteInterface_FeatureSet_Call) Run(run func()) *DeviceRemoteInterface_FeatureSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceRemoteInterface_FeatureSet_Call) Return(_a0 *model.NetworkManagementFeatureSetType) *DeviceRemoteInterface_FeatureSet_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_FeatureSet_Call) RunAndReturn(run func() *model.NetworkManagementFeatureSetType) *DeviceRemoteInterface_FeatureSet_Call { + _c.Call.Return(run) + return _c +} + +// HandleSpineMesssage provides a mock function with given fields: message +func (_m *DeviceRemoteInterface) HandleSpineMesssage(message []byte) (*model.MsgCounterType, error) { + ret := _m.Called(message) + + if len(ret) == 0 { + panic("no return value specified for HandleSpineMesssage") + } + + var r0 *model.MsgCounterType + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (*model.MsgCounterType, error)); ok { + return rf(message) + } + if rf, ok := ret.Get(0).(func([]byte) *model.MsgCounterType); ok { + r0 = rf(message) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func([]byte) error); ok { + r1 = rf(message) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// DeviceRemoteInterface_HandleSpineMesssage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleSpineMesssage' +type DeviceRemoteInterface_HandleSpineMesssage_Call struct { + *mock.Call +} + +// HandleSpineMesssage is a helper method to define mock.On call +// - message []byte +func (_e *DeviceRemoteInterface_Expecter) HandleSpineMesssage(message interface{}) *DeviceRemoteInterface_HandleSpineMesssage_Call { + return &DeviceRemoteInterface_HandleSpineMesssage_Call{Call: _e.mock.On("HandleSpineMesssage", message)} +} + +func (_c *DeviceRemoteInterface_HandleSpineMesssage_Call) Run(run func(message []byte)) *DeviceRemoteInterface_HandleSpineMesssage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *DeviceRemoteInterface_HandleSpineMesssage_Call) Return(_a0 *model.MsgCounterType, _a1 error) *DeviceRemoteInterface_HandleSpineMesssage_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *DeviceRemoteInterface_HandleSpineMesssage_Call) RunAndReturn(run func([]byte) (*model.MsgCounterType, error)) *DeviceRemoteInterface_HandleSpineMesssage_Call { + _c.Call.Return(run) + return _c +} + +// RemoveByAddress provides a mock function with given fields: addr +func (_m *DeviceRemoteInterface) RemoveByAddress(addr []model.AddressEntityType) api.EntityRemoteInterface { + ret := _m.Called(addr) + + if len(ret) == 0 { + panic("no return value specified for RemoveByAddress") + } + + var r0 api.EntityRemoteInterface + if rf, ok := ret.Get(0).(func([]model.AddressEntityType) api.EntityRemoteInterface); ok { + r0 = rf(addr) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.EntityRemoteInterface) + } + } + + return r0 +} + +// DeviceRemoteInterface_RemoveByAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveByAddress' +type DeviceRemoteInterface_RemoveByAddress_Call struct { + *mock.Call +} + +// RemoveByAddress is a helper method to define mock.On call +// - addr []model.AddressEntityType +func (_e *DeviceRemoteInterface_Expecter) RemoveByAddress(addr interface{}) *DeviceRemoteInterface_RemoveByAddress_Call { + return &DeviceRemoteInterface_RemoveByAddress_Call{Call: _e.mock.On("RemoveByAddress", addr)} +} + +func (_c *DeviceRemoteInterface_RemoveByAddress_Call) Run(run func(addr []model.AddressEntityType)) *DeviceRemoteInterface_RemoveByAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]model.AddressEntityType)) + }) + return _c +} + +func (_c *DeviceRemoteInterface_RemoveByAddress_Call) Return(_a0 api.EntityRemoteInterface) *DeviceRemoteInterface_RemoveByAddress_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_RemoveByAddress_Call) RunAndReturn(run func([]model.AddressEntityType) api.EntityRemoteInterface) *DeviceRemoteInterface_RemoveByAddress_Call { + _c.Call.Return(run) + return _c +} + +// Sender provides a mock function with given fields: +func (_m *DeviceRemoteInterface) Sender() api.SenderInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Sender") + } + + var r0 api.SenderInterface + if rf, ok := ret.Get(0).(func() api.SenderInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.SenderInterface) + } + } + + return r0 +} + +// DeviceRemoteInterface_Sender_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sender' +type DeviceRemoteInterface_Sender_Call struct { + *mock.Call +} + +// Sender is a helper method to define mock.On call +func (_e *DeviceRemoteInterface_Expecter) Sender() *DeviceRemoteInterface_Sender_Call { + return &DeviceRemoteInterface_Sender_Call{Call: _e.mock.On("Sender")} +} + +func (_c *DeviceRemoteInterface_Sender_Call) Run(run func()) *DeviceRemoteInterface_Sender_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceRemoteInterface_Sender_Call) Return(_a0 api.SenderInterface) *DeviceRemoteInterface_Sender_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_Sender_Call) RunAndReturn(run func() api.SenderInterface) *DeviceRemoteInterface_Sender_Call { + _c.Call.Return(run) + return _c +} + +// SetAddress provides a mock function with given fields: address +func (_m *DeviceRemoteInterface) SetAddress(address *model.AddressDeviceType) { + _m.Called(address) +} + +// DeviceRemoteInterface_SetAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAddress' +type DeviceRemoteInterface_SetAddress_Call struct { + *mock.Call +} + +// SetAddress is a helper method to define mock.On call +// - address *model.AddressDeviceType +func (_e *DeviceRemoteInterface_Expecter) SetAddress(address interface{}) *DeviceRemoteInterface_SetAddress_Call { + return &DeviceRemoteInterface_SetAddress_Call{Call: _e.mock.On("SetAddress", address)} +} + +func (_c *DeviceRemoteInterface_SetAddress_Call) Run(run func(address *model.AddressDeviceType)) *DeviceRemoteInterface_SetAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.AddressDeviceType)) + }) + return _c +} + +func (_c *DeviceRemoteInterface_SetAddress_Call) Return() *DeviceRemoteInterface_SetAddress_Call { + _c.Call.Return() + return _c +} + +func (_c *DeviceRemoteInterface_SetAddress_Call) RunAndReturn(run func(*model.AddressDeviceType)) *DeviceRemoteInterface_SetAddress_Call { + _c.Call.Return(run) + return _c +} + +// Ski provides a mock function with given fields: +func (_m *DeviceRemoteInterface) Ski() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Ski") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// DeviceRemoteInterface_Ski_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ski' +type DeviceRemoteInterface_Ski_Call struct { + *mock.Call +} + +// Ski is a helper method to define mock.On call +func (_e *DeviceRemoteInterface_Expecter) Ski() *DeviceRemoteInterface_Ski_Call { + return &DeviceRemoteInterface_Ski_Call{Call: _e.mock.On("Ski")} +} + +func (_c *DeviceRemoteInterface_Ski_Call) Run(run func()) *DeviceRemoteInterface_Ski_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceRemoteInterface_Ski_Call) Return(_a0 string) *DeviceRemoteInterface_Ski_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_Ski_Call) RunAndReturn(run func() string) *DeviceRemoteInterface_Ski_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDevice provides a mock function with given fields: description +func (_m *DeviceRemoteInterface) UpdateDevice(description *model.NetworkManagementDeviceDescriptionDataType) { + _m.Called(description) +} + +// DeviceRemoteInterface_UpdateDevice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDevice' +type DeviceRemoteInterface_UpdateDevice_Call struct { + *mock.Call +} + +// UpdateDevice is a helper method to define mock.On call +// - description *model.NetworkManagementDeviceDescriptionDataType +func (_e *DeviceRemoteInterface_Expecter) UpdateDevice(description interface{}) *DeviceRemoteInterface_UpdateDevice_Call { + return &DeviceRemoteInterface_UpdateDevice_Call{Call: _e.mock.On("UpdateDevice", description)} +} + +func (_c *DeviceRemoteInterface_UpdateDevice_Call) Run(run func(description *model.NetworkManagementDeviceDescriptionDataType)) *DeviceRemoteInterface_UpdateDevice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.NetworkManagementDeviceDescriptionDataType)) + }) + return _c +} + +func (_c *DeviceRemoteInterface_UpdateDevice_Call) Return() *DeviceRemoteInterface_UpdateDevice_Call { + _c.Call.Return() + return _c +} + +func (_c *DeviceRemoteInterface_UpdateDevice_Call) RunAndReturn(run func(*model.NetworkManagementDeviceDescriptionDataType)) *DeviceRemoteInterface_UpdateDevice_Call { + _c.Call.Return(run) + return _c +} + +// UseCases provides a mock function with given fields: +func (_m *DeviceRemoteInterface) UseCases() []model.UseCaseInformationDataType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for UseCases") + } + + var r0 []model.UseCaseInformationDataType + if rf, ok := ret.Get(0).(func() []model.UseCaseInformationDataType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]model.UseCaseInformationDataType) + } + } + + return r0 +} + +// DeviceRemoteInterface_UseCases_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UseCases' +type DeviceRemoteInterface_UseCases_Call struct { + *mock.Call +} + +// UseCases is a helper method to define mock.On call +func (_e *DeviceRemoteInterface_Expecter) UseCases() *DeviceRemoteInterface_UseCases_Call { + return &DeviceRemoteInterface_UseCases_Call{Call: _e.mock.On("UseCases")} +} + +func (_c *DeviceRemoteInterface_UseCases_Call) Run(run func()) *DeviceRemoteInterface_UseCases_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *DeviceRemoteInterface_UseCases_Call) Return(_a0 []model.UseCaseInformationDataType) *DeviceRemoteInterface_UseCases_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_UseCases_Call) RunAndReturn(run func() []model.UseCaseInformationDataType) *DeviceRemoteInterface_UseCases_Call { + _c.Call.Return(run) + return _c +} + +// VerifyUseCaseScenariosAndFeaturesSupport provides a mock function with given fields: usecaseActor, usecaseName, scenarios, serverFeatures +func (_m *DeviceRemoteInterface) VerifyUseCaseScenariosAndFeaturesSupport(usecaseActor model.UseCaseActorType, usecaseName model.UseCaseNameType, scenarios []model.UseCaseScenarioSupportType, serverFeatures []model.FeatureTypeType) bool { + ret := _m.Called(usecaseActor, usecaseName, scenarios, serverFeatures) + + if len(ret) == 0 { + panic("no return value specified for VerifyUseCaseScenariosAndFeaturesSupport") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(model.UseCaseActorType, model.UseCaseNameType, []model.UseCaseScenarioSupportType, []model.FeatureTypeType) bool); ok { + r0 = rf(usecaseActor, usecaseName, scenarios, serverFeatures) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// DeviceRemoteInterface_VerifyUseCaseScenariosAndFeaturesSupport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyUseCaseScenariosAndFeaturesSupport' +type DeviceRemoteInterface_VerifyUseCaseScenariosAndFeaturesSupport_Call struct { + *mock.Call +} + +// VerifyUseCaseScenariosAndFeaturesSupport is a helper method to define mock.On call +// - usecaseActor model.UseCaseActorType +// - usecaseName model.UseCaseNameType +// - scenarios []model.UseCaseScenarioSupportType +// - serverFeatures []model.FeatureTypeType +func (_e *DeviceRemoteInterface_Expecter) VerifyUseCaseScenariosAndFeaturesSupport(usecaseActor interface{}, usecaseName interface{}, scenarios interface{}, serverFeatures interface{}) *DeviceRemoteInterface_VerifyUseCaseScenariosAndFeaturesSupport_Call { + return &DeviceRemoteInterface_VerifyUseCaseScenariosAndFeaturesSupport_Call{Call: _e.mock.On("VerifyUseCaseScenariosAndFeaturesSupport", usecaseActor, usecaseName, scenarios, serverFeatures)} +} + +func (_c *DeviceRemoteInterface_VerifyUseCaseScenariosAndFeaturesSupport_Call) Run(run func(usecaseActor model.UseCaseActorType, usecaseName model.UseCaseNameType, scenarios []model.UseCaseScenarioSupportType, serverFeatures []model.FeatureTypeType)) *DeviceRemoteInterface_VerifyUseCaseScenariosAndFeaturesSupport_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.UseCaseActorType), args[1].(model.UseCaseNameType), args[2].([]model.UseCaseScenarioSupportType), args[3].([]model.FeatureTypeType)) + }) + return _c +} + +func (_c *DeviceRemoteInterface_VerifyUseCaseScenariosAndFeaturesSupport_Call) Return(_a0 bool) *DeviceRemoteInterface_VerifyUseCaseScenariosAndFeaturesSupport_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *DeviceRemoteInterface_VerifyUseCaseScenariosAndFeaturesSupport_Call) RunAndReturn(run func(model.UseCaseActorType, model.UseCaseNameType, []model.UseCaseScenarioSupportType, []model.FeatureTypeType) bool) *DeviceRemoteInterface_VerifyUseCaseScenariosAndFeaturesSupport_Call { + _c.Call.Return(run) + return _c +} + +// NewDeviceRemoteInterface creates a new instance of DeviceRemoteInterface. 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 NewDeviceRemoteInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *DeviceRemoteInterface { + mock := &DeviceRemoteInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/Entity.go b/mocks/Entity.go deleted file mode 100644 index 9955dcf..0000000 --- a/mocks/Entity.go +++ /dev/null @@ -1,252 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - model "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" -) - -// Entity is an autogenerated mock type for the Entity type -type Entity struct { - mock.Mock -} - -type Entity_Expecter struct { - mock *mock.Mock -} - -func (_m *Entity) EXPECT() *Entity_Expecter { - return &Entity_Expecter{mock: &_m.Mock} -} - -// Address provides a mock function with given fields: -func (_m *Entity) Address() *model.EntityAddressType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Address") - } - - var r0 *model.EntityAddressType - if rf, ok := ret.Get(0).(func() *model.EntityAddressType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.EntityAddressType) - } - } - - return r0 -} - -// Entity_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' -type Entity_Address_Call struct { - *mock.Call -} - -// Address is a helper method to define mock.On call -func (_e *Entity_Expecter) Address() *Entity_Address_Call { - return &Entity_Address_Call{Call: _e.mock.On("Address")} -} - -func (_c *Entity_Address_Call) Run(run func()) *Entity_Address_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Entity_Address_Call) Return(_a0 *model.EntityAddressType) *Entity_Address_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Entity_Address_Call) RunAndReturn(run func() *model.EntityAddressType) *Entity_Address_Call { - _c.Call.Return(run) - return _c -} - -// Description provides a mock function with given fields: -func (_m *Entity) Description() *model.DescriptionType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Description") - } - - var r0 *model.DescriptionType - if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.DescriptionType) - } - } - - return r0 -} - -// Entity_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' -type Entity_Description_Call struct { - *mock.Call -} - -// Description is a helper method to define mock.On call -func (_e *Entity_Expecter) Description() *Entity_Description_Call { - return &Entity_Description_Call{Call: _e.mock.On("Description")} -} - -func (_c *Entity_Description_Call) Run(run func()) *Entity_Description_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Entity_Description_Call) Return(_a0 *model.DescriptionType) *Entity_Description_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Entity_Description_Call) RunAndReturn(run func() *model.DescriptionType) *Entity_Description_Call { - _c.Call.Return(run) - return _c -} - -// EntityType provides a mock function with given fields: -func (_m *Entity) EntityType() model.EntityTypeType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for EntityType") - } - - var r0 model.EntityTypeType - if rf, ok := ret.Get(0).(func() model.EntityTypeType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.EntityTypeType) - } - - return r0 -} - -// Entity_EntityType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EntityType' -type Entity_EntityType_Call struct { - *mock.Call -} - -// EntityType is a helper method to define mock.On call -func (_e *Entity_Expecter) EntityType() *Entity_EntityType_Call { - return &Entity_EntityType_Call{Call: _e.mock.On("EntityType")} -} - -func (_c *Entity_EntityType_Call) Run(run func()) *Entity_EntityType_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Entity_EntityType_Call) Return(_a0 model.EntityTypeType) *Entity_EntityType_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Entity_EntityType_Call) RunAndReturn(run func() model.EntityTypeType) *Entity_EntityType_Call { - _c.Call.Return(run) - return _c -} - -// NextFeatureId provides a mock function with given fields: -func (_m *Entity) NextFeatureId() uint { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for NextFeatureId") - } - - var r0 uint - if rf, ok := ret.Get(0).(func() uint); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint) - } - - return r0 -} - -// Entity_NextFeatureId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NextFeatureId' -type Entity_NextFeatureId_Call struct { - *mock.Call -} - -// NextFeatureId is a helper method to define mock.On call -func (_e *Entity_Expecter) NextFeatureId() *Entity_NextFeatureId_Call { - return &Entity_NextFeatureId_Call{Call: _e.mock.On("NextFeatureId")} -} - -func (_c *Entity_NextFeatureId_Call) Run(run func()) *Entity_NextFeatureId_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Entity_NextFeatureId_Call) Return(_a0 uint) *Entity_NextFeatureId_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Entity_NextFeatureId_Call) RunAndReturn(run func() uint) *Entity_NextFeatureId_Call { - _c.Call.Return(run) - return _c -} - -// SetDescription provides a mock function with given fields: d -func (_m *Entity) SetDescription(d *model.DescriptionType) { - _m.Called(d) -} - -// Entity_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' -type Entity_SetDescription_Call struct { - *mock.Call -} - -// SetDescription is a helper method to define mock.On call -// - d *model.DescriptionType -func (_e *Entity_Expecter) SetDescription(d interface{}) *Entity_SetDescription_Call { - return &Entity_SetDescription_Call{Call: _e.mock.On("SetDescription", d)} -} - -func (_c *Entity_SetDescription_Call) Run(run func(d *model.DescriptionType)) *Entity_SetDescription_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.DescriptionType)) - }) - return _c -} - -func (_c *Entity_SetDescription_Call) Return() *Entity_SetDescription_Call { - _c.Call.Return() - return _c -} - -func (_c *Entity_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *Entity_SetDescription_Call { - _c.Call.Return(run) - return _c -} - -// NewEntity creates a new instance of Entity. 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 NewEntity(t interface { - mock.TestingT - Cleanup(func()) -}) *Entity { - mock := &Entity{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/EntityInterface.go b/mocks/EntityInterface.go new file mode 100644 index 0000000..0fe04a3 --- /dev/null +++ b/mocks/EntityInterface.go @@ -0,0 +1,252 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + model "github.com/enbility/spine-go/model" + mock "github.com/stretchr/testify/mock" +) + +// EntityInterface is an autogenerated mock type for the EntityInterface type +type EntityInterface struct { + mock.Mock +} + +type EntityInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *EntityInterface) EXPECT() *EntityInterface_Expecter { + return &EntityInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *EntityInterface) Address() *model.EntityAddressType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 *model.EntityAddressType + if rf, ok := ret.Get(0).(func() *model.EntityAddressType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.EntityAddressType) + } + } + + return r0 +} + +// EntityInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type EntityInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *EntityInterface_Expecter) Address() *EntityInterface_Address_Call { + return &EntityInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *EntityInterface_Address_Call) Run(run func()) *EntityInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityInterface_Address_Call) Return(_a0 *model.EntityAddressType) *EntityInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityInterface_Address_Call) RunAndReturn(run func() *model.EntityAddressType) *EntityInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// Description provides a mock function with given fields: +func (_m *EntityInterface) Description() *model.DescriptionType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 *model.DescriptionType + if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.DescriptionType) + } + } + + return r0 +} + +// EntityInterface_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type EntityInterface_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *EntityInterface_Expecter) Description() *EntityInterface_Description_Call { + return &EntityInterface_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *EntityInterface_Description_Call) Run(run func()) *EntityInterface_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityInterface_Description_Call) Return(_a0 *model.DescriptionType) *EntityInterface_Description_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityInterface_Description_Call) RunAndReturn(run func() *model.DescriptionType) *EntityInterface_Description_Call { + _c.Call.Return(run) + return _c +} + +// EntityType provides a mock function with given fields: +func (_m *EntityInterface) EntityType() model.EntityTypeType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for EntityType") + } + + var r0 model.EntityTypeType + if rf, ok := ret.Get(0).(func() model.EntityTypeType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.EntityTypeType) + } + + return r0 +} + +// EntityInterface_EntityType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EntityType' +type EntityInterface_EntityType_Call struct { + *mock.Call +} + +// EntityType is a helper method to define mock.On call +func (_e *EntityInterface_Expecter) EntityType() *EntityInterface_EntityType_Call { + return &EntityInterface_EntityType_Call{Call: _e.mock.On("EntityType")} +} + +func (_c *EntityInterface_EntityType_Call) Run(run func()) *EntityInterface_EntityType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityInterface_EntityType_Call) Return(_a0 model.EntityTypeType) *EntityInterface_EntityType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityInterface_EntityType_Call) RunAndReturn(run func() model.EntityTypeType) *EntityInterface_EntityType_Call { + _c.Call.Return(run) + return _c +} + +// NextFeatureId provides a mock function with given fields: +func (_m *EntityInterface) NextFeatureId() uint { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NextFeatureId") + } + + var r0 uint + if rf, ok := ret.Get(0).(func() uint); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint) + } + + return r0 +} + +// EntityInterface_NextFeatureId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NextFeatureId' +type EntityInterface_NextFeatureId_Call struct { + *mock.Call +} + +// NextFeatureId is a helper method to define mock.On call +func (_e *EntityInterface_Expecter) NextFeatureId() *EntityInterface_NextFeatureId_Call { + return &EntityInterface_NextFeatureId_Call{Call: _e.mock.On("NextFeatureId")} +} + +func (_c *EntityInterface_NextFeatureId_Call) Run(run func()) *EntityInterface_NextFeatureId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityInterface_NextFeatureId_Call) Return(_a0 uint) *EntityInterface_NextFeatureId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityInterface_NextFeatureId_Call) RunAndReturn(run func() uint) *EntityInterface_NextFeatureId_Call { + _c.Call.Return(run) + return _c +} + +// SetDescription provides a mock function with given fields: d +func (_m *EntityInterface) SetDescription(d *model.DescriptionType) { + _m.Called(d) +} + +// EntityInterface_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' +type EntityInterface_SetDescription_Call struct { + *mock.Call +} + +// SetDescription is a helper method to define mock.On call +// - d *model.DescriptionType +func (_e *EntityInterface_Expecter) SetDescription(d interface{}) *EntityInterface_SetDescription_Call { + return &EntityInterface_SetDescription_Call{Call: _e.mock.On("SetDescription", d)} +} + +func (_c *EntityInterface_SetDescription_Call) Run(run func(d *model.DescriptionType)) *EntityInterface_SetDescription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.DescriptionType)) + }) + return _c +} + +func (_c *EntityInterface_SetDescription_Call) Return() *EntityInterface_SetDescription_Call { + _c.Call.Return() + return _c +} + +func (_c *EntityInterface_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *EntityInterface_SetDescription_Call { + _c.Call.Return(run) + return _c +} + +// NewEntityInterface creates a new instance of EntityInterface. 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 NewEntityInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *EntityInterface { + mock := &EntityInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/EntityLocal.go b/mocks/EntityLocal.go deleted file mode 100644 index f363466..0000000 --- a/mocks/EntityLocal.go +++ /dev/null @@ -1,742 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" - - model "github.com/enbility/spine-go/model" -) - -// EntityLocal is an autogenerated mock type for the EntityLocal type -type EntityLocal struct { - mock.Mock -} - -type EntityLocal_Expecter struct { - mock *mock.Mock -} - -func (_m *EntityLocal) EXPECT() *EntityLocal_Expecter { - return &EntityLocal_Expecter{mock: &_m.Mock} -} - -// AddFeature provides a mock function with given fields: f -func (_m *EntityLocal) AddFeature(f api.FeatureLocal) { - _m.Called(f) -} - -// EntityLocal_AddFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeature' -type EntityLocal_AddFeature_Call struct { - *mock.Call -} - -// AddFeature is a helper method to define mock.On call -// - f api.FeatureLocal -func (_e *EntityLocal_Expecter) AddFeature(f interface{}) *EntityLocal_AddFeature_Call { - return &EntityLocal_AddFeature_Call{Call: _e.mock.On("AddFeature", f)} -} - -func (_c *EntityLocal_AddFeature_Call) Run(run func(f api.FeatureLocal)) *EntityLocal_AddFeature_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.FeatureLocal)) - }) - return _c -} - -func (_c *EntityLocal_AddFeature_Call) Return() *EntityLocal_AddFeature_Call { - _c.Call.Return() - return _c -} - -func (_c *EntityLocal_AddFeature_Call) RunAndReturn(run func(api.FeatureLocal)) *EntityLocal_AddFeature_Call { - _c.Call.Return(run) - return _c -} - -// AddUseCaseSupport provides a mock function with given fields: actor, useCaseName, useCaseVersion, useCaseDocumemtSubRevision, useCaseAvailable, scenarios -func (_m *EntityLocal) AddUseCaseSupport(actor model.UseCaseActorType, useCaseName model.UseCaseNameType, useCaseVersion model.SpecificationVersionType, useCaseDocumemtSubRevision string, useCaseAvailable bool, scenarios []model.UseCaseScenarioSupportType) { - _m.Called(actor, useCaseName, useCaseVersion, useCaseDocumemtSubRevision, useCaseAvailable, scenarios) -} - -// EntityLocal_AddUseCaseSupport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCaseSupport' -type EntityLocal_AddUseCaseSupport_Call struct { - *mock.Call -} - -// AddUseCaseSupport is a helper method to define mock.On call -// - actor model.UseCaseActorType -// - useCaseName model.UseCaseNameType -// - useCaseVersion model.SpecificationVersionType -// - useCaseDocumemtSubRevision string -// - useCaseAvailable bool -// - scenarios []model.UseCaseScenarioSupportType -func (_e *EntityLocal_Expecter) AddUseCaseSupport(actor interface{}, useCaseName interface{}, useCaseVersion interface{}, useCaseDocumemtSubRevision interface{}, useCaseAvailable interface{}, scenarios interface{}) *EntityLocal_AddUseCaseSupport_Call { - return &EntityLocal_AddUseCaseSupport_Call{Call: _e.mock.On("AddUseCaseSupport", actor, useCaseName, useCaseVersion, useCaseDocumemtSubRevision, useCaseAvailable, scenarios)} -} - -func (_c *EntityLocal_AddUseCaseSupport_Call) Run(run func(actor model.UseCaseActorType, useCaseName model.UseCaseNameType, useCaseVersion model.SpecificationVersionType, useCaseDocumemtSubRevision string, useCaseAvailable bool, scenarios []model.UseCaseScenarioSupportType)) *EntityLocal_AddUseCaseSupport_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.UseCaseActorType), args[1].(model.UseCaseNameType), args[2].(model.SpecificationVersionType), args[3].(string), args[4].(bool), args[5].([]model.UseCaseScenarioSupportType)) - }) - return _c -} - -func (_c *EntityLocal_AddUseCaseSupport_Call) Return() *EntityLocal_AddUseCaseSupport_Call { - _c.Call.Return() - return _c -} - -func (_c *EntityLocal_AddUseCaseSupport_Call) RunAndReturn(run func(model.UseCaseActorType, model.UseCaseNameType, model.SpecificationVersionType, string, bool, []model.UseCaseScenarioSupportType)) *EntityLocal_AddUseCaseSupport_Call { - _c.Call.Return(run) - return _c -} - -// Address provides a mock function with given fields: -func (_m *EntityLocal) Address() *model.EntityAddressType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Address") - } - - var r0 *model.EntityAddressType - if rf, ok := ret.Get(0).(func() *model.EntityAddressType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.EntityAddressType) - } - } - - return r0 -} - -// EntityLocal_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' -type EntityLocal_Address_Call struct { - *mock.Call -} - -// Address is a helper method to define mock.On call -func (_e *EntityLocal_Expecter) Address() *EntityLocal_Address_Call { - return &EntityLocal_Address_Call{Call: _e.mock.On("Address")} -} - -func (_c *EntityLocal_Address_Call) Run(run func()) *EntityLocal_Address_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityLocal_Address_Call) Return(_a0 *model.EntityAddressType) *EntityLocal_Address_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityLocal_Address_Call) RunAndReturn(run func() *model.EntityAddressType) *EntityLocal_Address_Call { - _c.Call.Return(run) - return _c -} - -// Description provides a mock function with given fields: -func (_m *EntityLocal) Description() *model.DescriptionType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Description") - } - - var r0 *model.DescriptionType - if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.DescriptionType) - } - } - - return r0 -} - -// EntityLocal_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' -type EntityLocal_Description_Call struct { - *mock.Call -} - -// Description is a helper method to define mock.On call -func (_e *EntityLocal_Expecter) Description() *EntityLocal_Description_Call { - return &EntityLocal_Description_Call{Call: _e.mock.On("Description")} -} - -func (_c *EntityLocal_Description_Call) Run(run func()) *EntityLocal_Description_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityLocal_Description_Call) Return(_a0 *model.DescriptionType) *EntityLocal_Description_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityLocal_Description_Call) RunAndReturn(run func() *model.DescriptionType) *EntityLocal_Description_Call { - _c.Call.Return(run) - return _c -} - -// Device provides a mock function with given fields: -func (_m *EntityLocal) Device() api.DeviceLocal { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Device") - } - - var r0 api.DeviceLocal - if rf, ok := ret.Get(0).(func() api.DeviceLocal); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.DeviceLocal) - } - } - - return r0 -} - -// EntityLocal_Device_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Device' -type EntityLocal_Device_Call struct { - *mock.Call -} - -// Device is a helper method to define mock.On call -func (_e *EntityLocal_Expecter) Device() *EntityLocal_Device_Call { - return &EntityLocal_Device_Call{Call: _e.mock.On("Device")} -} - -func (_c *EntityLocal_Device_Call) Run(run func()) *EntityLocal_Device_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityLocal_Device_Call) Return(_a0 api.DeviceLocal) *EntityLocal_Device_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityLocal_Device_Call) RunAndReturn(run func() api.DeviceLocal) *EntityLocal_Device_Call { - _c.Call.Return(run) - return _c -} - -// EntityType provides a mock function with given fields: -func (_m *EntityLocal) EntityType() model.EntityTypeType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for EntityType") - } - - var r0 model.EntityTypeType - if rf, ok := ret.Get(0).(func() model.EntityTypeType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.EntityTypeType) - } - - return r0 -} - -// EntityLocal_EntityType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EntityType' -type EntityLocal_EntityType_Call struct { - *mock.Call -} - -// EntityType is a helper method to define mock.On call -func (_e *EntityLocal_Expecter) EntityType() *EntityLocal_EntityType_Call { - return &EntityLocal_EntityType_Call{Call: _e.mock.On("EntityType")} -} - -func (_c *EntityLocal_EntityType_Call) Run(run func()) *EntityLocal_EntityType_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityLocal_EntityType_Call) Return(_a0 model.EntityTypeType) *EntityLocal_EntityType_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityLocal_EntityType_Call) RunAndReturn(run func() model.EntityTypeType) *EntityLocal_EntityType_Call { - _c.Call.Return(run) - return _c -} - -// Feature provides a mock function with given fields: addressFeature -func (_m *EntityLocal) Feature(addressFeature *model.AddressFeatureType) api.FeatureLocal { - ret := _m.Called(addressFeature) - - if len(ret) == 0 { - panic("no return value specified for Feature") - } - - var r0 api.FeatureLocal - if rf, ok := ret.Get(0).(func(*model.AddressFeatureType) api.FeatureLocal); ok { - r0 = rf(addressFeature) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.FeatureLocal) - } - } - - return r0 -} - -// EntityLocal_Feature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Feature' -type EntityLocal_Feature_Call struct { - *mock.Call -} - -// Feature is a helper method to define mock.On call -// - addressFeature *model.AddressFeatureType -func (_e *EntityLocal_Expecter) Feature(addressFeature interface{}) *EntityLocal_Feature_Call { - return &EntityLocal_Feature_Call{Call: _e.mock.On("Feature", addressFeature)} -} - -func (_c *EntityLocal_Feature_Call) Run(run func(addressFeature *model.AddressFeatureType)) *EntityLocal_Feature_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.AddressFeatureType)) - }) - return _c -} - -func (_c *EntityLocal_Feature_Call) Return(_a0 api.FeatureLocal) *EntityLocal_Feature_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityLocal_Feature_Call) RunAndReturn(run func(*model.AddressFeatureType) api.FeatureLocal) *EntityLocal_Feature_Call { - _c.Call.Return(run) - return _c -} - -// FeatureOfTypeAndRole provides a mock function with given fields: featureType, role -func (_m *EntityLocal) FeatureOfTypeAndRole(featureType model.FeatureTypeType, role model.RoleType) api.FeatureLocal { - ret := _m.Called(featureType, role) - - if len(ret) == 0 { - panic("no return value specified for FeatureOfTypeAndRole") - } - - var r0 api.FeatureLocal - if rf, ok := ret.Get(0).(func(model.FeatureTypeType, model.RoleType) api.FeatureLocal); ok { - r0 = rf(featureType, role) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.FeatureLocal) - } - } - - return r0 -} - -// EntityLocal_FeatureOfTypeAndRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureOfTypeAndRole' -type EntityLocal_FeatureOfTypeAndRole_Call struct { - *mock.Call -} - -// FeatureOfTypeAndRole is a helper method to define mock.On call -// - featureType model.FeatureTypeType -// - role model.RoleType -func (_e *EntityLocal_Expecter) FeatureOfTypeAndRole(featureType interface{}, role interface{}) *EntityLocal_FeatureOfTypeAndRole_Call { - return &EntityLocal_FeatureOfTypeAndRole_Call{Call: _e.mock.On("FeatureOfTypeAndRole", featureType, role)} -} - -func (_c *EntityLocal_FeatureOfTypeAndRole_Call) Run(run func(featureType model.FeatureTypeType, role model.RoleType)) *EntityLocal_FeatureOfTypeAndRole_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FeatureTypeType), args[1].(model.RoleType)) - }) - return _c -} - -func (_c *EntityLocal_FeatureOfTypeAndRole_Call) Return(_a0 api.FeatureLocal) *EntityLocal_FeatureOfTypeAndRole_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityLocal_FeatureOfTypeAndRole_Call) RunAndReturn(run func(model.FeatureTypeType, model.RoleType) api.FeatureLocal) *EntityLocal_FeatureOfTypeAndRole_Call { - _c.Call.Return(run) - return _c -} - -// Features provides a mock function with given fields: -func (_m *EntityLocal) Features() []api.FeatureLocal { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Features") - } - - var r0 []api.FeatureLocal - if rf, ok := ret.Get(0).(func() []api.FeatureLocal); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]api.FeatureLocal) - } - } - - return r0 -} - -// EntityLocal_Features_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Features' -type EntityLocal_Features_Call struct { - *mock.Call -} - -// Features is a helper method to define mock.On call -func (_e *EntityLocal_Expecter) Features() *EntityLocal_Features_Call { - return &EntityLocal_Features_Call{Call: _e.mock.On("Features")} -} - -func (_c *EntityLocal_Features_Call) Run(run func()) *EntityLocal_Features_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityLocal_Features_Call) Return(_a0 []api.FeatureLocal) *EntityLocal_Features_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityLocal_Features_Call) RunAndReturn(run func() []api.FeatureLocal) *EntityLocal_Features_Call { - _c.Call.Return(run) - return _c -} - -// GetOrAddFeature provides a mock function with given fields: featureType, role -func (_m *EntityLocal) GetOrAddFeature(featureType model.FeatureTypeType, role model.RoleType) api.FeatureLocal { - ret := _m.Called(featureType, role) - - if len(ret) == 0 { - panic("no return value specified for GetOrAddFeature") - } - - var r0 api.FeatureLocal - if rf, ok := ret.Get(0).(func(model.FeatureTypeType, model.RoleType) api.FeatureLocal); ok { - r0 = rf(featureType, role) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.FeatureLocal) - } - } - - return r0 -} - -// EntityLocal_GetOrAddFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrAddFeature' -type EntityLocal_GetOrAddFeature_Call struct { - *mock.Call -} - -// GetOrAddFeature is a helper method to define mock.On call -// - featureType model.FeatureTypeType -// - role model.RoleType -func (_e *EntityLocal_Expecter) GetOrAddFeature(featureType interface{}, role interface{}) *EntityLocal_GetOrAddFeature_Call { - return &EntityLocal_GetOrAddFeature_Call{Call: _e.mock.On("GetOrAddFeature", featureType, role)} -} - -func (_c *EntityLocal_GetOrAddFeature_Call) Run(run func(featureType model.FeatureTypeType, role model.RoleType)) *EntityLocal_GetOrAddFeature_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FeatureTypeType), args[1].(model.RoleType)) - }) - return _c -} - -func (_c *EntityLocal_GetOrAddFeature_Call) Return(_a0 api.FeatureLocal) *EntityLocal_GetOrAddFeature_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityLocal_GetOrAddFeature_Call) RunAndReturn(run func(model.FeatureTypeType, model.RoleType) api.FeatureLocal) *EntityLocal_GetOrAddFeature_Call { - _c.Call.Return(run) - return _c -} - -// Information provides a mock function with given fields: -func (_m *EntityLocal) Information() *model.NodeManagementDetailedDiscoveryEntityInformationType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Information") - } - - var r0 *model.NodeManagementDetailedDiscoveryEntityInformationType - if rf, ok := ret.Get(0).(func() *model.NodeManagementDetailedDiscoveryEntityInformationType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.NodeManagementDetailedDiscoveryEntityInformationType) - } - } - - return r0 -} - -// EntityLocal_Information_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Information' -type EntityLocal_Information_Call struct { - *mock.Call -} - -// Information is a helper method to define mock.On call -func (_e *EntityLocal_Expecter) Information() *EntityLocal_Information_Call { - return &EntityLocal_Information_Call{Call: _e.mock.On("Information")} -} - -func (_c *EntityLocal_Information_Call) Run(run func()) *EntityLocal_Information_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityLocal_Information_Call) Return(_a0 *model.NodeManagementDetailedDiscoveryEntityInformationType) *EntityLocal_Information_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityLocal_Information_Call) RunAndReturn(run func() *model.NodeManagementDetailedDiscoveryEntityInformationType) *EntityLocal_Information_Call { - _c.Call.Return(run) - return _c -} - -// NextFeatureId provides a mock function with given fields: -func (_m *EntityLocal) NextFeatureId() uint { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for NextFeatureId") - } - - var r0 uint - if rf, ok := ret.Get(0).(func() uint); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint) - } - - return r0 -} - -// EntityLocal_NextFeatureId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NextFeatureId' -type EntityLocal_NextFeatureId_Call struct { - *mock.Call -} - -// NextFeatureId is a helper method to define mock.On call -func (_e *EntityLocal_Expecter) NextFeatureId() *EntityLocal_NextFeatureId_Call { - return &EntityLocal_NextFeatureId_Call{Call: _e.mock.On("NextFeatureId")} -} - -func (_c *EntityLocal_NextFeatureId_Call) Run(run func()) *EntityLocal_NextFeatureId_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityLocal_NextFeatureId_Call) Return(_a0 uint) *EntityLocal_NextFeatureId_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityLocal_NextFeatureId_Call) RunAndReturn(run func() uint) *EntityLocal_NextFeatureId_Call { - _c.Call.Return(run) - return _c -} - -// RemoveAllBindings provides a mock function with given fields: -func (_m *EntityLocal) RemoveAllBindings() { - _m.Called() -} - -// EntityLocal_RemoveAllBindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllBindings' -type EntityLocal_RemoveAllBindings_Call struct { - *mock.Call -} - -// RemoveAllBindings is a helper method to define mock.On call -func (_e *EntityLocal_Expecter) RemoveAllBindings() *EntityLocal_RemoveAllBindings_Call { - return &EntityLocal_RemoveAllBindings_Call{Call: _e.mock.On("RemoveAllBindings")} -} - -func (_c *EntityLocal_RemoveAllBindings_Call) Run(run func()) *EntityLocal_RemoveAllBindings_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityLocal_RemoveAllBindings_Call) Return() *EntityLocal_RemoveAllBindings_Call { - _c.Call.Return() - return _c -} - -func (_c *EntityLocal_RemoveAllBindings_Call) RunAndReturn(run func()) *EntityLocal_RemoveAllBindings_Call { - _c.Call.Return(run) - return _c -} - -// RemoveAllSubscriptions provides a mock function with given fields: -func (_m *EntityLocal) RemoveAllSubscriptions() { - _m.Called() -} - -// EntityLocal_RemoveAllSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllSubscriptions' -type EntityLocal_RemoveAllSubscriptions_Call struct { - *mock.Call -} - -// RemoveAllSubscriptions is a helper method to define mock.On call -func (_e *EntityLocal_Expecter) RemoveAllSubscriptions() *EntityLocal_RemoveAllSubscriptions_Call { - return &EntityLocal_RemoveAllSubscriptions_Call{Call: _e.mock.On("RemoveAllSubscriptions")} -} - -func (_c *EntityLocal_RemoveAllSubscriptions_Call) Run(run func()) *EntityLocal_RemoveAllSubscriptions_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityLocal_RemoveAllSubscriptions_Call) Return() *EntityLocal_RemoveAllSubscriptions_Call { - _c.Call.Return() - return _c -} - -func (_c *EntityLocal_RemoveAllSubscriptions_Call) RunAndReturn(run func()) *EntityLocal_RemoveAllSubscriptions_Call { - _c.Call.Return(run) - return _c -} - -// RemoveAllUseCaseSupports provides a mock function with given fields: -func (_m *EntityLocal) RemoveAllUseCaseSupports() { - _m.Called() -} - -// EntityLocal_RemoveAllUseCaseSupports_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllUseCaseSupports' -type EntityLocal_RemoveAllUseCaseSupports_Call struct { - *mock.Call -} - -// RemoveAllUseCaseSupports is a helper method to define mock.On call -func (_e *EntityLocal_Expecter) RemoveAllUseCaseSupports() *EntityLocal_RemoveAllUseCaseSupports_Call { - return &EntityLocal_RemoveAllUseCaseSupports_Call{Call: _e.mock.On("RemoveAllUseCaseSupports")} -} - -func (_c *EntityLocal_RemoveAllUseCaseSupports_Call) Run(run func()) *EntityLocal_RemoveAllUseCaseSupports_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityLocal_RemoveAllUseCaseSupports_Call) Return() *EntityLocal_RemoveAllUseCaseSupports_Call { - _c.Call.Return() - return _c -} - -func (_c *EntityLocal_RemoveAllUseCaseSupports_Call) RunAndReturn(run func()) *EntityLocal_RemoveAllUseCaseSupports_Call { - _c.Call.Return(run) - return _c -} - -// RemoveUseCaseSupport provides a mock function with given fields: actor, useCaseName -func (_m *EntityLocal) RemoveUseCaseSupport(actor model.UseCaseActorType, useCaseName model.UseCaseNameType) { - _m.Called(actor, useCaseName) -} - -// EntityLocal_RemoveUseCaseSupport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCaseSupport' -type EntityLocal_RemoveUseCaseSupport_Call struct { - *mock.Call -} - -// RemoveUseCaseSupport is a helper method to define mock.On call -// - actor model.UseCaseActorType -// - useCaseName model.UseCaseNameType -func (_e *EntityLocal_Expecter) RemoveUseCaseSupport(actor interface{}, useCaseName interface{}) *EntityLocal_RemoveUseCaseSupport_Call { - return &EntityLocal_RemoveUseCaseSupport_Call{Call: _e.mock.On("RemoveUseCaseSupport", actor, useCaseName)} -} - -func (_c *EntityLocal_RemoveUseCaseSupport_Call) Run(run func(actor model.UseCaseActorType, useCaseName model.UseCaseNameType)) *EntityLocal_RemoveUseCaseSupport_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.UseCaseActorType), args[1].(model.UseCaseNameType)) - }) - return _c -} - -func (_c *EntityLocal_RemoveUseCaseSupport_Call) Return() *EntityLocal_RemoveUseCaseSupport_Call { - _c.Call.Return() - return _c -} - -func (_c *EntityLocal_RemoveUseCaseSupport_Call) RunAndReturn(run func(model.UseCaseActorType, model.UseCaseNameType)) *EntityLocal_RemoveUseCaseSupport_Call { - _c.Call.Return(run) - return _c -} - -// SetDescription provides a mock function with given fields: d -func (_m *EntityLocal) SetDescription(d *model.DescriptionType) { - _m.Called(d) -} - -// EntityLocal_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' -type EntityLocal_SetDescription_Call struct { - *mock.Call -} - -// SetDescription is a helper method to define mock.On call -// - d *model.DescriptionType -func (_e *EntityLocal_Expecter) SetDescription(d interface{}) *EntityLocal_SetDescription_Call { - return &EntityLocal_SetDescription_Call{Call: _e.mock.On("SetDescription", d)} -} - -func (_c *EntityLocal_SetDescription_Call) Run(run func(d *model.DescriptionType)) *EntityLocal_SetDescription_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.DescriptionType)) - }) - return _c -} - -func (_c *EntityLocal_SetDescription_Call) Return() *EntityLocal_SetDescription_Call { - _c.Call.Return() - return _c -} - -func (_c *EntityLocal_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *EntityLocal_SetDescription_Call { - _c.Call.Return(run) - return _c -} - -// NewEntityLocal creates a new instance of EntityLocal. 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 NewEntityLocal(t interface { - mock.TestingT - Cleanup(func()) -}) *EntityLocal { - mock := &EntityLocal{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/EntityLocalInterface.go b/mocks/EntityLocalInterface.go new file mode 100644 index 0000000..3d918d0 --- /dev/null +++ b/mocks/EntityLocalInterface.go @@ -0,0 +1,742 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" + + model "github.com/enbility/spine-go/model" +) + +// EntityLocalInterface is an autogenerated mock type for the EntityLocalInterface type +type EntityLocalInterface struct { + mock.Mock +} + +type EntityLocalInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *EntityLocalInterface) EXPECT() *EntityLocalInterface_Expecter { + return &EntityLocalInterface_Expecter{mock: &_m.Mock} +} + +// AddFeature provides a mock function with given fields: f +func (_m *EntityLocalInterface) AddFeature(f api.FeatureLocalInterface) { + _m.Called(f) +} + +// EntityLocalInterface_AddFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeature' +type EntityLocalInterface_AddFeature_Call struct { + *mock.Call +} + +// AddFeature is a helper method to define mock.On call +// - f api.FeatureLocalInterface +func (_e *EntityLocalInterface_Expecter) AddFeature(f interface{}) *EntityLocalInterface_AddFeature_Call { + return &EntityLocalInterface_AddFeature_Call{Call: _e.mock.On("AddFeature", f)} +} + +func (_c *EntityLocalInterface_AddFeature_Call) Run(run func(f api.FeatureLocalInterface)) *EntityLocalInterface_AddFeature_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.FeatureLocalInterface)) + }) + return _c +} + +func (_c *EntityLocalInterface_AddFeature_Call) Return() *EntityLocalInterface_AddFeature_Call { + _c.Call.Return() + return _c +} + +func (_c *EntityLocalInterface_AddFeature_Call) RunAndReturn(run func(api.FeatureLocalInterface)) *EntityLocalInterface_AddFeature_Call { + _c.Call.Return(run) + return _c +} + +// AddUseCaseSupport provides a mock function with given fields: actor, useCaseName, useCaseVersion, useCaseDocumemtSubRevision, useCaseAvailable, scenarios +func (_m *EntityLocalInterface) AddUseCaseSupport(actor model.UseCaseActorType, useCaseName model.UseCaseNameType, useCaseVersion model.SpecificationVersionType, useCaseDocumemtSubRevision string, useCaseAvailable bool, scenarios []model.UseCaseScenarioSupportType) { + _m.Called(actor, useCaseName, useCaseVersion, useCaseDocumemtSubRevision, useCaseAvailable, scenarios) +} + +// EntityLocalInterface_AddUseCaseSupport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCaseSupport' +type EntityLocalInterface_AddUseCaseSupport_Call struct { + *mock.Call +} + +// AddUseCaseSupport is a helper method to define mock.On call +// - actor model.UseCaseActorType +// - useCaseName model.UseCaseNameType +// - useCaseVersion model.SpecificationVersionType +// - useCaseDocumemtSubRevision string +// - useCaseAvailable bool +// - scenarios []model.UseCaseScenarioSupportType +func (_e *EntityLocalInterface_Expecter) AddUseCaseSupport(actor interface{}, useCaseName interface{}, useCaseVersion interface{}, useCaseDocumemtSubRevision interface{}, useCaseAvailable interface{}, scenarios interface{}) *EntityLocalInterface_AddUseCaseSupport_Call { + return &EntityLocalInterface_AddUseCaseSupport_Call{Call: _e.mock.On("AddUseCaseSupport", actor, useCaseName, useCaseVersion, useCaseDocumemtSubRevision, useCaseAvailable, scenarios)} +} + +func (_c *EntityLocalInterface_AddUseCaseSupport_Call) Run(run func(actor model.UseCaseActorType, useCaseName model.UseCaseNameType, useCaseVersion model.SpecificationVersionType, useCaseDocumemtSubRevision string, useCaseAvailable bool, scenarios []model.UseCaseScenarioSupportType)) *EntityLocalInterface_AddUseCaseSupport_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.UseCaseActorType), args[1].(model.UseCaseNameType), args[2].(model.SpecificationVersionType), args[3].(string), args[4].(bool), args[5].([]model.UseCaseScenarioSupportType)) + }) + return _c +} + +func (_c *EntityLocalInterface_AddUseCaseSupport_Call) Return() *EntityLocalInterface_AddUseCaseSupport_Call { + _c.Call.Return() + return _c +} + +func (_c *EntityLocalInterface_AddUseCaseSupport_Call) RunAndReturn(run func(model.UseCaseActorType, model.UseCaseNameType, model.SpecificationVersionType, string, bool, []model.UseCaseScenarioSupportType)) *EntityLocalInterface_AddUseCaseSupport_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *EntityLocalInterface) Address() *model.EntityAddressType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 *model.EntityAddressType + if rf, ok := ret.Get(0).(func() *model.EntityAddressType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.EntityAddressType) + } + } + + return r0 +} + +// EntityLocalInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type EntityLocalInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *EntityLocalInterface_Expecter) Address() *EntityLocalInterface_Address_Call { + return &EntityLocalInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *EntityLocalInterface_Address_Call) Run(run func()) *EntityLocalInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityLocalInterface_Address_Call) Return(_a0 *model.EntityAddressType) *EntityLocalInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityLocalInterface_Address_Call) RunAndReturn(run func() *model.EntityAddressType) *EntityLocalInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// Description provides a mock function with given fields: +func (_m *EntityLocalInterface) Description() *model.DescriptionType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 *model.DescriptionType + if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.DescriptionType) + } + } + + return r0 +} + +// EntityLocalInterface_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type EntityLocalInterface_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *EntityLocalInterface_Expecter) Description() *EntityLocalInterface_Description_Call { + return &EntityLocalInterface_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *EntityLocalInterface_Description_Call) Run(run func()) *EntityLocalInterface_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityLocalInterface_Description_Call) Return(_a0 *model.DescriptionType) *EntityLocalInterface_Description_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityLocalInterface_Description_Call) RunAndReturn(run func() *model.DescriptionType) *EntityLocalInterface_Description_Call { + _c.Call.Return(run) + return _c +} + +// Device provides a mock function with given fields: +func (_m *EntityLocalInterface) Device() api.DeviceLocalInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Device") + } + + var r0 api.DeviceLocalInterface + if rf, ok := ret.Get(0).(func() api.DeviceLocalInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.DeviceLocalInterface) + } + } + + return r0 +} + +// EntityLocalInterface_Device_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Device' +type EntityLocalInterface_Device_Call struct { + *mock.Call +} + +// Device is a helper method to define mock.On call +func (_e *EntityLocalInterface_Expecter) Device() *EntityLocalInterface_Device_Call { + return &EntityLocalInterface_Device_Call{Call: _e.mock.On("Device")} +} + +func (_c *EntityLocalInterface_Device_Call) Run(run func()) *EntityLocalInterface_Device_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityLocalInterface_Device_Call) Return(_a0 api.DeviceLocalInterface) *EntityLocalInterface_Device_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityLocalInterface_Device_Call) RunAndReturn(run func() api.DeviceLocalInterface) *EntityLocalInterface_Device_Call { + _c.Call.Return(run) + return _c +} + +// EntityType provides a mock function with given fields: +func (_m *EntityLocalInterface) EntityType() model.EntityTypeType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for EntityType") + } + + var r0 model.EntityTypeType + if rf, ok := ret.Get(0).(func() model.EntityTypeType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.EntityTypeType) + } + + return r0 +} + +// EntityLocalInterface_EntityType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EntityType' +type EntityLocalInterface_EntityType_Call struct { + *mock.Call +} + +// EntityType is a helper method to define mock.On call +func (_e *EntityLocalInterface_Expecter) EntityType() *EntityLocalInterface_EntityType_Call { + return &EntityLocalInterface_EntityType_Call{Call: _e.mock.On("EntityType")} +} + +func (_c *EntityLocalInterface_EntityType_Call) Run(run func()) *EntityLocalInterface_EntityType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityLocalInterface_EntityType_Call) Return(_a0 model.EntityTypeType) *EntityLocalInterface_EntityType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityLocalInterface_EntityType_Call) RunAndReturn(run func() model.EntityTypeType) *EntityLocalInterface_EntityType_Call { + _c.Call.Return(run) + return _c +} + +// Feature provides a mock function with given fields: addressFeature +func (_m *EntityLocalInterface) Feature(addressFeature *model.AddressFeatureType) api.FeatureLocalInterface { + ret := _m.Called(addressFeature) + + if len(ret) == 0 { + panic("no return value specified for Feature") + } + + var r0 api.FeatureLocalInterface + if rf, ok := ret.Get(0).(func(*model.AddressFeatureType) api.FeatureLocalInterface); ok { + r0 = rf(addressFeature) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.FeatureLocalInterface) + } + } + + return r0 +} + +// EntityLocalInterface_Feature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Feature' +type EntityLocalInterface_Feature_Call struct { + *mock.Call +} + +// Feature is a helper method to define mock.On call +// - addressFeature *model.AddressFeatureType +func (_e *EntityLocalInterface_Expecter) Feature(addressFeature interface{}) *EntityLocalInterface_Feature_Call { + return &EntityLocalInterface_Feature_Call{Call: _e.mock.On("Feature", addressFeature)} +} + +func (_c *EntityLocalInterface_Feature_Call) Run(run func(addressFeature *model.AddressFeatureType)) *EntityLocalInterface_Feature_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.AddressFeatureType)) + }) + return _c +} + +func (_c *EntityLocalInterface_Feature_Call) Return(_a0 api.FeatureLocalInterface) *EntityLocalInterface_Feature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityLocalInterface_Feature_Call) RunAndReturn(run func(*model.AddressFeatureType) api.FeatureLocalInterface) *EntityLocalInterface_Feature_Call { + _c.Call.Return(run) + return _c +} + +// FeatureOfTypeAndRole provides a mock function with given fields: featureType, role +func (_m *EntityLocalInterface) FeatureOfTypeAndRole(featureType model.FeatureTypeType, role model.RoleType) api.FeatureLocalInterface { + ret := _m.Called(featureType, role) + + if len(ret) == 0 { + panic("no return value specified for FeatureOfTypeAndRole") + } + + var r0 api.FeatureLocalInterface + if rf, ok := ret.Get(0).(func(model.FeatureTypeType, model.RoleType) api.FeatureLocalInterface); ok { + r0 = rf(featureType, role) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.FeatureLocalInterface) + } + } + + return r0 +} + +// EntityLocalInterface_FeatureOfTypeAndRole_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FeatureOfTypeAndRole' +type EntityLocalInterface_FeatureOfTypeAndRole_Call struct { + *mock.Call +} + +// FeatureOfTypeAndRole is a helper method to define mock.On call +// - featureType model.FeatureTypeType +// - role model.RoleType +func (_e *EntityLocalInterface_Expecter) FeatureOfTypeAndRole(featureType interface{}, role interface{}) *EntityLocalInterface_FeatureOfTypeAndRole_Call { + return &EntityLocalInterface_FeatureOfTypeAndRole_Call{Call: _e.mock.On("FeatureOfTypeAndRole", featureType, role)} +} + +func (_c *EntityLocalInterface_FeatureOfTypeAndRole_Call) Run(run func(featureType model.FeatureTypeType, role model.RoleType)) *EntityLocalInterface_FeatureOfTypeAndRole_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FeatureTypeType), args[1].(model.RoleType)) + }) + return _c +} + +func (_c *EntityLocalInterface_FeatureOfTypeAndRole_Call) Return(_a0 api.FeatureLocalInterface) *EntityLocalInterface_FeatureOfTypeAndRole_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityLocalInterface_FeatureOfTypeAndRole_Call) RunAndReturn(run func(model.FeatureTypeType, model.RoleType) api.FeatureLocalInterface) *EntityLocalInterface_FeatureOfTypeAndRole_Call { + _c.Call.Return(run) + return _c +} + +// Features provides a mock function with given fields: +func (_m *EntityLocalInterface) Features() []api.FeatureLocalInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Features") + } + + var r0 []api.FeatureLocalInterface + if rf, ok := ret.Get(0).(func() []api.FeatureLocalInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]api.FeatureLocalInterface) + } + } + + return r0 +} + +// EntityLocalInterface_Features_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Features' +type EntityLocalInterface_Features_Call struct { + *mock.Call +} + +// Features is a helper method to define mock.On call +func (_e *EntityLocalInterface_Expecter) Features() *EntityLocalInterface_Features_Call { + return &EntityLocalInterface_Features_Call{Call: _e.mock.On("Features")} +} + +func (_c *EntityLocalInterface_Features_Call) Run(run func()) *EntityLocalInterface_Features_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityLocalInterface_Features_Call) Return(_a0 []api.FeatureLocalInterface) *EntityLocalInterface_Features_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityLocalInterface_Features_Call) RunAndReturn(run func() []api.FeatureLocalInterface) *EntityLocalInterface_Features_Call { + _c.Call.Return(run) + return _c +} + +// GetOrAddFeature provides a mock function with given fields: featureType, role +func (_m *EntityLocalInterface) GetOrAddFeature(featureType model.FeatureTypeType, role model.RoleType) api.FeatureLocalInterface { + ret := _m.Called(featureType, role) + + if len(ret) == 0 { + panic("no return value specified for GetOrAddFeature") + } + + var r0 api.FeatureLocalInterface + if rf, ok := ret.Get(0).(func(model.FeatureTypeType, model.RoleType) api.FeatureLocalInterface); ok { + r0 = rf(featureType, role) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.FeatureLocalInterface) + } + } + + return r0 +} + +// EntityLocalInterface_GetOrAddFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrAddFeature' +type EntityLocalInterface_GetOrAddFeature_Call struct { + *mock.Call +} + +// GetOrAddFeature is a helper method to define mock.On call +// - featureType model.FeatureTypeType +// - role model.RoleType +func (_e *EntityLocalInterface_Expecter) GetOrAddFeature(featureType interface{}, role interface{}) *EntityLocalInterface_GetOrAddFeature_Call { + return &EntityLocalInterface_GetOrAddFeature_Call{Call: _e.mock.On("GetOrAddFeature", featureType, role)} +} + +func (_c *EntityLocalInterface_GetOrAddFeature_Call) Run(run func(featureType model.FeatureTypeType, role model.RoleType)) *EntityLocalInterface_GetOrAddFeature_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FeatureTypeType), args[1].(model.RoleType)) + }) + return _c +} + +func (_c *EntityLocalInterface_GetOrAddFeature_Call) Return(_a0 api.FeatureLocalInterface) *EntityLocalInterface_GetOrAddFeature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityLocalInterface_GetOrAddFeature_Call) RunAndReturn(run func(model.FeatureTypeType, model.RoleType) api.FeatureLocalInterface) *EntityLocalInterface_GetOrAddFeature_Call { + _c.Call.Return(run) + return _c +} + +// Information provides a mock function with given fields: +func (_m *EntityLocalInterface) Information() *model.NodeManagementDetailedDiscoveryEntityInformationType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Information") + } + + var r0 *model.NodeManagementDetailedDiscoveryEntityInformationType + if rf, ok := ret.Get(0).(func() *model.NodeManagementDetailedDiscoveryEntityInformationType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.NodeManagementDetailedDiscoveryEntityInformationType) + } + } + + return r0 +} + +// EntityLocalInterface_Information_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Information' +type EntityLocalInterface_Information_Call struct { + *mock.Call +} + +// Information is a helper method to define mock.On call +func (_e *EntityLocalInterface_Expecter) Information() *EntityLocalInterface_Information_Call { + return &EntityLocalInterface_Information_Call{Call: _e.mock.On("Information")} +} + +func (_c *EntityLocalInterface_Information_Call) Run(run func()) *EntityLocalInterface_Information_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityLocalInterface_Information_Call) Return(_a0 *model.NodeManagementDetailedDiscoveryEntityInformationType) *EntityLocalInterface_Information_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityLocalInterface_Information_Call) RunAndReturn(run func() *model.NodeManagementDetailedDiscoveryEntityInformationType) *EntityLocalInterface_Information_Call { + _c.Call.Return(run) + return _c +} + +// NextFeatureId provides a mock function with given fields: +func (_m *EntityLocalInterface) NextFeatureId() uint { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NextFeatureId") + } + + var r0 uint + if rf, ok := ret.Get(0).(func() uint); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint) + } + + return r0 +} + +// EntityLocalInterface_NextFeatureId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NextFeatureId' +type EntityLocalInterface_NextFeatureId_Call struct { + *mock.Call +} + +// NextFeatureId is a helper method to define mock.On call +func (_e *EntityLocalInterface_Expecter) NextFeatureId() *EntityLocalInterface_NextFeatureId_Call { + return &EntityLocalInterface_NextFeatureId_Call{Call: _e.mock.On("NextFeatureId")} +} + +func (_c *EntityLocalInterface_NextFeatureId_Call) Run(run func()) *EntityLocalInterface_NextFeatureId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityLocalInterface_NextFeatureId_Call) Return(_a0 uint) *EntityLocalInterface_NextFeatureId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityLocalInterface_NextFeatureId_Call) RunAndReturn(run func() uint) *EntityLocalInterface_NextFeatureId_Call { + _c.Call.Return(run) + return _c +} + +// RemoveAllBindings provides a mock function with given fields: +func (_m *EntityLocalInterface) RemoveAllBindings() { + _m.Called() +} + +// EntityLocalInterface_RemoveAllBindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllBindings' +type EntityLocalInterface_RemoveAllBindings_Call struct { + *mock.Call +} + +// RemoveAllBindings is a helper method to define mock.On call +func (_e *EntityLocalInterface_Expecter) RemoveAllBindings() *EntityLocalInterface_RemoveAllBindings_Call { + return &EntityLocalInterface_RemoveAllBindings_Call{Call: _e.mock.On("RemoveAllBindings")} +} + +func (_c *EntityLocalInterface_RemoveAllBindings_Call) Run(run func()) *EntityLocalInterface_RemoveAllBindings_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityLocalInterface_RemoveAllBindings_Call) Return() *EntityLocalInterface_RemoveAllBindings_Call { + _c.Call.Return() + return _c +} + +func (_c *EntityLocalInterface_RemoveAllBindings_Call) RunAndReturn(run func()) *EntityLocalInterface_RemoveAllBindings_Call { + _c.Call.Return(run) + return _c +} + +// RemoveAllSubscriptions provides a mock function with given fields: +func (_m *EntityLocalInterface) RemoveAllSubscriptions() { + _m.Called() +} + +// EntityLocalInterface_RemoveAllSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllSubscriptions' +type EntityLocalInterface_RemoveAllSubscriptions_Call struct { + *mock.Call +} + +// RemoveAllSubscriptions is a helper method to define mock.On call +func (_e *EntityLocalInterface_Expecter) RemoveAllSubscriptions() *EntityLocalInterface_RemoveAllSubscriptions_Call { + return &EntityLocalInterface_RemoveAllSubscriptions_Call{Call: _e.mock.On("RemoveAllSubscriptions")} +} + +func (_c *EntityLocalInterface_RemoveAllSubscriptions_Call) Run(run func()) *EntityLocalInterface_RemoveAllSubscriptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityLocalInterface_RemoveAllSubscriptions_Call) Return() *EntityLocalInterface_RemoveAllSubscriptions_Call { + _c.Call.Return() + return _c +} + +func (_c *EntityLocalInterface_RemoveAllSubscriptions_Call) RunAndReturn(run func()) *EntityLocalInterface_RemoveAllSubscriptions_Call { + _c.Call.Return(run) + return _c +} + +// RemoveAllUseCaseSupports provides a mock function with given fields: +func (_m *EntityLocalInterface) RemoveAllUseCaseSupports() { + _m.Called() +} + +// EntityLocalInterface_RemoveAllUseCaseSupports_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllUseCaseSupports' +type EntityLocalInterface_RemoveAllUseCaseSupports_Call struct { + *mock.Call +} + +// RemoveAllUseCaseSupports is a helper method to define mock.On call +func (_e *EntityLocalInterface_Expecter) RemoveAllUseCaseSupports() *EntityLocalInterface_RemoveAllUseCaseSupports_Call { + return &EntityLocalInterface_RemoveAllUseCaseSupports_Call{Call: _e.mock.On("RemoveAllUseCaseSupports")} +} + +func (_c *EntityLocalInterface_RemoveAllUseCaseSupports_Call) Run(run func()) *EntityLocalInterface_RemoveAllUseCaseSupports_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityLocalInterface_RemoveAllUseCaseSupports_Call) Return() *EntityLocalInterface_RemoveAllUseCaseSupports_Call { + _c.Call.Return() + return _c +} + +func (_c *EntityLocalInterface_RemoveAllUseCaseSupports_Call) RunAndReturn(run func()) *EntityLocalInterface_RemoveAllUseCaseSupports_Call { + _c.Call.Return(run) + return _c +} + +// RemoveUseCaseSupport provides a mock function with given fields: actor, useCaseName +func (_m *EntityLocalInterface) RemoveUseCaseSupport(actor model.UseCaseActorType, useCaseName model.UseCaseNameType) { + _m.Called(actor, useCaseName) +} + +// EntityLocalInterface_RemoveUseCaseSupport_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCaseSupport' +type EntityLocalInterface_RemoveUseCaseSupport_Call struct { + *mock.Call +} + +// RemoveUseCaseSupport is a helper method to define mock.On call +// - actor model.UseCaseActorType +// - useCaseName model.UseCaseNameType +func (_e *EntityLocalInterface_Expecter) RemoveUseCaseSupport(actor interface{}, useCaseName interface{}) *EntityLocalInterface_RemoveUseCaseSupport_Call { + return &EntityLocalInterface_RemoveUseCaseSupport_Call{Call: _e.mock.On("RemoveUseCaseSupport", actor, useCaseName)} +} + +func (_c *EntityLocalInterface_RemoveUseCaseSupport_Call) Run(run func(actor model.UseCaseActorType, useCaseName model.UseCaseNameType)) *EntityLocalInterface_RemoveUseCaseSupport_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.UseCaseActorType), args[1].(model.UseCaseNameType)) + }) + return _c +} + +func (_c *EntityLocalInterface_RemoveUseCaseSupport_Call) Return() *EntityLocalInterface_RemoveUseCaseSupport_Call { + _c.Call.Return() + return _c +} + +func (_c *EntityLocalInterface_RemoveUseCaseSupport_Call) RunAndReturn(run func(model.UseCaseActorType, model.UseCaseNameType)) *EntityLocalInterface_RemoveUseCaseSupport_Call { + _c.Call.Return(run) + return _c +} + +// SetDescription provides a mock function with given fields: d +func (_m *EntityLocalInterface) SetDescription(d *model.DescriptionType) { + _m.Called(d) +} + +// EntityLocalInterface_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' +type EntityLocalInterface_SetDescription_Call struct { + *mock.Call +} + +// SetDescription is a helper method to define mock.On call +// - d *model.DescriptionType +func (_e *EntityLocalInterface_Expecter) SetDescription(d interface{}) *EntityLocalInterface_SetDescription_Call { + return &EntityLocalInterface_SetDescription_Call{Call: _e.mock.On("SetDescription", d)} +} + +func (_c *EntityLocalInterface_SetDescription_Call) Run(run func(d *model.DescriptionType)) *EntityLocalInterface_SetDescription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.DescriptionType)) + }) + return _c +} + +func (_c *EntityLocalInterface_SetDescription_Call) Return() *EntityLocalInterface_SetDescription_Call { + _c.Call.Return() + return _c +} + +func (_c *EntityLocalInterface_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *EntityLocalInterface_SetDescription_Call { + _c.Call.Return(run) + return _c +} + +// NewEntityLocalInterface creates a new instance of EntityLocalInterface. 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 NewEntityLocalInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *EntityLocalInterface { + mock := &EntityLocalInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/EntityRemote.go b/mocks/EntityRemote.go deleted file mode 100644 index 33cab01..0000000 --- a/mocks/EntityRemote.go +++ /dev/null @@ -1,461 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" - - model "github.com/enbility/spine-go/model" -) - -// EntityRemote is an autogenerated mock type for the EntityRemote type -type EntityRemote struct { - mock.Mock -} - -type EntityRemote_Expecter struct { - mock *mock.Mock -} - -func (_m *EntityRemote) EXPECT() *EntityRemote_Expecter { - return &EntityRemote_Expecter{mock: &_m.Mock} -} - -// AddFeature provides a mock function with given fields: f -func (_m *EntityRemote) AddFeature(f api.FeatureRemote) { - _m.Called(f) -} - -// EntityRemote_AddFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeature' -type EntityRemote_AddFeature_Call struct { - *mock.Call -} - -// AddFeature is a helper method to define mock.On call -// - f api.FeatureRemote -func (_e *EntityRemote_Expecter) AddFeature(f interface{}) *EntityRemote_AddFeature_Call { - return &EntityRemote_AddFeature_Call{Call: _e.mock.On("AddFeature", f)} -} - -func (_c *EntityRemote_AddFeature_Call) Run(run func(f api.FeatureRemote)) *EntityRemote_AddFeature_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.FeatureRemote)) - }) - return _c -} - -func (_c *EntityRemote_AddFeature_Call) Return() *EntityRemote_AddFeature_Call { - _c.Call.Return() - return _c -} - -func (_c *EntityRemote_AddFeature_Call) RunAndReturn(run func(api.FeatureRemote)) *EntityRemote_AddFeature_Call { - _c.Call.Return(run) - return _c -} - -// Address provides a mock function with given fields: -func (_m *EntityRemote) Address() *model.EntityAddressType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Address") - } - - var r0 *model.EntityAddressType - if rf, ok := ret.Get(0).(func() *model.EntityAddressType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.EntityAddressType) - } - } - - return r0 -} - -// EntityRemote_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' -type EntityRemote_Address_Call struct { - *mock.Call -} - -// Address is a helper method to define mock.On call -func (_e *EntityRemote_Expecter) Address() *EntityRemote_Address_Call { - return &EntityRemote_Address_Call{Call: _e.mock.On("Address")} -} - -func (_c *EntityRemote_Address_Call) Run(run func()) *EntityRemote_Address_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityRemote_Address_Call) Return(_a0 *model.EntityAddressType) *EntityRemote_Address_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityRemote_Address_Call) RunAndReturn(run func() *model.EntityAddressType) *EntityRemote_Address_Call { - _c.Call.Return(run) - return _c -} - -// Description provides a mock function with given fields: -func (_m *EntityRemote) Description() *model.DescriptionType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Description") - } - - var r0 *model.DescriptionType - if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.DescriptionType) - } - } - - return r0 -} - -// EntityRemote_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' -type EntityRemote_Description_Call struct { - *mock.Call -} - -// Description is a helper method to define mock.On call -func (_e *EntityRemote_Expecter) Description() *EntityRemote_Description_Call { - return &EntityRemote_Description_Call{Call: _e.mock.On("Description")} -} - -func (_c *EntityRemote_Description_Call) Run(run func()) *EntityRemote_Description_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityRemote_Description_Call) Return(_a0 *model.DescriptionType) *EntityRemote_Description_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityRemote_Description_Call) RunAndReturn(run func() *model.DescriptionType) *EntityRemote_Description_Call { - _c.Call.Return(run) - return _c -} - -// Device provides a mock function with given fields: -func (_m *EntityRemote) Device() api.DeviceRemote { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Device") - } - - var r0 api.DeviceRemote - if rf, ok := ret.Get(0).(func() api.DeviceRemote); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.DeviceRemote) - } - } - - return r0 -} - -// EntityRemote_Device_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Device' -type EntityRemote_Device_Call struct { - *mock.Call -} - -// Device is a helper method to define mock.On call -func (_e *EntityRemote_Expecter) Device() *EntityRemote_Device_Call { - return &EntityRemote_Device_Call{Call: _e.mock.On("Device")} -} - -func (_c *EntityRemote_Device_Call) Run(run func()) *EntityRemote_Device_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityRemote_Device_Call) Return(_a0 api.DeviceRemote) *EntityRemote_Device_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityRemote_Device_Call) RunAndReturn(run func() api.DeviceRemote) *EntityRemote_Device_Call { - _c.Call.Return(run) - return _c -} - -// EntityType provides a mock function with given fields: -func (_m *EntityRemote) EntityType() model.EntityTypeType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for EntityType") - } - - var r0 model.EntityTypeType - if rf, ok := ret.Get(0).(func() model.EntityTypeType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.EntityTypeType) - } - - return r0 -} - -// EntityRemote_EntityType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EntityType' -type EntityRemote_EntityType_Call struct { - *mock.Call -} - -// EntityType is a helper method to define mock.On call -func (_e *EntityRemote_Expecter) EntityType() *EntityRemote_EntityType_Call { - return &EntityRemote_EntityType_Call{Call: _e.mock.On("EntityType")} -} - -func (_c *EntityRemote_EntityType_Call) Run(run func()) *EntityRemote_EntityType_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityRemote_EntityType_Call) Return(_a0 model.EntityTypeType) *EntityRemote_EntityType_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityRemote_EntityType_Call) RunAndReturn(run func() model.EntityTypeType) *EntityRemote_EntityType_Call { - _c.Call.Return(run) - return _c -} - -// Feature provides a mock function with given fields: addressFeature -func (_m *EntityRemote) Feature(addressFeature *model.AddressFeatureType) api.FeatureRemote { - ret := _m.Called(addressFeature) - - if len(ret) == 0 { - panic("no return value specified for Feature") - } - - var r0 api.FeatureRemote - if rf, ok := ret.Get(0).(func(*model.AddressFeatureType) api.FeatureRemote); ok { - r0 = rf(addressFeature) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.FeatureRemote) - } - } - - return r0 -} - -// EntityRemote_Feature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Feature' -type EntityRemote_Feature_Call struct { - *mock.Call -} - -// Feature is a helper method to define mock.On call -// - addressFeature *model.AddressFeatureType -func (_e *EntityRemote_Expecter) Feature(addressFeature interface{}) *EntityRemote_Feature_Call { - return &EntityRemote_Feature_Call{Call: _e.mock.On("Feature", addressFeature)} -} - -func (_c *EntityRemote_Feature_Call) Run(run func(addressFeature *model.AddressFeatureType)) *EntityRemote_Feature_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.AddressFeatureType)) - }) - return _c -} - -func (_c *EntityRemote_Feature_Call) Return(_a0 api.FeatureRemote) *EntityRemote_Feature_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityRemote_Feature_Call) RunAndReturn(run func(*model.AddressFeatureType) api.FeatureRemote) *EntityRemote_Feature_Call { - _c.Call.Return(run) - return _c -} - -// Features provides a mock function with given fields: -func (_m *EntityRemote) Features() []api.FeatureRemote { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Features") - } - - var r0 []api.FeatureRemote - if rf, ok := ret.Get(0).(func() []api.FeatureRemote); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]api.FeatureRemote) - } - } - - return r0 -} - -// EntityRemote_Features_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Features' -type EntityRemote_Features_Call struct { - *mock.Call -} - -// Features is a helper method to define mock.On call -func (_e *EntityRemote_Expecter) Features() *EntityRemote_Features_Call { - return &EntityRemote_Features_Call{Call: _e.mock.On("Features")} -} - -func (_c *EntityRemote_Features_Call) Run(run func()) *EntityRemote_Features_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityRemote_Features_Call) Return(_a0 []api.FeatureRemote) *EntityRemote_Features_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityRemote_Features_Call) RunAndReturn(run func() []api.FeatureRemote) *EntityRemote_Features_Call { - _c.Call.Return(run) - return _c -} - -// NextFeatureId provides a mock function with given fields: -func (_m *EntityRemote) NextFeatureId() uint { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for NextFeatureId") - } - - var r0 uint - if rf, ok := ret.Get(0).(func() uint); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint) - } - - return r0 -} - -// EntityRemote_NextFeatureId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NextFeatureId' -type EntityRemote_NextFeatureId_Call struct { - *mock.Call -} - -// NextFeatureId is a helper method to define mock.On call -func (_e *EntityRemote_Expecter) NextFeatureId() *EntityRemote_NextFeatureId_Call { - return &EntityRemote_NextFeatureId_Call{Call: _e.mock.On("NextFeatureId")} -} - -func (_c *EntityRemote_NextFeatureId_Call) Run(run func()) *EntityRemote_NextFeatureId_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityRemote_NextFeatureId_Call) Return(_a0 uint) *EntityRemote_NextFeatureId_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *EntityRemote_NextFeatureId_Call) RunAndReturn(run func() uint) *EntityRemote_NextFeatureId_Call { - _c.Call.Return(run) - return _c -} - -// RemoveAllFeatures provides a mock function with given fields: -func (_m *EntityRemote) RemoveAllFeatures() { - _m.Called() -} - -// EntityRemote_RemoveAllFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllFeatures' -type EntityRemote_RemoveAllFeatures_Call struct { - *mock.Call -} - -// RemoveAllFeatures is a helper method to define mock.On call -func (_e *EntityRemote_Expecter) RemoveAllFeatures() *EntityRemote_RemoveAllFeatures_Call { - return &EntityRemote_RemoveAllFeatures_Call{Call: _e.mock.On("RemoveAllFeatures")} -} - -func (_c *EntityRemote_RemoveAllFeatures_Call) Run(run func()) *EntityRemote_RemoveAllFeatures_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *EntityRemote_RemoveAllFeatures_Call) Return() *EntityRemote_RemoveAllFeatures_Call { - _c.Call.Return() - return _c -} - -func (_c *EntityRemote_RemoveAllFeatures_Call) RunAndReturn(run func()) *EntityRemote_RemoveAllFeatures_Call { - _c.Call.Return(run) - return _c -} - -// SetDescription provides a mock function with given fields: d -func (_m *EntityRemote) SetDescription(d *model.DescriptionType) { - _m.Called(d) -} - -// EntityRemote_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' -type EntityRemote_SetDescription_Call struct { - *mock.Call -} - -// SetDescription is a helper method to define mock.On call -// - d *model.DescriptionType -func (_e *EntityRemote_Expecter) SetDescription(d interface{}) *EntityRemote_SetDescription_Call { - return &EntityRemote_SetDescription_Call{Call: _e.mock.On("SetDescription", d)} -} - -func (_c *EntityRemote_SetDescription_Call) Run(run func(d *model.DescriptionType)) *EntityRemote_SetDescription_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.DescriptionType)) - }) - return _c -} - -func (_c *EntityRemote_SetDescription_Call) Return() *EntityRemote_SetDescription_Call { - _c.Call.Return() - return _c -} - -func (_c *EntityRemote_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *EntityRemote_SetDescription_Call { - _c.Call.Return(run) - return _c -} - -// NewEntityRemote creates a new instance of EntityRemote. 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 NewEntityRemote(t interface { - mock.TestingT - Cleanup(func()) -}) *EntityRemote { - mock := &EntityRemote{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/EntityRemoteInterface.go b/mocks/EntityRemoteInterface.go new file mode 100644 index 0000000..13881e2 --- /dev/null +++ b/mocks/EntityRemoteInterface.go @@ -0,0 +1,461 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" + + model "github.com/enbility/spine-go/model" +) + +// EntityRemoteInterface is an autogenerated mock type for the EntityRemoteInterface type +type EntityRemoteInterface struct { + mock.Mock +} + +type EntityRemoteInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *EntityRemoteInterface) EXPECT() *EntityRemoteInterface_Expecter { + return &EntityRemoteInterface_Expecter{mock: &_m.Mock} +} + +// AddFeature provides a mock function with given fields: f +func (_m *EntityRemoteInterface) AddFeature(f api.FeatureRemoteInterface) { + _m.Called(f) +} + +// EntityRemoteInterface_AddFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeature' +type EntityRemoteInterface_AddFeature_Call struct { + *mock.Call +} + +// AddFeature is a helper method to define mock.On call +// - f api.FeatureRemoteInterface +func (_e *EntityRemoteInterface_Expecter) AddFeature(f interface{}) *EntityRemoteInterface_AddFeature_Call { + return &EntityRemoteInterface_AddFeature_Call{Call: _e.mock.On("AddFeature", f)} +} + +func (_c *EntityRemoteInterface_AddFeature_Call) Run(run func(f api.FeatureRemoteInterface)) *EntityRemoteInterface_AddFeature_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.FeatureRemoteInterface)) + }) + return _c +} + +func (_c *EntityRemoteInterface_AddFeature_Call) Return() *EntityRemoteInterface_AddFeature_Call { + _c.Call.Return() + return _c +} + +func (_c *EntityRemoteInterface_AddFeature_Call) RunAndReturn(run func(api.FeatureRemoteInterface)) *EntityRemoteInterface_AddFeature_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *EntityRemoteInterface) Address() *model.EntityAddressType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 *model.EntityAddressType + if rf, ok := ret.Get(0).(func() *model.EntityAddressType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.EntityAddressType) + } + } + + return r0 +} + +// EntityRemoteInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type EntityRemoteInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *EntityRemoteInterface_Expecter) Address() *EntityRemoteInterface_Address_Call { + return &EntityRemoteInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *EntityRemoteInterface_Address_Call) Run(run func()) *EntityRemoteInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityRemoteInterface_Address_Call) Return(_a0 *model.EntityAddressType) *EntityRemoteInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityRemoteInterface_Address_Call) RunAndReturn(run func() *model.EntityAddressType) *EntityRemoteInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// Description provides a mock function with given fields: +func (_m *EntityRemoteInterface) Description() *model.DescriptionType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 *model.DescriptionType + if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.DescriptionType) + } + } + + return r0 +} + +// EntityRemoteInterface_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type EntityRemoteInterface_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *EntityRemoteInterface_Expecter) Description() *EntityRemoteInterface_Description_Call { + return &EntityRemoteInterface_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *EntityRemoteInterface_Description_Call) Run(run func()) *EntityRemoteInterface_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityRemoteInterface_Description_Call) Return(_a0 *model.DescriptionType) *EntityRemoteInterface_Description_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityRemoteInterface_Description_Call) RunAndReturn(run func() *model.DescriptionType) *EntityRemoteInterface_Description_Call { + _c.Call.Return(run) + return _c +} + +// Device provides a mock function with given fields: +func (_m *EntityRemoteInterface) Device() api.DeviceRemoteInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Device") + } + + var r0 api.DeviceRemoteInterface + if rf, ok := ret.Get(0).(func() api.DeviceRemoteInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.DeviceRemoteInterface) + } + } + + return r0 +} + +// EntityRemoteInterface_Device_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Device' +type EntityRemoteInterface_Device_Call struct { + *mock.Call +} + +// Device is a helper method to define mock.On call +func (_e *EntityRemoteInterface_Expecter) Device() *EntityRemoteInterface_Device_Call { + return &EntityRemoteInterface_Device_Call{Call: _e.mock.On("Device")} +} + +func (_c *EntityRemoteInterface_Device_Call) Run(run func()) *EntityRemoteInterface_Device_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityRemoteInterface_Device_Call) Return(_a0 api.DeviceRemoteInterface) *EntityRemoteInterface_Device_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityRemoteInterface_Device_Call) RunAndReturn(run func() api.DeviceRemoteInterface) *EntityRemoteInterface_Device_Call { + _c.Call.Return(run) + return _c +} + +// EntityType provides a mock function with given fields: +func (_m *EntityRemoteInterface) EntityType() model.EntityTypeType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for EntityType") + } + + var r0 model.EntityTypeType + if rf, ok := ret.Get(0).(func() model.EntityTypeType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.EntityTypeType) + } + + return r0 +} + +// EntityRemoteInterface_EntityType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EntityType' +type EntityRemoteInterface_EntityType_Call struct { + *mock.Call +} + +// EntityType is a helper method to define mock.On call +func (_e *EntityRemoteInterface_Expecter) EntityType() *EntityRemoteInterface_EntityType_Call { + return &EntityRemoteInterface_EntityType_Call{Call: _e.mock.On("EntityType")} +} + +func (_c *EntityRemoteInterface_EntityType_Call) Run(run func()) *EntityRemoteInterface_EntityType_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityRemoteInterface_EntityType_Call) Return(_a0 model.EntityTypeType) *EntityRemoteInterface_EntityType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityRemoteInterface_EntityType_Call) RunAndReturn(run func() model.EntityTypeType) *EntityRemoteInterface_EntityType_Call { + _c.Call.Return(run) + return _c +} + +// Feature provides a mock function with given fields: addressFeature +func (_m *EntityRemoteInterface) Feature(addressFeature *model.AddressFeatureType) api.FeatureRemoteInterface { + ret := _m.Called(addressFeature) + + if len(ret) == 0 { + panic("no return value specified for Feature") + } + + var r0 api.FeatureRemoteInterface + if rf, ok := ret.Get(0).(func(*model.AddressFeatureType) api.FeatureRemoteInterface); ok { + r0 = rf(addressFeature) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.FeatureRemoteInterface) + } + } + + return r0 +} + +// EntityRemoteInterface_Feature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Feature' +type EntityRemoteInterface_Feature_Call struct { + *mock.Call +} + +// Feature is a helper method to define mock.On call +// - addressFeature *model.AddressFeatureType +func (_e *EntityRemoteInterface_Expecter) Feature(addressFeature interface{}) *EntityRemoteInterface_Feature_Call { + return &EntityRemoteInterface_Feature_Call{Call: _e.mock.On("Feature", addressFeature)} +} + +func (_c *EntityRemoteInterface_Feature_Call) Run(run func(addressFeature *model.AddressFeatureType)) *EntityRemoteInterface_Feature_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.AddressFeatureType)) + }) + return _c +} + +func (_c *EntityRemoteInterface_Feature_Call) Return(_a0 api.FeatureRemoteInterface) *EntityRemoteInterface_Feature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityRemoteInterface_Feature_Call) RunAndReturn(run func(*model.AddressFeatureType) api.FeatureRemoteInterface) *EntityRemoteInterface_Feature_Call { + _c.Call.Return(run) + return _c +} + +// Features provides a mock function with given fields: +func (_m *EntityRemoteInterface) Features() []api.FeatureRemoteInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Features") + } + + var r0 []api.FeatureRemoteInterface + if rf, ok := ret.Get(0).(func() []api.FeatureRemoteInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]api.FeatureRemoteInterface) + } + } + + return r0 +} + +// EntityRemoteInterface_Features_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Features' +type EntityRemoteInterface_Features_Call struct { + *mock.Call +} + +// Features is a helper method to define mock.On call +func (_e *EntityRemoteInterface_Expecter) Features() *EntityRemoteInterface_Features_Call { + return &EntityRemoteInterface_Features_Call{Call: _e.mock.On("Features")} +} + +func (_c *EntityRemoteInterface_Features_Call) Run(run func()) *EntityRemoteInterface_Features_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityRemoteInterface_Features_Call) Return(_a0 []api.FeatureRemoteInterface) *EntityRemoteInterface_Features_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityRemoteInterface_Features_Call) RunAndReturn(run func() []api.FeatureRemoteInterface) *EntityRemoteInterface_Features_Call { + _c.Call.Return(run) + return _c +} + +// NextFeatureId provides a mock function with given fields: +func (_m *EntityRemoteInterface) NextFeatureId() uint { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NextFeatureId") + } + + var r0 uint + if rf, ok := ret.Get(0).(func() uint); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint) + } + + return r0 +} + +// EntityRemoteInterface_NextFeatureId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NextFeatureId' +type EntityRemoteInterface_NextFeatureId_Call struct { + *mock.Call +} + +// NextFeatureId is a helper method to define mock.On call +func (_e *EntityRemoteInterface_Expecter) NextFeatureId() *EntityRemoteInterface_NextFeatureId_Call { + return &EntityRemoteInterface_NextFeatureId_Call{Call: _e.mock.On("NextFeatureId")} +} + +func (_c *EntityRemoteInterface_NextFeatureId_Call) Run(run func()) *EntityRemoteInterface_NextFeatureId_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityRemoteInterface_NextFeatureId_Call) Return(_a0 uint) *EntityRemoteInterface_NextFeatureId_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EntityRemoteInterface_NextFeatureId_Call) RunAndReturn(run func() uint) *EntityRemoteInterface_NextFeatureId_Call { + _c.Call.Return(run) + return _c +} + +// RemoveAllFeatures provides a mock function with given fields: +func (_m *EntityRemoteInterface) RemoveAllFeatures() { + _m.Called() +} + +// EntityRemoteInterface_RemoveAllFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllFeatures' +type EntityRemoteInterface_RemoveAllFeatures_Call struct { + *mock.Call +} + +// RemoveAllFeatures is a helper method to define mock.On call +func (_e *EntityRemoteInterface_Expecter) RemoveAllFeatures() *EntityRemoteInterface_RemoveAllFeatures_Call { + return &EntityRemoteInterface_RemoveAllFeatures_Call{Call: _e.mock.On("RemoveAllFeatures")} +} + +func (_c *EntityRemoteInterface_RemoveAllFeatures_Call) Run(run func()) *EntityRemoteInterface_RemoveAllFeatures_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EntityRemoteInterface_RemoveAllFeatures_Call) Return() *EntityRemoteInterface_RemoveAllFeatures_Call { + _c.Call.Return() + return _c +} + +func (_c *EntityRemoteInterface_RemoveAllFeatures_Call) RunAndReturn(run func()) *EntityRemoteInterface_RemoveAllFeatures_Call { + _c.Call.Return(run) + return _c +} + +// SetDescription provides a mock function with given fields: d +func (_m *EntityRemoteInterface) SetDescription(d *model.DescriptionType) { + _m.Called(d) +} + +// EntityRemoteInterface_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' +type EntityRemoteInterface_SetDescription_Call struct { + *mock.Call +} + +// SetDescription is a helper method to define mock.On call +// - d *model.DescriptionType +func (_e *EntityRemoteInterface_Expecter) SetDescription(d interface{}) *EntityRemoteInterface_SetDescription_Call { + return &EntityRemoteInterface_SetDescription_Call{Call: _e.mock.On("SetDescription", d)} +} + +func (_c *EntityRemoteInterface_SetDescription_Call) Run(run func(d *model.DescriptionType)) *EntityRemoteInterface_SetDescription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.DescriptionType)) + }) + return _c +} + +func (_c *EntityRemoteInterface_SetDescription_Call) Return() *EntityRemoteInterface_SetDescription_Call { + _c.Call.Return() + return _c +} + +func (_c *EntityRemoteInterface_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *EntityRemoteInterface_SetDescription_Call { + _c.Call.Return(run) + return _c +} + +// NewEntityRemoteInterface creates a new instance of EntityRemoteInterface. 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 NewEntityRemoteInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *EntityRemoteInterface { + mock := &EntityRemoteInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/EventHandler.go b/mocks/EventHandler.go deleted file mode 100644 index 777e78c..0000000 --- a/mocks/EventHandler.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" -) - -// EventHandler is an autogenerated mock type for the EventHandler type -type EventHandler struct { - mock.Mock -} - -type EventHandler_Expecter struct { - mock *mock.Mock -} - -func (_m *EventHandler) EXPECT() *EventHandler_Expecter { - return &EventHandler_Expecter{mock: &_m.Mock} -} - -// HandleEvent provides a mock function with given fields: _a0 -func (_m *EventHandler) HandleEvent(_a0 api.EventPayload) { - _m.Called(_a0) -} - -// EventHandler_HandleEvent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleEvent' -type EventHandler_HandleEvent_Call struct { - *mock.Call -} - -// HandleEvent is a helper method to define mock.On call -// - _a0 api.EventPayload -func (_e *EventHandler_Expecter) HandleEvent(_a0 interface{}) *EventHandler_HandleEvent_Call { - return &EventHandler_HandleEvent_Call{Call: _e.mock.On("HandleEvent", _a0)} -} - -func (_c *EventHandler_HandleEvent_Call) Run(run func(_a0 api.EventPayload)) *EventHandler_HandleEvent_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.EventPayload)) - }) - return _c -} - -func (_c *EventHandler_HandleEvent_Call) Return() *EventHandler_HandleEvent_Call { - _c.Call.Return() - return _c -} - -func (_c *EventHandler_HandleEvent_Call) RunAndReturn(run func(api.EventPayload)) *EventHandler_HandleEvent_Call { - _c.Call.Return(run) - return _c -} - -// NewEventHandler creates a new instance of EventHandler. 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 NewEventHandler(t interface { - mock.TestingT - Cleanup(func()) -}) *EventHandler { - mock := &EventHandler{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/EventHandlerInterface.go b/mocks/EventHandlerInterface.go new file mode 100644 index 0000000..701f404 --- /dev/null +++ b/mocks/EventHandlerInterface.go @@ -0,0 +1,68 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" +) + +// EventHandlerInterface is an autogenerated mock type for the EventHandlerInterface type +type EventHandlerInterface struct { + mock.Mock +} + +type EventHandlerInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *EventHandlerInterface) EXPECT() *EventHandlerInterface_Expecter { + return &EventHandlerInterface_Expecter{mock: &_m.Mock} +} + +// HandleEvent provides a mock function with given fields: _a0 +func (_m *EventHandlerInterface) HandleEvent(_a0 api.EventPayload) { + _m.Called(_a0) +} + +// EventHandlerInterface_HandleEvent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleEvent' +type EventHandlerInterface_HandleEvent_Call struct { + *mock.Call +} + +// HandleEvent is a helper method to define mock.On call +// - _a0 api.EventPayload +func (_e *EventHandlerInterface_Expecter) HandleEvent(_a0 interface{}) *EventHandlerInterface_HandleEvent_Call { + return &EventHandlerInterface_HandleEvent_Call{Call: _e.mock.On("HandleEvent", _a0)} +} + +func (_c *EventHandlerInterface_HandleEvent_Call) Run(run func(_a0 api.EventPayload)) *EventHandlerInterface_HandleEvent_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.EventPayload)) + }) + return _c +} + +func (_c *EventHandlerInterface_HandleEvent_Call) Return() *EventHandlerInterface_HandleEvent_Call { + _c.Call.Return() + return _c +} + +func (_c *EventHandlerInterface_HandleEvent_Call) RunAndReturn(run func(api.EventPayload)) *EventHandlerInterface_HandleEvent_Call { + _c.Call.Return(run) + return _c +} + +// NewEventHandlerInterface creates a new instance of EventHandlerInterface. 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 NewEventHandlerInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *EventHandlerInterface { + mock := &EventHandlerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/Feature.go b/mocks/Feature.go deleted file mode 100644 index 7c2b360..0000000 --- a/mocks/Feature.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" - - model "github.com/enbility/spine-go/model" -) - -// Feature is an autogenerated mock type for the Feature type -type Feature struct { - mock.Mock -} - -type Feature_Expecter struct { - mock *mock.Mock -} - -func (_m *Feature) EXPECT() *Feature_Expecter { - return &Feature_Expecter{mock: &_m.Mock} -} - -// Address provides a mock function with given fields: -func (_m *Feature) Address() *model.FeatureAddressType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Address") - } - - var r0 *model.FeatureAddressType - if rf, ok := ret.Get(0).(func() *model.FeatureAddressType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.FeatureAddressType) - } - } - - return r0 -} - -// Feature_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' -type Feature_Address_Call struct { - *mock.Call -} - -// Address is a helper method to define mock.On call -func (_e *Feature_Expecter) Address() *Feature_Address_Call { - return &Feature_Address_Call{Call: _e.mock.On("Address")} -} - -func (_c *Feature_Address_Call) Run(run func()) *Feature_Address_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Feature_Address_Call) Return(_a0 *model.FeatureAddressType) *Feature_Address_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Feature_Address_Call) RunAndReturn(run func() *model.FeatureAddressType) *Feature_Address_Call { - _c.Call.Return(run) - return _c -} - -// Description provides a mock function with given fields: -func (_m *Feature) Description() *model.DescriptionType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Description") - } - - var r0 *model.DescriptionType - if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.DescriptionType) - } - } - - return r0 -} - -// Feature_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' -type Feature_Description_Call struct { - *mock.Call -} - -// Description is a helper method to define mock.On call -func (_e *Feature_Expecter) Description() *Feature_Description_Call { - return &Feature_Description_Call{Call: _e.mock.On("Description")} -} - -func (_c *Feature_Description_Call) Run(run func()) *Feature_Description_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Feature_Description_Call) Return(_a0 *model.DescriptionType) *Feature_Description_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Feature_Description_Call) RunAndReturn(run func() *model.DescriptionType) *Feature_Description_Call { - _c.Call.Return(run) - return _c -} - -// Operations provides a mock function with given fields: -func (_m *Feature) Operations() map[model.FunctionType]api.Operations { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Operations") - } - - var r0 map[model.FunctionType]api.Operations - if rf, ok := ret.Get(0).(func() map[model.FunctionType]api.Operations); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[model.FunctionType]api.Operations) - } - } - - return r0 -} - -// Feature_Operations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Operations' -type Feature_Operations_Call struct { - *mock.Call -} - -// Operations is a helper method to define mock.On call -func (_e *Feature_Expecter) Operations() *Feature_Operations_Call { - return &Feature_Operations_Call{Call: _e.mock.On("Operations")} -} - -func (_c *Feature_Operations_Call) Run(run func()) *Feature_Operations_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Feature_Operations_Call) Return(_a0 map[model.FunctionType]api.Operations) *Feature_Operations_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Feature_Operations_Call) RunAndReturn(run func() map[model.FunctionType]api.Operations) *Feature_Operations_Call { - _c.Call.Return(run) - return _c -} - -// Role provides a mock function with given fields: -func (_m *Feature) Role() model.RoleType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Role") - } - - var r0 model.RoleType - if rf, ok := ret.Get(0).(func() model.RoleType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.RoleType) - } - - return r0 -} - -// Feature_Role_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Role' -type Feature_Role_Call struct { - *mock.Call -} - -// Role is a helper method to define mock.On call -func (_e *Feature_Expecter) Role() *Feature_Role_Call { - return &Feature_Role_Call{Call: _e.mock.On("Role")} -} - -func (_c *Feature_Role_Call) Run(run func()) *Feature_Role_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Feature_Role_Call) Return(_a0 model.RoleType) *Feature_Role_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Feature_Role_Call) RunAndReturn(run func() model.RoleType) *Feature_Role_Call { - _c.Call.Return(run) - return _c -} - -// SetDescription provides a mock function with given fields: desc -func (_m *Feature) SetDescription(desc *model.DescriptionType) { - _m.Called(desc) -} - -// Feature_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' -type Feature_SetDescription_Call struct { - *mock.Call -} - -// SetDescription is a helper method to define mock.On call -// - desc *model.DescriptionType -func (_e *Feature_Expecter) SetDescription(desc interface{}) *Feature_SetDescription_Call { - return &Feature_SetDescription_Call{Call: _e.mock.On("SetDescription", desc)} -} - -func (_c *Feature_SetDescription_Call) Run(run func(desc *model.DescriptionType)) *Feature_SetDescription_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.DescriptionType)) - }) - return _c -} - -func (_c *Feature_SetDescription_Call) Return() *Feature_SetDescription_Call { - _c.Call.Return() - return _c -} - -func (_c *Feature_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *Feature_SetDescription_Call { - _c.Call.Return(run) - return _c -} - -// SetDescriptionString provides a mock function with given fields: s -func (_m *Feature) SetDescriptionString(s string) { - _m.Called(s) -} - -// Feature_SetDescriptionString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescriptionString' -type Feature_SetDescriptionString_Call struct { - *mock.Call -} - -// SetDescriptionString is a helper method to define mock.On call -// - s string -func (_e *Feature_Expecter) SetDescriptionString(s interface{}) *Feature_SetDescriptionString_Call { - return &Feature_SetDescriptionString_Call{Call: _e.mock.On("SetDescriptionString", s)} -} - -func (_c *Feature_SetDescriptionString_Call) Run(run func(s string)) *Feature_SetDescriptionString_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *Feature_SetDescriptionString_Call) Return() *Feature_SetDescriptionString_Call { - _c.Call.Return() - return _c -} - -func (_c *Feature_SetDescriptionString_Call) RunAndReturn(run func(string)) *Feature_SetDescriptionString_Call { - _c.Call.Return(run) - return _c -} - -// String provides a mock function with given fields: -func (_m *Feature) String() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for String") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// Feature_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' -type Feature_String_Call struct { - *mock.Call -} - -// String is a helper method to define mock.On call -func (_e *Feature_Expecter) String() *Feature_String_Call { - return &Feature_String_Call{Call: _e.mock.On("String")} -} - -func (_c *Feature_String_Call) Run(run func()) *Feature_String_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Feature_String_Call) Return(_a0 string) *Feature_String_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Feature_String_Call) RunAndReturn(run func() string) *Feature_String_Call { - _c.Call.Return(run) - return _c -} - -// Type provides a mock function with given fields: -func (_m *Feature) Type() model.FeatureTypeType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Type") - } - - var r0 model.FeatureTypeType - if rf, ok := ret.Get(0).(func() model.FeatureTypeType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.FeatureTypeType) - } - - return r0 -} - -// Feature_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' -type Feature_Type_Call struct { - *mock.Call -} - -// Type is a helper method to define mock.On call -func (_e *Feature_Expecter) Type() *Feature_Type_Call { - return &Feature_Type_Call{Call: _e.mock.On("Type")} -} - -func (_c *Feature_Type_Call) Run(run func()) *Feature_Type_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Feature_Type_Call) Return(_a0 model.FeatureTypeType) *Feature_Type_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Feature_Type_Call) RunAndReturn(run func() model.FeatureTypeType) *Feature_Type_Call { - _c.Call.Return(run) - return _c -} - -// NewFeature creates a new instance of Feature. 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 NewFeature(t interface { - mock.TestingT - Cleanup(func()) -}) *Feature { - mock := &Feature{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/FeatureInterface.go b/mocks/FeatureInterface.go new file mode 100644 index 0000000..a90cab8 --- /dev/null +++ b/mocks/FeatureInterface.go @@ -0,0 +1,379 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" + + model "github.com/enbility/spine-go/model" +) + +// FeatureInterface is an autogenerated mock type for the FeatureInterface type +type FeatureInterface struct { + mock.Mock +} + +type FeatureInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *FeatureInterface) EXPECT() *FeatureInterface_Expecter { + return &FeatureInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *FeatureInterface) Address() *model.FeatureAddressType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 *model.FeatureAddressType + if rf, ok := ret.Get(0).(func() *model.FeatureAddressType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.FeatureAddressType) + } + } + + return r0 +} + +// FeatureInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type FeatureInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *FeatureInterface_Expecter) Address() *FeatureInterface_Address_Call { + return &FeatureInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *FeatureInterface_Address_Call) Run(run func()) *FeatureInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureInterface_Address_Call) Return(_a0 *model.FeatureAddressType) *FeatureInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureInterface_Address_Call) RunAndReturn(run func() *model.FeatureAddressType) *FeatureInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// Description provides a mock function with given fields: +func (_m *FeatureInterface) Description() *model.DescriptionType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 *model.DescriptionType + if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.DescriptionType) + } + } + + return r0 +} + +// FeatureInterface_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type FeatureInterface_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *FeatureInterface_Expecter) Description() *FeatureInterface_Description_Call { + return &FeatureInterface_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *FeatureInterface_Description_Call) Run(run func()) *FeatureInterface_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureInterface_Description_Call) Return(_a0 *model.DescriptionType) *FeatureInterface_Description_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureInterface_Description_Call) RunAndReturn(run func() *model.DescriptionType) *FeatureInterface_Description_Call { + _c.Call.Return(run) + return _c +} + +// Operations provides a mock function with given fields: +func (_m *FeatureInterface) Operations() map[model.FunctionType]api.OperationsInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Operations") + } + + var r0 map[model.FunctionType]api.OperationsInterface + if rf, ok := ret.Get(0).(func() map[model.FunctionType]api.OperationsInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[model.FunctionType]api.OperationsInterface) + } + } + + return r0 +} + +// FeatureInterface_Operations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Operations' +type FeatureInterface_Operations_Call struct { + *mock.Call +} + +// Operations is a helper method to define mock.On call +func (_e *FeatureInterface_Expecter) Operations() *FeatureInterface_Operations_Call { + return &FeatureInterface_Operations_Call{Call: _e.mock.On("Operations")} +} + +func (_c *FeatureInterface_Operations_Call) Run(run func()) *FeatureInterface_Operations_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureInterface_Operations_Call) Return(_a0 map[model.FunctionType]api.OperationsInterface) *FeatureInterface_Operations_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureInterface_Operations_Call) RunAndReturn(run func() map[model.FunctionType]api.OperationsInterface) *FeatureInterface_Operations_Call { + _c.Call.Return(run) + return _c +} + +// Role provides a mock function with given fields: +func (_m *FeatureInterface) Role() model.RoleType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Role") + } + + var r0 model.RoleType + if rf, ok := ret.Get(0).(func() model.RoleType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.RoleType) + } + + return r0 +} + +// FeatureInterface_Role_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Role' +type FeatureInterface_Role_Call struct { + *mock.Call +} + +// Role is a helper method to define mock.On call +func (_e *FeatureInterface_Expecter) Role() *FeatureInterface_Role_Call { + return &FeatureInterface_Role_Call{Call: _e.mock.On("Role")} +} + +func (_c *FeatureInterface_Role_Call) Run(run func()) *FeatureInterface_Role_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureInterface_Role_Call) Return(_a0 model.RoleType) *FeatureInterface_Role_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureInterface_Role_Call) RunAndReturn(run func() model.RoleType) *FeatureInterface_Role_Call { + _c.Call.Return(run) + return _c +} + +// SetDescription provides a mock function with given fields: desc +func (_m *FeatureInterface) SetDescription(desc *model.DescriptionType) { + _m.Called(desc) +} + +// FeatureInterface_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' +type FeatureInterface_SetDescription_Call struct { + *mock.Call +} + +// SetDescription is a helper method to define mock.On call +// - desc *model.DescriptionType +func (_e *FeatureInterface_Expecter) SetDescription(desc interface{}) *FeatureInterface_SetDescription_Call { + return &FeatureInterface_SetDescription_Call{Call: _e.mock.On("SetDescription", desc)} +} + +func (_c *FeatureInterface_SetDescription_Call) Run(run func(desc *model.DescriptionType)) *FeatureInterface_SetDescription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.DescriptionType)) + }) + return _c +} + +func (_c *FeatureInterface_SetDescription_Call) Return() *FeatureInterface_SetDescription_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureInterface_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *FeatureInterface_SetDescription_Call { + _c.Call.Return(run) + return _c +} + +// SetDescriptionString provides a mock function with given fields: s +func (_m *FeatureInterface) SetDescriptionString(s string) { + _m.Called(s) +} + +// FeatureInterface_SetDescriptionString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescriptionString' +type FeatureInterface_SetDescriptionString_Call struct { + *mock.Call +} + +// SetDescriptionString is a helper method to define mock.On call +// - s string +func (_e *FeatureInterface_Expecter) SetDescriptionString(s interface{}) *FeatureInterface_SetDescriptionString_Call { + return &FeatureInterface_SetDescriptionString_Call{Call: _e.mock.On("SetDescriptionString", s)} +} + +func (_c *FeatureInterface_SetDescriptionString_Call) Run(run func(s string)) *FeatureInterface_SetDescriptionString_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *FeatureInterface_SetDescriptionString_Call) Return() *FeatureInterface_SetDescriptionString_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureInterface_SetDescriptionString_Call) RunAndReturn(run func(string)) *FeatureInterface_SetDescriptionString_Call { + _c.Call.Return(run) + return _c +} + +// String provides a mock function with given fields: +func (_m *FeatureInterface) String() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for String") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// FeatureInterface_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type FeatureInterface_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *FeatureInterface_Expecter) String() *FeatureInterface_String_Call { + return &FeatureInterface_String_Call{Call: _e.mock.On("String")} +} + +func (_c *FeatureInterface_String_Call) Run(run func()) *FeatureInterface_String_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureInterface_String_Call) Return(_a0 string) *FeatureInterface_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureInterface_String_Call) RunAndReturn(run func() string) *FeatureInterface_String_Call { + _c.Call.Return(run) + return _c +} + +// Type provides a mock function with given fields: +func (_m *FeatureInterface) Type() model.FeatureTypeType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Type") + } + + var r0 model.FeatureTypeType + if rf, ok := ret.Get(0).(func() model.FeatureTypeType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.FeatureTypeType) + } + + return r0 +} + +// FeatureInterface_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' +type FeatureInterface_Type_Call struct { + *mock.Call +} + +// Type is a helper method to define mock.On call +func (_e *FeatureInterface_Expecter) Type() *FeatureInterface_Type_Call { + return &FeatureInterface_Type_Call{Call: _e.mock.On("Type")} +} + +func (_c *FeatureInterface_Type_Call) Run(run func()) *FeatureInterface_Type_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureInterface_Type_Call) Return(_a0 model.FeatureTypeType) *FeatureInterface_Type_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureInterface_Type_Call) RunAndReturn(run func() model.FeatureTypeType) *FeatureInterface_Type_Call { + _c.Call.Return(run) + return _c +} + +// NewFeatureInterface creates a new instance of FeatureInterface. 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 NewFeatureInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *FeatureInterface { + mock := &FeatureInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/FeatureLocal.go b/mocks/FeatureLocal.go deleted file mode 100644 index 661307b..0000000 --- a/mocks/FeatureLocal.go +++ /dev/null @@ -1,1321 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" - - model "github.com/enbility/spine-go/model" - - time "time" -) - -// FeatureLocal is an autogenerated mock type for the FeatureLocal type -type FeatureLocal struct { - mock.Mock -} - -type FeatureLocal_Expecter struct { - mock *mock.Mock -} - -func (_m *FeatureLocal) EXPECT() *FeatureLocal_Expecter { - return &FeatureLocal_Expecter{mock: &_m.Mock} -} - -// AddFunctionType provides a mock function with given fields: function, read, write -func (_m *FeatureLocal) AddFunctionType(function model.FunctionType, read bool, write bool) { - _m.Called(function, read, write) -} - -// FeatureLocal_AddFunctionType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFunctionType' -type FeatureLocal_AddFunctionType_Call struct { - *mock.Call -} - -// AddFunctionType is a helper method to define mock.On call -// - function model.FunctionType -// - read bool -// - write bool -func (_e *FeatureLocal_Expecter) AddFunctionType(function interface{}, read interface{}, write interface{}) *FeatureLocal_AddFunctionType_Call { - return &FeatureLocal_AddFunctionType_Call{Call: _e.mock.On("AddFunctionType", function, read, write)} -} - -func (_c *FeatureLocal_AddFunctionType_Call) Run(run func(function model.FunctionType, read bool, write bool)) *FeatureLocal_AddFunctionType_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(bool), args[2].(bool)) - }) - return _c -} - -func (_c *FeatureLocal_AddFunctionType_Call) Return() *FeatureLocal_AddFunctionType_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureLocal_AddFunctionType_Call) RunAndReturn(run func(model.FunctionType, bool, bool)) *FeatureLocal_AddFunctionType_Call { - _c.Call.Return(run) - return _c -} - -// AddResultCallback provides a mock function with given fields: msgCounterReference, function -func (_m *FeatureLocal) AddResultCallback(msgCounterReference model.MsgCounterType, function func(api.ResultMessage)) { - _m.Called(msgCounterReference, function) -} - -// FeatureLocal_AddResultCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddResultCallback' -type FeatureLocal_AddResultCallback_Call struct { - *mock.Call -} - -// AddResultCallback is a helper method to define mock.On call -// - msgCounterReference model.MsgCounterType -// - function func(api.ResultMessage) -func (_e *FeatureLocal_Expecter) AddResultCallback(msgCounterReference interface{}, function interface{}) *FeatureLocal_AddResultCallback_Call { - return &FeatureLocal_AddResultCallback_Call{Call: _e.mock.On("AddResultCallback", msgCounterReference, function)} -} - -func (_c *FeatureLocal_AddResultCallback_Call) Run(run func(msgCounterReference model.MsgCounterType, function func(api.ResultMessage))) *FeatureLocal_AddResultCallback_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.MsgCounterType), args[1].(func(api.ResultMessage))) - }) - return _c -} - -func (_c *FeatureLocal_AddResultCallback_Call) Return() *FeatureLocal_AddResultCallback_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureLocal_AddResultCallback_Call) RunAndReturn(run func(model.MsgCounterType, func(api.ResultMessage))) *FeatureLocal_AddResultCallback_Call { - _c.Call.Return(run) - return _c -} - -// AddResultHandler provides a mock function with given fields: handler -func (_m *FeatureLocal) AddResultHandler(handler api.FeatureResult) { - _m.Called(handler) -} - -// FeatureLocal_AddResultHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddResultHandler' -type FeatureLocal_AddResultHandler_Call struct { - *mock.Call -} - -// AddResultHandler is a helper method to define mock.On call -// - handler api.FeatureResult -func (_e *FeatureLocal_Expecter) AddResultHandler(handler interface{}) *FeatureLocal_AddResultHandler_Call { - return &FeatureLocal_AddResultHandler_Call{Call: _e.mock.On("AddResultHandler", handler)} -} - -func (_c *FeatureLocal_AddResultHandler_Call) Run(run func(handler api.FeatureResult)) *FeatureLocal_AddResultHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.FeatureResult)) - }) - return _c -} - -func (_c *FeatureLocal_AddResultHandler_Call) Return() *FeatureLocal_AddResultHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureLocal_AddResultHandler_Call) RunAndReturn(run func(api.FeatureResult)) *FeatureLocal_AddResultHandler_Call { - _c.Call.Return(run) - return _c -} - -// Address provides a mock function with given fields: -func (_m *FeatureLocal) Address() *model.FeatureAddressType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Address") - } - - var r0 *model.FeatureAddressType - if rf, ok := ret.Get(0).(func() *model.FeatureAddressType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.FeatureAddressType) - } - } - - return r0 -} - -// FeatureLocal_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' -type FeatureLocal_Address_Call struct { - *mock.Call -} - -// Address is a helper method to define mock.On call -func (_e *FeatureLocal_Expecter) Address() *FeatureLocal_Address_Call { - return &FeatureLocal_Address_Call{Call: _e.mock.On("Address")} -} - -func (_c *FeatureLocal_Address_Call) Run(run func()) *FeatureLocal_Address_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureLocal_Address_Call) Return(_a0 *model.FeatureAddressType) *FeatureLocal_Address_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureLocal_Address_Call) RunAndReturn(run func() *model.FeatureAddressType) *FeatureLocal_Address_Call { - _c.Call.Return(run) - return _c -} - -// Bind provides a mock function with given fields: remoteAdress -func (_m *FeatureLocal) Bind(remoteAdress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(remoteAdress) - - if len(ret) == 0 { - panic("no return value specified for Bind") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(remoteAdress) - } - if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) *model.MsgCounterType); ok { - r0 = rf(remoteAdress) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(*model.FeatureAddressType) *model.ErrorType); ok { - r1 = rf(remoteAdress) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// FeatureLocal_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' -type FeatureLocal_Bind_Call struct { - *mock.Call -} - -// Bind is a helper method to define mock.On call -// - remoteAdress *model.FeatureAddressType -func (_e *FeatureLocal_Expecter) Bind(remoteAdress interface{}) *FeatureLocal_Bind_Call { - return &FeatureLocal_Bind_Call{Call: _e.mock.On("Bind", remoteAdress)} -} - -func (_c *FeatureLocal_Bind_Call) Run(run func(remoteAdress *model.FeatureAddressType)) *FeatureLocal_Bind_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.FeatureAddressType)) - }) - return _c -} - -func (_c *FeatureLocal_Bind_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocal_Bind_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *FeatureLocal_Bind_Call) RunAndReturn(run func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocal_Bind_Call { - _c.Call.Return(run) - return _c -} - -// DataCopy provides a mock function with given fields: function -func (_m *FeatureLocal) DataCopy(function model.FunctionType) interface{} { - ret := _m.Called(function) - - if len(ret) == 0 { - panic("no return value specified for DataCopy") - } - - var r0 interface{} - if rf, ok := ret.Get(0).(func(model.FunctionType) interface{}); ok { - r0 = rf(function) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - return r0 -} - -// FeatureLocal_DataCopy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataCopy' -type FeatureLocal_DataCopy_Call struct { - *mock.Call -} - -// DataCopy is a helper method to define mock.On call -// - function model.FunctionType -func (_e *FeatureLocal_Expecter) DataCopy(function interface{}) *FeatureLocal_DataCopy_Call { - return &FeatureLocal_DataCopy_Call{Call: _e.mock.On("DataCopy", function)} -} - -func (_c *FeatureLocal_DataCopy_Call) Run(run func(function model.FunctionType)) *FeatureLocal_DataCopy_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType)) - }) - return _c -} - -func (_c *FeatureLocal_DataCopy_Call) Return(_a0 interface{}) *FeatureLocal_DataCopy_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureLocal_DataCopy_Call) RunAndReturn(run func(model.FunctionType) interface{}) *FeatureLocal_DataCopy_Call { - _c.Call.Return(run) - return _c -} - -// Description provides a mock function with given fields: -func (_m *FeatureLocal) Description() *model.DescriptionType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Description") - } - - var r0 *model.DescriptionType - if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.DescriptionType) - } - } - - return r0 -} - -// FeatureLocal_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' -type FeatureLocal_Description_Call struct { - *mock.Call -} - -// Description is a helper method to define mock.On call -func (_e *FeatureLocal_Expecter) Description() *FeatureLocal_Description_Call { - return &FeatureLocal_Description_Call{Call: _e.mock.On("Description")} -} - -func (_c *FeatureLocal_Description_Call) Run(run func()) *FeatureLocal_Description_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureLocal_Description_Call) Return(_a0 *model.DescriptionType) *FeatureLocal_Description_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureLocal_Description_Call) RunAndReturn(run func() *model.DescriptionType) *FeatureLocal_Description_Call { - _c.Call.Return(run) - return _c -} - -// Device provides a mock function with given fields: -func (_m *FeatureLocal) Device() api.DeviceLocal { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Device") - } - - var r0 api.DeviceLocal - if rf, ok := ret.Get(0).(func() api.DeviceLocal); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.DeviceLocal) - } - } - - return r0 -} - -// FeatureLocal_Device_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Device' -type FeatureLocal_Device_Call struct { - *mock.Call -} - -// Device is a helper method to define mock.On call -func (_e *FeatureLocal_Expecter) Device() *FeatureLocal_Device_Call { - return &FeatureLocal_Device_Call{Call: _e.mock.On("Device")} -} - -func (_c *FeatureLocal_Device_Call) Run(run func()) *FeatureLocal_Device_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureLocal_Device_Call) Return(_a0 api.DeviceLocal) *FeatureLocal_Device_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureLocal_Device_Call) RunAndReturn(run func() api.DeviceLocal) *FeatureLocal_Device_Call { - _c.Call.Return(run) - return _c -} - -// Entity provides a mock function with given fields: -func (_m *FeatureLocal) Entity() api.EntityLocal { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Entity") - } - - var r0 api.EntityLocal - if rf, ok := ret.Get(0).(func() api.EntityLocal); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.EntityLocal) - } - } - - return r0 -} - -// FeatureLocal_Entity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entity' -type FeatureLocal_Entity_Call struct { - *mock.Call -} - -// Entity is a helper method to define mock.On call -func (_e *FeatureLocal_Expecter) Entity() *FeatureLocal_Entity_Call { - return &FeatureLocal_Entity_Call{Call: _e.mock.On("Entity")} -} - -func (_c *FeatureLocal_Entity_Call) Run(run func()) *FeatureLocal_Entity_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureLocal_Entity_Call) Return(_a0 api.EntityLocal) *FeatureLocal_Entity_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureLocal_Entity_Call) RunAndReturn(run func() api.EntityLocal) *FeatureLocal_Entity_Call { - _c.Call.Return(run) - return _c -} - -// FetchRequestData provides a mock function with given fields: msgCounter, destination -func (_m *FeatureLocal) FetchRequestData(msgCounter model.MsgCounterType, destination api.FeatureRemote) (interface{}, *model.ErrorType) { - ret := _m.Called(msgCounter, destination) - - if len(ret) == 0 { - panic("no return value specified for FetchRequestData") - } - - var r0 interface{} - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.MsgCounterType, api.FeatureRemote) (interface{}, *model.ErrorType)); ok { - return rf(msgCounter, destination) - } - if rf, ok := ret.Get(0).(func(model.MsgCounterType, api.FeatureRemote) interface{}); ok { - r0 = rf(msgCounter, destination) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - if rf, ok := ret.Get(1).(func(model.MsgCounterType, api.FeatureRemote) *model.ErrorType); ok { - r1 = rf(msgCounter, destination) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// FeatureLocal_FetchRequestData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchRequestData' -type FeatureLocal_FetchRequestData_Call struct { - *mock.Call -} - -// FetchRequestData is a helper method to define mock.On call -// - msgCounter model.MsgCounterType -// - destination api.FeatureRemote -func (_e *FeatureLocal_Expecter) FetchRequestData(msgCounter interface{}, destination interface{}) *FeatureLocal_FetchRequestData_Call { - return &FeatureLocal_FetchRequestData_Call{Call: _e.mock.On("FetchRequestData", msgCounter, destination)} -} - -func (_c *FeatureLocal_FetchRequestData_Call) Run(run func(msgCounter model.MsgCounterType, destination api.FeatureRemote)) *FeatureLocal_FetchRequestData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.MsgCounterType), args[1].(api.FeatureRemote)) - }) - return _c -} - -func (_c *FeatureLocal_FetchRequestData_Call) Return(_a0 interface{}, _a1 *model.ErrorType) *FeatureLocal_FetchRequestData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *FeatureLocal_FetchRequestData_Call) RunAndReturn(run func(model.MsgCounterType, api.FeatureRemote) (interface{}, *model.ErrorType)) *FeatureLocal_FetchRequestData_Call { - _c.Call.Return(run) - return _c -} - -// HandleMessage provides a mock function with given fields: message -func (_m *FeatureLocal) HandleMessage(message *api.Message) *model.ErrorType { - ret := _m.Called(message) - - if len(ret) == 0 { - panic("no return value specified for HandleMessage") - } - - var r0 *model.ErrorType - if rf, ok := ret.Get(0).(func(*api.Message) *model.ErrorType); ok { - r0 = rf(message) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.ErrorType) - } - } - - return r0 -} - -// FeatureLocal_HandleMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleMessage' -type FeatureLocal_HandleMessage_Call struct { - *mock.Call -} - -// HandleMessage is a helper method to define mock.On call -// - message *api.Message -func (_e *FeatureLocal_Expecter) HandleMessage(message interface{}) *FeatureLocal_HandleMessage_Call { - return &FeatureLocal_HandleMessage_Call{Call: _e.mock.On("HandleMessage", message)} -} - -func (_c *FeatureLocal_HandleMessage_Call) Run(run func(message *api.Message)) *FeatureLocal_HandleMessage_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*api.Message)) - }) - return _c -} - -func (_c *FeatureLocal_HandleMessage_Call) Return(_a0 *model.ErrorType) *FeatureLocal_HandleMessage_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureLocal_HandleMessage_Call) RunAndReturn(run func(*api.Message) *model.ErrorType) *FeatureLocal_HandleMessage_Call { - _c.Call.Return(run) - return _c -} - -// Information provides a mock function with given fields: -func (_m *FeatureLocal) Information() *model.NodeManagementDetailedDiscoveryFeatureInformationType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Information") - } - - var r0 *model.NodeManagementDetailedDiscoveryFeatureInformationType - if rf, ok := ret.Get(0).(func() *model.NodeManagementDetailedDiscoveryFeatureInformationType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.NodeManagementDetailedDiscoveryFeatureInformationType) - } - } - - return r0 -} - -// FeatureLocal_Information_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Information' -type FeatureLocal_Information_Call struct { - *mock.Call -} - -// Information is a helper method to define mock.On call -func (_e *FeatureLocal_Expecter) Information() *FeatureLocal_Information_Call { - return &FeatureLocal_Information_Call{Call: _e.mock.On("Information")} -} - -func (_c *FeatureLocal_Information_Call) Run(run func()) *FeatureLocal_Information_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureLocal_Information_Call) Return(_a0 *model.NodeManagementDetailedDiscoveryFeatureInformationType) *FeatureLocal_Information_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureLocal_Information_Call) RunAndReturn(run func() *model.NodeManagementDetailedDiscoveryFeatureInformationType) *FeatureLocal_Information_Call { - _c.Call.Return(run) - return _c -} - -// NotifyData provides a mock function with given fields: function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination -func (_m *FeatureLocal) NotifyData(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{}, destination api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) - - if len(ret) == 0 { - panic("no return value specified for NotifyData") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) - } - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemote) *model.MsgCounterType); ok { - r0 = rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemote) *model.ErrorType); ok { - r1 = rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// FeatureLocal_NotifyData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotifyData' -type FeatureLocal_NotifyData_Call struct { - *mock.Call -} - -// NotifyData is a helper method to define mock.On call -// - function model.FunctionType -// - deleteSelector interface{} -// - partialSelector interface{} -// - partialWithoutSelector bool -// - deleteElements interface{} -// - destination api.FeatureRemote -func (_e *FeatureLocal_Expecter) NotifyData(function interface{}, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector interface{}, deleteElements interface{}, destination interface{}) *FeatureLocal_NotifyData_Call { - return &FeatureLocal_NotifyData_Call{Call: _e.mock.On("NotifyData", function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination)} -} - -func (_c *FeatureLocal_NotifyData_Call) Run(run func(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{}, destination api.FeatureRemote)) *FeatureLocal_NotifyData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(bool), args[4].(interface{}), args[5].(api.FeatureRemote)) - }) - return _c -} - -func (_c *FeatureLocal_NotifyData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocal_NotifyData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *FeatureLocal_NotifyData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocal_NotifyData_Call { - _c.Call.Return(run) - return _c -} - -// Operations provides a mock function with given fields: -func (_m *FeatureLocal) Operations() map[model.FunctionType]api.Operations { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Operations") - } - - var r0 map[model.FunctionType]api.Operations - if rf, ok := ret.Get(0).(func() map[model.FunctionType]api.Operations); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[model.FunctionType]api.Operations) - } - } - - return r0 -} - -// FeatureLocal_Operations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Operations' -type FeatureLocal_Operations_Call struct { - *mock.Call -} - -// Operations is a helper method to define mock.On call -func (_e *FeatureLocal_Expecter) Operations() *FeatureLocal_Operations_Call { - return &FeatureLocal_Operations_Call{Call: _e.mock.On("Operations")} -} - -func (_c *FeatureLocal_Operations_Call) Run(run func()) *FeatureLocal_Operations_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureLocal_Operations_Call) Return(_a0 map[model.FunctionType]api.Operations) *FeatureLocal_Operations_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureLocal_Operations_Call) RunAndReturn(run func() map[model.FunctionType]api.Operations) *FeatureLocal_Operations_Call { - _c.Call.Return(run) - return _c -} - -// RemoveAllBindings provides a mock function with given fields: -func (_m *FeatureLocal) RemoveAllBindings() { - _m.Called() -} - -// FeatureLocal_RemoveAllBindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllBindings' -type FeatureLocal_RemoveAllBindings_Call struct { - *mock.Call -} - -// RemoveAllBindings is a helper method to define mock.On call -func (_e *FeatureLocal_Expecter) RemoveAllBindings() *FeatureLocal_RemoveAllBindings_Call { - return &FeatureLocal_RemoveAllBindings_Call{Call: _e.mock.On("RemoveAllBindings")} -} - -func (_c *FeatureLocal_RemoveAllBindings_Call) Run(run func()) *FeatureLocal_RemoveAllBindings_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureLocal_RemoveAllBindings_Call) Return() *FeatureLocal_RemoveAllBindings_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureLocal_RemoveAllBindings_Call) RunAndReturn(run func()) *FeatureLocal_RemoveAllBindings_Call { - _c.Call.Return(run) - return _c -} - -// RemoveAllSubscriptions provides a mock function with given fields: -func (_m *FeatureLocal) RemoveAllSubscriptions() { - _m.Called() -} - -// FeatureLocal_RemoveAllSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllSubscriptions' -type FeatureLocal_RemoveAllSubscriptions_Call struct { - *mock.Call -} - -// RemoveAllSubscriptions is a helper method to define mock.On call -func (_e *FeatureLocal_Expecter) RemoveAllSubscriptions() *FeatureLocal_RemoveAllSubscriptions_Call { - return &FeatureLocal_RemoveAllSubscriptions_Call{Call: _e.mock.On("RemoveAllSubscriptions")} -} - -func (_c *FeatureLocal_RemoveAllSubscriptions_Call) Run(run func()) *FeatureLocal_RemoveAllSubscriptions_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureLocal_RemoveAllSubscriptions_Call) Return() *FeatureLocal_RemoveAllSubscriptions_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureLocal_RemoveAllSubscriptions_Call) RunAndReturn(run func()) *FeatureLocal_RemoveAllSubscriptions_Call { - _c.Call.Return(run) - return _c -} - -// RemoveBinding provides a mock function with given fields: remoteAddress -func (_m *FeatureLocal) RemoveBinding(remoteAddress *model.FeatureAddressType) { - _m.Called(remoteAddress) -} - -// FeatureLocal_RemoveBinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveBinding' -type FeatureLocal_RemoveBinding_Call struct { - *mock.Call -} - -// RemoveBinding is a helper method to define mock.On call -// - remoteAddress *model.FeatureAddressType -func (_e *FeatureLocal_Expecter) RemoveBinding(remoteAddress interface{}) *FeatureLocal_RemoveBinding_Call { - return &FeatureLocal_RemoveBinding_Call{Call: _e.mock.On("RemoveBinding", remoteAddress)} -} - -func (_c *FeatureLocal_RemoveBinding_Call) Run(run func(remoteAddress *model.FeatureAddressType)) *FeatureLocal_RemoveBinding_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.FeatureAddressType)) - }) - return _c -} - -func (_c *FeatureLocal_RemoveBinding_Call) Return() *FeatureLocal_RemoveBinding_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureLocal_RemoveBinding_Call) RunAndReturn(run func(*model.FeatureAddressType)) *FeatureLocal_RemoveBinding_Call { - _c.Call.Return(run) - return _c -} - -// RemoveSubscription provides a mock function with given fields: remoteAddress -func (_m *FeatureLocal) RemoveSubscription(remoteAddress *model.FeatureAddressType) { - _m.Called(remoteAddress) -} - -// FeatureLocal_RemoveSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSubscription' -type FeatureLocal_RemoveSubscription_Call struct { - *mock.Call -} - -// RemoveSubscription is a helper method to define mock.On call -// - remoteAddress *model.FeatureAddressType -func (_e *FeatureLocal_Expecter) RemoveSubscription(remoteAddress interface{}) *FeatureLocal_RemoveSubscription_Call { - return &FeatureLocal_RemoveSubscription_Call{Call: _e.mock.On("RemoveSubscription", remoteAddress)} -} - -func (_c *FeatureLocal_RemoveSubscription_Call) Run(run func(remoteAddress *model.FeatureAddressType)) *FeatureLocal_RemoveSubscription_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.FeatureAddressType)) - }) - return _c -} - -func (_c *FeatureLocal_RemoveSubscription_Call) Return() *FeatureLocal_RemoveSubscription_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureLocal_RemoveSubscription_Call) RunAndReturn(run func(*model.FeatureAddressType)) *FeatureLocal_RemoveSubscription_Call { - _c.Call.Return(run) - return _c -} - -// RequestData provides a mock function with given fields: function, selector, elements, destination -func (_m *FeatureLocal) RequestData(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(function, selector, elements, destination) - - if len(ret) == 0 { - panic("no return value specified for RequestData") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(function, selector, elements, destination) - } - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemote) *model.MsgCounterType); ok { - r0 = rf(function, selector, elements, destination) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemote) *model.ErrorType); ok { - r1 = rf(function, selector, elements, destination) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// FeatureLocal_RequestData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestData' -type FeatureLocal_RequestData_Call struct { - *mock.Call -} - -// RequestData is a helper method to define mock.On call -// - function model.FunctionType -// - selector interface{} -// - elements interface{} -// - destination api.FeatureRemote -func (_e *FeatureLocal_Expecter) RequestData(function interface{}, selector interface{}, elements interface{}, destination interface{}) *FeatureLocal_RequestData_Call { - return &FeatureLocal_RequestData_Call{Call: _e.mock.On("RequestData", function, selector, elements, destination)} -} - -func (_c *FeatureLocal_RequestData_Call) Run(run func(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemote)) *FeatureLocal_RequestData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(api.FeatureRemote)) - }) - return _c -} - -func (_c *FeatureLocal_RequestData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocal_RequestData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *FeatureLocal_RequestData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocal_RequestData_Call { - _c.Call.Return(run) - return _c -} - -// RequestDataBySenderAddress provides a mock function with given fields: cmd, sender, destinationSki, destinationAddress, maxDelay -func (_m *FeatureLocal) RequestDataBySenderAddress(cmd model.CmdType, sender api.Sender, destinationSki string, destinationAddress *model.FeatureAddressType, maxDelay time.Duration) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(cmd, sender, destinationSki, destinationAddress, maxDelay) - - if len(ret) == 0 { - panic("no return value specified for RequestDataBySenderAddress") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.CmdType, api.Sender, string, *model.FeatureAddressType, time.Duration) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(cmd, sender, destinationSki, destinationAddress, maxDelay) - } - if rf, ok := ret.Get(0).(func(model.CmdType, api.Sender, string, *model.FeatureAddressType, time.Duration) *model.MsgCounterType); ok { - r0 = rf(cmd, sender, destinationSki, destinationAddress, maxDelay) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(model.CmdType, api.Sender, string, *model.FeatureAddressType, time.Duration) *model.ErrorType); ok { - r1 = rf(cmd, sender, destinationSki, destinationAddress, maxDelay) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// FeatureLocal_RequestDataBySenderAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestDataBySenderAddress' -type FeatureLocal_RequestDataBySenderAddress_Call struct { - *mock.Call -} - -// RequestDataBySenderAddress is a helper method to define mock.On call -// - cmd model.CmdType -// - sender api.Sender -// - destinationSki string -// - destinationAddress *model.FeatureAddressType -// - maxDelay time.Duration -func (_e *FeatureLocal_Expecter) RequestDataBySenderAddress(cmd interface{}, sender interface{}, destinationSki interface{}, destinationAddress interface{}, maxDelay interface{}) *FeatureLocal_RequestDataBySenderAddress_Call { - return &FeatureLocal_RequestDataBySenderAddress_Call{Call: _e.mock.On("RequestDataBySenderAddress", cmd, sender, destinationSki, destinationAddress, maxDelay)} -} - -func (_c *FeatureLocal_RequestDataBySenderAddress_Call) Run(run func(cmd model.CmdType, sender api.Sender, destinationSki string, destinationAddress *model.FeatureAddressType, maxDelay time.Duration)) *FeatureLocal_RequestDataBySenderAddress_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.CmdType), args[1].(api.Sender), args[2].(string), args[3].(*model.FeatureAddressType), args[4].(time.Duration)) - }) - return _c -} - -func (_c *FeatureLocal_RequestDataBySenderAddress_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocal_RequestDataBySenderAddress_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *FeatureLocal_RequestDataBySenderAddress_Call) RunAndReturn(run func(model.CmdType, api.Sender, string, *model.FeatureAddressType, time.Duration) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocal_RequestDataBySenderAddress_Call { - _c.Call.Return(run) - return _c -} - -// Role provides a mock function with given fields: -func (_m *FeatureLocal) Role() model.RoleType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Role") - } - - var r0 model.RoleType - if rf, ok := ret.Get(0).(func() model.RoleType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.RoleType) - } - - return r0 -} - -// FeatureLocal_Role_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Role' -type FeatureLocal_Role_Call struct { - *mock.Call -} - -// Role is a helper method to define mock.On call -func (_e *FeatureLocal_Expecter) Role() *FeatureLocal_Role_Call { - return &FeatureLocal_Role_Call{Call: _e.mock.On("Role")} -} - -func (_c *FeatureLocal_Role_Call) Run(run func()) *FeatureLocal_Role_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureLocal_Role_Call) Return(_a0 model.RoleType) *FeatureLocal_Role_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureLocal_Role_Call) RunAndReturn(run func() model.RoleType) *FeatureLocal_Role_Call { - _c.Call.Return(run) - return _c -} - -// SetData provides a mock function with given fields: function, data -func (_m *FeatureLocal) SetData(function model.FunctionType, data interface{}) { - _m.Called(function, data) -} - -// FeatureLocal_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData' -type FeatureLocal_SetData_Call struct { - *mock.Call -} - -// SetData is a helper method to define mock.On call -// - function model.FunctionType -// - data interface{} -func (_e *FeatureLocal_Expecter) SetData(function interface{}, data interface{}) *FeatureLocal_SetData_Call { - return &FeatureLocal_SetData_Call{Call: _e.mock.On("SetData", function, data)} -} - -func (_c *FeatureLocal_SetData_Call) Run(run func(function model.FunctionType, data interface{})) *FeatureLocal_SetData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{})) - }) - return _c -} - -func (_c *FeatureLocal_SetData_Call) Return() *FeatureLocal_SetData_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureLocal_SetData_Call) RunAndReturn(run func(model.FunctionType, interface{})) *FeatureLocal_SetData_Call { - _c.Call.Return(run) - return _c -} - -// SetDescription provides a mock function with given fields: desc -func (_m *FeatureLocal) SetDescription(desc *model.DescriptionType) { - _m.Called(desc) -} - -// FeatureLocal_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' -type FeatureLocal_SetDescription_Call struct { - *mock.Call -} - -// SetDescription is a helper method to define mock.On call -// - desc *model.DescriptionType -func (_e *FeatureLocal_Expecter) SetDescription(desc interface{}) *FeatureLocal_SetDescription_Call { - return &FeatureLocal_SetDescription_Call{Call: _e.mock.On("SetDescription", desc)} -} - -func (_c *FeatureLocal_SetDescription_Call) Run(run func(desc *model.DescriptionType)) *FeatureLocal_SetDescription_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.DescriptionType)) - }) - return _c -} - -func (_c *FeatureLocal_SetDescription_Call) Return() *FeatureLocal_SetDescription_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureLocal_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *FeatureLocal_SetDescription_Call { - _c.Call.Return(run) - return _c -} - -// SetDescriptionString provides a mock function with given fields: s -func (_m *FeatureLocal) SetDescriptionString(s string) { - _m.Called(s) -} - -// FeatureLocal_SetDescriptionString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescriptionString' -type FeatureLocal_SetDescriptionString_Call struct { - *mock.Call -} - -// SetDescriptionString is a helper method to define mock.On call -// - s string -func (_e *FeatureLocal_Expecter) SetDescriptionString(s interface{}) *FeatureLocal_SetDescriptionString_Call { - return &FeatureLocal_SetDescriptionString_Call{Call: _e.mock.On("SetDescriptionString", s)} -} - -func (_c *FeatureLocal_SetDescriptionString_Call) Run(run func(s string)) *FeatureLocal_SetDescriptionString_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *FeatureLocal_SetDescriptionString_Call) Return() *FeatureLocal_SetDescriptionString_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureLocal_SetDescriptionString_Call) RunAndReturn(run func(string)) *FeatureLocal_SetDescriptionString_Call { - _c.Call.Return(run) - return _c -} - -// String provides a mock function with given fields: -func (_m *FeatureLocal) String() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for String") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// FeatureLocal_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' -type FeatureLocal_String_Call struct { - *mock.Call -} - -// String is a helper method to define mock.On call -func (_e *FeatureLocal_Expecter) String() *FeatureLocal_String_Call { - return &FeatureLocal_String_Call{Call: _e.mock.On("String")} -} - -func (_c *FeatureLocal_String_Call) Run(run func()) *FeatureLocal_String_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureLocal_String_Call) Return(_a0 string) *FeatureLocal_String_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureLocal_String_Call) RunAndReturn(run func() string) *FeatureLocal_String_Call { - _c.Call.Return(run) - return _c -} - -// Subscribe provides a mock function with given fields: remoteAdress -func (_m *FeatureLocal) Subscribe(remoteAdress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(remoteAdress) - - if len(ret) == 0 { - panic("no return value specified for Subscribe") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(remoteAdress) - } - if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) *model.MsgCounterType); ok { - r0 = rf(remoteAdress) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(*model.FeatureAddressType) *model.ErrorType); ok { - r1 = rf(remoteAdress) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// FeatureLocal_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe' -type FeatureLocal_Subscribe_Call struct { - *mock.Call -} - -// Subscribe is a helper method to define mock.On call -// - remoteAdress *model.FeatureAddressType -func (_e *FeatureLocal_Expecter) Subscribe(remoteAdress interface{}) *FeatureLocal_Subscribe_Call { - return &FeatureLocal_Subscribe_Call{Call: _e.mock.On("Subscribe", remoteAdress)} -} - -func (_c *FeatureLocal_Subscribe_Call) Run(run func(remoteAdress *model.FeatureAddressType)) *FeatureLocal_Subscribe_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.FeatureAddressType)) - }) - return _c -} - -func (_c *FeatureLocal_Subscribe_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocal_Subscribe_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *FeatureLocal_Subscribe_Call) RunAndReturn(run func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocal_Subscribe_Call { - _c.Call.Return(run) - return _c -} - -// Type provides a mock function with given fields: -func (_m *FeatureLocal) Type() model.FeatureTypeType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Type") - } - - var r0 model.FeatureTypeType - if rf, ok := ret.Get(0).(func() model.FeatureTypeType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.FeatureTypeType) - } - - return r0 -} - -// FeatureLocal_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' -type FeatureLocal_Type_Call struct { - *mock.Call -} - -// Type is a helper method to define mock.On call -func (_e *FeatureLocal_Expecter) Type() *FeatureLocal_Type_Call { - return &FeatureLocal_Type_Call{Call: _e.mock.On("Type")} -} - -func (_c *FeatureLocal_Type_Call) Run(run func()) *FeatureLocal_Type_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureLocal_Type_Call) Return(_a0 model.FeatureTypeType) *FeatureLocal_Type_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureLocal_Type_Call) RunAndReturn(run func() model.FeatureTypeType) *FeatureLocal_Type_Call { - _c.Call.Return(run) - return _c -} - -// WriteData provides a mock function with given fields: function, deleteSelector, partialSelector, deleteElements, destination -func (_m *FeatureLocal) WriteData(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(function, deleteSelector, partialSelector, deleteElements, destination) - - if len(ret) == 0 { - panic("no return value specified for WriteData") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(function, deleteSelector, partialSelector, deleteElements, destination) - } - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemote) *model.MsgCounterType); ok { - r0 = rf(function, deleteSelector, partialSelector, deleteElements, destination) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemote) *model.ErrorType); ok { - r1 = rf(function, deleteSelector, partialSelector, deleteElements, destination) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// FeatureLocal_WriteData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteData' -type FeatureLocal_WriteData_Call struct { - *mock.Call -} - -// WriteData is a helper method to define mock.On call -// - function model.FunctionType -// - deleteSelector interface{} -// - partialSelector interface{} -// - deleteElements interface{} -// - destination api.FeatureRemote -func (_e *FeatureLocal_Expecter) WriteData(function interface{}, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination interface{}) *FeatureLocal_WriteData_Call { - return &FeatureLocal_WriteData_Call{Call: _e.mock.On("WriteData", function, deleteSelector, partialSelector, deleteElements, destination)} -} - -func (_c *FeatureLocal_WriteData_Call) Run(run func(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination api.FeatureRemote)) *FeatureLocal_WriteData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(interface{}), args[4].(api.FeatureRemote)) - }) - return _c -} - -func (_c *FeatureLocal_WriteData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocal_WriteData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *FeatureLocal_WriteData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocal_WriteData_Call { - _c.Call.Return(run) - return _c -} - -// NewFeatureLocal creates a new instance of FeatureLocal. 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 NewFeatureLocal(t interface { - mock.TestingT - Cleanup(func()) -}) *FeatureLocal { - mock := &FeatureLocal{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/FeatureLocalInterface.go b/mocks/FeatureLocalInterface.go new file mode 100644 index 0000000..4c1f2c5 --- /dev/null +++ b/mocks/FeatureLocalInterface.go @@ -0,0 +1,1321 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" + + model "github.com/enbility/spine-go/model" + + time "time" +) + +// FeatureLocalInterface is an autogenerated mock type for the FeatureLocalInterface type +type FeatureLocalInterface struct { + mock.Mock +} + +type FeatureLocalInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *FeatureLocalInterface) EXPECT() *FeatureLocalInterface_Expecter { + return &FeatureLocalInterface_Expecter{mock: &_m.Mock} +} + +// AddFunctionType provides a mock function with given fields: function, read, write +func (_m *FeatureLocalInterface) AddFunctionType(function model.FunctionType, read bool, write bool) { + _m.Called(function, read, write) +} + +// FeatureLocalInterface_AddFunctionType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFunctionType' +type FeatureLocalInterface_AddFunctionType_Call struct { + *mock.Call +} + +// AddFunctionType is a helper method to define mock.On call +// - function model.FunctionType +// - read bool +// - write bool +func (_e *FeatureLocalInterface_Expecter) AddFunctionType(function interface{}, read interface{}, write interface{}) *FeatureLocalInterface_AddFunctionType_Call { + return &FeatureLocalInterface_AddFunctionType_Call{Call: _e.mock.On("AddFunctionType", function, read, write)} +} + +func (_c *FeatureLocalInterface_AddFunctionType_Call) Run(run func(function model.FunctionType, read bool, write bool)) *FeatureLocalInterface_AddFunctionType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(bool), args[2].(bool)) + }) + return _c +} + +func (_c *FeatureLocalInterface_AddFunctionType_Call) Return() *FeatureLocalInterface_AddFunctionType_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureLocalInterface_AddFunctionType_Call) RunAndReturn(run func(model.FunctionType, bool, bool)) *FeatureLocalInterface_AddFunctionType_Call { + _c.Call.Return(run) + return _c +} + +// AddResultCallback provides a mock function with given fields: msgCounterReference, function +func (_m *FeatureLocalInterface) AddResultCallback(msgCounterReference model.MsgCounterType, function func(api.ResultMessage)) { + _m.Called(msgCounterReference, function) +} + +// FeatureLocalInterface_AddResultCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddResultCallback' +type FeatureLocalInterface_AddResultCallback_Call struct { + *mock.Call +} + +// AddResultCallback is a helper method to define mock.On call +// - msgCounterReference model.MsgCounterType +// - function func(api.ResultMessage) +func (_e *FeatureLocalInterface_Expecter) AddResultCallback(msgCounterReference interface{}, function interface{}) *FeatureLocalInterface_AddResultCallback_Call { + return &FeatureLocalInterface_AddResultCallback_Call{Call: _e.mock.On("AddResultCallback", msgCounterReference, function)} +} + +func (_c *FeatureLocalInterface_AddResultCallback_Call) Run(run func(msgCounterReference model.MsgCounterType, function func(api.ResultMessage))) *FeatureLocalInterface_AddResultCallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.MsgCounterType), args[1].(func(api.ResultMessage))) + }) + return _c +} + +func (_c *FeatureLocalInterface_AddResultCallback_Call) Return() *FeatureLocalInterface_AddResultCallback_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureLocalInterface_AddResultCallback_Call) RunAndReturn(run func(model.MsgCounterType, func(api.ResultMessage))) *FeatureLocalInterface_AddResultCallback_Call { + _c.Call.Return(run) + return _c +} + +// AddResultHandler provides a mock function with given fields: handler +func (_m *FeatureLocalInterface) AddResultHandler(handler api.FeatureResultInterface) { + _m.Called(handler) +} + +// FeatureLocalInterface_AddResultHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddResultHandler' +type FeatureLocalInterface_AddResultHandler_Call struct { + *mock.Call +} + +// AddResultHandler is a helper method to define mock.On call +// - handler api.FeatureResultInterface +func (_e *FeatureLocalInterface_Expecter) AddResultHandler(handler interface{}) *FeatureLocalInterface_AddResultHandler_Call { + return &FeatureLocalInterface_AddResultHandler_Call{Call: _e.mock.On("AddResultHandler", handler)} +} + +func (_c *FeatureLocalInterface_AddResultHandler_Call) Run(run func(handler api.FeatureResultInterface)) *FeatureLocalInterface_AddResultHandler_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.FeatureResultInterface)) + }) + return _c +} + +func (_c *FeatureLocalInterface_AddResultHandler_Call) Return() *FeatureLocalInterface_AddResultHandler_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureLocalInterface_AddResultHandler_Call) RunAndReturn(run func(api.FeatureResultInterface)) *FeatureLocalInterface_AddResultHandler_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *FeatureLocalInterface) Address() *model.FeatureAddressType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 *model.FeatureAddressType + if rf, ok := ret.Get(0).(func() *model.FeatureAddressType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.FeatureAddressType) + } + } + + return r0 +} + +// FeatureLocalInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type FeatureLocalInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *FeatureLocalInterface_Expecter) Address() *FeatureLocalInterface_Address_Call { + return &FeatureLocalInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *FeatureLocalInterface_Address_Call) Run(run func()) *FeatureLocalInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureLocalInterface_Address_Call) Return(_a0 *model.FeatureAddressType) *FeatureLocalInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureLocalInterface_Address_Call) RunAndReturn(run func() *model.FeatureAddressType) *FeatureLocalInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// Bind provides a mock function with given fields: remoteAdress +func (_m *FeatureLocalInterface) Bind(remoteAdress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(remoteAdress) + + if len(ret) == 0 { + panic("no return value specified for Bind") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(remoteAdress) + } + if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) *model.MsgCounterType); ok { + r0 = rf(remoteAdress) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(*model.FeatureAddressType) *model.ErrorType); ok { + r1 = rf(remoteAdress) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// FeatureLocalInterface_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' +type FeatureLocalInterface_Bind_Call struct { + *mock.Call +} + +// Bind is a helper method to define mock.On call +// - remoteAdress *model.FeatureAddressType +func (_e *FeatureLocalInterface_Expecter) Bind(remoteAdress interface{}) *FeatureLocalInterface_Bind_Call { + return &FeatureLocalInterface_Bind_Call{Call: _e.mock.On("Bind", remoteAdress)} +} + +func (_c *FeatureLocalInterface_Bind_Call) Run(run func(remoteAdress *model.FeatureAddressType)) *FeatureLocalInterface_Bind_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType)) + }) + return _c +} + +func (_c *FeatureLocalInterface_Bind_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocalInterface_Bind_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeatureLocalInterface_Bind_Call) RunAndReturn(run func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocalInterface_Bind_Call { + _c.Call.Return(run) + return _c +} + +// DataCopy provides a mock function with given fields: function +func (_m *FeatureLocalInterface) DataCopy(function model.FunctionType) interface{} { + ret := _m.Called(function) + + if len(ret) == 0 { + panic("no return value specified for DataCopy") + } + + var r0 interface{} + if rf, ok := ret.Get(0).(func(model.FunctionType) interface{}); ok { + r0 = rf(function) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + + return r0 +} + +// FeatureLocalInterface_DataCopy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataCopy' +type FeatureLocalInterface_DataCopy_Call struct { + *mock.Call +} + +// DataCopy is a helper method to define mock.On call +// - function model.FunctionType +func (_e *FeatureLocalInterface_Expecter) DataCopy(function interface{}) *FeatureLocalInterface_DataCopy_Call { + return &FeatureLocalInterface_DataCopy_Call{Call: _e.mock.On("DataCopy", function)} +} + +func (_c *FeatureLocalInterface_DataCopy_Call) Run(run func(function model.FunctionType)) *FeatureLocalInterface_DataCopy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType)) + }) + return _c +} + +func (_c *FeatureLocalInterface_DataCopy_Call) Return(_a0 interface{}) *FeatureLocalInterface_DataCopy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureLocalInterface_DataCopy_Call) RunAndReturn(run func(model.FunctionType) interface{}) *FeatureLocalInterface_DataCopy_Call { + _c.Call.Return(run) + return _c +} + +// Description provides a mock function with given fields: +func (_m *FeatureLocalInterface) Description() *model.DescriptionType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 *model.DescriptionType + if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.DescriptionType) + } + } + + return r0 +} + +// FeatureLocalInterface_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type FeatureLocalInterface_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *FeatureLocalInterface_Expecter) Description() *FeatureLocalInterface_Description_Call { + return &FeatureLocalInterface_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *FeatureLocalInterface_Description_Call) Run(run func()) *FeatureLocalInterface_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureLocalInterface_Description_Call) Return(_a0 *model.DescriptionType) *FeatureLocalInterface_Description_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureLocalInterface_Description_Call) RunAndReturn(run func() *model.DescriptionType) *FeatureLocalInterface_Description_Call { + _c.Call.Return(run) + return _c +} + +// Device provides a mock function with given fields: +func (_m *FeatureLocalInterface) Device() api.DeviceLocalInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Device") + } + + var r0 api.DeviceLocalInterface + if rf, ok := ret.Get(0).(func() api.DeviceLocalInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.DeviceLocalInterface) + } + } + + return r0 +} + +// FeatureLocalInterface_Device_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Device' +type FeatureLocalInterface_Device_Call struct { + *mock.Call +} + +// Device is a helper method to define mock.On call +func (_e *FeatureLocalInterface_Expecter) Device() *FeatureLocalInterface_Device_Call { + return &FeatureLocalInterface_Device_Call{Call: _e.mock.On("Device")} +} + +func (_c *FeatureLocalInterface_Device_Call) Run(run func()) *FeatureLocalInterface_Device_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureLocalInterface_Device_Call) Return(_a0 api.DeviceLocalInterface) *FeatureLocalInterface_Device_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureLocalInterface_Device_Call) RunAndReturn(run func() api.DeviceLocalInterface) *FeatureLocalInterface_Device_Call { + _c.Call.Return(run) + return _c +} + +// Entity provides a mock function with given fields: +func (_m *FeatureLocalInterface) Entity() api.EntityLocalInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Entity") + } + + var r0 api.EntityLocalInterface + if rf, ok := ret.Get(0).(func() api.EntityLocalInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.EntityLocalInterface) + } + } + + return r0 +} + +// FeatureLocalInterface_Entity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entity' +type FeatureLocalInterface_Entity_Call struct { + *mock.Call +} + +// Entity is a helper method to define mock.On call +func (_e *FeatureLocalInterface_Expecter) Entity() *FeatureLocalInterface_Entity_Call { + return &FeatureLocalInterface_Entity_Call{Call: _e.mock.On("Entity")} +} + +func (_c *FeatureLocalInterface_Entity_Call) Run(run func()) *FeatureLocalInterface_Entity_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureLocalInterface_Entity_Call) Return(_a0 api.EntityLocalInterface) *FeatureLocalInterface_Entity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureLocalInterface_Entity_Call) RunAndReturn(run func() api.EntityLocalInterface) *FeatureLocalInterface_Entity_Call { + _c.Call.Return(run) + return _c +} + +// FetchRequestData provides a mock function with given fields: msgCounter, destination +func (_m *FeatureLocalInterface) FetchRequestData(msgCounter model.MsgCounterType, destination api.FeatureRemoteInterface) (interface{}, *model.ErrorType) { + ret := _m.Called(msgCounter, destination) + + if len(ret) == 0 { + panic("no return value specified for FetchRequestData") + } + + var r0 interface{} + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(model.MsgCounterType, api.FeatureRemoteInterface) (interface{}, *model.ErrorType)); ok { + return rf(msgCounter, destination) + } + if rf, ok := ret.Get(0).(func(model.MsgCounterType, api.FeatureRemoteInterface) interface{}); ok { + r0 = rf(msgCounter, destination) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + + if rf, ok := ret.Get(1).(func(model.MsgCounterType, api.FeatureRemoteInterface) *model.ErrorType); ok { + r1 = rf(msgCounter, destination) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// FeatureLocalInterface_FetchRequestData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchRequestData' +type FeatureLocalInterface_FetchRequestData_Call struct { + *mock.Call +} + +// FetchRequestData is a helper method to define mock.On call +// - msgCounter model.MsgCounterType +// - destination api.FeatureRemoteInterface +func (_e *FeatureLocalInterface_Expecter) FetchRequestData(msgCounter interface{}, destination interface{}) *FeatureLocalInterface_FetchRequestData_Call { + return &FeatureLocalInterface_FetchRequestData_Call{Call: _e.mock.On("FetchRequestData", msgCounter, destination)} +} + +func (_c *FeatureLocalInterface_FetchRequestData_Call) Run(run func(msgCounter model.MsgCounterType, destination api.FeatureRemoteInterface)) *FeatureLocalInterface_FetchRequestData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.MsgCounterType), args[1].(api.FeatureRemoteInterface)) + }) + return _c +} + +func (_c *FeatureLocalInterface_FetchRequestData_Call) Return(_a0 interface{}, _a1 *model.ErrorType) *FeatureLocalInterface_FetchRequestData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeatureLocalInterface_FetchRequestData_Call) RunAndReturn(run func(model.MsgCounterType, api.FeatureRemoteInterface) (interface{}, *model.ErrorType)) *FeatureLocalInterface_FetchRequestData_Call { + _c.Call.Return(run) + return _c +} + +// HandleMessage provides a mock function with given fields: message +func (_m *FeatureLocalInterface) HandleMessage(message *api.Message) *model.ErrorType { + ret := _m.Called(message) + + if len(ret) == 0 { + panic("no return value specified for HandleMessage") + } + + var r0 *model.ErrorType + if rf, ok := ret.Get(0).(func(*api.Message) *model.ErrorType); ok { + r0 = rf(message) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.ErrorType) + } + } + + return r0 +} + +// FeatureLocalInterface_HandleMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleMessage' +type FeatureLocalInterface_HandleMessage_Call struct { + *mock.Call +} + +// HandleMessage is a helper method to define mock.On call +// - message *api.Message +func (_e *FeatureLocalInterface_Expecter) HandleMessage(message interface{}) *FeatureLocalInterface_HandleMessage_Call { + return &FeatureLocalInterface_HandleMessage_Call{Call: _e.mock.On("HandleMessage", message)} +} + +func (_c *FeatureLocalInterface_HandleMessage_Call) Run(run func(message *api.Message)) *FeatureLocalInterface_HandleMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*api.Message)) + }) + return _c +} + +func (_c *FeatureLocalInterface_HandleMessage_Call) Return(_a0 *model.ErrorType) *FeatureLocalInterface_HandleMessage_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureLocalInterface_HandleMessage_Call) RunAndReturn(run func(*api.Message) *model.ErrorType) *FeatureLocalInterface_HandleMessage_Call { + _c.Call.Return(run) + return _c +} + +// Information provides a mock function with given fields: +func (_m *FeatureLocalInterface) Information() *model.NodeManagementDetailedDiscoveryFeatureInformationType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Information") + } + + var r0 *model.NodeManagementDetailedDiscoveryFeatureInformationType + if rf, ok := ret.Get(0).(func() *model.NodeManagementDetailedDiscoveryFeatureInformationType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.NodeManagementDetailedDiscoveryFeatureInformationType) + } + } + + return r0 +} + +// FeatureLocalInterface_Information_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Information' +type FeatureLocalInterface_Information_Call struct { + *mock.Call +} + +// Information is a helper method to define mock.On call +func (_e *FeatureLocalInterface_Expecter) Information() *FeatureLocalInterface_Information_Call { + return &FeatureLocalInterface_Information_Call{Call: _e.mock.On("Information")} +} + +func (_c *FeatureLocalInterface_Information_Call) Run(run func()) *FeatureLocalInterface_Information_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureLocalInterface_Information_Call) Return(_a0 *model.NodeManagementDetailedDiscoveryFeatureInformationType) *FeatureLocalInterface_Information_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureLocalInterface_Information_Call) RunAndReturn(run func() *model.NodeManagementDetailedDiscoveryFeatureInformationType) *FeatureLocalInterface_Information_Call { + _c.Call.Return(run) + return _c +} + +// NotifyData provides a mock function with given fields: function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination +func (_m *FeatureLocalInterface) NotifyData(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{}, destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) + + if len(ret) == 0 { + panic("no return value specified for NotifyData") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) + } + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemoteInterface) *model.MsgCounterType); ok { + r0 = rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemoteInterface) *model.ErrorType); ok { + r1 = rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// FeatureLocalInterface_NotifyData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotifyData' +type FeatureLocalInterface_NotifyData_Call struct { + *mock.Call +} + +// NotifyData is a helper method to define mock.On call +// - function model.FunctionType +// - deleteSelector interface{} +// - partialSelector interface{} +// - partialWithoutSelector bool +// - deleteElements interface{} +// - destination api.FeatureRemoteInterface +func (_e *FeatureLocalInterface_Expecter) NotifyData(function interface{}, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector interface{}, deleteElements interface{}, destination interface{}) *FeatureLocalInterface_NotifyData_Call { + return &FeatureLocalInterface_NotifyData_Call{Call: _e.mock.On("NotifyData", function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination)} +} + +func (_c *FeatureLocalInterface_NotifyData_Call) Run(run func(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{}, destination api.FeatureRemoteInterface)) *FeatureLocalInterface_NotifyData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(bool), args[4].(interface{}), args[5].(api.FeatureRemoteInterface)) + }) + return _c +} + +func (_c *FeatureLocalInterface_NotifyData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocalInterface_NotifyData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeatureLocalInterface_NotifyData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocalInterface_NotifyData_Call { + _c.Call.Return(run) + return _c +} + +// Operations provides a mock function with given fields: +func (_m *FeatureLocalInterface) Operations() map[model.FunctionType]api.OperationsInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Operations") + } + + var r0 map[model.FunctionType]api.OperationsInterface + if rf, ok := ret.Get(0).(func() map[model.FunctionType]api.OperationsInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[model.FunctionType]api.OperationsInterface) + } + } + + return r0 +} + +// FeatureLocalInterface_Operations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Operations' +type FeatureLocalInterface_Operations_Call struct { + *mock.Call +} + +// Operations is a helper method to define mock.On call +func (_e *FeatureLocalInterface_Expecter) Operations() *FeatureLocalInterface_Operations_Call { + return &FeatureLocalInterface_Operations_Call{Call: _e.mock.On("Operations")} +} + +func (_c *FeatureLocalInterface_Operations_Call) Run(run func()) *FeatureLocalInterface_Operations_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureLocalInterface_Operations_Call) Return(_a0 map[model.FunctionType]api.OperationsInterface) *FeatureLocalInterface_Operations_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureLocalInterface_Operations_Call) RunAndReturn(run func() map[model.FunctionType]api.OperationsInterface) *FeatureLocalInterface_Operations_Call { + _c.Call.Return(run) + return _c +} + +// RemoveAllBindings provides a mock function with given fields: +func (_m *FeatureLocalInterface) RemoveAllBindings() { + _m.Called() +} + +// FeatureLocalInterface_RemoveAllBindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllBindings' +type FeatureLocalInterface_RemoveAllBindings_Call struct { + *mock.Call +} + +// RemoveAllBindings is a helper method to define mock.On call +func (_e *FeatureLocalInterface_Expecter) RemoveAllBindings() *FeatureLocalInterface_RemoveAllBindings_Call { + return &FeatureLocalInterface_RemoveAllBindings_Call{Call: _e.mock.On("RemoveAllBindings")} +} + +func (_c *FeatureLocalInterface_RemoveAllBindings_Call) Run(run func()) *FeatureLocalInterface_RemoveAllBindings_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureLocalInterface_RemoveAllBindings_Call) Return() *FeatureLocalInterface_RemoveAllBindings_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureLocalInterface_RemoveAllBindings_Call) RunAndReturn(run func()) *FeatureLocalInterface_RemoveAllBindings_Call { + _c.Call.Return(run) + return _c +} + +// RemoveAllSubscriptions provides a mock function with given fields: +func (_m *FeatureLocalInterface) RemoveAllSubscriptions() { + _m.Called() +} + +// FeatureLocalInterface_RemoveAllSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllSubscriptions' +type FeatureLocalInterface_RemoveAllSubscriptions_Call struct { + *mock.Call +} + +// RemoveAllSubscriptions is a helper method to define mock.On call +func (_e *FeatureLocalInterface_Expecter) RemoveAllSubscriptions() *FeatureLocalInterface_RemoveAllSubscriptions_Call { + return &FeatureLocalInterface_RemoveAllSubscriptions_Call{Call: _e.mock.On("RemoveAllSubscriptions")} +} + +func (_c *FeatureLocalInterface_RemoveAllSubscriptions_Call) Run(run func()) *FeatureLocalInterface_RemoveAllSubscriptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureLocalInterface_RemoveAllSubscriptions_Call) Return() *FeatureLocalInterface_RemoveAllSubscriptions_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureLocalInterface_RemoveAllSubscriptions_Call) RunAndReturn(run func()) *FeatureLocalInterface_RemoveAllSubscriptions_Call { + _c.Call.Return(run) + return _c +} + +// RemoveBinding provides a mock function with given fields: remoteAddress +func (_m *FeatureLocalInterface) RemoveBinding(remoteAddress *model.FeatureAddressType) { + _m.Called(remoteAddress) +} + +// FeatureLocalInterface_RemoveBinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveBinding' +type FeatureLocalInterface_RemoveBinding_Call struct { + *mock.Call +} + +// RemoveBinding is a helper method to define mock.On call +// - remoteAddress *model.FeatureAddressType +func (_e *FeatureLocalInterface_Expecter) RemoveBinding(remoteAddress interface{}) *FeatureLocalInterface_RemoveBinding_Call { + return &FeatureLocalInterface_RemoveBinding_Call{Call: _e.mock.On("RemoveBinding", remoteAddress)} +} + +func (_c *FeatureLocalInterface_RemoveBinding_Call) Run(run func(remoteAddress *model.FeatureAddressType)) *FeatureLocalInterface_RemoveBinding_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType)) + }) + return _c +} + +func (_c *FeatureLocalInterface_RemoveBinding_Call) Return() *FeatureLocalInterface_RemoveBinding_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureLocalInterface_RemoveBinding_Call) RunAndReturn(run func(*model.FeatureAddressType)) *FeatureLocalInterface_RemoveBinding_Call { + _c.Call.Return(run) + return _c +} + +// RemoveSubscription provides a mock function with given fields: remoteAddress +func (_m *FeatureLocalInterface) RemoveSubscription(remoteAddress *model.FeatureAddressType) { + _m.Called(remoteAddress) +} + +// FeatureLocalInterface_RemoveSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSubscription' +type FeatureLocalInterface_RemoveSubscription_Call struct { + *mock.Call +} + +// RemoveSubscription is a helper method to define mock.On call +// - remoteAddress *model.FeatureAddressType +func (_e *FeatureLocalInterface_Expecter) RemoveSubscription(remoteAddress interface{}) *FeatureLocalInterface_RemoveSubscription_Call { + return &FeatureLocalInterface_RemoveSubscription_Call{Call: _e.mock.On("RemoveSubscription", remoteAddress)} +} + +func (_c *FeatureLocalInterface_RemoveSubscription_Call) Run(run func(remoteAddress *model.FeatureAddressType)) *FeatureLocalInterface_RemoveSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType)) + }) + return _c +} + +func (_c *FeatureLocalInterface_RemoveSubscription_Call) Return() *FeatureLocalInterface_RemoveSubscription_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureLocalInterface_RemoveSubscription_Call) RunAndReturn(run func(*model.FeatureAddressType)) *FeatureLocalInterface_RemoveSubscription_Call { + _c.Call.Return(run) + return _c +} + +// RequestData provides a mock function with given fields: function, selector, elements, destination +func (_m *FeatureLocalInterface) RequestData(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(function, selector, elements, destination) + + if len(ret) == 0 { + panic("no return value specified for RequestData") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(function, selector, elements, destination) + } + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) *model.MsgCounterType); ok { + r0 = rf(function, selector, elements, destination) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) *model.ErrorType); ok { + r1 = rf(function, selector, elements, destination) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// FeatureLocalInterface_RequestData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestData' +type FeatureLocalInterface_RequestData_Call struct { + *mock.Call +} + +// RequestData is a helper method to define mock.On call +// - function model.FunctionType +// - selector interface{} +// - elements interface{} +// - destination api.FeatureRemoteInterface +func (_e *FeatureLocalInterface_Expecter) RequestData(function interface{}, selector interface{}, elements interface{}, destination interface{}) *FeatureLocalInterface_RequestData_Call { + return &FeatureLocalInterface_RequestData_Call{Call: _e.mock.On("RequestData", function, selector, elements, destination)} +} + +func (_c *FeatureLocalInterface_RequestData_Call) Run(run func(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemoteInterface)) *FeatureLocalInterface_RequestData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(api.FeatureRemoteInterface)) + }) + return _c +} + +func (_c *FeatureLocalInterface_RequestData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocalInterface_RequestData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeatureLocalInterface_RequestData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocalInterface_RequestData_Call { + _c.Call.Return(run) + return _c +} + +// RequestDataBySenderAddress provides a mock function with given fields: cmd, sender, destinationSki, destinationAddress, maxDelay +func (_m *FeatureLocalInterface) RequestDataBySenderAddress(cmd model.CmdType, sender api.SenderInterface, destinationSki string, destinationAddress *model.FeatureAddressType, maxDelay time.Duration) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(cmd, sender, destinationSki, destinationAddress, maxDelay) + + if len(ret) == 0 { + panic("no return value specified for RequestDataBySenderAddress") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(model.CmdType, api.SenderInterface, string, *model.FeatureAddressType, time.Duration) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(cmd, sender, destinationSki, destinationAddress, maxDelay) + } + if rf, ok := ret.Get(0).(func(model.CmdType, api.SenderInterface, string, *model.FeatureAddressType, time.Duration) *model.MsgCounterType); ok { + r0 = rf(cmd, sender, destinationSki, destinationAddress, maxDelay) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(model.CmdType, api.SenderInterface, string, *model.FeatureAddressType, time.Duration) *model.ErrorType); ok { + r1 = rf(cmd, sender, destinationSki, destinationAddress, maxDelay) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// FeatureLocalInterface_RequestDataBySenderAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestDataBySenderAddress' +type FeatureLocalInterface_RequestDataBySenderAddress_Call struct { + *mock.Call +} + +// RequestDataBySenderAddress is a helper method to define mock.On call +// - cmd model.CmdType +// - sender api.SenderInterface +// - destinationSki string +// - destinationAddress *model.FeatureAddressType +// - maxDelay time.Duration +func (_e *FeatureLocalInterface_Expecter) RequestDataBySenderAddress(cmd interface{}, sender interface{}, destinationSki interface{}, destinationAddress interface{}, maxDelay interface{}) *FeatureLocalInterface_RequestDataBySenderAddress_Call { + return &FeatureLocalInterface_RequestDataBySenderAddress_Call{Call: _e.mock.On("RequestDataBySenderAddress", cmd, sender, destinationSki, destinationAddress, maxDelay)} +} + +func (_c *FeatureLocalInterface_RequestDataBySenderAddress_Call) Run(run func(cmd model.CmdType, sender api.SenderInterface, destinationSki string, destinationAddress *model.FeatureAddressType, maxDelay time.Duration)) *FeatureLocalInterface_RequestDataBySenderAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.CmdType), args[1].(api.SenderInterface), args[2].(string), args[3].(*model.FeatureAddressType), args[4].(time.Duration)) + }) + return _c +} + +func (_c *FeatureLocalInterface_RequestDataBySenderAddress_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocalInterface_RequestDataBySenderAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeatureLocalInterface_RequestDataBySenderAddress_Call) RunAndReturn(run func(model.CmdType, api.SenderInterface, string, *model.FeatureAddressType, time.Duration) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocalInterface_RequestDataBySenderAddress_Call { + _c.Call.Return(run) + return _c +} + +// Role provides a mock function with given fields: +func (_m *FeatureLocalInterface) Role() model.RoleType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Role") + } + + var r0 model.RoleType + if rf, ok := ret.Get(0).(func() model.RoleType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.RoleType) + } + + return r0 +} + +// FeatureLocalInterface_Role_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Role' +type FeatureLocalInterface_Role_Call struct { + *mock.Call +} + +// Role is a helper method to define mock.On call +func (_e *FeatureLocalInterface_Expecter) Role() *FeatureLocalInterface_Role_Call { + return &FeatureLocalInterface_Role_Call{Call: _e.mock.On("Role")} +} + +func (_c *FeatureLocalInterface_Role_Call) Run(run func()) *FeatureLocalInterface_Role_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureLocalInterface_Role_Call) Return(_a0 model.RoleType) *FeatureLocalInterface_Role_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureLocalInterface_Role_Call) RunAndReturn(run func() model.RoleType) *FeatureLocalInterface_Role_Call { + _c.Call.Return(run) + return _c +} + +// SetData provides a mock function with given fields: function, data +func (_m *FeatureLocalInterface) SetData(function model.FunctionType, data interface{}) { + _m.Called(function, data) +} + +// FeatureLocalInterface_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData' +type FeatureLocalInterface_SetData_Call struct { + *mock.Call +} + +// SetData is a helper method to define mock.On call +// - function model.FunctionType +// - data interface{} +func (_e *FeatureLocalInterface_Expecter) SetData(function interface{}, data interface{}) *FeatureLocalInterface_SetData_Call { + return &FeatureLocalInterface_SetData_Call{Call: _e.mock.On("SetData", function, data)} +} + +func (_c *FeatureLocalInterface_SetData_Call) Run(run func(function model.FunctionType, data interface{})) *FeatureLocalInterface_SetData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(interface{})) + }) + return _c +} + +func (_c *FeatureLocalInterface_SetData_Call) Return() *FeatureLocalInterface_SetData_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureLocalInterface_SetData_Call) RunAndReturn(run func(model.FunctionType, interface{})) *FeatureLocalInterface_SetData_Call { + _c.Call.Return(run) + return _c +} + +// SetDescription provides a mock function with given fields: desc +func (_m *FeatureLocalInterface) SetDescription(desc *model.DescriptionType) { + _m.Called(desc) +} + +// FeatureLocalInterface_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' +type FeatureLocalInterface_SetDescription_Call struct { + *mock.Call +} + +// SetDescription is a helper method to define mock.On call +// - desc *model.DescriptionType +func (_e *FeatureLocalInterface_Expecter) SetDescription(desc interface{}) *FeatureLocalInterface_SetDescription_Call { + return &FeatureLocalInterface_SetDescription_Call{Call: _e.mock.On("SetDescription", desc)} +} + +func (_c *FeatureLocalInterface_SetDescription_Call) Run(run func(desc *model.DescriptionType)) *FeatureLocalInterface_SetDescription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.DescriptionType)) + }) + return _c +} + +func (_c *FeatureLocalInterface_SetDescription_Call) Return() *FeatureLocalInterface_SetDescription_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureLocalInterface_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *FeatureLocalInterface_SetDescription_Call { + _c.Call.Return(run) + return _c +} + +// SetDescriptionString provides a mock function with given fields: s +func (_m *FeatureLocalInterface) SetDescriptionString(s string) { + _m.Called(s) +} + +// FeatureLocalInterface_SetDescriptionString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescriptionString' +type FeatureLocalInterface_SetDescriptionString_Call struct { + *mock.Call +} + +// SetDescriptionString is a helper method to define mock.On call +// - s string +func (_e *FeatureLocalInterface_Expecter) SetDescriptionString(s interface{}) *FeatureLocalInterface_SetDescriptionString_Call { + return &FeatureLocalInterface_SetDescriptionString_Call{Call: _e.mock.On("SetDescriptionString", s)} +} + +func (_c *FeatureLocalInterface_SetDescriptionString_Call) Run(run func(s string)) *FeatureLocalInterface_SetDescriptionString_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *FeatureLocalInterface_SetDescriptionString_Call) Return() *FeatureLocalInterface_SetDescriptionString_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureLocalInterface_SetDescriptionString_Call) RunAndReturn(run func(string)) *FeatureLocalInterface_SetDescriptionString_Call { + _c.Call.Return(run) + return _c +} + +// String provides a mock function with given fields: +func (_m *FeatureLocalInterface) String() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for String") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// FeatureLocalInterface_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type FeatureLocalInterface_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *FeatureLocalInterface_Expecter) String() *FeatureLocalInterface_String_Call { + return &FeatureLocalInterface_String_Call{Call: _e.mock.On("String")} +} + +func (_c *FeatureLocalInterface_String_Call) Run(run func()) *FeatureLocalInterface_String_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureLocalInterface_String_Call) Return(_a0 string) *FeatureLocalInterface_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureLocalInterface_String_Call) RunAndReturn(run func() string) *FeatureLocalInterface_String_Call { + _c.Call.Return(run) + return _c +} + +// Subscribe provides a mock function with given fields: remoteAdress +func (_m *FeatureLocalInterface) Subscribe(remoteAdress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(remoteAdress) + + if len(ret) == 0 { + panic("no return value specified for Subscribe") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(remoteAdress) + } + if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) *model.MsgCounterType); ok { + r0 = rf(remoteAdress) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(*model.FeatureAddressType) *model.ErrorType); ok { + r1 = rf(remoteAdress) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// FeatureLocalInterface_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe' +type FeatureLocalInterface_Subscribe_Call struct { + *mock.Call +} + +// Subscribe is a helper method to define mock.On call +// - remoteAdress *model.FeatureAddressType +func (_e *FeatureLocalInterface_Expecter) Subscribe(remoteAdress interface{}) *FeatureLocalInterface_Subscribe_Call { + return &FeatureLocalInterface_Subscribe_Call{Call: _e.mock.On("Subscribe", remoteAdress)} +} + +func (_c *FeatureLocalInterface_Subscribe_Call) Run(run func(remoteAdress *model.FeatureAddressType)) *FeatureLocalInterface_Subscribe_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType)) + }) + return _c +} + +func (_c *FeatureLocalInterface_Subscribe_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocalInterface_Subscribe_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeatureLocalInterface_Subscribe_Call) RunAndReturn(run func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocalInterface_Subscribe_Call { + _c.Call.Return(run) + return _c +} + +// Type provides a mock function with given fields: +func (_m *FeatureLocalInterface) Type() model.FeatureTypeType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Type") + } + + var r0 model.FeatureTypeType + if rf, ok := ret.Get(0).(func() model.FeatureTypeType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.FeatureTypeType) + } + + return r0 +} + +// FeatureLocalInterface_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' +type FeatureLocalInterface_Type_Call struct { + *mock.Call +} + +// Type is a helper method to define mock.On call +func (_e *FeatureLocalInterface_Expecter) Type() *FeatureLocalInterface_Type_Call { + return &FeatureLocalInterface_Type_Call{Call: _e.mock.On("Type")} +} + +func (_c *FeatureLocalInterface_Type_Call) Run(run func()) *FeatureLocalInterface_Type_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureLocalInterface_Type_Call) Return(_a0 model.FeatureTypeType) *FeatureLocalInterface_Type_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureLocalInterface_Type_Call) RunAndReturn(run func() model.FeatureTypeType) *FeatureLocalInterface_Type_Call { + _c.Call.Return(run) + return _c +} + +// WriteData provides a mock function with given fields: function, deleteSelector, partialSelector, deleteElements, destination +func (_m *FeatureLocalInterface) WriteData(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(function, deleteSelector, partialSelector, deleteElements, destination) + + if len(ret) == 0 { + panic("no return value specified for WriteData") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(function, deleteSelector, partialSelector, deleteElements, destination) + } + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemoteInterface) *model.MsgCounterType); ok { + r0 = rf(function, deleteSelector, partialSelector, deleteElements, destination) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemoteInterface) *model.ErrorType); ok { + r1 = rf(function, deleteSelector, partialSelector, deleteElements, destination) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// FeatureLocalInterface_WriteData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteData' +type FeatureLocalInterface_WriteData_Call struct { + *mock.Call +} + +// WriteData is a helper method to define mock.On call +// - function model.FunctionType +// - deleteSelector interface{} +// - partialSelector interface{} +// - deleteElements interface{} +// - destination api.FeatureRemoteInterface +func (_e *FeatureLocalInterface_Expecter) WriteData(function interface{}, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination interface{}) *FeatureLocalInterface_WriteData_Call { + return &FeatureLocalInterface_WriteData_Call{Call: _e.mock.On("WriteData", function, deleteSelector, partialSelector, deleteElements, destination)} +} + +func (_c *FeatureLocalInterface_WriteData_Call) Run(run func(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination api.FeatureRemoteInterface)) *FeatureLocalInterface_WriteData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(interface{}), args[4].(api.FeatureRemoteInterface)) + }) + return _c +} + +func (_c *FeatureLocalInterface_WriteData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *FeatureLocalInterface_WriteData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FeatureLocalInterface_WriteData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)) *FeatureLocalInterface_WriteData_Call { + _c.Call.Return(run) + return _c +} + +// NewFeatureLocalInterface creates a new instance of FeatureLocalInterface. 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 NewFeatureLocalInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *FeatureLocalInterface { + mock := &FeatureLocalInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/FeatureRemote.go b/mocks/FeatureRemote.go deleted file mode 100644 index 8ab69a7..0000000 --- a/mocks/FeatureRemote.go +++ /dev/null @@ -1,751 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" - - model "github.com/enbility/spine-go/model" - - time "time" -) - -// FeatureRemote is an autogenerated mock type for the FeatureRemote type -type FeatureRemote struct { - mock.Mock -} - -type FeatureRemote_Expecter struct { - mock *mock.Mock -} - -func (_m *FeatureRemote) EXPECT() *FeatureRemote_Expecter { - return &FeatureRemote_Expecter{mock: &_m.Mock} -} - -// Address provides a mock function with given fields: -func (_m *FeatureRemote) Address() *model.FeatureAddressType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Address") - } - - var r0 *model.FeatureAddressType - if rf, ok := ret.Get(0).(func() *model.FeatureAddressType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.FeatureAddressType) - } - } - - return r0 -} - -// FeatureRemote_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' -type FeatureRemote_Address_Call struct { - *mock.Call -} - -// Address is a helper method to define mock.On call -func (_e *FeatureRemote_Expecter) Address() *FeatureRemote_Address_Call { - return &FeatureRemote_Address_Call{Call: _e.mock.On("Address")} -} - -func (_c *FeatureRemote_Address_Call) Run(run func()) *FeatureRemote_Address_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureRemote_Address_Call) Return(_a0 *model.FeatureAddressType) *FeatureRemote_Address_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureRemote_Address_Call) RunAndReturn(run func() *model.FeatureAddressType) *FeatureRemote_Address_Call { - _c.Call.Return(run) - return _c -} - -// DataCopy provides a mock function with given fields: function -func (_m *FeatureRemote) DataCopy(function model.FunctionType) interface{} { - ret := _m.Called(function) - - if len(ret) == 0 { - panic("no return value specified for DataCopy") - } - - var r0 interface{} - if rf, ok := ret.Get(0).(func(model.FunctionType) interface{}); ok { - r0 = rf(function) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - return r0 -} - -// FeatureRemote_DataCopy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataCopy' -type FeatureRemote_DataCopy_Call struct { - *mock.Call -} - -// DataCopy is a helper method to define mock.On call -// - function model.FunctionType -func (_e *FeatureRemote_Expecter) DataCopy(function interface{}) *FeatureRemote_DataCopy_Call { - return &FeatureRemote_DataCopy_Call{Call: _e.mock.On("DataCopy", function)} -} - -func (_c *FeatureRemote_DataCopy_Call) Run(run func(function model.FunctionType)) *FeatureRemote_DataCopy_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType)) - }) - return _c -} - -func (_c *FeatureRemote_DataCopy_Call) Return(_a0 interface{}) *FeatureRemote_DataCopy_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureRemote_DataCopy_Call) RunAndReturn(run func(model.FunctionType) interface{}) *FeatureRemote_DataCopy_Call { - _c.Call.Return(run) - return _c -} - -// Description provides a mock function with given fields: -func (_m *FeatureRemote) Description() *model.DescriptionType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Description") - } - - var r0 *model.DescriptionType - if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.DescriptionType) - } - } - - return r0 -} - -// FeatureRemote_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' -type FeatureRemote_Description_Call struct { - *mock.Call -} - -// Description is a helper method to define mock.On call -func (_e *FeatureRemote_Expecter) Description() *FeatureRemote_Description_Call { - return &FeatureRemote_Description_Call{Call: _e.mock.On("Description")} -} - -func (_c *FeatureRemote_Description_Call) Run(run func()) *FeatureRemote_Description_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureRemote_Description_Call) Return(_a0 *model.DescriptionType) *FeatureRemote_Description_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureRemote_Description_Call) RunAndReturn(run func() *model.DescriptionType) *FeatureRemote_Description_Call { - _c.Call.Return(run) - return _c -} - -// Device provides a mock function with given fields: -func (_m *FeatureRemote) Device() api.DeviceRemote { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Device") - } - - var r0 api.DeviceRemote - if rf, ok := ret.Get(0).(func() api.DeviceRemote); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.DeviceRemote) - } - } - - return r0 -} - -// FeatureRemote_Device_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Device' -type FeatureRemote_Device_Call struct { - *mock.Call -} - -// Device is a helper method to define mock.On call -func (_e *FeatureRemote_Expecter) Device() *FeatureRemote_Device_Call { - return &FeatureRemote_Device_Call{Call: _e.mock.On("Device")} -} - -func (_c *FeatureRemote_Device_Call) Run(run func()) *FeatureRemote_Device_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureRemote_Device_Call) Return(_a0 api.DeviceRemote) *FeatureRemote_Device_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureRemote_Device_Call) RunAndReturn(run func() api.DeviceRemote) *FeatureRemote_Device_Call { - _c.Call.Return(run) - return _c -} - -// Entity provides a mock function with given fields: -func (_m *FeatureRemote) Entity() api.EntityRemote { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Entity") - } - - var r0 api.EntityRemote - if rf, ok := ret.Get(0).(func() api.EntityRemote); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.EntityRemote) - } - } - - return r0 -} - -// FeatureRemote_Entity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entity' -type FeatureRemote_Entity_Call struct { - *mock.Call -} - -// Entity is a helper method to define mock.On call -func (_e *FeatureRemote_Expecter) Entity() *FeatureRemote_Entity_Call { - return &FeatureRemote_Entity_Call{Call: _e.mock.On("Entity")} -} - -func (_c *FeatureRemote_Entity_Call) Run(run func()) *FeatureRemote_Entity_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureRemote_Entity_Call) Return(_a0 api.EntityRemote) *FeatureRemote_Entity_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureRemote_Entity_Call) RunAndReturn(run func() api.EntityRemote) *FeatureRemote_Entity_Call { - _c.Call.Return(run) - return _c -} - -// MaxResponseDelayDuration provides a mock function with given fields: -func (_m *FeatureRemote) MaxResponseDelayDuration() time.Duration { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for MaxResponseDelayDuration") - } - - var r0 time.Duration - if rf, ok := ret.Get(0).(func() time.Duration); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(time.Duration) - } - - return r0 -} - -// FeatureRemote_MaxResponseDelayDuration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MaxResponseDelayDuration' -type FeatureRemote_MaxResponseDelayDuration_Call struct { - *mock.Call -} - -// MaxResponseDelayDuration is a helper method to define mock.On call -func (_e *FeatureRemote_Expecter) MaxResponseDelayDuration() *FeatureRemote_MaxResponseDelayDuration_Call { - return &FeatureRemote_MaxResponseDelayDuration_Call{Call: _e.mock.On("MaxResponseDelayDuration")} -} - -func (_c *FeatureRemote_MaxResponseDelayDuration_Call) Run(run func()) *FeatureRemote_MaxResponseDelayDuration_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureRemote_MaxResponseDelayDuration_Call) Return(_a0 time.Duration) *FeatureRemote_MaxResponseDelayDuration_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureRemote_MaxResponseDelayDuration_Call) RunAndReturn(run func() time.Duration) *FeatureRemote_MaxResponseDelayDuration_Call { - _c.Call.Return(run) - return _c -} - -// Operations provides a mock function with given fields: -func (_m *FeatureRemote) Operations() map[model.FunctionType]api.Operations { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Operations") - } - - var r0 map[model.FunctionType]api.Operations - if rf, ok := ret.Get(0).(func() map[model.FunctionType]api.Operations); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[model.FunctionType]api.Operations) - } - } - - return r0 -} - -// FeatureRemote_Operations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Operations' -type FeatureRemote_Operations_Call struct { - *mock.Call -} - -// Operations is a helper method to define mock.On call -func (_e *FeatureRemote_Expecter) Operations() *FeatureRemote_Operations_Call { - return &FeatureRemote_Operations_Call{Call: _e.mock.On("Operations")} -} - -func (_c *FeatureRemote_Operations_Call) Run(run func()) *FeatureRemote_Operations_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureRemote_Operations_Call) Return(_a0 map[model.FunctionType]api.Operations) *FeatureRemote_Operations_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureRemote_Operations_Call) RunAndReturn(run func() map[model.FunctionType]api.Operations) *FeatureRemote_Operations_Call { - _c.Call.Return(run) - return _c -} - -// Role provides a mock function with given fields: -func (_m *FeatureRemote) Role() model.RoleType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Role") - } - - var r0 model.RoleType - if rf, ok := ret.Get(0).(func() model.RoleType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.RoleType) - } - - return r0 -} - -// FeatureRemote_Role_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Role' -type FeatureRemote_Role_Call struct { - *mock.Call -} - -// Role is a helper method to define mock.On call -func (_e *FeatureRemote_Expecter) Role() *FeatureRemote_Role_Call { - return &FeatureRemote_Role_Call{Call: _e.mock.On("Role")} -} - -func (_c *FeatureRemote_Role_Call) Run(run func()) *FeatureRemote_Role_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureRemote_Role_Call) Return(_a0 model.RoleType) *FeatureRemote_Role_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureRemote_Role_Call) RunAndReturn(run func() model.RoleType) *FeatureRemote_Role_Call { - _c.Call.Return(run) - return _c -} - -// Sender provides a mock function with given fields: -func (_m *FeatureRemote) Sender() api.Sender { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Sender") - } - - var r0 api.Sender - if rf, ok := ret.Get(0).(func() api.Sender); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.Sender) - } - } - - return r0 -} - -// FeatureRemote_Sender_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sender' -type FeatureRemote_Sender_Call struct { - *mock.Call -} - -// Sender is a helper method to define mock.On call -func (_e *FeatureRemote_Expecter) Sender() *FeatureRemote_Sender_Call { - return &FeatureRemote_Sender_Call{Call: _e.mock.On("Sender")} -} - -func (_c *FeatureRemote_Sender_Call) Run(run func()) *FeatureRemote_Sender_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureRemote_Sender_Call) Return(_a0 api.Sender) *FeatureRemote_Sender_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureRemote_Sender_Call) RunAndReturn(run func() api.Sender) *FeatureRemote_Sender_Call { - _c.Call.Return(run) - return _c -} - -// SetData provides a mock function with given fields: function, data -func (_m *FeatureRemote) SetData(function model.FunctionType, data interface{}) { - _m.Called(function, data) -} - -// FeatureRemote_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData' -type FeatureRemote_SetData_Call struct { - *mock.Call -} - -// SetData is a helper method to define mock.On call -// - function model.FunctionType -// - data interface{} -func (_e *FeatureRemote_Expecter) SetData(function interface{}, data interface{}) *FeatureRemote_SetData_Call { - return &FeatureRemote_SetData_Call{Call: _e.mock.On("SetData", function, data)} -} - -func (_c *FeatureRemote_SetData_Call) Run(run func(function model.FunctionType, data interface{})) *FeatureRemote_SetData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{})) - }) - return _c -} - -func (_c *FeatureRemote_SetData_Call) Return() *FeatureRemote_SetData_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureRemote_SetData_Call) RunAndReturn(run func(model.FunctionType, interface{})) *FeatureRemote_SetData_Call { - _c.Call.Return(run) - return _c -} - -// SetDescription provides a mock function with given fields: desc -func (_m *FeatureRemote) SetDescription(desc *model.DescriptionType) { - _m.Called(desc) -} - -// FeatureRemote_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' -type FeatureRemote_SetDescription_Call struct { - *mock.Call -} - -// SetDescription is a helper method to define mock.On call -// - desc *model.DescriptionType -func (_e *FeatureRemote_Expecter) SetDescription(desc interface{}) *FeatureRemote_SetDescription_Call { - return &FeatureRemote_SetDescription_Call{Call: _e.mock.On("SetDescription", desc)} -} - -func (_c *FeatureRemote_SetDescription_Call) Run(run func(desc *model.DescriptionType)) *FeatureRemote_SetDescription_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.DescriptionType)) - }) - return _c -} - -func (_c *FeatureRemote_SetDescription_Call) Return() *FeatureRemote_SetDescription_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureRemote_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *FeatureRemote_SetDescription_Call { - _c.Call.Return(run) - return _c -} - -// SetDescriptionString provides a mock function with given fields: s -func (_m *FeatureRemote) SetDescriptionString(s string) { - _m.Called(s) -} - -// FeatureRemote_SetDescriptionString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescriptionString' -type FeatureRemote_SetDescriptionString_Call struct { - *mock.Call -} - -// SetDescriptionString is a helper method to define mock.On call -// - s string -func (_e *FeatureRemote_Expecter) SetDescriptionString(s interface{}) *FeatureRemote_SetDescriptionString_Call { - return &FeatureRemote_SetDescriptionString_Call{Call: _e.mock.On("SetDescriptionString", s)} -} - -func (_c *FeatureRemote_SetDescriptionString_Call) Run(run func(s string)) *FeatureRemote_SetDescriptionString_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *FeatureRemote_SetDescriptionString_Call) Return() *FeatureRemote_SetDescriptionString_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureRemote_SetDescriptionString_Call) RunAndReturn(run func(string)) *FeatureRemote_SetDescriptionString_Call { - _c.Call.Return(run) - return _c -} - -// SetMaxResponseDelay provides a mock function with given fields: delay -func (_m *FeatureRemote) SetMaxResponseDelay(delay *model.MaxResponseDelayType) { - _m.Called(delay) -} - -// FeatureRemote_SetMaxResponseDelay_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMaxResponseDelay' -type FeatureRemote_SetMaxResponseDelay_Call struct { - *mock.Call -} - -// SetMaxResponseDelay is a helper method to define mock.On call -// - delay *model.MaxResponseDelayType -func (_e *FeatureRemote_Expecter) SetMaxResponseDelay(delay interface{}) *FeatureRemote_SetMaxResponseDelay_Call { - return &FeatureRemote_SetMaxResponseDelay_Call{Call: _e.mock.On("SetMaxResponseDelay", delay)} -} - -func (_c *FeatureRemote_SetMaxResponseDelay_Call) Run(run func(delay *model.MaxResponseDelayType)) *FeatureRemote_SetMaxResponseDelay_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.MaxResponseDelayType)) - }) - return _c -} - -func (_c *FeatureRemote_SetMaxResponseDelay_Call) Return() *FeatureRemote_SetMaxResponseDelay_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureRemote_SetMaxResponseDelay_Call) RunAndReturn(run func(*model.MaxResponseDelayType)) *FeatureRemote_SetMaxResponseDelay_Call { - _c.Call.Return(run) - return _c -} - -// SetOperations provides a mock function with given fields: functions -func (_m *FeatureRemote) SetOperations(functions []model.FunctionPropertyType) { - _m.Called(functions) -} - -// FeatureRemote_SetOperations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetOperations' -type FeatureRemote_SetOperations_Call struct { - *mock.Call -} - -// SetOperations is a helper method to define mock.On call -// - functions []model.FunctionPropertyType -func (_e *FeatureRemote_Expecter) SetOperations(functions interface{}) *FeatureRemote_SetOperations_Call { - return &FeatureRemote_SetOperations_Call{Call: _e.mock.On("SetOperations", functions)} -} - -func (_c *FeatureRemote_SetOperations_Call) Run(run func(functions []model.FunctionPropertyType)) *FeatureRemote_SetOperations_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]model.FunctionPropertyType)) - }) - return _c -} - -func (_c *FeatureRemote_SetOperations_Call) Return() *FeatureRemote_SetOperations_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureRemote_SetOperations_Call) RunAndReturn(run func([]model.FunctionPropertyType)) *FeatureRemote_SetOperations_Call { - _c.Call.Return(run) - return _c -} - -// String provides a mock function with given fields: -func (_m *FeatureRemote) String() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for String") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// FeatureRemote_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' -type FeatureRemote_String_Call struct { - *mock.Call -} - -// String is a helper method to define mock.On call -func (_e *FeatureRemote_Expecter) String() *FeatureRemote_String_Call { - return &FeatureRemote_String_Call{Call: _e.mock.On("String")} -} - -func (_c *FeatureRemote_String_Call) Run(run func()) *FeatureRemote_String_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureRemote_String_Call) Return(_a0 string) *FeatureRemote_String_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureRemote_String_Call) RunAndReturn(run func() string) *FeatureRemote_String_Call { - _c.Call.Return(run) - return _c -} - -// Type provides a mock function with given fields: -func (_m *FeatureRemote) Type() model.FeatureTypeType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Type") - } - - var r0 model.FeatureTypeType - if rf, ok := ret.Get(0).(func() model.FeatureTypeType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.FeatureTypeType) - } - - return r0 -} - -// FeatureRemote_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' -type FeatureRemote_Type_Call struct { - *mock.Call -} - -// Type is a helper method to define mock.On call -func (_e *FeatureRemote_Expecter) Type() *FeatureRemote_Type_Call { - return &FeatureRemote_Type_Call{Call: _e.mock.On("Type")} -} - -func (_c *FeatureRemote_Type_Call) Run(run func()) *FeatureRemote_Type_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FeatureRemote_Type_Call) Return(_a0 model.FeatureTypeType) *FeatureRemote_Type_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FeatureRemote_Type_Call) RunAndReturn(run func() model.FeatureTypeType) *FeatureRemote_Type_Call { - _c.Call.Return(run) - return _c -} - -// UpdateData provides a mock function with given fields: function, data, filterPartial, filterDelete -func (_m *FeatureRemote) UpdateData(function model.FunctionType, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType) { - _m.Called(function, data, filterPartial, filterDelete) -} - -// FeatureRemote_UpdateData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateData' -type FeatureRemote_UpdateData_Call struct { - *mock.Call -} - -// UpdateData is a helper method to define mock.On call -// - function model.FunctionType -// - data interface{} -// - filterPartial *model.FilterType -// - filterDelete *model.FilterType -func (_e *FeatureRemote_Expecter) UpdateData(function interface{}, data interface{}, filterPartial interface{}, filterDelete interface{}) *FeatureRemote_UpdateData_Call { - return &FeatureRemote_UpdateData_Call{Call: _e.mock.On("UpdateData", function, data, filterPartial, filterDelete)} -} - -func (_c *FeatureRemote_UpdateData_Call) Run(run func(function model.FunctionType, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FeatureRemote_UpdateData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(*model.FilterType), args[3].(*model.FilterType)) - }) - return _c -} - -func (_c *FeatureRemote_UpdateData_Call) Return() *FeatureRemote_UpdateData_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureRemote_UpdateData_Call) RunAndReturn(run func(model.FunctionType, interface{}, *model.FilterType, *model.FilterType)) *FeatureRemote_UpdateData_Call { - _c.Call.Return(run) - return _c -} - -// NewFeatureRemote creates a new instance of FeatureRemote. 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 NewFeatureRemote(t interface { - mock.TestingT - Cleanup(func()) -}) *FeatureRemote { - mock := &FeatureRemote{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/FeatureRemoteInterface.go b/mocks/FeatureRemoteInterface.go new file mode 100644 index 0000000..096a44a --- /dev/null +++ b/mocks/FeatureRemoteInterface.go @@ -0,0 +1,751 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" + + model "github.com/enbility/spine-go/model" + + time "time" +) + +// FeatureRemoteInterface is an autogenerated mock type for the FeatureRemoteInterface type +type FeatureRemoteInterface struct { + mock.Mock +} + +type FeatureRemoteInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *FeatureRemoteInterface) EXPECT() *FeatureRemoteInterface_Expecter { + return &FeatureRemoteInterface_Expecter{mock: &_m.Mock} +} + +// Address provides a mock function with given fields: +func (_m *FeatureRemoteInterface) Address() *model.FeatureAddressType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 *model.FeatureAddressType + if rf, ok := ret.Get(0).(func() *model.FeatureAddressType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.FeatureAddressType) + } + } + + return r0 +} + +// FeatureRemoteInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type FeatureRemoteInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *FeatureRemoteInterface_Expecter) Address() *FeatureRemoteInterface_Address_Call { + return &FeatureRemoteInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *FeatureRemoteInterface_Address_Call) Run(run func()) *FeatureRemoteInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureRemoteInterface_Address_Call) Return(_a0 *model.FeatureAddressType) *FeatureRemoteInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureRemoteInterface_Address_Call) RunAndReturn(run func() *model.FeatureAddressType) *FeatureRemoteInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// DataCopy provides a mock function with given fields: function +func (_m *FeatureRemoteInterface) DataCopy(function model.FunctionType) interface{} { + ret := _m.Called(function) + + if len(ret) == 0 { + panic("no return value specified for DataCopy") + } + + var r0 interface{} + if rf, ok := ret.Get(0).(func(model.FunctionType) interface{}); ok { + r0 = rf(function) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + + return r0 +} + +// FeatureRemoteInterface_DataCopy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataCopy' +type FeatureRemoteInterface_DataCopy_Call struct { + *mock.Call +} + +// DataCopy is a helper method to define mock.On call +// - function model.FunctionType +func (_e *FeatureRemoteInterface_Expecter) DataCopy(function interface{}) *FeatureRemoteInterface_DataCopy_Call { + return &FeatureRemoteInterface_DataCopy_Call{Call: _e.mock.On("DataCopy", function)} +} + +func (_c *FeatureRemoteInterface_DataCopy_Call) Run(run func(function model.FunctionType)) *FeatureRemoteInterface_DataCopy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType)) + }) + return _c +} + +func (_c *FeatureRemoteInterface_DataCopy_Call) Return(_a0 interface{}) *FeatureRemoteInterface_DataCopy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureRemoteInterface_DataCopy_Call) RunAndReturn(run func(model.FunctionType) interface{}) *FeatureRemoteInterface_DataCopy_Call { + _c.Call.Return(run) + return _c +} + +// Description provides a mock function with given fields: +func (_m *FeatureRemoteInterface) Description() *model.DescriptionType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 *model.DescriptionType + if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.DescriptionType) + } + } + + return r0 +} + +// FeatureRemoteInterface_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type FeatureRemoteInterface_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *FeatureRemoteInterface_Expecter) Description() *FeatureRemoteInterface_Description_Call { + return &FeatureRemoteInterface_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *FeatureRemoteInterface_Description_Call) Run(run func()) *FeatureRemoteInterface_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureRemoteInterface_Description_Call) Return(_a0 *model.DescriptionType) *FeatureRemoteInterface_Description_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureRemoteInterface_Description_Call) RunAndReturn(run func() *model.DescriptionType) *FeatureRemoteInterface_Description_Call { + _c.Call.Return(run) + return _c +} + +// Device provides a mock function with given fields: +func (_m *FeatureRemoteInterface) Device() api.DeviceRemoteInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Device") + } + + var r0 api.DeviceRemoteInterface + if rf, ok := ret.Get(0).(func() api.DeviceRemoteInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.DeviceRemoteInterface) + } + } + + return r0 +} + +// FeatureRemoteInterface_Device_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Device' +type FeatureRemoteInterface_Device_Call struct { + *mock.Call +} + +// Device is a helper method to define mock.On call +func (_e *FeatureRemoteInterface_Expecter) Device() *FeatureRemoteInterface_Device_Call { + return &FeatureRemoteInterface_Device_Call{Call: _e.mock.On("Device")} +} + +func (_c *FeatureRemoteInterface_Device_Call) Run(run func()) *FeatureRemoteInterface_Device_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureRemoteInterface_Device_Call) Return(_a0 api.DeviceRemoteInterface) *FeatureRemoteInterface_Device_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureRemoteInterface_Device_Call) RunAndReturn(run func() api.DeviceRemoteInterface) *FeatureRemoteInterface_Device_Call { + _c.Call.Return(run) + return _c +} + +// Entity provides a mock function with given fields: +func (_m *FeatureRemoteInterface) Entity() api.EntityRemoteInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Entity") + } + + var r0 api.EntityRemoteInterface + if rf, ok := ret.Get(0).(func() api.EntityRemoteInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.EntityRemoteInterface) + } + } + + return r0 +} + +// FeatureRemoteInterface_Entity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entity' +type FeatureRemoteInterface_Entity_Call struct { + *mock.Call +} + +// Entity is a helper method to define mock.On call +func (_e *FeatureRemoteInterface_Expecter) Entity() *FeatureRemoteInterface_Entity_Call { + return &FeatureRemoteInterface_Entity_Call{Call: _e.mock.On("Entity")} +} + +func (_c *FeatureRemoteInterface_Entity_Call) Run(run func()) *FeatureRemoteInterface_Entity_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureRemoteInterface_Entity_Call) Return(_a0 api.EntityRemoteInterface) *FeatureRemoteInterface_Entity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureRemoteInterface_Entity_Call) RunAndReturn(run func() api.EntityRemoteInterface) *FeatureRemoteInterface_Entity_Call { + _c.Call.Return(run) + return _c +} + +// MaxResponseDelayDuration provides a mock function with given fields: +func (_m *FeatureRemoteInterface) MaxResponseDelayDuration() time.Duration { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MaxResponseDelayDuration") + } + + var r0 time.Duration + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Duration) + } + + return r0 +} + +// FeatureRemoteInterface_MaxResponseDelayDuration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MaxResponseDelayDuration' +type FeatureRemoteInterface_MaxResponseDelayDuration_Call struct { + *mock.Call +} + +// MaxResponseDelayDuration is a helper method to define mock.On call +func (_e *FeatureRemoteInterface_Expecter) MaxResponseDelayDuration() *FeatureRemoteInterface_MaxResponseDelayDuration_Call { + return &FeatureRemoteInterface_MaxResponseDelayDuration_Call{Call: _e.mock.On("MaxResponseDelayDuration")} +} + +func (_c *FeatureRemoteInterface_MaxResponseDelayDuration_Call) Run(run func()) *FeatureRemoteInterface_MaxResponseDelayDuration_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureRemoteInterface_MaxResponseDelayDuration_Call) Return(_a0 time.Duration) *FeatureRemoteInterface_MaxResponseDelayDuration_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureRemoteInterface_MaxResponseDelayDuration_Call) RunAndReturn(run func() time.Duration) *FeatureRemoteInterface_MaxResponseDelayDuration_Call { + _c.Call.Return(run) + return _c +} + +// Operations provides a mock function with given fields: +func (_m *FeatureRemoteInterface) Operations() map[model.FunctionType]api.OperationsInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Operations") + } + + var r0 map[model.FunctionType]api.OperationsInterface + if rf, ok := ret.Get(0).(func() map[model.FunctionType]api.OperationsInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[model.FunctionType]api.OperationsInterface) + } + } + + return r0 +} + +// FeatureRemoteInterface_Operations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Operations' +type FeatureRemoteInterface_Operations_Call struct { + *mock.Call +} + +// Operations is a helper method to define mock.On call +func (_e *FeatureRemoteInterface_Expecter) Operations() *FeatureRemoteInterface_Operations_Call { + return &FeatureRemoteInterface_Operations_Call{Call: _e.mock.On("Operations")} +} + +func (_c *FeatureRemoteInterface_Operations_Call) Run(run func()) *FeatureRemoteInterface_Operations_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureRemoteInterface_Operations_Call) Return(_a0 map[model.FunctionType]api.OperationsInterface) *FeatureRemoteInterface_Operations_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureRemoteInterface_Operations_Call) RunAndReturn(run func() map[model.FunctionType]api.OperationsInterface) *FeatureRemoteInterface_Operations_Call { + _c.Call.Return(run) + return _c +} + +// Role provides a mock function with given fields: +func (_m *FeatureRemoteInterface) Role() model.RoleType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Role") + } + + var r0 model.RoleType + if rf, ok := ret.Get(0).(func() model.RoleType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.RoleType) + } + + return r0 +} + +// FeatureRemoteInterface_Role_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Role' +type FeatureRemoteInterface_Role_Call struct { + *mock.Call +} + +// Role is a helper method to define mock.On call +func (_e *FeatureRemoteInterface_Expecter) Role() *FeatureRemoteInterface_Role_Call { + return &FeatureRemoteInterface_Role_Call{Call: _e.mock.On("Role")} +} + +func (_c *FeatureRemoteInterface_Role_Call) Run(run func()) *FeatureRemoteInterface_Role_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureRemoteInterface_Role_Call) Return(_a0 model.RoleType) *FeatureRemoteInterface_Role_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureRemoteInterface_Role_Call) RunAndReturn(run func() model.RoleType) *FeatureRemoteInterface_Role_Call { + _c.Call.Return(run) + return _c +} + +// Sender provides a mock function with given fields: +func (_m *FeatureRemoteInterface) Sender() api.SenderInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Sender") + } + + var r0 api.SenderInterface + if rf, ok := ret.Get(0).(func() api.SenderInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.SenderInterface) + } + } + + return r0 +} + +// FeatureRemoteInterface_Sender_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sender' +type FeatureRemoteInterface_Sender_Call struct { + *mock.Call +} + +// Sender is a helper method to define mock.On call +func (_e *FeatureRemoteInterface_Expecter) Sender() *FeatureRemoteInterface_Sender_Call { + return &FeatureRemoteInterface_Sender_Call{Call: _e.mock.On("Sender")} +} + +func (_c *FeatureRemoteInterface_Sender_Call) Run(run func()) *FeatureRemoteInterface_Sender_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureRemoteInterface_Sender_Call) Return(_a0 api.SenderInterface) *FeatureRemoteInterface_Sender_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureRemoteInterface_Sender_Call) RunAndReturn(run func() api.SenderInterface) *FeatureRemoteInterface_Sender_Call { + _c.Call.Return(run) + return _c +} + +// SetData provides a mock function with given fields: function, data +func (_m *FeatureRemoteInterface) SetData(function model.FunctionType, data interface{}) { + _m.Called(function, data) +} + +// FeatureRemoteInterface_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData' +type FeatureRemoteInterface_SetData_Call struct { + *mock.Call +} + +// SetData is a helper method to define mock.On call +// - function model.FunctionType +// - data interface{} +func (_e *FeatureRemoteInterface_Expecter) SetData(function interface{}, data interface{}) *FeatureRemoteInterface_SetData_Call { + return &FeatureRemoteInterface_SetData_Call{Call: _e.mock.On("SetData", function, data)} +} + +func (_c *FeatureRemoteInterface_SetData_Call) Run(run func(function model.FunctionType, data interface{})) *FeatureRemoteInterface_SetData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(interface{})) + }) + return _c +} + +func (_c *FeatureRemoteInterface_SetData_Call) Return() *FeatureRemoteInterface_SetData_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureRemoteInterface_SetData_Call) RunAndReturn(run func(model.FunctionType, interface{})) *FeatureRemoteInterface_SetData_Call { + _c.Call.Return(run) + return _c +} + +// SetDescription provides a mock function with given fields: desc +func (_m *FeatureRemoteInterface) SetDescription(desc *model.DescriptionType) { + _m.Called(desc) +} + +// FeatureRemoteInterface_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' +type FeatureRemoteInterface_SetDescription_Call struct { + *mock.Call +} + +// SetDescription is a helper method to define mock.On call +// - desc *model.DescriptionType +func (_e *FeatureRemoteInterface_Expecter) SetDescription(desc interface{}) *FeatureRemoteInterface_SetDescription_Call { + return &FeatureRemoteInterface_SetDescription_Call{Call: _e.mock.On("SetDescription", desc)} +} + +func (_c *FeatureRemoteInterface_SetDescription_Call) Run(run func(desc *model.DescriptionType)) *FeatureRemoteInterface_SetDescription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.DescriptionType)) + }) + return _c +} + +func (_c *FeatureRemoteInterface_SetDescription_Call) Return() *FeatureRemoteInterface_SetDescription_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureRemoteInterface_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *FeatureRemoteInterface_SetDescription_Call { + _c.Call.Return(run) + return _c +} + +// SetDescriptionString provides a mock function with given fields: s +func (_m *FeatureRemoteInterface) SetDescriptionString(s string) { + _m.Called(s) +} + +// FeatureRemoteInterface_SetDescriptionString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescriptionString' +type FeatureRemoteInterface_SetDescriptionString_Call struct { + *mock.Call +} + +// SetDescriptionString is a helper method to define mock.On call +// - s string +func (_e *FeatureRemoteInterface_Expecter) SetDescriptionString(s interface{}) *FeatureRemoteInterface_SetDescriptionString_Call { + return &FeatureRemoteInterface_SetDescriptionString_Call{Call: _e.mock.On("SetDescriptionString", s)} +} + +func (_c *FeatureRemoteInterface_SetDescriptionString_Call) Run(run func(s string)) *FeatureRemoteInterface_SetDescriptionString_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *FeatureRemoteInterface_SetDescriptionString_Call) Return() *FeatureRemoteInterface_SetDescriptionString_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureRemoteInterface_SetDescriptionString_Call) RunAndReturn(run func(string)) *FeatureRemoteInterface_SetDescriptionString_Call { + _c.Call.Return(run) + return _c +} + +// SetMaxResponseDelay provides a mock function with given fields: delay +func (_m *FeatureRemoteInterface) SetMaxResponseDelay(delay *model.MaxResponseDelayType) { + _m.Called(delay) +} + +// FeatureRemoteInterface_SetMaxResponseDelay_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMaxResponseDelay' +type FeatureRemoteInterface_SetMaxResponseDelay_Call struct { + *mock.Call +} + +// SetMaxResponseDelay is a helper method to define mock.On call +// - delay *model.MaxResponseDelayType +func (_e *FeatureRemoteInterface_Expecter) SetMaxResponseDelay(delay interface{}) *FeatureRemoteInterface_SetMaxResponseDelay_Call { + return &FeatureRemoteInterface_SetMaxResponseDelay_Call{Call: _e.mock.On("SetMaxResponseDelay", delay)} +} + +func (_c *FeatureRemoteInterface_SetMaxResponseDelay_Call) Run(run func(delay *model.MaxResponseDelayType)) *FeatureRemoteInterface_SetMaxResponseDelay_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.MaxResponseDelayType)) + }) + return _c +} + +func (_c *FeatureRemoteInterface_SetMaxResponseDelay_Call) Return() *FeatureRemoteInterface_SetMaxResponseDelay_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureRemoteInterface_SetMaxResponseDelay_Call) RunAndReturn(run func(*model.MaxResponseDelayType)) *FeatureRemoteInterface_SetMaxResponseDelay_Call { + _c.Call.Return(run) + return _c +} + +// SetOperations provides a mock function with given fields: functions +func (_m *FeatureRemoteInterface) SetOperations(functions []model.FunctionPropertyType) { + _m.Called(functions) +} + +// FeatureRemoteInterface_SetOperations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetOperations' +type FeatureRemoteInterface_SetOperations_Call struct { + *mock.Call +} + +// SetOperations is a helper method to define mock.On call +// - functions []model.FunctionPropertyType +func (_e *FeatureRemoteInterface_Expecter) SetOperations(functions interface{}) *FeatureRemoteInterface_SetOperations_Call { + return &FeatureRemoteInterface_SetOperations_Call{Call: _e.mock.On("SetOperations", functions)} +} + +func (_c *FeatureRemoteInterface_SetOperations_Call) Run(run func(functions []model.FunctionPropertyType)) *FeatureRemoteInterface_SetOperations_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]model.FunctionPropertyType)) + }) + return _c +} + +func (_c *FeatureRemoteInterface_SetOperations_Call) Return() *FeatureRemoteInterface_SetOperations_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureRemoteInterface_SetOperations_Call) RunAndReturn(run func([]model.FunctionPropertyType)) *FeatureRemoteInterface_SetOperations_Call { + _c.Call.Return(run) + return _c +} + +// String provides a mock function with given fields: +func (_m *FeatureRemoteInterface) String() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for String") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// FeatureRemoteInterface_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type FeatureRemoteInterface_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *FeatureRemoteInterface_Expecter) String() *FeatureRemoteInterface_String_Call { + return &FeatureRemoteInterface_String_Call{Call: _e.mock.On("String")} +} + +func (_c *FeatureRemoteInterface_String_Call) Run(run func()) *FeatureRemoteInterface_String_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureRemoteInterface_String_Call) Return(_a0 string) *FeatureRemoteInterface_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureRemoteInterface_String_Call) RunAndReturn(run func() string) *FeatureRemoteInterface_String_Call { + _c.Call.Return(run) + return _c +} + +// Type provides a mock function with given fields: +func (_m *FeatureRemoteInterface) Type() model.FeatureTypeType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Type") + } + + var r0 model.FeatureTypeType + if rf, ok := ret.Get(0).(func() model.FeatureTypeType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.FeatureTypeType) + } + + return r0 +} + +// FeatureRemoteInterface_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' +type FeatureRemoteInterface_Type_Call struct { + *mock.Call +} + +// Type is a helper method to define mock.On call +func (_e *FeatureRemoteInterface_Expecter) Type() *FeatureRemoteInterface_Type_Call { + return &FeatureRemoteInterface_Type_Call{Call: _e.mock.On("Type")} +} + +func (_c *FeatureRemoteInterface_Type_Call) Run(run func()) *FeatureRemoteInterface_Type_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FeatureRemoteInterface_Type_Call) Return(_a0 model.FeatureTypeType) *FeatureRemoteInterface_Type_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FeatureRemoteInterface_Type_Call) RunAndReturn(run func() model.FeatureTypeType) *FeatureRemoteInterface_Type_Call { + _c.Call.Return(run) + return _c +} + +// UpdateData provides a mock function with given fields: function, data, filterPartial, filterDelete +func (_m *FeatureRemoteInterface) UpdateData(function model.FunctionType, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType) { + _m.Called(function, data, filterPartial, filterDelete) +} + +// FeatureRemoteInterface_UpdateData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateData' +type FeatureRemoteInterface_UpdateData_Call struct { + *mock.Call +} + +// UpdateData is a helper method to define mock.On call +// - function model.FunctionType +// - data interface{} +// - filterPartial *model.FilterType +// - filterDelete *model.FilterType +func (_e *FeatureRemoteInterface_Expecter) UpdateData(function interface{}, data interface{}, filterPartial interface{}, filterDelete interface{}) *FeatureRemoteInterface_UpdateData_Call { + return &FeatureRemoteInterface_UpdateData_Call{Call: _e.mock.On("UpdateData", function, data, filterPartial, filterDelete)} +} + +func (_c *FeatureRemoteInterface_UpdateData_Call) Run(run func(function model.FunctionType, data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FeatureRemoteInterface_UpdateData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(*model.FilterType), args[3].(*model.FilterType)) + }) + return _c +} + +func (_c *FeatureRemoteInterface_UpdateData_Call) Return() *FeatureRemoteInterface_UpdateData_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureRemoteInterface_UpdateData_Call) RunAndReturn(run func(model.FunctionType, interface{}, *model.FilterType, *model.FilterType)) *FeatureRemoteInterface_UpdateData_Call { + _c.Call.Return(run) + return _c +} + +// NewFeatureRemoteInterface creates a new instance of FeatureRemoteInterface. 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 NewFeatureRemoteInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *FeatureRemoteInterface { + mock := &FeatureRemoteInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/FeatureResult.go b/mocks/FeatureResult.go deleted file mode 100644 index f9d30ad..0000000 --- a/mocks/FeatureResult.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" -) - -// FeatureResult is an autogenerated mock type for the FeatureResult type -type FeatureResult struct { - mock.Mock -} - -type FeatureResult_Expecter struct { - mock *mock.Mock -} - -func (_m *FeatureResult) EXPECT() *FeatureResult_Expecter { - return &FeatureResult_Expecter{mock: &_m.Mock} -} - -// HandleResult provides a mock function with given fields: _a0 -func (_m *FeatureResult) HandleResult(_a0 api.ResultMessage) { - _m.Called(_a0) -} - -// FeatureResult_HandleResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleResult' -type FeatureResult_HandleResult_Call struct { - *mock.Call -} - -// HandleResult is a helper method to define mock.On call -// - _a0 api.ResultMessage -func (_e *FeatureResult_Expecter) HandleResult(_a0 interface{}) *FeatureResult_HandleResult_Call { - return &FeatureResult_HandleResult_Call{Call: _e.mock.On("HandleResult", _a0)} -} - -func (_c *FeatureResult_HandleResult_Call) Run(run func(_a0 api.ResultMessage)) *FeatureResult_HandleResult_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.ResultMessage)) - }) - return _c -} - -func (_c *FeatureResult_HandleResult_Call) Return() *FeatureResult_HandleResult_Call { - _c.Call.Return() - return _c -} - -func (_c *FeatureResult_HandleResult_Call) RunAndReturn(run func(api.ResultMessage)) *FeatureResult_HandleResult_Call { - _c.Call.Return(run) - return _c -} - -// NewFeatureResult creates a new instance of FeatureResult. 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 NewFeatureResult(t interface { - mock.TestingT - Cleanup(func()) -}) *FeatureResult { - mock := &FeatureResult{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/FeatureResultInterface.go b/mocks/FeatureResultInterface.go new file mode 100644 index 0000000..2f5b25c --- /dev/null +++ b/mocks/FeatureResultInterface.go @@ -0,0 +1,68 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" +) + +// FeatureResultInterface is an autogenerated mock type for the FeatureResultInterface type +type FeatureResultInterface struct { + mock.Mock +} + +type FeatureResultInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *FeatureResultInterface) EXPECT() *FeatureResultInterface_Expecter { + return &FeatureResultInterface_Expecter{mock: &_m.Mock} +} + +// HandleResult provides a mock function with given fields: _a0 +func (_m *FeatureResultInterface) HandleResult(_a0 api.ResultMessage) { + _m.Called(_a0) +} + +// FeatureResultInterface_HandleResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleResult' +type FeatureResultInterface_HandleResult_Call struct { + *mock.Call +} + +// HandleResult is a helper method to define mock.On call +// - _a0 api.ResultMessage +func (_e *FeatureResultInterface_Expecter) HandleResult(_a0 interface{}) *FeatureResultInterface_HandleResult_Call { + return &FeatureResultInterface_HandleResult_Call{Call: _e.mock.On("HandleResult", _a0)} +} + +func (_c *FeatureResultInterface_HandleResult_Call) Run(run func(_a0 api.ResultMessage)) *FeatureResultInterface_HandleResult_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.ResultMessage)) + }) + return _c +} + +func (_c *FeatureResultInterface_HandleResult_Call) Return() *FeatureResultInterface_HandleResult_Call { + _c.Call.Return() + return _c +} + +func (_c *FeatureResultInterface_HandleResult_Call) RunAndReturn(run func(api.ResultMessage)) *FeatureResultInterface_HandleResult_Call { + _c.Call.Return(run) + return _c +} + +// NewFeatureResultInterface creates a new instance of FeatureResultInterface. 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 NewFeatureResultInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *FeatureResultInterface { + mock := &FeatureResultInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/FunctionData.go b/mocks/FunctionData.go deleted file mode 100644 index e43891b..0000000 --- a/mocks/FunctionData.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - model "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" -) - -// FunctionData is an autogenerated mock type for the FunctionData type -type FunctionData struct { - mock.Mock -} - -type FunctionData_Expecter struct { - mock *mock.Mock -} - -func (_m *FunctionData) EXPECT() *FunctionData_Expecter { - return &FunctionData_Expecter{mock: &_m.Mock} -} - -// DataCopyAny provides a mock function with given fields: -func (_m *FunctionData) DataCopyAny() interface{} { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for DataCopyAny") - } - - var r0 interface{} - if rf, ok := ret.Get(0).(func() interface{}); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - return r0 -} - -// FunctionData_DataCopyAny_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataCopyAny' -type FunctionData_DataCopyAny_Call struct { - *mock.Call -} - -// DataCopyAny is a helper method to define mock.On call -func (_e *FunctionData_Expecter) DataCopyAny() *FunctionData_DataCopyAny_Call { - return &FunctionData_DataCopyAny_Call{Call: _e.mock.On("DataCopyAny")} -} - -func (_c *FunctionData_DataCopyAny_Call) Run(run func()) *FunctionData_DataCopyAny_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FunctionData_DataCopyAny_Call) Return(_a0 interface{}) *FunctionData_DataCopyAny_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FunctionData_DataCopyAny_Call) RunAndReturn(run func() interface{}) *FunctionData_DataCopyAny_Call { - _c.Call.Return(run) - return _c -} - -// Function provides a mock function with given fields: -func (_m *FunctionData) Function() model.FunctionType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Function") - } - - var r0 model.FunctionType - if rf, ok := ret.Get(0).(func() model.FunctionType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.FunctionType) - } - - return r0 -} - -// FunctionData_Function_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Function' -type FunctionData_Function_Call struct { - *mock.Call -} - -// Function is a helper method to define mock.On call -func (_e *FunctionData_Expecter) Function() *FunctionData_Function_Call { - return &FunctionData_Function_Call{Call: _e.mock.On("Function")} -} - -func (_c *FunctionData_Function_Call) Run(run func()) *FunctionData_Function_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FunctionData_Function_Call) Return(_a0 model.FunctionType) *FunctionData_Function_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FunctionData_Function_Call) RunAndReturn(run func() model.FunctionType) *FunctionData_Function_Call { - _c.Call.Return(run) - return _c -} - -// UpdateDataAny provides a mock function with given fields: data, filterPartial, filterDelete -func (_m *FunctionData) UpdateDataAny(data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType) { - _m.Called(data, filterPartial, filterDelete) -} - -// FunctionData_UpdateDataAny_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataAny' -type FunctionData_UpdateDataAny_Call struct { - *mock.Call -} - -// UpdateDataAny is a helper method to define mock.On call -// - data interface{} -// - filterPartial *model.FilterType -// - filterDelete *model.FilterType -func (_e *FunctionData_Expecter) UpdateDataAny(data interface{}, filterPartial interface{}, filterDelete interface{}) *FunctionData_UpdateDataAny_Call { - return &FunctionData_UpdateDataAny_Call{Call: _e.mock.On("UpdateDataAny", data, filterPartial, filterDelete)} -} - -func (_c *FunctionData_UpdateDataAny_Call) Run(run func(data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FunctionData_UpdateDataAny_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(interface{}), args[1].(*model.FilterType), args[2].(*model.FilterType)) - }) - return _c -} - -func (_c *FunctionData_UpdateDataAny_Call) Return() *FunctionData_UpdateDataAny_Call { - _c.Call.Return() - return _c -} - -func (_c *FunctionData_UpdateDataAny_Call) RunAndReturn(run func(interface{}, *model.FilterType, *model.FilterType)) *FunctionData_UpdateDataAny_Call { - _c.Call.Return(run) - return _c -} - -// NewFunctionData creates a new instance of FunctionData. 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 NewFunctionData(t interface { - mock.TestingT - Cleanup(func()) -}) *FunctionData { - mock := &FunctionData{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/FunctionDataCmd.go b/mocks/FunctionDataCmd.go deleted file mode 100644 index b6f887e..0000000 --- a/mocks/FunctionDataCmd.go +++ /dev/null @@ -1,352 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - model "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" -) - -// FunctionDataCmd is an autogenerated mock type for the FunctionDataCmd type -type FunctionDataCmd struct { - mock.Mock -} - -type FunctionDataCmd_Expecter struct { - mock *mock.Mock -} - -func (_m *FunctionDataCmd) EXPECT() *FunctionDataCmd_Expecter { - return &FunctionDataCmd_Expecter{mock: &_m.Mock} -} - -// DataCopyAny provides a mock function with given fields: -func (_m *FunctionDataCmd) DataCopyAny() interface{} { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for DataCopyAny") - } - - var r0 interface{} - if rf, ok := ret.Get(0).(func() interface{}); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - return r0 -} - -// FunctionDataCmd_DataCopyAny_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataCopyAny' -type FunctionDataCmd_DataCopyAny_Call struct { - *mock.Call -} - -// DataCopyAny is a helper method to define mock.On call -func (_e *FunctionDataCmd_Expecter) DataCopyAny() *FunctionDataCmd_DataCopyAny_Call { - return &FunctionDataCmd_DataCopyAny_Call{Call: _e.mock.On("DataCopyAny")} -} - -func (_c *FunctionDataCmd_DataCopyAny_Call) Run(run func()) *FunctionDataCmd_DataCopyAny_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FunctionDataCmd_DataCopyAny_Call) Return(_a0 interface{}) *FunctionDataCmd_DataCopyAny_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FunctionDataCmd_DataCopyAny_Call) RunAndReturn(run func() interface{}) *FunctionDataCmd_DataCopyAny_Call { - _c.Call.Return(run) - return _c -} - -// Function provides a mock function with given fields: -func (_m *FunctionDataCmd) Function() model.FunctionType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Function") - } - - var r0 model.FunctionType - if rf, ok := ret.Get(0).(func() model.FunctionType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.FunctionType) - } - - return r0 -} - -// FunctionDataCmd_Function_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Function' -type FunctionDataCmd_Function_Call struct { - *mock.Call -} - -// Function is a helper method to define mock.On call -func (_e *FunctionDataCmd_Expecter) Function() *FunctionDataCmd_Function_Call { - return &FunctionDataCmd_Function_Call{Call: _e.mock.On("Function")} -} - -func (_c *FunctionDataCmd_Function_Call) Run(run func()) *FunctionDataCmd_Function_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *FunctionDataCmd_Function_Call) Return(_a0 model.FunctionType) *FunctionDataCmd_Function_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FunctionDataCmd_Function_Call) RunAndReturn(run func() model.FunctionType) *FunctionDataCmd_Function_Call { - _c.Call.Return(run) - return _c -} - -// NotifyCmdType provides a mock function with given fields: deleteSelector, partialSelector, partialWithoutSelector, deleteElements -func (_m *FunctionDataCmd) NotifyCmdType(deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{}) model.CmdType { - ret := _m.Called(deleteSelector, partialSelector, partialWithoutSelector, deleteElements) - - if len(ret) == 0 { - panic("no return value specified for NotifyCmdType") - } - - var r0 model.CmdType - if rf, ok := ret.Get(0).(func(interface{}, interface{}, bool, interface{}) model.CmdType); ok { - r0 = rf(deleteSelector, partialSelector, partialWithoutSelector, deleteElements) - } else { - r0 = ret.Get(0).(model.CmdType) - } - - return r0 -} - -// FunctionDataCmd_NotifyCmdType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotifyCmdType' -type FunctionDataCmd_NotifyCmdType_Call struct { - *mock.Call -} - -// NotifyCmdType is a helper method to define mock.On call -// - deleteSelector interface{} -// - partialSelector interface{} -// - partialWithoutSelector bool -// - deleteElements interface{} -func (_e *FunctionDataCmd_Expecter) NotifyCmdType(deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector interface{}, deleteElements interface{}) *FunctionDataCmd_NotifyCmdType_Call { - return &FunctionDataCmd_NotifyCmdType_Call{Call: _e.mock.On("NotifyCmdType", deleteSelector, partialSelector, partialWithoutSelector, deleteElements)} -} - -func (_c *FunctionDataCmd_NotifyCmdType_Call) Run(run func(deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{})) *FunctionDataCmd_NotifyCmdType_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(interface{}), args[1].(interface{}), args[2].(bool), args[3].(interface{})) - }) - return _c -} - -func (_c *FunctionDataCmd_NotifyCmdType_Call) Return(_a0 model.CmdType) *FunctionDataCmd_NotifyCmdType_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FunctionDataCmd_NotifyCmdType_Call) RunAndReturn(run func(interface{}, interface{}, bool, interface{}) model.CmdType) *FunctionDataCmd_NotifyCmdType_Call { - _c.Call.Return(run) - return _c -} - -// ReadCmdType provides a mock function with given fields: partialSelector, elements -func (_m *FunctionDataCmd) ReadCmdType(partialSelector interface{}, elements interface{}) model.CmdType { - ret := _m.Called(partialSelector, elements) - - if len(ret) == 0 { - panic("no return value specified for ReadCmdType") - } - - var r0 model.CmdType - if rf, ok := ret.Get(0).(func(interface{}, interface{}) model.CmdType); ok { - r0 = rf(partialSelector, elements) - } else { - r0 = ret.Get(0).(model.CmdType) - } - - return r0 -} - -// FunctionDataCmd_ReadCmdType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadCmdType' -type FunctionDataCmd_ReadCmdType_Call struct { - *mock.Call -} - -// ReadCmdType is a helper method to define mock.On call -// - partialSelector interface{} -// - elements interface{} -func (_e *FunctionDataCmd_Expecter) ReadCmdType(partialSelector interface{}, elements interface{}) *FunctionDataCmd_ReadCmdType_Call { - return &FunctionDataCmd_ReadCmdType_Call{Call: _e.mock.On("ReadCmdType", partialSelector, elements)} -} - -func (_c *FunctionDataCmd_ReadCmdType_Call) Run(run func(partialSelector interface{}, elements interface{})) *FunctionDataCmd_ReadCmdType_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(interface{}), args[1].(interface{})) - }) - return _c -} - -func (_c *FunctionDataCmd_ReadCmdType_Call) Return(_a0 model.CmdType) *FunctionDataCmd_ReadCmdType_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FunctionDataCmd_ReadCmdType_Call) RunAndReturn(run func(interface{}, interface{}) model.CmdType) *FunctionDataCmd_ReadCmdType_Call { - _c.Call.Return(run) - return _c -} - -// ReplyCmdType provides a mock function with given fields: partial -func (_m *FunctionDataCmd) ReplyCmdType(partial bool) model.CmdType { - ret := _m.Called(partial) - - if len(ret) == 0 { - panic("no return value specified for ReplyCmdType") - } - - var r0 model.CmdType - if rf, ok := ret.Get(0).(func(bool) model.CmdType); ok { - r0 = rf(partial) - } else { - r0 = ret.Get(0).(model.CmdType) - } - - return r0 -} - -// FunctionDataCmd_ReplyCmdType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplyCmdType' -type FunctionDataCmd_ReplyCmdType_Call struct { - *mock.Call -} - -// ReplyCmdType is a helper method to define mock.On call -// - partial bool -func (_e *FunctionDataCmd_Expecter) ReplyCmdType(partial interface{}) *FunctionDataCmd_ReplyCmdType_Call { - return &FunctionDataCmd_ReplyCmdType_Call{Call: _e.mock.On("ReplyCmdType", partial)} -} - -func (_c *FunctionDataCmd_ReplyCmdType_Call) Run(run func(partial bool)) *FunctionDataCmd_ReplyCmdType_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(bool)) - }) - return _c -} - -func (_c *FunctionDataCmd_ReplyCmdType_Call) Return(_a0 model.CmdType) *FunctionDataCmd_ReplyCmdType_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FunctionDataCmd_ReplyCmdType_Call) RunAndReturn(run func(bool) model.CmdType) *FunctionDataCmd_ReplyCmdType_Call { - _c.Call.Return(run) - return _c -} - -// UpdateDataAny provides a mock function with given fields: data, filterPartial, filterDelete -func (_m *FunctionDataCmd) UpdateDataAny(data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType) { - _m.Called(data, filterPartial, filterDelete) -} - -// FunctionDataCmd_UpdateDataAny_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataAny' -type FunctionDataCmd_UpdateDataAny_Call struct { - *mock.Call -} - -// UpdateDataAny is a helper method to define mock.On call -// - data interface{} -// - filterPartial *model.FilterType -// - filterDelete *model.FilterType -func (_e *FunctionDataCmd_Expecter) UpdateDataAny(data interface{}, filterPartial interface{}, filterDelete interface{}) *FunctionDataCmd_UpdateDataAny_Call { - return &FunctionDataCmd_UpdateDataAny_Call{Call: _e.mock.On("UpdateDataAny", data, filterPartial, filterDelete)} -} - -func (_c *FunctionDataCmd_UpdateDataAny_Call) Run(run func(data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FunctionDataCmd_UpdateDataAny_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(interface{}), args[1].(*model.FilterType), args[2].(*model.FilterType)) - }) - return _c -} - -func (_c *FunctionDataCmd_UpdateDataAny_Call) Return() *FunctionDataCmd_UpdateDataAny_Call { - _c.Call.Return() - return _c -} - -func (_c *FunctionDataCmd_UpdateDataAny_Call) RunAndReturn(run func(interface{}, *model.FilterType, *model.FilterType)) *FunctionDataCmd_UpdateDataAny_Call { - _c.Call.Return(run) - return _c -} - -// WriteCmdType provides a mock function with given fields: deleteSelector, partialSelector, deleteElements -func (_m *FunctionDataCmd) WriteCmdType(deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}) model.CmdType { - ret := _m.Called(deleteSelector, partialSelector, deleteElements) - - if len(ret) == 0 { - panic("no return value specified for WriteCmdType") - } - - var r0 model.CmdType - if rf, ok := ret.Get(0).(func(interface{}, interface{}, interface{}) model.CmdType); ok { - r0 = rf(deleteSelector, partialSelector, deleteElements) - } else { - r0 = ret.Get(0).(model.CmdType) - } - - return r0 -} - -// FunctionDataCmd_WriteCmdType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteCmdType' -type FunctionDataCmd_WriteCmdType_Call struct { - *mock.Call -} - -// WriteCmdType is a helper method to define mock.On call -// - deleteSelector interface{} -// - partialSelector interface{} -// - deleteElements interface{} -func (_e *FunctionDataCmd_Expecter) WriteCmdType(deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}) *FunctionDataCmd_WriteCmdType_Call { - return &FunctionDataCmd_WriteCmdType_Call{Call: _e.mock.On("WriteCmdType", deleteSelector, partialSelector, deleteElements)} -} - -func (_c *FunctionDataCmd_WriteCmdType_Call) Run(run func(deleteSelector interface{}, partialSelector interface{}, deleteElements interface{})) *FunctionDataCmd_WriteCmdType_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(interface{}), args[1].(interface{}), args[2].(interface{})) - }) - return _c -} - -func (_c *FunctionDataCmd_WriteCmdType_Call) Return(_a0 model.CmdType) *FunctionDataCmd_WriteCmdType_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *FunctionDataCmd_WriteCmdType_Call) RunAndReturn(run func(interface{}, interface{}, interface{}) model.CmdType) *FunctionDataCmd_WriteCmdType_Call { - _c.Call.Return(run) - return _c -} - -// NewFunctionDataCmd creates a new instance of FunctionDataCmd. 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 NewFunctionDataCmd(t interface { - mock.TestingT - Cleanup(func()) -}) *FunctionDataCmd { - mock := &FunctionDataCmd{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/FunctionDataCmdInterface.go b/mocks/FunctionDataCmdInterface.go new file mode 100644 index 0000000..f7d8f30 --- /dev/null +++ b/mocks/FunctionDataCmdInterface.go @@ -0,0 +1,352 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + model "github.com/enbility/spine-go/model" + mock "github.com/stretchr/testify/mock" +) + +// FunctionDataCmdInterface is an autogenerated mock type for the FunctionDataCmdInterface type +type FunctionDataCmdInterface struct { + mock.Mock +} + +type FunctionDataCmdInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *FunctionDataCmdInterface) EXPECT() *FunctionDataCmdInterface_Expecter { + return &FunctionDataCmdInterface_Expecter{mock: &_m.Mock} +} + +// DataCopyAny provides a mock function with given fields: +func (_m *FunctionDataCmdInterface) DataCopyAny() interface{} { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DataCopyAny") + } + + var r0 interface{} + if rf, ok := ret.Get(0).(func() interface{}); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + + return r0 +} + +// FunctionDataCmdInterface_DataCopyAny_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataCopyAny' +type FunctionDataCmdInterface_DataCopyAny_Call struct { + *mock.Call +} + +// DataCopyAny is a helper method to define mock.On call +func (_e *FunctionDataCmdInterface_Expecter) DataCopyAny() *FunctionDataCmdInterface_DataCopyAny_Call { + return &FunctionDataCmdInterface_DataCopyAny_Call{Call: _e.mock.On("DataCopyAny")} +} + +func (_c *FunctionDataCmdInterface_DataCopyAny_Call) Run(run func()) *FunctionDataCmdInterface_DataCopyAny_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FunctionDataCmdInterface_DataCopyAny_Call) Return(_a0 interface{}) *FunctionDataCmdInterface_DataCopyAny_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FunctionDataCmdInterface_DataCopyAny_Call) RunAndReturn(run func() interface{}) *FunctionDataCmdInterface_DataCopyAny_Call { + _c.Call.Return(run) + return _c +} + +// Function provides a mock function with given fields: +func (_m *FunctionDataCmdInterface) Function() model.FunctionType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Function") + } + + var r0 model.FunctionType + if rf, ok := ret.Get(0).(func() model.FunctionType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.FunctionType) + } + + return r0 +} + +// FunctionDataCmdInterface_Function_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Function' +type FunctionDataCmdInterface_Function_Call struct { + *mock.Call +} + +// Function is a helper method to define mock.On call +func (_e *FunctionDataCmdInterface_Expecter) Function() *FunctionDataCmdInterface_Function_Call { + return &FunctionDataCmdInterface_Function_Call{Call: _e.mock.On("Function")} +} + +func (_c *FunctionDataCmdInterface_Function_Call) Run(run func()) *FunctionDataCmdInterface_Function_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FunctionDataCmdInterface_Function_Call) Return(_a0 model.FunctionType) *FunctionDataCmdInterface_Function_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FunctionDataCmdInterface_Function_Call) RunAndReturn(run func() model.FunctionType) *FunctionDataCmdInterface_Function_Call { + _c.Call.Return(run) + return _c +} + +// NotifyCmdType provides a mock function with given fields: deleteSelector, partialSelector, partialWithoutSelector, deleteElements +func (_m *FunctionDataCmdInterface) NotifyCmdType(deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{}) model.CmdType { + ret := _m.Called(deleteSelector, partialSelector, partialWithoutSelector, deleteElements) + + if len(ret) == 0 { + panic("no return value specified for NotifyCmdType") + } + + var r0 model.CmdType + if rf, ok := ret.Get(0).(func(interface{}, interface{}, bool, interface{}) model.CmdType); ok { + r0 = rf(deleteSelector, partialSelector, partialWithoutSelector, deleteElements) + } else { + r0 = ret.Get(0).(model.CmdType) + } + + return r0 +} + +// FunctionDataCmdInterface_NotifyCmdType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotifyCmdType' +type FunctionDataCmdInterface_NotifyCmdType_Call struct { + *mock.Call +} + +// NotifyCmdType is a helper method to define mock.On call +// - deleteSelector interface{} +// - partialSelector interface{} +// - partialWithoutSelector bool +// - deleteElements interface{} +func (_e *FunctionDataCmdInterface_Expecter) NotifyCmdType(deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector interface{}, deleteElements interface{}) *FunctionDataCmdInterface_NotifyCmdType_Call { + return &FunctionDataCmdInterface_NotifyCmdType_Call{Call: _e.mock.On("NotifyCmdType", deleteSelector, partialSelector, partialWithoutSelector, deleteElements)} +} + +func (_c *FunctionDataCmdInterface_NotifyCmdType_Call) Run(run func(deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{})) *FunctionDataCmdInterface_NotifyCmdType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(interface{}), args[2].(bool), args[3].(interface{})) + }) + return _c +} + +func (_c *FunctionDataCmdInterface_NotifyCmdType_Call) Return(_a0 model.CmdType) *FunctionDataCmdInterface_NotifyCmdType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FunctionDataCmdInterface_NotifyCmdType_Call) RunAndReturn(run func(interface{}, interface{}, bool, interface{}) model.CmdType) *FunctionDataCmdInterface_NotifyCmdType_Call { + _c.Call.Return(run) + return _c +} + +// ReadCmdType provides a mock function with given fields: partialSelector, elements +func (_m *FunctionDataCmdInterface) ReadCmdType(partialSelector interface{}, elements interface{}) model.CmdType { + ret := _m.Called(partialSelector, elements) + + if len(ret) == 0 { + panic("no return value specified for ReadCmdType") + } + + var r0 model.CmdType + if rf, ok := ret.Get(0).(func(interface{}, interface{}) model.CmdType); ok { + r0 = rf(partialSelector, elements) + } else { + r0 = ret.Get(0).(model.CmdType) + } + + return r0 +} + +// FunctionDataCmdInterface_ReadCmdType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadCmdType' +type FunctionDataCmdInterface_ReadCmdType_Call struct { + *mock.Call +} + +// ReadCmdType is a helper method to define mock.On call +// - partialSelector interface{} +// - elements interface{} +func (_e *FunctionDataCmdInterface_Expecter) ReadCmdType(partialSelector interface{}, elements interface{}) *FunctionDataCmdInterface_ReadCmdType_Call { + return &FunctionDataCmdInterface_ReadCmdType_Call{Call: _e.mock.On("ReadCmdType", partialSelector, elements)} +} + +func (_c *FunctionDataCmdInterface_ReadCmdType_Call) Run(run func(partialSelector interface{}, elements interface{})) *FunctionDataCmdInterface_ReadCmdType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(interface{})) + }) + return _c +} + +func (_c *FunctionDataCmdInterface_ReadCmdType_Call) Return(_a0 model.CmdType) *FunctionDataCmdInterface_ReadCmdType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FunctionDataCmdInterface_ReadCmdType_Call) RunAndReturn(run func(interface{}, interface{}) model.CmdType) *FunctionDataCmdInterface_ReadCmdType_Call { + _c.Call.Return(run) + return _c +} + +// ReplyCmdType provides a mock function with given fields: partial +func (_m *FunctionDataCmdInterface) ReplyCmdType(partial bool) model.CmdType { + ret := _m.Called(partial) + + if len(ret) == 0 { + panic("no return value specified for ReplyCmdType") + } + + var r0 model.CmdType + if rf, ok := ret.Get(0).(func(bool) model.CmdType); ok { + r0 = rf(partial) + } else { + r0 = ret.Get(0).(model.CmdType) + } + + return r0 +} + +// FunctionDataCmdInterface_ReplyCmdType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplyCmdType' +type FunctionDataCmdInterface_ReplyCmdType_Call struct { + *mock.Call +} + +// ReplyCmdType is a helper method to define mock.On call +// - partial bool +func (_e *FunctionDataCmdInterface_Expecter) ReplyCmdType(partial interface{}) *FunctionDataCmdInterface_ReplyCmdType_Call { + return &FunctionDataCmdInterface_ReplyCmdType_Call{Call: _e.mock.On("ReplyCmdType", partial)} +} + +func (_c *FunctionDataCmdInterface_ReplyCmdType_Call) Run(run func(partial bool)) *FunctionDataCmdInterface_ReplyCmdType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(bool)) + }) + return _c +} + +func (_c *FunctionDataCmdInterface_ReplyCmdType_Call) Return(_a0 model.CmdType) *FunctionDataCmdInterface_ReplyCmdType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FunctionDataCmdInterface_ReplyCmdType_Call) RunAndReturn(run func(bool) model.CmdType) *FunctionDataCmdInterface_ReplyCmdType_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataAny provides a mock function with given fields: data, filterPartial, filterDelete +func (_m *FunctionDataCmdInterface) UpdateDataAny(data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType) { + _m.Called(data, filterPartial, filterDelete) +} + +// FunctionDataCmdInterface_UpdateDataAny_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataAny' +type FunctionDataCmdInterface_UpdateDataAny_Call struct { + *mock.Call +} + +// UpdateDataAny is a helper method to define mock.On call +// - data interface{} +// - filterPartial *model.FilterType +// - filterDelete *model.FilterType +func (_e *FunctionDataCmdInterface_Expecter) UpdateDataAny(data interface{}, filterPartial interface{}, filterDelete interface{}) *FunctionDataCmdInterface_UpdateDataAny_Call { + return &FunctionDataCmdInterface_UpdateDataAny_Call{Call: _e.mock.On("UpdateDataAny", data, filterPartial, filterDelete)} +} + +func (_c *FunctionDataCmdInterface_UpdateDataAny_Call) Run(run func(data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FunctionDataCmdInterface_UpdateDataAny_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(*model.FilterType), args[2].(*model.FilterType)) + }) + return _c +} + +func (_c *FunctionDataCmdInterface_UpdateDataAny_Call) Return() *FunctionDataCmdInterface_UpdateDataAny_Call { + _c.Call.Return() + return _c +} + +func (_c *FunctionDataCmdInterface_UpdateDataAny_Call) RunAndReturn(run func(interface{}, *model.FilterType, *model.FilterType)) *FunctionDataCmdInterface_UpdateDataAny_Call { + _c.Call.Return(run) + return _c +} + +// WriteCmdType provides a mock function with given fields: deleteSelector, partialSelector, deleteElements +func (_m *FunctionDataCmdInterface) WriteCmdType(deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}) model.CmdType { + ret := _m.Called(deleteSelector, partialSelector, deleteElements) + + if len(ret) == 0 { + panic("no return value specified for WriteCmdType") + } + + var r0 model.CmdType + if rf, ok := ret.Get(0).(func(interface{}, interface{}, interface{}) model.CmdType); ok { + r0 = rf(deleteSelector, partialSelector, deleteElements) + } else { + r0 = ret.Get(0).(model.CmdType) + } + + return r0 +} + +// FunctionDataCmdInterface_WriteCmdType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteCmdType' +type FunctionDataCmdInterface_WriteCmdType_Call struct { + *mock.Call +} + +// WriteCmdType is a helper method to define mock.On call +// - deleteSelector interface{} +// - partialSelector interface{} +// - deleteElements interface{} +func (_e *FunctionDataCmdInterface_Expecter) WriteCmdType(deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}) *FunctionDataCmdInterface_WriteCmdType_Call { + return &FunctionDataCmdInterface_WriteCmdType_Call{Call: _e.mock.On("WriteCmdType", deleteSelector, partialSelector, deleteElements)} +} + +func (_c *FunctionDataCmdInterface_WriteCmdType_Call) Run(run func(deleteSelector interface{}, partialSelector interface{}, deleteElements interface{})) *FunctionDataCmdInterface_WriteCmdType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(interface{}), args[2].(interface{})) + }) + return _c +} + +func (_c *FunctionDataCmdInterface_WriteCmdType_Call) Return(_a0 model.CmdType) *FunctionDataCmdInterface_WriteCmdType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FunctionDataCmdInterface_WriteCmdType_Call) RunAndReturn(run func(interface{}, interface{}, interface{}) model.CmdType) *FunctionDataCmdInterface_WriteCmdType_Call { + _c.Call.Return(run) + return _c +} + +// NewFunctionDataCmdInterface creates a new instance of FunctionDataCmdInterface. 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 NewFunctionDataCmdInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *FunctionDataCmdInterface { + mock := &FunctionDataCmdInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/FunctionDataInterface.go b/mocks/FunctionDataInterface.go new file mode 100644 index 0000000..77053c4 --- /dev/null +++ b/mocks/FunctionDataInterface.go @@ -0,0 +1,162 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + model "github.com/enbility/spine-go/model" + mock "github.com/stretchr/testify/mock" +) + +// FunctionDataInterface is an autogenerated mock type for the FunctionDataInterface type +type FunctionDataInterface struct { + mock.Mock +} + +type FunctionDataInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *FunctionDataInterface) EXPECT() *FunctionDataInterface_Expecter { + return &FunctionDataInterface_Expecter{mock: &_m.Mock} +} + +// DataCopyAny provides a mock function with given fields: +func (_m *FunctionDataInterface) DataCopyAny() interface{} { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for DataCopyAny") + } + + var r0 interface{} + if rf, ok := ret.Get(0).(func() interface{}); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + + return r0 +} + +// FunctionDataInterface_DataCopyAny_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataCopyAny' +type FunctionDataInterface_DataCopyAny_Call struct { + *mock.Call +} + +// DataCopyAny is a helper method to define mock.On call +func (_e *FunctionDataInterface_Expecter) DataCopyAny() *FunctionDataInterface_DataCopyAny_Call { + return &FunctionDataInterface_DataCopyAny_Call{Call: _e.mock.On("DataCopyAny")} +} + +func (_c *FunctionDataInterface_DataCopyAny_Call) Run(run func()) *FunctionDataInterface_DataCopyAny_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FunctionDataInterface_DataCopyAny_Call) Return(_a0 interface{}) *FunctionDataInterface_DataCopyAny_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FunctionDataInterface_DataCopyAny_Call) RunAndReturn(run func() interface{}) *FunctionDataInterface_DataCopyAny_Call { + _c.Call.Return(run) + return _c +} + +// Function provides a mock function with given fields: +func (_m *FunctionDataInterface) Function() model.FunctionType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Function") + } + + var r0 model.FunctionType + if rf, ok := ret.Get(0).(func() model.FunctionType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.FunctionType) + } + + return r0 +} + +// FunctionDataInterface_Function_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Function' +type FunctionDataInterface_Function_Call struct { + *mock.Call +} + +// Function is a helper method to define mock.On call +func (_e *FunctionDataInterface_Expecter) Function() *FunctionDataInterface_Function_Call { + return &FunctionDataInterface_Function_Call{Call: _e.mock.On("Function")} +} + +func (_c *FunctionDataInterface_Function_Call) Run(run func()) *FunctionDataInterface_Function_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *FunctionDataInterface_Function_Call) Return(_a0 model.FunctionType) *FunctionDataInterface_Function_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *FunctionDataInterface_Function_Call) RunAndReturn(run func() model.FunctionType) *FunctionDataInterface_Function_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataAny provides a mock function with given fields: data, filterPartial, filterDelete +func (_m *FunctionDataInterface) UpdateDataAny(data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType) { + _m.Called(data, filterPartial, filterDelete) +} + +// FunctionDataInterface_UpdateDataAny_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataAny' +type FunctionDataInterface_UpdateDataAny_Call struct { + *mock.Call +} + +// UpdateDataAny is a helper method to define mock.On call +// - data interface{} +// - filterPartial *model.FilterType +// - filterDelete *model.FilterType +func (_e *FunctionDataInterface_Expecter) UpdateDataAny(data interface{}, filterPartial interface{}, filterDelete interface{}) *FunctionDataInterface_UpdateDataAny_Call { + return &FunctionDataInterface_UpdateDataAny_Call{Call: _e.mock.On("UpdateDataAny", data, filterPartial, filterDelete)} +} + +func (_c *FunctionDataInterface_UpdateDataAny_Call) Run(run func(data interface{}, filterPartial *model.FilterType, filterDelete *model.FilterType)) *FunctionDataInterface_UpdateDataAny_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{}), args[1].(*model.FilterType), args[2].(*model.FilterType)) + }) + return _c +} + +func (_c *FunctionDataInterface_UpdateDataAny_Call) Return() *FunctionDataInterface_UpdateDataAny_Call { + _c.Call.Return() + return _c +} + +func (_c *FunctionDataInterface_UpdateDataAny_Call) RunAndReturn(run func(interface{}, *model.FilterType, *model.FilterType)) *FunctionDataInterface_UpdateDataAny_Call { + _c.Call.Return(run) + return _c +} + +// NewFunctionDataInterface creates a new instance of FunctionDataInterface. 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 NewFunctionDataInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *FunctionDataInterface { + mock := &FunctionDataInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/HeartbeatManager.go b/mocks/HeartbeatManager.go deleted file mode 100644 index c4b0759..0000000 --- a/mocks/HeartbeatManager.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" -) - -// HeartbeatManager is an autogenerated mock type for the HeartbeatManager type -type HeartbeatManager struct { - mock.Mock -} - -type HeartbeatManager_Expecter struct { - mock *mock.Mock -} - -func (_m *HeartbeatManager) EXPECT() *HeartbeatManager_Expecter { - return &HeartbeatManager_Expecter{mock: &_m.Mock} -} - -// IsHeartbeatRunning provides a mock function with given fields: -func (_m *HeartbeatManager) IsHeartbeatRunning() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsHeartbeatRunning") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// HeartbeatManager_IsHeartbeatRunning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsHeartbeatRunning' -type HeartbeatManager_IsHeartbeatRunning_Call struct { - *mock.Call -} - -// IsHeartbeatRunning is a helper method to define mock.On call -func (_e *HeartbeatManager_Expecter) IsHeartbeatRunning() *HeartbeatManager_IsHeartbeatRunning_Call { - return &HeartbeatManager_IsHeartbeatRunning_Call{Call: _e.mock.On("IsHeartbeatRunning")} -} - -func (_c *HeartbeatManager_IsHeartbeatRunning_Call) Run(run func()) *HeartbeatManager_IsHeartbeatRunning_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *HeartbeatManager_IsHeartbeatRunning_Call) Return(_a0 bool) *HeartbeatManager_IsHeartbeatRunning_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *HeartbeatManager_IsHeartbeatRunning_Call) RunAndReturn(run func() bool) *HeartbeatManager_IsHeartbeatRunning_Call { - _c.Call.Return(run) - return _c -} - -// SetLocalFeature provides a mock function with given fields: entity, feature -func (_m *HeartbeatManager) SetLocalFeature(entity api.EntityLocal, feature api.FeatureLocal) { - _m.Called(entity, feature) -} - -// HeartbeatManager_SetLocalFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLocalFeature' -type HeartbeatManager_SetLocalFeature_Call struct { - *mock.Call -} - -// SetLocalFeature is a helper method to define mock.On call -// - entity api.EntityLocal -// - feature api.FeatureLocal -func (_e *HeartbeatManager_Expecter) SetLocalFeature(entity interface{}, feature interface{}) *HeartbeatManager_SetLocalFeature_Call { - return &HeartbeatManager_SetLocalFeature_Call{Call: _e.mock.On("SetLocalFeature", entity, feature)} -} - -func (_c *HeartbeatManager_SetLocalFeature_Call) Run(run func(entity api.EntityLocal, feature api.FeatureLocal)) *HeartbeatManager_SetLocalFeature_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.EntityLocal), args[1].(api.FeatureLocal)) - }) - return _c -} - -func (_c *HeartbeatManager_SetLocalFeature_Call) Return() *HeartbeatManager_SetLocalFeature_Call { - _c.Call.Return() - return _c -} - -func (_c *HeartbeatManager_SetLocalFeature_Call) RunAndReturn(run func(api.EntityLocal, api.FeatureLocal)) *HeartbeatManager_SetLocalFeature_Call { - _c.Call.Return(run) - return _c -} - -// StartHeartbeat provides a mock function with given fields: -func (_m *HeartbeatManager) StartHeartbeat() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for StartHeartbeat") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// HeartbeatManager_StartHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartHeartbeat' -type HeartbeatManager_StartHeartbeat_Call struct { - *mock.Call -} - -// StartHeartbeat is a helper method to define mock.On call -func (_e *HeartbeatManager_Expecter) StartHeartbeat() *HeartbeatManager_StartHeartbeat_Call { - return &HeartbeatManager_StartHeartbeat_Call{Call: _e.mock.On("StartHeartbeat")} -} - -func (_c *HeartbeatManager_StartHeartbeat_Call) Run(run func()) *HeartbeatManager_StartHeartbeat_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *HeartbeatManager_StartHeartbeat_Call) Return(_a0 error) *HeartbeatManager_StartHeartbeat_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *HeartbeatManager_StartHeartbeat_Call) RunAndReturn(run func() error) *HeartbeatManager_StartHeartbeat_Call { - _c.Call.Return(run) - return _c -} - -// StopHeartbeat provides a mock function with given fields: -func (_m *HeartbeatManager) StopHeartbeat() { - _m.Called() -} - -// HeartbeatManager_StopHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopHeartbeat' -type HeartbeatManager_StopHeartbeat_Call struct { - *mock.Call -} - -// StopHeartbeat is a helper method to define mock.On call -func (_e *HeartbeatManager_Expecter) StopHeartbeat() *HeartbeatManager_StopHeartbeat_Call { - return &HeartbeatManager_StopHeartbeat_Call{Call: _e.mock.On("StopHeartbeat")} -} - -func (_c *HeartbeatManager_StopHeartbeat_Call) Run(run func()) *HeartbeatManager_StopHeartbeat_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *HeartbeatManager_StopHeartbeat_Call) Return() *HeartbeatManager_StopHeartbeat_Call { - _c.Call.Return() - return _c -} - -func (_c *HeartbeatManager_StopHeartbeat_Call) RunAndReturn(run func()) *HeartbeatManager_StopHeartbeat_Call { - _c.Call.Return(run) - return _c -} - -// UpdateHeartbeatOnSubscriptions provides a mock function with given fields: -func (_m *HeartbeatManager) UpdateHeartbeatOnSubscriptions() { - _m.Called() -} - -// HeartbeatManager_UpdateHeartbeatOnSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateHeartbeatOnSubscriptions' -type HeartbeatManager_UpdateHeartbeatOnSubscriptions_Call struct { - *mock.Call -} - -// UpdateHeartbeatOnSubscriptions is a helper method to define mock.On call -func (_e *HeartbeatManager_Expecter) UpdateHeartbeatOnSubscriptions() *HeartbeatManager_UpdateHeartbeatOnSubscriptions_Call { - return &HeartbeatManager_UpdateHeartbeatOnSubscriptions_Call{Call: _e.mock.On("UpdateHeartbeatOnSubscriptions")} -} - -func (_c *HeartbeatManager_UpdateHeartbeatOnSubscriptions_Call) Run(run func()) *HeartbeatManager_UpdateHeartbeatOnSubscriptions_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *HeartbeatManager_UpdateHeartbeatOnSubscriptions_Call) Return() *HeartbeatManager_UpdateHeartbeatOnSubscriptions_Call { - _c.Call.Return() - return _c -} - -func (_c *HeartbeatManager_UpdateHeartbeatOnSubscriptions_Call) RunAndReturn(run func()) *HeartbeatManager_UpdateHeartbeatOnSubscriptions_Call { - _c.Call.Return(run) - return _c -} - -// NewHeartbeatManager creates a new instance of HeartbeatManager. 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 NewHeartbeatManager(t interface { - mock.TestingT - Cleanup(func()) -}) *HeartbeatManager { - mock := &HeartbeatManager{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/HeartbeatManagerInterface.go b/mocks/HeartbeatManagerInterface.go new file mode 100644 index 0000000..340a84b --- /dev/null +++ b/mocks/HeartbeatManagerInterface.go @@ -0,0 +1,223 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" +) + +// HeartbeatManagerInterface is an autogenerated mock type for the HeartbeatManagerInterface type +type HeartbeatManagerInterface struct { + mock.Mock +} + +type HeartbeatManagerInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *HeartbeatManagerInterface) EXPECT() *HeartbeatManagerInterface_Expecter { + return &HeartbeatManagerInterface_Expecter{mock: &_m.Mock} +} + +// IsHeartbeatRunning provides a mock function with given fields: +func (_m *HeartbeatManagerInterface) IsHeartbeatRunning() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsHeartbeatRunning") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// HeartbeatManagerInterface_IsHeartbeatRunning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsHeartbeatRunning' +type HeartbeatManagerInterface_IsHeartbeatRunning_Call struct { + *mock.Call +} + +// IsHeartbeatRunning is a helper method to define mock.On call +func (_e *HeartbeatManagerInterface_Expecter) IsHeartbeatRunning() *HeartbeatManagerInterface_IsHeartbeatRunning_Call { + return &HeartbeatManagerInterface_IsHeartbeatRunning_Call{Call: _e.mock.On("IsHeartbeatRunning")} +} + +func (_c *HeartbeatManagerInterface_IsHeartbeatRunning_Call) Run(run func()) *HeartbeatManagerInterface_IsHeartbeatRunning_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeartbeatManagerInterface_IsHeartbeatRunning_Call) Return(_a0 bool) *HeartbeatManagerInterface_IsHeartbeatRunning_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeartbeatManagerInterface_IsHeartbeatRunning_Call) RunAndReturn(run func() bool) *HeartbeatManagerInterface_IsHeartbeatRunning_Call { + _c.Call.Return(run) + return _c +} + +// SetLocalFeature provides a mock function with given fields: entity, feature +func (_m *HeartbeatManagerInterface) SetLocalFeature(entity api.EntityLocalInterface, feature api.FeatureLocalInterface) { + _m.Called(entity, feature) +} + +// HeartbeatManagerInterface_SetLocalFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLocalFeature' +type HeartbeatManagerInterface_SetLocalFeature_Call struct { + *mock.Call +} + +// SetLocalFeature is a helper method to define mock.On call +// - entity api.EntityLocalInterface +// - feature api.FeatureLocalInterface +func (_e *HeartbeatManagerInterface_Expecter) SetLocalFeature(entity interface{}, feature interface{}) *HeartbeatManagerInterface_SetLocalFeature_Call { + return &HeartbeatManagerInterface_SetLocalFeature_Call{Call: _e.mock.On("SetLocalFeature", entity, feature)} +} + +func (_c *HeartbeatManagerInterface_SetLocalFeature_Call) Run(run func(entity api.EntityLocalInterface, feature api.FeatureLocalInterface)) *HeartbeatManagerInterface_SetLocalFeature_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.EntityLocalInterface), args[1].(api.FeatureLocalInterface)) + }) + return _c +} + +func (_c *HeartbeatManagerInterface_SetLocalFeature_Call) Return() *HeartbeatManagerInterface_SetLocalFeature_Call { + _c.Call.Return() + return _c +} + +func (_c *HeartbeatManagerInterface_SetLocalFeature_Call) RunAndReturn(run func(api.EntityLocalInterface, api.FeatureLocalInterface)) *HeartbeatManagerInterface_SetLocalFeature_Call { + _c.Call.Return(run) + return _c +} + +// StartHeartbeat provides a mock function with given fields: +func (_m *HeartbeatManagerInterface) StartHeartbeat() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for StartHeartbeat") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// HeartbeatManagerInterface_StartHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartHeartbeat' +type HeartbeatManagerInterface_StartHeartbeat_Call struct { + *mock.Call +} + +// StartHeartbeat is a helper method to define mock.On call +func (_e *HeartbeatManagerInterface_Expecter) StartHeartbeat() *HeartbeatManagerInterface_StartHeartbeat_Call { + return &HeartbeatManagerInterface_StartHeartbeat_Call{Call: _e.mock.On("StartHeartbeat")} +} + +func (_c *HeartbeatManagerInterface_StartHeartbeat_Call) Run(run func()) *HeartbeatManagerInterface_StartHeartbeat_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeartbeatManagerInterface_StartHeartbeat_Call) Return(_a0 error) *HeartbeatManagerInterface_StartHeartbeat_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *HeartbeatManagerInterface_StartHeartbeat_Call) RunAndReturn(run func() error) *HeartbeatManagerInterface_StartHeartbeat_Call { + _c.Call.Return(run) + return _c +} + +// StopHeartbeat provides a mock function with given fields: +func (_m *HeartbeatManagerInterface) StopHeartbeat() { + _m.Called() +} + +// HeartbeatManagerInterface_StopHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopHeartbeat' +type HeartbeatManagerInterface_StopHeartbeat_Call struct { + *mock.Call +} + +// StopHeartbeat is a helper method to define mock.On call +func (_e *HeartbeatManagerInterface_Expecter) StopHeartbeat() *HeartbeatManagerInterface_StopHeartbeat_Call { + return &HeartbeatManagerInterface_StopHeartbeat_Call{Call: _e.mock.On("StopHeartbeat")} +} + +func (_c *HeartbeatManagerInterface_StopHeartbeat_Call) Run(run func()) *HeartbeatManagerInterface_StopHeartbeat_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeartbeatManagerInterface_StopHeartbeat_Call) Return() *HeartbeatManagerInterface_StopHeartbeat_Call { + _c.Call.Return() + return _c +} + +func (_c *HeartbeatManagerInterface_StopHeartbeat_Call) RunAndReturn(run func()) *HeartbeatManagerInterface_StopHeartbeat_Call { + _c.Call.Return(run) + return _c +} + +// UpdateHeartbeatOnSubscriptions provides a mock function with given fields: +func (_m *HeartbeatManagerInterface) UpdateHeartbeatOnSubscriptions() { + _m.Called() +} + +// HeartbeatManagerInterface_UpdateHeartbeatOnSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateHeartbeatOnSubscriptions' +type HeartbeatManagerInterface_UpdateHeartbeatOnSubscriptions_Call struct { + *mock.Call +} + +// UpdateHeartbeatOnSubscriptions is a helper method to define mock.On call +func (_e *HeartbeatManagerInterface_Expecter) UpdateHeartbeatOnSubscriptions() *HeartbeatManagerInterface_UpdateHeartbeatOnSubscriptions_Call { + return &HeartbeatManagerInterface_UpdateHeartbeatOnSubscriptions_Call{Call: _e.mock.On("UpdateHeartbeatOnSubscriptions")} +} + +func (_c *HeartbeatManagerInterface_UpdateHeartbeatOnSubscriptions_Call) Run(run func()) *HeartbeatManagerInterface_UpdateHeartbeatOnSubscriptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *HeartbeatManagerInterface_UpdateHeartbeatOnSubscriptions_Call) Return() *HeartbeatManagerInterface_UpdateHeartbeatOnSubscriptions_Call { + _c.Call.Return() + return _c +} + +func (_c *HeartbeatManagerInterface_UpdateHeartbeatOnSubscriptions_Call) RunAndReturn(run func()) *HeartbeatManagerInterface_UpdateHeartbeatOnSubscriptions_Call { + _c.Call.Return(run) + return _c +} + +// NewHeartbeatManagerInterface creates a new instance of HeartbeatManagerInterface. 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 NewHeartbeatManagerInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *HeartbeatManagerInterface { + mock := &HeartbeatManagerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/NodeManagement.go b/mocks/NodeManagement.go deleted file mode 100644 index 25ba591..0000000 --- a/mocks/NodeManagement.go +++ /dev/null @@ -1,1321 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" - - model "github.com/enbility/spine-go/model" - - time "time" -) - -// NodeManagement is an autogenerated mock type for the NodeManagement type -type NodeManagement struct { - mock.Mock -} - -type NodeManagement_Expecter struct { - mock *mock.Mock -} - -func (_m *NodeManagement) EXPECT() *NodeManagement_Expecter { - return &NodeManagement_Expecter{mock: &_m.Mock} -} - -// AddFunctionType provides a mock function with given fields: function, read, write -func (_m *NodeManagement) AddFunctionType(function model.FunctionType, read bool, write bool) { - _m.Called(function, read, write) -} - -// NodeManagement_AddFunctionType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFunctionType' -type NodeManagement_AddFunctionType_Call struct { - *mock.Call -} - -// AddFunctionType is a helper method to define mock.On call -// - function model.FunctionType -// - read bool -// - write bool -func (_e *NodeManagement_Expecter) AddFunctionType(function interface{}, read interface{}, write interface{}) *NodeManagement_AddFunctionType_Call { - return &NodeManagement_AddFunctionType_Call{Call: _e.mock.On("AddFunctionType", function, read, write)} -} - -func (_c *NodeManagement_AddFunctionType_Call) Run(run func(function model.FunctionType, read bool, write bool)) *NodeManagement_AddFunctionType_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(bool), args[2].(bool)) - }) - return _c -} - -func (_c *NodeManagement_AddFunctionType_Call) Return() *NodeManagement_AddFunctionType_Call { - _c.Call.Return() - return _c -} - -func (_c *NodeManagement_AddFunctionType_Call) RunAndReturn(run func(model.FunctionType, bool, bool)) *NodeManagement_AddFunctionType_Call { - _c.Call.Return(run) - return _c -} - -// AddResultCallback provides a mock function with given fields: msgCounterReference, function -func (_m *NodeManagement) AddResultCallback(msgCounterReference model.MsgCounterType, function func(api.ResultMessage)) { - _m.Called(msgCounterReference, function) -} - -// NodeManagement_AddResultCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddResultCallback' -type NodeManagement_AddResultCallback_Call struct { - *mock.Call -} - -// AddResultCallback is a helper method to define mock.On call -// - msgCounterReference model.MsgCounterType -// - function func(api.ResultMessage) -func (_e *NodeManagement_Expecter) AddResultCallback(msgCounterReference interface{}, function interface{}) *NodeManagement_AddResultCallback_Call { - return &NodeManagement_AddResultCallback_Call{Call: _e.mock.On("AddResultCallback", msgCounterReference, function)} -} - -func (_c *NodeManagement_AddResultCallback_Call) Run(run func(msgCounterReference model.MsgCounterType, function func(api.ResultMessage))) *NodeManagement_AddResultCallback_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.MsgCounterType), args[1].(func(api.ResultMessage))) - }) - return _c -} - -func (_c *NodeManagement_AddResultCallback_Call) Return() *NodeManagement_AddResultCallback_Call { - _c.Call.Return() - return _c -} - -func (_c *NodeManagement_AddResultCallback_Call) RunAndReturn(run func(model.MsgCounterType, func(api.ResultMessage))) *NodeManagement_AddResultCallback_Call { - _c.Call.Return(run) - return _c -} - -// AddResultHandler provides a mock function with given fields: handler -func (_m *NodeManagement) AddResultHandler(handler api.FeatureResult) { - _m.Called(handler) -} - -// NodeManagement_AddResultHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddResultHandler' -type NodeManagement_AddResultHandler_Call struct { - *mock.Call -} - -// AddResultHandler is a helper method to define mock.On call -// - handler api.FeatureResult -func (_e *NodeManagement_Expecter) AddResultHandler(handler interface{}) *NodeManagement_AddResultHandler_Call { - return &NodeManagement_AddResultHandler_Call{Call: _e.mock.On("AddResultHandler", handler)} -} - -func (_c *NodeManagement_AddResultHandler_Call) Run(run func(handler api.FeatureResult)) *NodeManagement_AddResultHandler_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.FeatureResult)) - }) - return _c -} - -func (_c *NodeManagement_AddResultHandler_Call) Return() *NodeManagement_AddResultHandler_Call { - _c.Call.Return() - return _c -} - -func (_c *NodeManagement_AddResultHandler_Call) RunAndReturn(run func(api.FeatureResult)) *NodeManagement_AddResultHandler_Call { - _c.Call.Return(run) - return _c -} - -// Address provides a mock function with given fields: -func (_m *NodeManagement) Address() *model.FeatureAddressType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Address") - } - - var r0 *model.FeatureAddressType - if rf, ok := ret.Get(0).(func() *model.FeatureAddressType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.FeatureAddressType) - } - } - - return r0 -} - -// NodeManagement_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' -type NodeManagement_Address_Call struct { - *mock.Call -} - -// Address is a helper method to define mock.On call -func (_e *NodeManagement_Expecter) Address() *NodeManagement_Address_Call { - return &NodeManagement_Address_Call{Call: _e.mock.On("Address")} -} - -func (_c *NodeManagement_Address_Call) Run(run func()) *NodeManagement_Address_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *NodeManagement_Address_Call) Return(_a0 *model.FeatureAddressType) *NodeManagement_Address_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *NodeManagement_Address_Call) RunAndReturn(run func() *model.FeatureAddressType) *NodeManagement_Address_Call { - _c.Call.Return(run) - return _c -} - -// Bind provides a mock function with given fields: remoteAdress -func (_m *NodeManagement) Bind(remoteAdress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(remoteAdress) - - if len(ret) == 0 { - panic("no return value specified for Bind") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(remoteAdress) - } - if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) *model.MsgCounterType); ok { - r0 = rf(remoteAdress) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(*model.FeatureAddressType) *model.ErrorType); ok { - r1 = rf(remoteAdress) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// NodeManagement_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' -type NodeManagement_Bind_Call struct { - *mock.Call -} - -// Bind is a helper method to define mock.On call -// - remoteAdress *model.FeatureAddressType -func (_e *NodeManagement_Expecter) Bind(remoteAdress interface{}) *NodeManagement_Bind_Call { - return &NodeManagement_Bind_Call{Call: _e.mock.On("Bind", remoteAdress)} -} - -func (_c *NodeManagement_Bind_Call) Run(run func(remoteAdress *model.FeatureAddressType)) *NodeManagement_Bind_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.FeatureAddressType)) - }) - return _c -} - -func (_c *NodeManagement_Bind_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagement_Bind_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *NodeManagement_Bind_Call) RunAndReturn(run func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)) *NodeManagement_Bind_Call { - _c.Call.Return(run) - return _c -} - -// DataCopy provides a mock function with given fields: function -func (_m *NodeManagement) DataCopy(function model.FunctionType) interface{} { - ret := _m.Called(function) - - if len(ret) == 0 { - panic("no return value specified for DataCopy") - } - - var r0 interface{} - if rf, ok := ret.Get(0).(func(model.FunctionType) interface{}); ok { - r0 = rf(function) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - return r0 -} - -// NodeManagement_DataCopy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataCopy' -type NodeManagement_DataCopy_Call struct { - *mock.Call -} - -// DataCopy is a helper method to define mock.On call -// - function model.FunctionType -func (_e *NodeManagement_Expecter) DataCopy(function interface{}) *NodeManagement_DataCopy_Call { - return &NodeManagement_DataCopy_Call{Call: _e.mock.On("DataCopy", function)} -} - -func (_c *NodeManagement_DataCopy_Call) Run(run func(function model.FunctionType)) *NodeManagement_DataCopy_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType)) - }) - return _c -} - -func (_c *NodeManagement_DataCopy_Call) Return(_a0 interface{}) *NodeManagement_DataCopy_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *NodeManagement_DataCopy_Call) RunAndReturn(run func(model.FunctionType) interface{}) *NodeManagement_DataCopy_Call { - _c.Call.Return(run) - return _c -} - -// Description provides a mock function with given fields: -func (_m *NodeManagement) Description() *model.DescriptionType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Description") - } - - var r0 *model.DescriptionType - if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.DescriptionType) - } - } - - return r0 -} - -// NodeManagement_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' -type NodeManagement_Description_Call struct { - *mock.Call -} - -// Description is a helper method to define mock.On call -func (_e *NodeManagement_Expecter) Description() *NodeManagement_Description_Call { - return &NodeManagement_Description_Call{Call: _e.mock.On("Description")} -} - -func (_c *NodeManagement_Description_Call) Run(run func()) *NodeManagement_Description_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *NodeManagement_Description_Call) Return(_a0 *model.DescriptionType) *NodeManagement_Description_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *NodeManagement_Description_Call) RunAndReturn(run func() *model.DescriptionType) *NodeManagement_Description_Call { - _c.Call.Return(run) - return _c -} - -// Device provides a mock function with given fields: -func (_m *NodeManagement) Device() api.DeviceLocal { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Device") - } - - var r0 api.DeviceLocal - if rf, ok := ret.Get(0).(func() api.DeviceLocal); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.DeviceLocal) - } - } - - return r0 -} - -// NodeManagement_Device_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Device' -type NodeManagement_Device_Call struct { - *mock.Call -} - -// Device is a helper method to define mock.On call -func (_e *NodeManagement_Expecter) Device() *NodeManagement_Device_Call { - return &NodeManagement_Device_Call{Call: _e.mock.On("Device")} -} - -func (_c *NodeManagement_Device_Call) Run(run func()) *NodeManagement_Device_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *NodeManagement_Device_Call) Return(_a0 api.DeviceLocal) *NodeManagement_Device_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *NodeManagement_Device_Call) RunAndReturn(run func() api.DeviceLocal) *NodeManagement_Device_Call { - _c.Call.Return(run) - return _c -} - -// Entity provides a mock function with given fields: -func (_m *NodeManagement) Entity() api.EntityLocal { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Entity") - } - - var r0 api.EntityLocal - if rf, ok := ret.Get(0).(func() api.EntityLocal); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(api.EntityLocal) - } - } - - return r0 -} - -// NodeManagement_Entity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entity' -type NodeManagement_Entity_Call struct { - *mock.Call -} - -// Entity is a helper method to define mock.On call -func (_e *NodeManagement_Expecter) Entity() *NodeManagement_Entity_Call { - return &NodeManagement_Entity_Call{Call: _e.mock.On("Entity")} -} - -func (_c *NodeManagement_Entity_Call) Run(run func()) *NodeManagement_Entity_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *NodeManagement_Entity_Call) Return(_a0 api.EntityLocal) *NodeManagement_Entity_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *NodeManagement_Entity_Call) RunAndReturn(run func() api.EntityLocal) *NodeManagement_Entity_Call { - _c.Call.Return(run) - return _c -} - -// FetchRequestData provides a mock function with given fields: msgCounter, destination -func (_m *NodeManagement) FetchRequestData(msgCounter model.MsgCounterType, destination api.FeatureRemote) (interface{}, *model.ErrorType) { - ret := _m.Called(msgCounter, destination) - - if len(ret) == 0 { - panic("no return value specified for FetchRequestData") - } - - var r0 interface{} - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.MsgCounterType, api.FeatureRemote) (interface{}, *model.ErrorType)); ok { - return rf(msgCounter, destination) - } - if rf, ok := ret.Get(0).(func(model.MsgCounterType, api.FeatureRemote) interface{}); ok { - r0 = rf(msgCounter, destination) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - if rf, ok := ret.Get(1).(func(model.MsgCounterType, api.FeatureRemote) *model.ErrorType); ok { - r1 = rf(msgCounter, destination) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// NodeManagement_FetchRequestData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchRequestData' -type NodeManagement_FetchRequestData_Call struct { - *mock.Call -} - -// FetchRequestData is a helper method to define mock.On call -// - msgCounter model.MsgCounterType -// - destination api.FeatureRemote -func (_e *NodeManagement_Expecter) FetchRequestData(msgCounter interface{}, destination interface{}) *NodeManagement_FetchRequestData_Call { - return &NodeManagement_FetchRequestData_Call{Call: _e.mock.On("FetchRequestData", msgCounter, destination)} -} - -func (_c *NodeManagement_FetchRequestData_Call) Run(run func(msgCounter model.MsgCounterType, destination api.FeatureRemote)) *NodeManagement_FetchRequestData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.MsgCounterType), args[1].(api.FeatureRemote)) - }) - return _c -} - -func (_c *NodeManagement_FetchRequestData_Call) Return(_a0 interface{}, _a1 *model.ErrorType) *NodeManagement_FetchRequestData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *NodeManagement_FetchRequestData_Call) RunAndReturn(run func(model.MsgCounterType, api.FeatureRemote) (interface{}, *model.ErrorType)) *NodeManagement_FetchRequestData_Call { - _c.Call.Return(run) - return _c -} - -// HandleMessage provides a mock function with given fields: message -func (_m *NodeManagement) HandleMessage(message *api.Message) *model.ErrorType { - ret := _m.Called(message) - - if len(ret) == 0 { - panic("no return value specified for HandleMessage") - } - - var r0 *model.ErrorType - if rf, ok := ret.Get(0).(func(*api.Message) *model.ErrorType); ok { - r0 = rf(message) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.ErrorType) - } - } - - return r0 -} - -// NodeManagement_HandleMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleMessage' -type NodeManagement_HandleMessage_Call struct { - *mock.Call -} - -// HandleMessage is a helper method to define mock.On call -// - message *api.Message -func (_e *NodeManagement_Expecter) HandleMessage(message interface{}) *NodeManagement_HandleMessage_Call { - return &NodeManagement_HandleMessage_Call{Call: _e.mock.On("HandleMessage", message)} -} - -func (_c *NodeManagement_HandleMessage_Call) Run(run func(message *api.Message)) *NodeManagement_HandleMessage_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*api.Message)) - }) - return _c -} - -func (_c *NodeManagement_HandleMessage_Call) Return(_a0 *model.ErrorType) *NodeManagement_HandleMessage_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *NodeManagement_HandleMessage_Call) RunAndReturn(run func(*api.Message) *model.ErrorType) *NodeManagement_HandleMessage_Call { - _c.Call.Return(run) - return _c -} - -// Information provides a mock function with given fields: -func (_m *NodeManagement) Information() *model.NodeManagementDetailedDiscoveryFeatureInformationType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Information") - } - - var r0 *model.NodeManagementDetailedDiscoveryFeatureInformationType - if rf, ok := ret.Get(0).(func() *model.NodeManagementDetailedDiscoveryFeatureInformationType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.NodeManagementDetailedDiscoveryFeatureInformationType) - } - } - - return r0 -} - -// NodeManagement_Information_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Information' -type NodeManagement_Information_Call struct { - *mock.Call -} - -// Information is a helper method to define mock.On call -func (_e *NodeManagement_Expecter) Information() *NodeManagement_Information_Call { - return &NodeManagement_Information_Call{Call: _e.mock.On("Information")} -} - -func (_c *NodeManagement_Information_Call) Run(run func()) *NodeManagement_Information_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *NodeManagement_Information_Call) Return(_a0 *model.NodeManagementDetailedDiscoveryFeatureInformationType) *NodeManagement_Information_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *NodeManagement_Information_Call) RunAndReturn(run func() *model.NodeManagementDetailedDiscoveryFeatureInformationType) *NodeManagement_Information_Call { - _c.Call.Return(run) - return _c -} - -// NotifyData provides a mock function with given fields: function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination -func (_m *NodeManagement) NotifyData(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{}, destination api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) - - if len(ret) == 0 { - panic("no return value specified for NotifyData") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) - } - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemote) *model.MsgCounterType); ok { - r0 = rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemote) *model.ErrorType); ok { - r1 = rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// NodeManagement_NotifyData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotifyData' -type NodeManagement_NotifyData_Call struct { - *mock.Call -} - -// NotifyData is a helper method to define mock.On call -// - function model.FunctionType -// - deleteSelector interface{} -// - partialSelector interface{} -// - partialWithoutSelector bool -// - deleteElements interface{} -// - destination api.FeatureRemote -func (_e *NodeManagement_Expecter) NotifyData(function interface{}, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector interface{}, deleteElements interface{}, destination interface{}) *NodeManagement_NotifyData_Call { - return &NodeManagement_NotifyData_Call{Call: _e.mock.On("NotifyData", function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination)} -} - -func (_c *NodeManagement_NotifyData_Call) Run(run func(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{}, destination api.FeatureRemote)) *NodeManagement_NotifyData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(bool), args[4].(interface{}), args[5].(api.FeatureRemote)) - }) - return _c -} - -func (_c *NodeManagement_NotifyData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagement_NotifyData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *NodeManagement_NotifyData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)) *NodeManagement_NotifyData_Call { - _c.Call.Return(run) - return _c -} - -// Operations provides a mock function with given fields: -func (_m *NodeManagement) Operations() map[model.FunctionType]api.Operations { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Operations") - } - - var r0 map[model.FunctionType]api.Operations - if rf, ok := ret.Get(0).(func() map[model.FunctionType]api.Operations); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[model.FunctionType]api.Operations) - } - } - - return r0 -} - -// NodeManagement_Operations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Operations' -type NodeManagement_Operations_Call struct { - *mock.Call -} - -// Operations is a helper method to define mock.On call -func (_e *NodeManagement_Expecter) Operations() *NodeManagement_Operations_Call { - return &NodeManagement_Operations_Call{Call: _e.mock.On("Operations")} -} - -func (_c *NodeManagement_Operations_Call) Run(run func()) *NodeManagement_Operations_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *NodeManagement_Operations_Call) Return(_a0 map[model.FunctionType]api.Operations) *NodeManagement_Operations_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *NodeManagement_Operations_Call) RunAndReturn(run func() map[model.FunctionType]api.Operations) *NodeManagement_Operations_Call { - _c.Call.Return(run) - return _c -} - -// RemoveAllBindings provides a mock function with given fields: -func (_m *NodeManagement) RemoveAllBindings() { - _m.Called() -} - -// NodeManagement_RemoveAllBindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllBindings' -type NodeManagement_RemoveAllBindings_Call struct { - *mock.Call -} - -// RemoveAllBindings is a helper method to define mock.On call -func (_e *NodeManagement_Expecter) RemoveAllBindings() *NodeManagement_RemoveAllBindings_Call { - return &NodeManagement_RemoveAllBindings_Call{Call: _e.mock.On("RemoveAllBindings")} -} - -func (_c *NodeManagement_RemoveAllBindings_Call) Run(run func()) *NodeManagement_RemoveAllBindings_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *NodeManagement_RemoveAllBindings_Call) Return() *NodeManagement_RemoveAllBindings_Call { - _c.Call.Return() - return _c -} - -func (_c *NodeManagement_RemoveAllBindings_Call) RunAndReturn(run func()) *NodeManagement_RemoveAllBindings_Call { - _c.Call.Return(run) - return _c -} - -// RemoveAllSubscriptions provides a mock function with given fields: -func (_m *NodeManagement) RemoveAllSubscriptions() { - _m.Called() -} - -// NodeManagement_RemoveAllSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllSubscriptions' -type NodeManagement_RemoveAllSubscriptions_Call struct { - *mock.Call -} - -// RemoveAllSubscriptions is a helper method to define mock.On call -func (_e *NodeManagement_Expecter) RemoveAllSubscriptions() *NodeManagement_RemoveAllSubscriptions_Call { - return &NodeManagement_RemoveAllSubscriptions_Call{Call: _e.mock.On("RemoveAllSubscriptions")} -} - -func (_c *NodeManagement_RemoveAllSubscriptions_Call) Run(run func()) *NodeManagement_RemoveAllSubscriptions_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *NodeManagement_RemoveAllSubscriptions_Call) Return() *NodeManagement_RemoveAllSubscriptions_Call { - _c.Call.Return() - return _c -} - -func (_c *NodeManagement_RemoveAllSubscriptions_Call) RunAndReturn(run func()) *NodeManagement_RemoveAllSubscriptions_Call { - _c.Call.Return(run) - return _c -} - -// RemoveBinding provides a mock function with given fields: remoteAddress -func (_m *NodeManagement) RemoveBinding(remoteAddress *model.FeatureAddressType) { - _m.Called(remoteAddress) -} - -// NodeManagement_RemoveBinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveBinding' -type NodeManagement_RemoveBinding_Call struct { - *mock.Call -} - -// RemoveBinding is a helper method to define mock.On call -// - remoteAddress *model.FeatureAddressType -func (_e *NodeManagement_Expecter) RemoveBinding(remoteAddress interface{}) *NodeManagement_RemoveBinding_Call { - return &NodeManagement_RemoveBinding_Call{Call: _e.mock.On("RemoveBinding", remoteAddress)} -} - -func (_c *NodeManagement_RemoveBinding_Call) Run(run func(remoteAddress *model.FeatureAddressType)) *NodeManagement_RemoveBinding_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.FeatureAddressType)) - }) - return _c -} - -func (_c *NodeManagement_RemoveBinding_Call) Return() *NodeManagement_RemoveBinding_Call { - _c.Call.Return() - return _c -} - -func (_c *NodeManagement_RemoveBinding_Call) RunAndReturn(run func(*model.FeatureAddressType)) *NodeManagement_RemoveBinding_Call { - _c.Call.Return(run) - return _c -} - -// RemoveSubscription provides a mock function with given fields: remoteAddress -func (_m *NodeManagement) RemoveSubscription(remoteAddress *model.FeatureAddressType) { - _m.Called(remoteAddress) -} - -// NodeManagement_RemoveSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSubscription' -type NodeManagement_RemoveSubscription_Call struct { - *mock.Call -} - -// RemoveSubscription is a helper method to define mock.On call -// - remoteAddress *model.FeatureAddressType -func (_e *NodeManagement_Expecter) RemoveSubscription(remoteAddress interface{}) *NodeManagement_RemoveSubscription_Call { - return &NodeManagement_RemoveSubscription_Call{Call: _e.mock.On("RemoveSubscription", remoteAddress)} -} - -func (_c *NodeManagement_RemoveSubscription_Call) Run(run func(remoteAddress *model.FeatureAddressType)) *NodeManagement_RemoveSubscription_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.FeatureAddressType)) - }) - return _c -} - -func (_c *NodeManagement_RemoveSubscription_Call) Return() *NodeManagement_RemoveSubscription_Call { - _c.Call.Return() - return _c -} - -func (_c *NodeManagement_RemoveSubscription_Call) RunAndReturn(run func(*model.FeatureAddressType)) *NodeManagement_RemoveSubscription_Call { - _c.Call.Return(run) - return _c -} - -// RequestData provides a mock function with given fields: function, selector, elements, destination -func (_m *NodeManagement) RequestData(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(function, selector, elements, destination) - - if len(ret) == 0 { - panic("no return value specified for RequestData") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(function, selector, elements, destination) - } - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemote) *model.MsgCounterType); ok { - r0 = rf(function, selector, elements, destination) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemote) *model.ErrorType); ok { - r1 = rf(function, selector, elements, destination) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// NodeManagement_RequestData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestData' -type NodeManagement_RequestData_Call struct { - *mock.Call -} - -// RequestData is a helper method to define mock.On call -// - function model.FunctionType -// - selector interface{} -// - elements interface{} -// - destination api.FeatureRemote -func (_e *NodeManagement_Expecter) RequestData(function interface{}, selector interface{}, elements interface{}, destination interface{}) *NodeManagement_RequestData_Call { - return &NodeManagement_RequestData_Call{Call: _e.mock.On("RequestData", function, selector, elements, destination)} -} - -func (_c *NodeManagement_RequestData_Call) Run(run func(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemote)) *NodeManagement_RequestData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(api.FeatureRemote)) - }) - return _c -} - -func (_c *NodeManagement_RequestData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagement_RequestData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *NodeManagement_RequestData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)) *NodeManagement_RequestData_Call { - _c.Call.Return(run) - return _c -} - -// RequestDataBySenderAddress provides a mock function with given fields: cmd, sender, destinationSki, destinationAddress, maxDelay -func (_m *NodeManagement) RequestDataBySenderAddress(cmd model.CmdType, sender api.Sender, destinationSki string, destinationAddress *model.FeatureAddressType, maxDelay time.Duration) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(cmd, sender, destinationSki, destinationAddress, maxDelay) - - if len(ret) == 0 { - panic("no return value specified for RequestDataBySenderAddress") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.CmdType, api.Sender, string, *model.FeatureAddressType, time.Duration) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(cmd, sender, destinationSki, destinationAddress, maxDelay) - } - if rf, ok := ret.Get(0).(func(model.CmdType, api.Sender, string, *model.FeatureAddressType, time.Duration) *model.MsgCounterType); ok { - r0 = rf(cmd, sender, destinationSki, destinationAddress, maxDelay) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(model.CmdType, api.Sender, string, *model.FeatureAddressType, time.Duration) *model.ErrorType); ok { - r1 = rf(cmd, sender, destinationSki, destinationAddress, maxDelay) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// NodeManagement_RequestDataBySenderAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestDataBySenderAddress' -type NodeManagement_RequestDataBySenderAddress_Call struct { - *mock.Call -} - -// RequestDataBySenderAddress is a helper method to define mock.On call -// - cmd model.CmdType -// - sender api.Sender -// - destinationSki string -// - destinationAddress *model.FeatureAddressType -// - maxDelay time.Duration -func (_e *NodeManagement_Expecter) RequestDataBySenderAddress(cmd interface{}, sender interface{}, destinationSki interface{}, destinationAddress interface{}, maxDelay interface{}) *NodeManagement_RequestDataBySenderAddress_Call { - return &NodeManagement_RequestDataBySenderAddress_Call{Call: _e.mock.On("RequestDataBySenderAddress", cmd, sender, destinationSki, destinationAddress, maxDelay)} -} - -func (_c *NodeManagement_RequestDataBySenderAddress_Call) Run(run func(cmd model.CmdType, sender api.Sender, destinationSki string, destinationAddress *model.FeatureAddressType, maxDelay time.Duration)) *NodeManagement_RequestDataBySenderAddress_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.CmdType), args[1].(api.Sender), args[2].(string), args[3].(*model.FeatureAddressType), args[4].(time.Duration)) - }) - return _c -} - -func (_c *NodeManagement_RequestDataBySenderAddress_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagement_RequestDataBySenderAddress_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *NodeManagement_RequestDataBySenderAddress_Call) RunAndReturn(run func(model.CmdType, api.Sender, string, *model.FeatureAddressType, time.Duration) (*model.MsgCounterType, *model.ErrorType)) *NodeManagement_RequestDataBySenderAddress_Call { - _c.Call.Return(run) - return _c -} - -// Role provides a mock function with given fields: -func (_m *NodeManagement) Role() model.RoleType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Role") - } - - var r0 model.RoleType - if rf, ok := ret.Get(0).(func() model.RoleType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.RoleType) - } - - return r0 -} - -// NodeManagement_Role_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Role' -type NodeManagement_Role_Call struct { - *mock.Call -} - -// Role is a helper method to define mock.On call -func (_e *NodeManagement_Expecter) Role() *NodeManagement_Role_Call { - return &NodeManagement_Role_Call{Call: _e.mock.On("Role")} -} - -func (_c *NodeManagement_Role_Call) Run(run func()) *NodeManagement_Role_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *NodeManagement_Role_Call) Return(_a0 model.RoleType) *NodeManagement_Role_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *NodeManagement_Role_Call) RunAndReturn(run func() model.RoleType) *NodeManagement_Role_Call { - _c.Call.Return(run) - return _c -} - -// SetData provides a mock function with given fields: function, data -func (_m *NodeManagement) SetData(function model.FunctionType, data interface{}) { - _m.Called(function, data) -} - -// NodeManagement_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData' -type NodeManagement_SetData_Call struct { - *mock.Call -} - -// SetData is a helper method to define mock.On call -// - function model.FunctionType -// - data interface{} -func (_e *NodeManagement_Expecter) SetData(function interface{}, data interface{}) *NodeManagement_SetData_Call { - return &NodeManagement_SetData_Call{Call: _e.mock.On("SetData", function, data)} -} - -func (_c *NodeManagement_SetData_Call) Run(run func(function model.FunctionType, data interface{})) *NodeManagement_SetData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{})) - }) - return _c -} - -func (_c *NodeManagement_SetData_Call) Return() *NodeManagement_SetData_Call { - _c.Call.Return() - return _c -} - -func (_c *NodeManagement_SetData_Call) RunAndReturn(run func(model.FunctionType, interface{})) *NodeManagement_SetData_Call { - _c.Call.Return(run) - return _c -} - -// SetDescription provides a mock function with given fields: desc -func (_m *NodeManagement) SetDescription(desc *model.DescriptionType) { - _m.Called(desc) -} - -// NodeManagement_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' -type NodeManagement_SetDescription_Call struct { - *mock.Call -} - -// SetDescription is a helper method to define mock.On call -// - desc *model.DescriptionType -func (_e *NodeManagement_Expecter) SetDescription(desc interface{}) *NodeManagement_SetDescription_Call { - return &NodeManagement_SetDescription_Call{Call: _e.mock.On("SetDescription", desc)} -} - -func (_c *NodeManagement_SetDescription_Call) Run(run func(desc *model.DescriptionType)) *NodeManagement_SetDescription_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.DescriptionType)) - }) - return _c -} - -func (_c *NodeManagement_SetDescription_Call) Return() *NodeManagement_SetDescription_Call { - _c.Call.Return() - return _c -} - -func (_c *NodeManagement_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *NodeManagement_SetDescription_Call { - _c.Call.Return(run) - return _c -} - -// SetDescriptionString provides a mock function with given fields: s -func (_m *NodeManagement) SetDescriptionString(s string) { - _m.Called(s) -} - -// NodeManagement_SetDescriptionString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescriptionString' -type NodeManagement_SetDescriptionString_Call struct { - *mock.Call -} - -// SetDescriptionString is a helper method to define mock.On call -// - s string -func (_e *NodeManagement_Expecter) SetDescriptionString(s interface{}) *NodeManagement_SetDescriptionString_Call { - return &NodeManagement_SetDescriptionString_Call{Call: _e.mock.On("SetDescriptionString", s)} -} - -func (_c *NodeManagement_SetDescriptionString_Call) Run(run func(s string)) *NodeManagement_SetDescriptionString_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *NodeManagement_SetDescriptionString_Call) Return() *NodeManagement_SetDescriptionString_Call { - _c.Call.Return() - return _c -} - -func (_c *NodeManagement_SetDescriptionString_Call) RunAndReturn(run func(string)) *NodeManagement_SetDescriptionString_Call { - _c.Call.Return(run) - return _c -} - -// String provides a mock function with given fields: -func (_m *NodeManagement) String() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for String") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// NodeManagement_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' -type NodeManagement_String_Call struct { - *mock.Call -} - -// String is a helper method to define mock.On call -func (_e *NodeManagement_Expecter) String() *NodeManagement_String_Call { - return &NodeManagement_String_Call{Call: _e.mock.On("String")} -} - -func (_c *NodeManagement_String_Call) Run(run func()) *NodeManagement_String_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *NodeManagement_String_Call) Return(_a0 string) *NodeManagement_String_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *NodeManagement_String_Call) RunAndReturn(run func() string) *NodeManagement_String_Call { - _c.Call.Return(run) - return _c -} - -// Subscribe provides a mock function with given fields: remoteAdress -func (_m *NodeManagement) Subscribe(remoteAdress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(remoteAdress) - - if len(ret) == 0 { - panic("no return value specified for Subscribe") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(remoteAdress) - } - if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) *model.MsgCounterType); ok { - r0 = rf(remoteAdress) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(*model.FeatureAddressType) *model.ErrorType); ok { - r1 = rf(remoteAdress) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// NodeManagement_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe' -type NodeManagement_Subscribe_Call struct { - *mock.Call -} - -// Subscribe is a helper method to define mock.On call -// - remoteAdress *model.FeatureAddressType -func (_e *NodeManagement_Expecter) Subscribe(remoteAdress interface{}) *NodeManagement_Subscribe_Call { - return &NodeManagement_Subscribe_Call{Call: _e.mock.On("Subscribe", remoteAdress)} -} - -func (_c *NodeManagement_Subscribe_Call) Run(run func(remoteAdress *model.FeatureAddressType)) *NodeManagement_Subscribe_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*model.FeatureAddressType)) - }) - return _c -} - -func (_c *NodeManagement_Subscribe_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagement_Subscribe_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *NodeManagement_Subscribe_Call) RunAndReturn(run func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)) *NodeManagement_Subscribe_Call { - _c.Call.Return(run) - return _c -} - -// Type provides a mock function with given fields: -func (_m *NodeManagement) Type() model.FeatureTypeType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Type") - } - - var r0 model.FeatureTypeType - if rf, ok := ret.Get(0).(func() model.FeatureTypeType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(model.FeatureTypeType) - } - - return r0 -} - -// NodeManagement_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' -type NodeManagement_Type_Call struct { - *mock.Call -} - -// Type is a helper method to define mock.On call -func (_e *NodeManagement_Expecter) Type() *NodeManagement_Type_Call { - return &NodeManagement_Type_Call{Call: _e.mock.On("Type")} -} - -func (_c *NodeManagement_Type_Call) Run(run func()) *NodeManagement_Type_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *NodeManagement_Type_Call) Return(_a0 model.FeatureTypeType) *NodeManagement_Type_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *NodeManagement_Type_Call) RunAndReturn(run func() model.FeatureTypeType) *NodeManagement_Type_Call { - _c.Call.Return(run) - return _c -} - -// WriteData provides a mock function with given fields: function, deleteSelector, partialSelector, deleteElements, destination -func (_m *NodeManagement) WriteData(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType) { - ret := _m.Called(function, deleteSelector, partialSelector, deleteElements, destination) - - if len(ret) == 0 { - panic("no return value specified for WriteData") - } - - var r0 *model.MsgCounterType - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)); ok { - return rf(function, deleteSelector, partialSelector, deleteElements, destination) - } - if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemote) *model.MsgCounterType); ok { - r0 = rf(function, deleteSelector, partialSelector, deleteElements, destination) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.MsgCounterType) - } - } - - if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemote) *model.ErrorType); ok { - r1 = rf(function, deleteSelector, partialSelector, deleteElements, destination) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// NodeManagement_WriteData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteData' -type NodeManagement_WriteData_Call struct { - *mock.Call -} - -// WriteData is a helper method to define mock.On call -// - function model.FunctionType -// - deleteSelector interface{} -// - partialSelector interface{} -// - deleteElements interface{} -// - destination api.FeatureRemote -func (_e *NodeManagement_Expecter) WriteData(function interface{}, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination interface{}) *NodeManagement_WriteData_Call { - return &NodeManagement_WriteData_Call{Call: _e.mock.On("WriteData", function, deleteSelector, partialSelector, deleteElements, destination)} -} - -func (_c *NodeManagement_WriteData_Call) Run(run func(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination api.FeatureRemote)) *NodeManagement_WriteData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(interface{}), args[4].(api.FeatureRemote)) - }) - return _c -} - -func (_c *NodeManagement_WriteData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagement_WriteData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *NodeManagement_WriteData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType)) *NodeManagement_WriteData_Call { - _c.Call.Return(run) - return _c -} - -// NewNodeManagement creates a new instance of NodeManagement. 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 NewNodeManagement(t interface { - mock.TestingT - Cleanup(func()) -}) *NodeManagement { - mock := &NodeManagement{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/NodeManagementInterface.go b/mocks/NodeManagementInterface.go new file mode 100644 index 0000000..9b26e1a --- /dev/null +++ b/mocks/NodeManagementInterface.go @@ -0,0 +1,1321 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" + + model "github.com/enbility/spine-go/model" + + time "time" +) + +// NodeManagementInterface is an autogenerated mock type for the NodeManagementInterface type +type NodeManagementInterface struct { + mock.Mock +} + +type NodeManagementInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *NodeManagementInterface) EXPECT() *NodeManagementInterface_Expecter { + return &NodeManagementInterface_Expecter{mock: &_m.Mock} +} + +// AddFunctionType provides a mock function with given fields: function, read, write +func (_m *NodeManagementInterface) AddFunctionType(function model.FunctionType, read bool, write bool) { + _m.Called(function, read, write) +} + +// NodeManagementInterface_AddFunctionType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFunctionType' +type NodeManagementInterface_AddFunctionType_Call struct { + *mock.Call +} + +// AddFunctionType is a helper method to define mock.On call +// - function model.FunctionType +// - read bool +// - write bool +func (_e *NodeManagementInterface_Expecter) AddFunctionType(function interface{}, read interface{}, write interface{}) *NodeManagementInterface_AddFunctionType_Call { + return &NodeManagementInterface_AddFunctionType_Call{Call: _e.mock.On("AddFunctionType", function, read, write)} +} + +func (_c *NodeManagementInterface_AddFunctionType_Call) Run(run func(function model.FunctionType, read bool, write bool)) *NodeManagementInterface_AddFunctionType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(bool), args[2].(bool)) + }) + return _c +} + +func (_c *NodeManagementInterface_AddFunctionType_Call) Return() *NodeManagementInterface_AddFunctionType_Call { + _c.Call.Return() + return _c +} + +func (_c *NodeManagementInterface_AddFunctionType_Call) RunAndReturn(run func(model.FunctionType, bool, bool)) *NodeManagementInterface_AddFunctionType_Call { + _c.Call.Return(run) + return _c +} + +// AddResultCallback provides a mock function with given fields: msgCounterReference, function +func (_m *NodeManagementInterface) AddResultCallback(msgCounterReference model.MsgCounterType, function func(api.ResultMessage)) { + _m.Called(msgCounterReference, function) +} + +// NodeManagementInterface_AddResultCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddResultCallback' +type NodeManagementInterface_AddResultCallback_Call struct { + *mock.Call +} + +// AddResultCallback is a helper method to define mock.On call +// - msgCounterReference model.MsgCounterType +// - function func(api.ResultMessage) +func (_e *NodeManagementInterface_Expecter) AddResultCallback(msgCounterReference interface{}, function interface{}) *NodeManagementInterface_AddResultCallback_Call { + return &NodeManagementInterface_AddResultCallback_Call{Call: _e.mock.On("AddResultCallback", msgCounterReference, function)} +} + +func (_c *NodeManagementInterface_AddResultCallback_Call) Run(run func(msgCounterReference model.MsgCounterType, function func(api.ResultMessage))) *NodeManagementInterface_AddResultCallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.MsgCounterType), args[1].(func(api.ResultMessage))) + }) + return _c +} + +func (_c *NodeManagementInterface_AddResultCallback_Call) Return() *NodeManagementInterface_AddResultCallback_Call { + _c.Call.Return() + return _c +} + +func (_c *NodeManagementInterface_AddResultCallback_Call) RunAndReturn(run func(model.MsgCounterType, func(api.ResultMessage))) *NodeManagementInterface_AddResultCallback_Call { + _c.Call.Return(run) + return _c +} + +// AddResultHandler provides a mock function with given fields: handler +func (_m *NodeManagementInterface) AddResultHandler(handler api.FeatureResultInterface) { + _m.Called(handler) +} + +// NodeManagementInterface_AddResultHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddResultHandler' +type NodeManagementInterface_AddResultHandler_Call struct { + *mock.Call +} + +// AddResultHandler is a helper method to define mock.On call +// - handler api.FeatureResultInterface +func (_e *NodeManagementInterface_Expecter) AddResultHandler(handler interface{}) *NodeManagementInterface_AddResultHandler_Call { + return &NodeManagementInterface_AddResultHandler_Call{Call: _e.mock.On("AddResultHandler", handler)} +} + +func (_c *NodeManagementInterface_AddResultHandler_Call) Run(run func(handler api.FeatureResultInterface)) *NodeManagementInterface_AddResultHandler_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.FeatureResultInterface)) + }) + return _c +} + +func (_c *NodeManagementInterface_AddResultHandler_Call) Return() *NodeManagementInterface_AddResultHandler_Call { + _c.Call.Return() + return _c +} + +func (_c *NodeManagementInterface_AddResultHandler_Call) RunAndReturn(run func(api.FeatureResultInterface)) *NodeManagementInterface_AddResultHandler_Call { + _c.Call.Return(run) + return _c +} + +// Address provides a mock function with given fields: +func (_m *NodeManagementInterface) Address() *model.FeatureAddressType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Address") + } + + var r0 *model.FeatureAddressType + if rf, ok := ret.Get(0).(func() *model.FeatureAddressType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.FeatureAddressType) + } + } + + return r0 +} + +// NodeManagementInterface_Address_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Address' +type NodeManagementInterface_Address_Call struct { + *mock.Call +} + +// Address is a helper method to define mock.On call +func (_e *NodeManagementInterface_Expecter) Address() *NodeManagementInterface_Address_Call { + return &NodeManagementInterface_Address_Call{Call: _e.mock.On("Address")} +} + +func (_c *NodeManagementInterface_Address_Call) Run(run func()) *NodeManagementInterface_Address_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeManagementInterface_Address_Call) Return(_a0 *model.FeatureAddressType) *NodeManagementInterface_Address_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeManagementInterface_Address_Call) RunAndReturn(run func() *model.FeatureAddressType) *NodeManagementInterface_Address_Call { + _c.Call.Return(run) + return _c +} + +// Bind provides a mock function with given fields: remoteAdress +func (_m *NodeManagementInterface) Bind(remoteAdress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(remoteAdress) + + if len(ret) == 0 { + panic("no return value specified for Bind") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(remoteAdress) + } + if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) *model.MsgCounterType); ok { + r0 = rf(remoteAdress) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(*model.FeatureAddressType) *model.ErrorType); ok { + r1 = rf(remoteAdress) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// NodeManagementInterface_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' +type NodeManagementInterface_Bind_Call struct { + *mock.Call +} + +// Bind is a helper method to define mock.On call +// - remoteAdress *model.FeatureAddressType +func (_e *NodeManagementInterface_Expecter) Bind(remoteAdress interface{}) *NodeManagementInterface_Bind_Call { + return &NodeManagementInterface_Bind_Call{Call: _e.mock.On("Bind", remoteAdress)} +} + +func (_c *NodeManagementInterface_Bind_Call) Run(run func(remoteAdress *model.FeatureAddressType)) *NodeManagementInterface_Bind_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType)) + }) + return _c +} + +func (_c *NodeManagementInterface_Bind_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagementInterface_Bind_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeManagementInterface_Bind_Call) RunAndReturn(run func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)) *NodeManagementInterface_Bind_Call { + _c.Call.Return(run) + return _c +} + +// DataCopy provides a mock function with given fields: function +func (_m *NodeManagementInterface) DataCopy(function model.FunctionType) interface{} { + ret := _m.Called(function) + + if len(ret) == 0 { + panic("no return value specified for DataCopy") + } + + var r0 interface{} + if rf, ok := ret.Get(0).(func(model.FunctionType) interface{}); ok { + r0 = rf(function) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + + return r0 +} + +// NodeManagementInterface_DataCopy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DataCopy' +type NodeManagementInterface_DataCopy_Call struct { + *mock.Call +} + +// DataCopy is a helper method to define mock.On call +// - function model.FunctionType +func (_e *NodeManagementInterface_Expecter) DataCopy(function interface{}) *NodeManagementInterface_DataCopy_Call { + return &NodeManagementInterface_DataCopy_Call{Call: _e.mock.On("DataCopy", function)} +} + +func (_c *NodeManagementInterface_DataCopy_Call) Run(run func(function model.FunctionType)) *NodeManagementInterface_DataCopy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType)) + }) + return _c +} + +func (_c *NodeManagementInterface_DataCopy_Call) Return(_a0 interface{}) *NodeManagementInterface_DataCopy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeManagementInterface_DataCopy_Call) RunAndReturn(run func(model.FunctionType) interface{}) *NodeManagementInterface_DataCopy_Call { + _c.Call.Return(run) + return _c +} + +// Description provides a mock function with given fields: +func (_m *NodeManagementInterface) Description() *model.DescriptionType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Description") + } + + var r0 *model.DescriptionType + if rf, ok := ret.Get(0).(func() *model.DescriptionType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.DescriptionType) + } + } + + return r0 +} + +// NodeManagementInterface_Description_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Description' +type NodeManagementInterface_Description_Call struct { + *mock.Call +} + +// Description is a helper method to define mock.On call +func (_e *NodeManagementInterface_Expecter) Description() *NodeManagementInterface_Description_Call { + return &NodeManagementInterface_Description_Call{Call: _e.mock.On("Description")} +} + +func (_c *NodeManagementInterface_Description_Call) Run(run func()) *NodeManagementInterface_Description_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeManagementInterface_Description_Call) Return(_a0 *model.DescriptionType) *NodeManagementInterface_Description_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeManagementInterface_Description_Call) RunAndReturn(run func() *model.DescriptionType) *NodeManagementInterface_Description_Call { + _c.Call.Return(run) + return _c +} + +// Device provides a mock function with given fields: +func (_m *NodeManagementInterface) Device() api.DeviceLocalInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Device") + } + + var r0 api.DeviceLocalInterface + if rf, ok := ret.Get(0).(func() api.DeviceLocalInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.DeviceLocalInterface) + } + } + + return r0 +} + +// NodeManagementInterface_Device_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Device' +type NodeManagementInterface_Device_Call struct { + *mock.Call +} + +// Device is a helper method to define mock.On call +func (_e *NodeManagementInterface_Expecter) Device() *NodeManagementInterface_Device_Call { + return &NodeManagementInterface_Device_Call{Call: _e.mock.On("Device")} +} + +func (_c *NodeManagementInterface_Device_Call) Run(run func()) *NodeManagementInterface_Device_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeManagementInterface_Device_Call) Return(_a0 api.DeviceLocalInterface) *NodeManagementInterface_Device_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeManagementInterface_Device_Call) RunAndReturn(run func() api.DeviceLocalInterface) *NodeManagementInterface_Device_Call { + _c.Call.Return(run) + return _c +} + +// Entity provides a mock function with given fields: +func (_m *NodeManagementInterface) Entity() api.EntityLocalInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Entity") + } + + var r0 api.EntityLocalInterface + if rf, ok := ret.Get(0).(func() api.EntityLocalInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.EntityLocalInterface) + } + } + + return r0 +} + +// NodeManagementInterface_Entity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Entity' +type NodeManagementInterface_Entity_Call struct { + *mock.Call +} + +// Entity is a helper method to define mock.On call +func (_e *NodeManagementInterface_Expecter) Entity() *NodeManagementInterface_Entity_Call { + return &NodeManagementInterface_Entity_Call{Call: _e.mock.On("Entity")} +} + +func (_c *NodeManagementInterface_Entity_Call) Run(run func()) *NodeManagementInterface_Entity_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeManagementInterface_Entity_Call) Return(_a0 api.EntityLocalInterface) *NodeManagementInterface_Entity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeManagementInterface_Entity_Call) RunAndReturn(run func() api.EntityLocalInterface) *NodeManagementInterface_Entity_Call { + _c.Call.Return(run) + return _c +} + +// FetchRequestData provides a mock function with given fields: msgCounter, destination +func (_m *NodeManagementInterface) FetchRequestData(msgCounter model.MsgCounterType, destination api.FeatureRemoteInterface) (interface{}, *model.ErrorType) { + ret := _m.Called(msgCounter, destination) + + if len(ret) == 0 { + panic("no return value specified for FetchRequestData") + } + + var r0 interface{} + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(model.MsgCounterType, api.FeatureRemoteInterface) (interface{}, *model.ErrorType)); ok { + return rf(msgCounter, destination) + } + if rf, ok := ret.Get(0).(func(model.MsgCounterType, api.FeatureRemoteInterface) interface{}); ok { + r0 = rf(msgCounter, destination) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + + if rf, ok := ret.Get(1).(func(model.MsgCounterType, api.FeatureRemoteInterface) *model.ErrorType); ok { + r1 = rf(msgCounter, destination) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// NodeManagementInterface_FetchRequestData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchRequestData' +type NodeManagementInterface_FetchRequestData_Call struct { + *mock.Call +} + +// FetchRequestData is a helper method to define mock.On call +// - msgCounter model.MsgCounterType +// - destination api.FeatureRemoteInterface +func (_e *NodeManagementInterface_Expecter) FetchRequestData(msgCounter interface{}, destination interface{}) *NodeManagementInterface_FetchRequestData_Call { + return &NodeManagementInterface_FetchRequestData_Call{Call: _e.mock.On("FetchRequestData", msgCounter, destination)} +} + +func (_c *NodeManagementInterface_FetchRequestData_Call) Run(run func(msgCounter model.MsgCounterType, destination api.FeatureRemoteInterface)) *NodeManagementInterface_FetchRequestData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.MsgCounterType), args[1].(api.FeatureRemoteInterface)) + }) + return _c +} + +func (_c *NodeManagementInterface_FetchRequestData_Call) Return(_a0 interface{}, _a1 *model.ErrorType) *NodeManagementInterface_FetchRequestData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeManagementInterface_FetchRequestData_Call) RunAndReturn(run func(model.MsgCounterType, api.FeatureRemoteInterface) (interface{}, *model.ErrorType)) *NodeManagementInterface_FetchRequestData_Call { + _c.Call.Return(run) + return _c +} + +// HandleMessage provides a mock function with given fields: message +func (_m *NodeManagementInterface) HandleMessage(message *api.Message) *model.ErrorType { + ret := _m.Called(message) + + if len(ret) == 0 { + panic("no return value specified for HandleMessage") + } + + var r0 *model.ErrorType + if rf, ok := ret.Get(0).(func(*api.Message) *model.ErrorType); ok { + r0 = rf(message) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.ErrorType) + } + } + + return r0 +} + +// NodeManagementInterface_HandleMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleMessage' +type NodeManagementInterface_HandleMessage_Call struct { + *mock.Call +} + +// HandleMessage is a helper method to define mock.On call +// - message *api.Message +func (_e *NodeManagementInterface_Expecter) HandleMessage(message interface{}) *NodeManagementInterface_HandleMessage_Call { + return &NodeManagementInterface_HandleMessage_Call{Call: _e.mock.On("HandleMessage", message)} +} + +func (_c *NodeManagementInterface_HandleMessage_Call) Run(run func(message *api.Message)) *NodeManagementInterface_HandleMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*api.Message)) + }) + return _c +} + +func (_c *NodeManagementInterface_HandleMessage_Call) Return(_a0 *model.ErrorType) *NodeManagementInterface_HandleMessage_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeManagementInterface_HandleMessage_Call) RunAndReturn(run func(*api.Message) *model.ErrorType) *NodeManagementInterface_HandleMessage_Call { + _c.Call.Return(run) + return _c +} + +// Information provides a mock function with given fields: +func (_m *NodeManagementInterface) Information() *model.NodeManagementDetailedDiscoveryFeatureInformationType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Information") + } + + var r0 *model.NodeManagementDetailedDiscoveryFeatureInformationType + if rf, ok := ret.Get(0).(func() *model.NodeManagementDetailedDiscoveryFeatureInformationType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.NodeManagementDetailedDiscoveryFeatureInformationType) + } + } + + return r0 +} + +// NodeManagementInterface_Information_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Information' +type NodeManagementInterface_Information_Call struct { + *mock.Call +} + +// Information is a helper method to define mock.On call +func (_e *NodeManagementInterface_Expecter) Information() *NodeManagementInterface_Information_Call { + return &NodeManagementInterface_Information_Call{Call: _e.mock.On("Information")} +} + +func (_c *NodeManagementInterface_Information_Call) Run(run func()) *NodeManagementInterface_Information_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeManagementInterface_Information_Call) Return(_a0 *model.NodeManagementDetailedDiscoveryFeatureInformationType) *NodeManagementInterface_Information_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeManagementInterface_Information_Call) RunAndReturn(run func() *model.NodeManagementDetailedDiscoveryFeatureInformationType) *NodeManagementInterface_Information_Call { + _c.Call.Return(run) + return _c +} + +// NotifyData provides a mock function with given fields: function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination +func (_m *NodeManagementInterface) NotifyData(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{}, destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) + + if len(ret) == 0 { + panic("no return value specified for NotifyData") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) + } + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemoteInterface) *model.MsgCounterType); ok { + r0 = rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemoteInterface) *model.ErrorType); ok { + r1 = rf(function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// NodeManagementInterface_NotifyData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotifyData' +type NodeManagementInterface_NotifyData_Call struct { + *mock.Call +} + +// NotifyData is a helper method to define mock.On call +// - function model.FunctionType +// - deleteSelector interface{} +// - partialSelector interface{} +// - partialWithoutSelector bool +// - deleteElements interface{} +// - destination api.FeatureRemoteInterface +func (_e *NodeManagementInterface_Expecter) NotifyData(function interface{}, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector interface{}, deleteElements interface{}, destination interface{}) *NodeManagementInterface_NotifyData_Call { + return &NodeManagementInterface_NotifyData_Call{Call: _e.mock.On("NotifyData", function, deleteSelector, partialSelector, partialWithoutSelector, deleteElements, destination)} +} + +func (_c *NodeManagementInterface_NotifyData_Call) Run(run func(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, partialWithoutSelector bool, deleteElements interface{}, destination api.FeatureRemoteInterface)) *NodeManagementInterface_NotifyData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(bool), args[4].(interface{}), args[5].(api.FeatureRemoteInterface)) + }) + return _c +} + +func (_c *NodeManagementInterface_NotifyData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagementInterface_NotifyData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeManagementInterface_NotifyData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, bool, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)) *NodeManagementInterface_NotifyData_Call { + _c.Call.Return(run) + return _c +} + +// Operations provides a mock function with given fields: +func (_m *NodeManagementInterface) Operations() map[model.FunctionType]api.OperationsInterface { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Operations") + } + + var r0 map[model.FunctionType]api.OperationsInterface + if rf, ok := ret.Get(0).(func() map[model.FunctionType]api.OperationsInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[model.FunctionType]api.OperationsInterface) + } + } + + return r0 +} + +// NodeManagementInterface_Operations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Operations' +type NodeManagementInterface_Operations_Call struct { + *mock.Call +} + +// Operations is a helper method to define mock.On call +func (_e *NodeManagementInterface_Expecter) Operations() *NodeManagementInterface_Operations_Call { + return &NodeManagementInterface_Operations_Call{Call: _e.mock.On("Operations")} +} + +func (_c *NodeManagementInterface_Operations_Call) Run(run func()) *NodeManagementInterface_Operations_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeManagementInterface_Operations_Call) Return(_a0 map[model.FunctionType]api.OperationsInterface) *NodeManagementInterface_Operations_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeManagementInterface_Operations_Call) RunAndReturn(run func() map[model.FunctionType]api.OperationsInterface) *NodeManagementInterface_Operations_Call { + _c.Call.Return(run) + return _c +} + +// RemoveAllBindings provides a mock function with given fields: +func (_m *NodeManagementInterface) RemoveAllBindings() { + _m.Called() +} + +// NodeManagementInterface_RemoveAllBindings_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllBindings' +type NodeManagementInterface_RemoveAllBindings_Call struct { + *mock.Call +} + +// RemoveAllBindings is a helper method to define mock.On call +func (_e *NodeManagementInterface_Expecter) RemoveAllBindings() *NodeManagementInterface_RemoveAllBindings_Call { + return &NodeManagementInterface_RemoveAllBindings_Call{Call: _e.mock.On("RemoveAllBindings")} +} + +func (_c *NodeManagementInterface_RemoveAllBindings_Call) Run(run func()) *NodeManagementInterface_RemoveAllBindings_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeManagementInterface_RemoveAllBindings_Call) Return() *NodeManagementInterface_RemoveAllBindings_Call { + _c.Call.Return() + return _c +} + +func (_c *NodeManagementInterface_RemoveAllBindings_Call) RunAndReturn(run func()) *NodeManagementInterface_RemoveAllBindings_Call { + _c.Call.Return(run) + return _c +} + +// RemoveAllSubscriptions provides a mock function with given fields: +func (_m *NodeManagementInterface) RemoveAllSubscriptions() { + _m.Called() +} + +// NodeManagementInterface_RemoveAllSubscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllSubscriptions' +type NodeManagementInterface_RemoveAllSubscriptions_Call struct { + *mock.Call +} + +// RemoveAllSubscriptions is a helper method to define mock.On call +func (_e *NodeManagementInterface_Expecter) RemoveAllSubscriptions() *NodeManagementInterface_RemoveAllSubscriptions_Call { + return &NodeManagementInterface_RemoveAllSubscriptions_Call{Call: _e.mock.On("RemoveAllSubscriptions")} +} + +func (_c *NodeManagementInterface_RemoveAllSubscriptions_Call) Run(run func()) *NodeManagementInterface_RemoveAllSubscriptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeManagementInterface_RemoveAllSubscriptions_Call) Return() *NodeManagementInterface_RemoveAllSubscriptions_Call { + _c.Call.Return() + return _c +} + +func (_c *NodeManagementInterface_RemoveAllSubscriptions_Call) RunAndReturn(run func()) *NodeManagementInterface_RemoveAllSubscriptions_Call { + _c.Call.Return(run) + return _c +} + +// RemoveBinding provides a mock function with given fields: remoteAddress +func (_m *NodeManagementInterface) RemoveBinding(remoteAddress *model.FeatureAddressType) { + _m.Called(remoteAddress) +} + +// NodeManagementInterface_RemoveBinding_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveBinding' +type NodeManagementInterface_RemoveBinding_Call struct { + *mock.Call +} + +// RemoveBinding is a helper method to define mock.On call +// - remoteAddress *model.FeatureAddressType +func (_e *NodeManagementInterface_Expecter) RemoveBinding(remoteAddress interface{}) *NodeManagementInterface_RemoveBinding_Call { + return &NodeManagementInterface_RemoveBinding_Call{Call: _e.mock.On("RemoveBinding", remoteAddress)} +} + +func (_c *NodeManagementInterface_RemoveBinding_Call) Run(run func(remoteAddress *model.FeatureAddressType)) *NodeManagementInterface_RemoveBinding_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType)) + }) + return _c +} + +func (_c *NodeManagementInterface_RemoveBinding_Call) Return() *NodeManagementInterface_RemoveBinding_Call { + _c.Call.Return() + return _c +} + +func (_c *NodeManagementInterface_RemoveBinding_Call) RunAndReturn(run func(*model.FeatureAddressType)) *NodeManagementInterface_RemoveBinding_Call { + _c.Call.Return(run) + return _c +} + +// RemoveSubscription provides a mock function with given fields: remoteAddress +func (_m *NodeManagementInterface) RemoveSubscription(remoteAddress *model.FeatureAddressType) { + _m.Called(remoteAddress) +} + +// NodeManagementInterface_RemoveSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSubscription' +type NodeManagementInterface_RemoveSubscription_Call struct { + *mock.Call +} + +// RemoveSubscription is a helper method to define mock.On call +// - remoteAddress *model.FeatureAddressType +func (_e *NodeManagementInterface_Expecter) RemoveSubscription(remoteAddress interface{}) *NodeManagementInterface_RemoveSubscription_Call { + return &NodeManagementInterface_RemoveSubscription_Call{Call: _e.mock.On("RemoveSubscription", remoteAddress)} +} + +func (_c *NodeManagementInterface_RemoveSubscription_Call) Run(run func(remoteAddress *model.FeatureAddressType)) *NodeManagementInterface_RemoveSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType)) + }) + return _c +} + +func (_c *NodeManagementInterface_RemoveSubscription_Call) Return() *NodeManagementInterface_RemoveSubscription_Call { + _c.Call.Return() + return _c +} + +func (_c *NodeManagementInterface_RemoveSubscription_Call) RunAndReturn(run func(*model.FeatureAddressType)) *NodeManagementInterface_RemoveSubscription_Call { + _c.Call.Return(run) + return _c +} + +// RequestData provides a mock function with given fields: function, selector, elements, destination +func (_m *NodeManagementInterface) RequestData(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(function, selector, elements, destination) + + if len(ret) == 0 { + panic("no return value specified for RequestData") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(function, selector, elements, destination) + } + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) *model.MsgCounterType); ok { + r0 = rf(function, selector, elements, destination) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) *model.ErrorType); ok { + r1 = rf(function, selector, elements, destination) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// NodeManagementInterface_RequestData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestData' +type NodeManagementInterface_RequestData_Call struct { + *mock.Call +} + +// RequestData is a helper method to define mock.On call +// - function model.FunctionType +// - selector interface{} +// - elements interface{} +// - destination api.FeatureRemoteInterface +func (_e *NodeManagementInterface_Expecter) RequestData(function interface{}, selector interface{}, elements interface{}, destination interface{}) *NodeManagementInterface_RequestData_Call { + return &NodeManagementInterface_RequestData_Call{Call: _e.mock.On("RequestData", function, selector, elements, destination)} +} + +func (_c *NodeManagementInterface_RequestData_Call) Run(run func(function model.FunctionType, selector interface{}, elements interface{}, destination api.FeatureRemoteInterface)) *NodeManagementInterface_RequestData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(api.FeatureRemoteInterface)) + }) + return _c +} + +func (_c *NodeManagementInterface_RequestData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagementInterface_RequestData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeManagementInterface_RequestData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)) *NodeManagementInterface_RequestData_Call { + _c.Call.Return(run) + return _c +} + +// RequestDataBySenderAddress provides a mock function with given fields: cmd, sender, destinationSki, destinationAddress, maxDelay +func (_m *NodeManagementInterface) RequestDataBySenderAddress(cmd model.CmdType, sender api.SenderInterface, destinationSki string, destinationAddress *model.FeatureAddressType, maxDelay time.Duration) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(cmd, sender, destinationSki, destinationAddress, maxDelay) + + if len(ret) == 0 { + panic("no return value specified for RequestDataBySenderAddress") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(model.CmdType, api.SenderInterface, string, *model.FeatureAddressType, time.Duration) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(cmd, sender, destinationSki, destinationAddress, maxDelay) + } + if rf, ok := ret.Get(0).(func(model.CmdType, api.SenderInterface, string, *model.FeatureAddressType, time.Duration) *model.MsgCounterType); ok { + r0 = rf(cmd, sender, destinationSki, destinationAddress, maxDelay) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(model.CmdType, api.SenderInterface, string, *model.FeatureAddressType, time.Duration) *model.ErrorType); ok { + r1 = rf(cmd, sender, destinationSki, destinationAddress, maxDelay) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// NodeManagementInterface_RequestDataBySenderAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestDataBySenderAddress' +type NodeManagementInterface_RequestDataBySenderAddress_Call struct { + *mock.Call +} + +// RequestDataBySenderAddress is a helper method to define mock.On call +// - cmd model.CmdType +// - sender api.SenderInterface +// - destinationSki string +// - destinationAddress *model.FeatureAddressType +// - maxDelay time.Duration +func (_e *NodeManagementInterface_Expecter) RequestDataBySenderAddress(cmd interface{}, sender interface{}, destinationSki interface{}, destinationAddress interface{}, maxDelay interface{}) *NodeManagementInterface_RequestDataBySenderAddress_Call { + return &NodeManagementInterface_RequestDataBySenderAddress_Call{Call: _e.mock.On("RequestDataBySenderAddress", cmd, sender, destinationSki, destinationAddress, maxDelay)} +} + +func (_c *NodeManagementInterface_RequestDataBySenderAddress_Call) Run(run func(cmd model.CmdType, sender api.SenderInterface, destinationSki string, destinationAddress *model.FeatureAddressType, maxDelay time.Duration)) *NodeManagementInterface_RequestDataBySenderAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.CmdType), args[1].(api.SenderInterface), args[2].(string), args[3].(*model.FeatureAddressType), args[4].(time.Duration)) + }) + return _c +} + +func (_c *NodeManagementInterface_RequestDataBySenderAddress_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagementInterface_RequestDataBySenderAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeManagementInterface_RequestDataBySenderAddress_Call) RunAndReturn(run func(model.CmdType, api.SenderInterface, string, *model.FeatureAddressType, time.Duration) (*model.MsgCounterType, *model.ErrorType)) *NodeManagementInterface_RequestDataBySenderAddress_Call { + _c.Call.Return(run) + return _c +} + +// Role provides a mock function with given fields: +func (_m *NodeManagementInterface) Role() model.RoleType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Role") + } + + var r0 model.RoleType + if rf, ok := ret.Get(0).(func() model.RoleType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.RoleType) + } + + return r0 +} + +// NodeManagementInterface_Role_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Role' +type NodeManagementInterface_Role_Call struct { + *mock.Call +} + +// Role is a helper method to define mock.On call +func (_e *NodeManagementInterface_Expecter) Role() *NodeManagementInterface_Role_Call { + return &NodeManagementInterface_Role_Call{Call: _e.mock.On("Role")} +} + +func (_c *NodeManagementInterface_Role_Call) Run(run func()) *NodeManagementInterface_Role_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeManagementInterface_Role_Call) Return(_a0 model.RoleType) *NodeManagementInterface_Role_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeManagementInterface_Role_Call) RunAndReturn(run func() model.RoleType) *NodeManagementInterface_Role_Call { + _c.Call.Return(run) + return _c +} + +// SetData provides a mock function with given fields: function, data +func (_m *NodeManagementInterface) SetData(function model.FunctionType, data interface{}) { + _m.Called(function, data) +} + +// NodeManagementInterface_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData' +type NodeManagementInterface_SetData_Call struct { + *mock.Call +} + +// SetData is a helper method to define mock.On call +// - function model.FunctionType +// - data interface{} +func (_e *NodeManagementInterface_Expecter) SetData(function interface{}, data interface{}) *NodeManagementInterface_SetData_Call { + return &NodeManagementInterface_SetData_Call{Call: _e.mock.On("SetData", function, data)} +} + +func (_c *NodeManagementInterface_SetData_Call) Run(run func(function model.FunctionType, data interface{})) *NodeManagementInterface_SetData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(interface{})) + }) + return _c +} + +func (_c *NodeManagementInterface_SetData_Call) Return() *NodeManagementInterface_SetData_Call { + _c.Call.Return() + return _c +} + +func (_c *NodeManagementInterface_SetData_Call) RunAndReturn(run func(model.FunctionType, interface{})) *NodeManagementInterface_SetData_Call { + _c.Call.Return(run) + return _c +} + +// SetDescription provides a mock function with given fields: desc +func (_m *NodeManagementInterface) SetDescription(desc *model.DescriptionType) { + _m.Called(desc) +} + +// NodeManagementInterface_SetDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescription' +type NodeManagementInterface_SetDescription_Call struct { + *mock.Call +} + +// SetDescription is a helper method to define mock.On call +// - desc *model.DescriptionType +func (_e *NodeManagementInterface_Expecter) SetDescription(desc interface{}) *NodeManagementInterface_SetDescription_Call { + return &NodeManagementInterface_SetDescription_Call{Call: _e.mock.On("SetDescription", desc)} +} + +func (_c *NodeManagementInterface_SetDescription_Call) Run(run func(desc *model.DescriptionType)) *NodeManagementInterface_SetDescription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.DescriptionType)) + }) + return _c +} + +func (_c *NodeManagementInterface_SetDescription_Call) Return() *NodeManagementInterface_SetDescription_Call { + _c.Call.Return() + return _c +} + +func (_c *NodeManagementInterface_SetDescription_Call) RunAndReturn(run func(*model.DescriptionType)) *NodeManagementInterface_SetDescription_Call { + _c.Call.Return(run) + return _c +} + +// SetDescriptionString provides a mock function with given fields: s +func (_m *NodeManagementInterface) SetDescriptionString(s string) { + _m.Called(s) +} + +// NodeManagementInterface_SetDescriptionString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDescriptionString' +type NodeManagementInterface_SetDescriptionString_Call struct { + *mock.Call +} + +// SetDescriptionString is a helper method to define mock.On call +// - s string +func (_e *NodeManagementInterface_Expecter) SetDescriptionString(s interface{}) *NodeManagementInterface_SetDescriptionString_Call { + return &NodeManagementInterface_SetDescriptionString_Call{Call: _e.mock.On("SetDescriptionString", s)} +} + +func (_c *NodeManagementInterface_SetDescriptionString_Call) Run(run func(s string)) *NodeManagementInterface_SetDescriptionString_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *NodeManagementInterface_SetDescriptionString_Call) Return() *NodeManagementInterface_SetDescriptionString_Call { + _c.Call.Return() + return _c +} + +func (_c *NodeManagementInterface_SetDescriptionString_Call) RunAndReturn(run func(string)) *NodeManagementInterface_SetDescriptionString_Call { + _c.Call.Return(run) + return _c +} + +// String provides a mock function with given fields: +func (_m *NodeManagementInterface) String() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for String") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// NodeManagementInterface_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type NodeManagementInterface_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *NodeManagementInterface_Expecter) String() *NodeManagementInterface_String_Call { + return &NodeManagementInterface_String_Call{Call: _e.mock.On("String")} +} + +func (_c *NodeManagementInterface_String_Call) Run(run func()) *NodeManagementInterface_String_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeManagementInterface_String_Call) Return(_a0 string) *NodeManagementInterface_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeManagementInterface_String_Call) RunAndReturn(run func() string) *NodeManagementInterface_String_Call { + _c.Call.Return(run) + return _c +} + +// Subscribe provides a mock function with given fields: remoteAdress +func (_m *NodeManagementInterface) Subscribe(remoteAdress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(remoteAdress) + + if len(ret) == 0 { + panic("no return value specified for Subscribe") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(remoteAdress) + } + if rf, ok := ret.Get(0).(func(*model.FeatureAddressType) *model.MsgCounterType); ok { + r0 = rf(remoteAdress) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(*model.FeatureAddressType) *model.ErrorType); ok { + r1 = rf(remoteAdress) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// NodeManagementInterface_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe' +type NodeManagementInterface_Subscribe_Call struct { + *mock.Call +} + +// Subscribe is a helper method to define mock.On call +// - remoteAdress *model.FeatureAddressType +func (_e *NodeManagementInterface_Expecter) Subscribe(remoteAdress interface{}) *NodeManagementInterface_Subscribe_Call { + return &NodeManagementInterface_Subscribe_Call{Call: _e.mock.On("Subscribe", remoteAdress)} +} + +func (_c *NodeManagementInterface_Subscribe_Call) Run(run func(remoteAdress *model.FeatureAddressType)) *NodeManagementInterface_Subscribe_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*model.FeatureAddressType)) + }) + return _c +} + +func (_c *NodeManagementInterface_Subscribe_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagementInterface_Subscribe_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeManagementInterface_Subscribe_Call) RunAndReturn(run func(*model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)) *NodeManagementInterface_Subscribe_Call { + _c.Call.Return(run) + return _c +} + +// Type provides a mock function with given fields: +func (_m *NodeManagementInterface) Type() model.FeatureTypeType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Type") + } + + var r0 model.FeatureTypeType + if rf, ok := ret.Get(0).(func() model.FeatureTypeType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(model.FeatureTypeType) + } + + return r0 +} + +// NodeManagementInterface_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' +type NodeManagementInterface_Type_Call struct { + *mock.Call +} + +// Type is a helper method to define mock.On call +func (_e *NodeManagementInterface_Expecter) Type() *NodeManagementInterface_Type_Call { + return &NodeManagementInterface_Type_Call{Call: _e.mock.On("Type")} +} + +func (_c *NodeManagementInterface_Type_Call) Run(run func()) *NodeManagementInterface_Type_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *NodeManagementInterface_Type_Call) Return(_a0 model.FeatureTypeType) *NodeManagementInterface_Type_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *NodeManagementInterface_Type_Call) RunAndReturn(run func() model.FeatureTypeType) *NodeManagementInterface_Type_Call { + _c.Call.Return(run) + return _c +} + +// WriteData provides a mock function with given fields: function, deleteSelector, partialSelector, deleteElements, destination +func (_m *NodeManagementInterface) WriteData(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { + ret := _m.Called(function, deleteSelector, partialSelector, deleteElements, destination) + + if len(ret) == 0 { + panic("no return value specified for WriteData") + } + + var r0 *model.MsgCounterType + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)); ok { + return rf(function, deleteSelector, partialSelector, deleteElements, destination) + } + if rf, ok := ret.Get(0).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemoteInterface) *model.MsgCounterType); ok { + r0 = rf(function, deleteSelector, partialSelector, deleteElements, destination) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.MsgCounterType) + } + } + + if rf, ok := ret.Get(1).(func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemoteInterface) *model.ErrorType); ok { + r1 = rf(function, deleteSelector, partialSelector, deleteElements, destination) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// NodeManagementInterface_WriteData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WriteData' +type NodeManagementInterface_WriteData_Call struct { + *mock.Call +} + +// WriteData is a helper method to define mock.On call +// - function model.FunctionType +// - deleteSelector interface{} +// - partialSelector interface{} +// - deleteElements interface{} +// - destination api.FeatureRemoteInterface +func (_e *NodeManagementInterface_Expecter) WriteData(function interface{}, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination interface{}) *NodeManagementInterface_WriteData_Call { + return &NodeManagementInterface_WriteData_Call{Call: _e.mock.On("WriteData", function, deleteSelector, partialSelector, deleteElements, destination)} +} + +func (_c *NodeManagementInterface_WriteData_Call) Run(run func(function model.FunctionType, deleteSelector interface{}, partialSelector interface{}, deleteElements interface{}, destination api.FeatureRemoteInterface)) *NodeManagementInterface_WriteData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FunctionType), args[1].(interface{}), args[2].(interface{}), args[3].(interface{}), args[4].(api.FeatureRemoteInterface)) + }) + return _c +} + +func (_c *NodeManagementInterface_WriteData_Call) Return(_a0 *model.MsgCounterType, _a1 *model.ErrorType) *NodeManagementInterface_WriteData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *NodeManagementInterface_WriteData_Call) RunAndReturn(run func(model.FunctionType, interface{}, interface{}, interface{}, api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)) *NodeManagementInterface_WriteData_Call { + _c.Call.Return(run) + return _c +} + +// NewNodeManagementInterface creates a new instance of NodeManagementInterface. 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 NewNodeManagementInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *NodeManagementInterface { + mock := &NodeManagementInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/Operations.go b/mocks/Operations.go deleted file mode 100644 index 718fb6d..0000000 --- a/mocks/Operations.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - model "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" -) - -// Operations is an autogenerated mock type for the Operations type -type Operations struct { - mock.Mock -} - -type Operations_Expecter struct { - mock *mock.Mock -} - -func (_m *Operations) EXPECT() *Operations_Expecter { - return &Operations_Expecter{mock: &_m.Mock} -} - -// Information provides a mock function with given fields: -func (_m *Operations) Information() *model.PossibleOperationsType { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Information") - } - - var r0 *model.PossibleOperationsType - if rf, ok := ret.Get(0).(func() *model.PossibleOperationsType); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.PossibleOperationsType) - } - } - - return r0 -} - -// Operations_Information_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Information' -type Operations_Information_Call struct { - *mock.Call -} - -// Information is a helper method to define mock.On call -func (_e *Operations_Expecter) Information() *Operations_Information_Call { - return &Operations_Information_Call{Call: _e.mock.On("Information")} -} - -func (_c *Operations_Information_Call) Run(run func()) *Operations_Information_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Operations_Information_Call) Return(_a0 *model.PossibleOperationsType) *Operations_Information_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Operations_Information_Call) RunAndReturn(run func() *model.PossibleOperationsType) *Operations_Information_Call { - _c.Call.Return(run) - return _c -} - -// String provides a mock function with given fields: -func (_m *Operations) String() string { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for String") - } - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// Operations_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' -type Operations_String_Call struct { - *mock.Call -} - -// String is a helper method to define mock.On call -func (_e *Operations_Expecter) String() *Operations_String_Call { - return &Operations_String_Call{Call: _e.mock.On("String")} -} - -func (_c *Operations_String_Call) Run(run func()) *Operations_String_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Operations_String_Call) Return(_a0 string) *Operations_String_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Operations_String_Call) RunAndReturn(run func() string) *Operations_String_Call { - _c.Call.Return(run) - return _c -} - -// NewOperations creates a new instance of Operations. 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 NewOperations(t interface { - mock.TestingT - Cleanup(func()) -}) *Operations { - mock := &Operations{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/OperationsInterface.go b/mocks/OperationsInterface.go new file mode 100644 index 0000000..412333e --- /dev/null +++ b/mocks/OperationsInterface.go @@ -0,0 +1,217 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + model "github.com/enbility/spine-go/model" + mock "github.com/stretchr/testify/mock" +) + +// OperationsInterface is an autogenerated mock type for the OperationsInterface type +type OperationsInterface struct { + mock.Mock +} + +type OperationsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *OperationsInterface) EXPECT() *OperationsInterface_Expecter { + return &OperationsInterface_Expecter{mock: &_m.Mock} +} + +// Information provides a mock function with given fields: +func (_m *OperationsInterface) Information() *model.PossibleOperationsType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Information") + } + + var r0 *model.PossibleOperationsType + if rf, ok := ret.Get(0).(func() *model.PossibleOperationsType); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.PossibleOperationsType) + } + } + + return r0 +} + +// OperationsInterface_Information_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Information' +type OperationsInterface_Information_Call struct { + *mock.Call +} + +// Information is a helper method to define mock.On call +func (_e *OperationsInterface_Expecter) Information() *OperationsInterface_Information_Call { + return &OperationsInterface_Information_Call{Call: _e.mock.On("Information")} +} + +func (_c *OperationsInterface_Information_Call) Run(run func()) *OperationsInterface_Information_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OperationsInterface_Information_Call) Return(_a0 *model.PossibleOperationsType) *OperationsInterface_Information_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OperationsInterface_Information_Call) RunAndReturn(run func() *model.PossibleOperationsType) *OperationsInterface_Information_Call { + _c.Call.Return(run) + return _c +} + +// Read provides a mock function with given fields: +func (_m *OperationsInterface) Read() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Read") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// OperationsInterface_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' +type OperationsInterface_Read_Call struct { + *mock.Call +} + +// Read is a helper method to define mock.On call +func (_e *OperationsInterface_Expecter) Read() *OperationsInterface_Read_Call { + return &OperationsInterface_Read_Call{Call: _e.mock.On("Read")} +} + +func (_c *OperationsInterface_Read_Call) Run(run func()) *OperationsInterface_Read_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OperationsInterface_Read_Call) Return(_a0 bool) *OperationsInterface_Read_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OperationsInterface_Read_Call) RunAndReturn(run func() bool) *OperationsInterface_Read_Call { + _c.Call.Return(run) + return _c +} + +// String provides a mock function with given fields: +func (_m *OperationsInterface) String() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for String") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// OperationsInterface_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type OperationsInterface_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *OperationsInterface_Expecter) String() *OperationsInterface_String_Call { + return &OperationsInterface_String_Call{Call: _e.mock.On("String")} +} + +func (_c *OperationsInterface_String_Call) Run(run func()) *OperationsInterface_String_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OperationsInterface_String_Call) Return(_a0 string) *OperationsInterface_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OperationsInterface_String_Call) RunAndReturn(run func() string) *OperationsInterface_String_Call { + _c.Call.Return(run) + return _c +} + +// Write provides a mock function with given fields: +func (_m *OperationsInterface) Write() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Write") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// OperationsInterface_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' +type OperationsInterface_Write_Call struct { + *mock.Call +} + +// Write is a helper method to define mock.On call +func (_e *OperationsInterface_Expecter) Write() *OperationsInterface_Write_Call { + return &OperationsInterface_Write_Call{Call: _e.mock.On("Write")} +} + +func (_c *OperationsInterface_Write_Call) Run(run func()) *OperationsInterface_Write_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *OperationsInterface_Write_Call) Return(_a0 bool) *OperationsInterface_Write_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *OperationsInterface_Write_Call) RunAndReturn(run func() bool) *OperationsInterface_Write_Call { + _c.Call.Return(run) + return _c +} + +// NewOperationsInterface creates a new instance of OperationsInterface. 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 NewOperationsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *OperationsInterface { + mock := &OperationsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/PendingRequests.go b/mocks/PendingRequests.go deleted file mode 100644 index 90b890f..0000000 --- a/mocks/PendingRequests.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - model "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" - - time "time" -) - -// PendingRequests is an autogenerated mock type for the PendingRequests type -type PendingRequests struct { - mock.Mock -} - -type PendingRequests_Expecter struct { - mock *mock.Mock -} - -func (_m *PendingRequests) EXPECT() *PendingRequests_Expecter { - return &PendingRequests_Expecter{mock: &_m.Mock} -} - -// Add provides a mock function with given fields: ski, counter, maxDelay -func (_m *PendingRequests) Add(ski string, counter model.MsgCounterType, maxDelay time.Duration) { - _m.Called(ski, counter, maxDelay) -} - -// PendingRequests_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' -type PendingRequests_Add_Call struct { - *mock.Call -} - -// Add is a helper method to define mock.On call -// - ski string -// - counter model.MsgCounterType -// - maxDelay time.Duration -func (_e *PendingRequests_Expecter) Add(ski interface{}, counter interface{}, maxDelay interface{}) *PendingRequests_Add_Call { - return &PendingRequests_Add_Call{Call: _e.mock.On("Add", ski, counter, maxDelay)} -} - -func (_c *PendingRequests_Add_Call) Run(run func(ski string, counter model.MsgCounterType, maxDelay time.Duration)) *PendingRequests_Add_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(model.MsgCounterType), args[2].(time.Duration)) - }) - return _c -} - -func (_c *PendingRequests_Add_Call) Return() *PendingRequests_Add_Call { - _c.Call.Return() - return _c -} - -func (_c *PendingRequests_Add_Call) RunAndReturn(run func(string, model.MsgCounterType, time.Duration)) *PendingRequests_Add_Call { - _c.Call.Return(run) - return _c -} - -// GetData provides a mock function with given fields: ski, counter -func (_m *PendingRequests) GetData(ski string, counter model.MsgCounterType) (interface{}, *model.ErrorType) { - ret := _m.Called(ski, counter) - - if len(ret) == 0 { - panic("no return value specified for GetData") - } - - var r0 interface{} - var r1 *model.ErrorType - if rf, ok := ret.Get(0).(func(string, model.MsgCounterType) (interface{}, *model.ErrorType)); ok { - return rf(ski, counter) - } - if rf, ok := ret.Get(0).(func(string, model.MsgCounterType) interface{}); ok { - r0 = rf(ski, counter) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(interface{}) - } - } - - if rf, ok := ret.Get(1).(func(string, model.MsgCounterType) *model.ErrorType); ok { - r1 = rf(ski, counter) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).(*model.ErrorType) - } - } - - return r0, r1 -} - -// PendingRequests_GetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetData' -type PendingRequests_GetData_Call struct { - *mock.Call -} - -// GetData is a helper method to define mock.On call -// - ski string -// - counter model.MsgCounterType -func (_e *PendingRequests_Expecter) GetData(ski interface{}, counter interface{}) *PendingRequests_GetData_Call { - return &PendingRequests_GetData_Call{Call: _e.mock.On("GetData", ski, counter)} -} - -func (_c *PendingRequests_GetData_Call) Run(run func(ski string, counter model.MsgCounterType)) *PendingRequests_GetData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(model.MsgCounterType)) - }) - return _c -} - -func (_c *PendingRequests_GetData_Call) Return(_a0 interface{}, _a1 *model.ErrorType) *PendingRequests_GetData_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *PendingRequests_GetData_Call) RunAndReturn(run func(string, model.MsgCounterType) (interface{}, *model.ErrorType)) *PendingRequests_GetData_Call { - _c.Call.Return(run) - return _c -} - -// Remove provides a mock function with given fields: ski, counter -func (_m *PendingRequests) Remove(ski string, counter model.MsgCounterType) *model.ErrorType { - ret := _m.Called(ski, counter) - - if len(ret) == 0 { - panic("no return value specified for Remove") - } - - var r0 *model.ErrorType - if rf, ok := ret.Get(0).(func(string, model.MsgCounterType) *model.ErrorType); ok { - r0 = rf(ski, counter) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.ErrorType) - } - } - - return r0 -} - -// PendingRequests_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove' -type PendingRequests_Remove_Call struct { - *mock.Call -} - -// Remove is a helper method to define mock.On call -// - ski string -// - counter model.MsgCounterType -func (_e *PendingRequests_Expecter) Remove(ski interface{}, counter interface{}) *PendingRequests_Remove_Call { - return &PendingRequests_Remove_Call{Call: _e.mock.On("Remove", ski, counter)} -} - -func (_c *PendingRequests_Remove_Call) Run(run func(ski string, counter model.MsgCounterType)) *PendingRequests_Remove_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(model.MsgCounterType)) - }) - return _c -} - -func (_c *PendingRequests_Remove_Call) Return(_a0 *model.ErrorType) *PendingRequests_Remove_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *PendingRequests_Remove_Call) RunAndReturn(run func(string, model.MsgCounterType) *model.ErrorType) *PendingRequests_Remove_Call { - _c.Call.Return(run) - return _c -} - -// SetData provides a mock function with given fields: ski, counter, data -func (_m *PendingRequests) SetData(ski string, counter model.MsgCounterType, data interface{}) *model.ErrorType { - ret := _m.Called(ski, counter, data) - - if len(ret) == 0 { - panic("no return value specified for SetData") - } - - var r0 *model.ErrorType - if rf, ok := ret.Get(0).(func(string, model.MsgCounterType, interface{}) *model.ErrorType); ok { - r0 = rf(ski, counter, data) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.ErrorType) - } - } - - return r0 -} - -// PendingRequests_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData' -type PendingRequests_SetData_Call struct { - *mock.Call -} - -// SetData is a helper method to define mock.On call -// - ski string -// - counter model.MsgCounterType -// - data interface{} -func (_e *PendingRequests_Expecter) SetData(ski interface{}, counter interface{}, data interface{}) *PendingRequests_SetData_Call { - return &PendingRequests_SetData_Call{Call: _e.mock.On("SetData", ski, counter, data)} -} - -func (_c *PendingRequests_SetData_Call) Run(run func(ski string, counter model.MsgCounterType, data interface{})) *PendingRequests_SetData_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(model.MsgCounterType), args[2].(interface{})) - }) - return _c -} - -func (_c *PendingRequests_SetData_Call) Return(_a0 *model.ErrorType) *PendingRequests_SetData_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *PendingRequests_SetData_Call) RunAndReturn(run func(string, model.MsgCounterType, interface{}) *model.ErrorType) *PendingRequests_SetData_Call { - _c.Call.Return(run) - return _c -} - -// SetResult provides a mock function with given fields: ski, counter, errorResult -func (_m *PendingRequests) SetResult(ski string, counter model.MsgCounterType, errorResult *model.ErrorType) *model.ErrorType { - ret := _m.Called(ski, counter, errorResult) - - if len(ret) == 0 { - panic("no return value specified for SetResult") - } - - var r0 *model.ErrorType - if rf, ok := ret.Get(0).(func(string, model.MsgCounterType, *model.ErrorType) *model.ErrorType); ok { - r0 = rf(ski, counter, errorResult) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*model.ErrorType) - } - } - - return r0 -} - -// PendingRequests_SetResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetResult' -type PendingRequests_SetResult_Call struct { - *mock.Call -} - -// SetResult is a helper method to define mock.On call -// - ski string -// - counter model.MsgCounterType -// - errorResult *model.ErrorType -func (_e *PendingRequests_Expecter) SetResult(ski interface{}, counter interface{}, errorResult interface{}) *PendingRequests_SetResult_Call { - return &PendingRequests_SetResult_Call{Call: _e.mock.On("SetResult", ski, counter, errorResult)} -} - -func (_c *PendingRequests_SetResult_Call) Run(run func(ski string, counter model.MsgCounterType, errorResult *model.ErrorType)) *PendingRequests_SetResult_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string), args[1].(model.MsgCounterType), args[2].(*model.ErrorType)) - }) - return _c -} - -func (_c *PendingRequests_SetResult_Call) Return(_a0 *model.ErrorType) *PendingRequests_SetResult_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *PendingRequests_SetResult_Call) RunAndReturn(run func(string, model.MsgCounterType, *model.ErrorType) *model.ErrorType) *PendingRequests_SetResult_Call { - _c.Call.Return(run) - return _c -} - -// NewPendingRequests creates a new instance of PendingRequests. 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 NewPendingRequests(t interface { - mock.TestingT - Cleanup(func()) -}) *PendingRequests { - mock := &PendingRequests{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/PendingRequestsInterface.go b/mocks/PendingRequestsInterface.go new file mode 100644 index 0000000..a5ed56b --- /dev/null +++ b/mocks/PendingRequestsInterface.go @@ -0,0 +1,282 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + model "github.com/enbility/spine-go/model" + mock "github.com/stretchr/testify/mock" + + time "time" +) + +// PendingRequestsInterface is an autogenerated mock type for the PendingRequestsInterface type +type PendingRequestsInterface struct { + mock.Mock +} + +type PendingRequestsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *PendingRequestsInterface) EXPECT() *PendingRequestsInterface_Expecter { + return &PendingRequestsInterface_Expecter{mock: &_m.Mock} +} + +// Add provides a mock function with given fields: ski, counter, maxDelay +func (_m *PendingRequestsInterface) Add(ski string, counter model.MsgCounterType, maxDelay time.Duration) { + _m.Called(ski, counter, maxDelay) +} + +// PendingRequestsInterface_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type PendingRequestsInterface_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ski string +// - counter model.MsgCounterType +// - maxDelay time.Duration +func (_e *PendingRequestsInterface_Expecter) Add(ski interface{}, counter interface{}, maxDelay interface{}) *PendingRequestsInterface_Add_Call { + return &PendingRequestsInterface_Add_Call{Call: _e.mock.On("Add", ski, counter, maxDelay)} +} + +func (_c *PendingRequestsInterface_Add_Call) Run(run func(ski string, counter model.MsgCounterType, maxDelay time.Duration)) *PendingRequestsInterface_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(model.MsgCounterType), args[2].(time.Duration)) + }) + return _c +} + +func (_c *PendingRequestsInterface_Add_Call) Return() *PendingRequestsInterface_Add_Call { + _c.Call.Return() + return _c +} + +func (_c *PendingRequestsInterface_Add_Call) RunAndReturn(run func(string, model.MsgCounterType, time.Duration)) *PendingRequestsInterface_Add_Call { + _c.Call.Return(run) + return _c +} + +// GetData provides a mock function with given fields: ski, counter +func (_m *PendingRequestsInterface) GetData(ski string, counter model.MsgCounterType) (interface{}, *model.ErrorType) { + ret := _m.Called(ski, counter) + + if len(ret) == 0 { + panic("no return value specified for GetData") + } + + var r0 interface{} + var r1 *model.ErrorType + if rf, ok := ret.Get(0).(func(string, model.MsgCounterType) (interface{}, *model.ErrorType)); ok { + return rf(ski, counter) + } + if rf, ok := ret.Get(0).(func(string, model.MsgCounterType) interface{}); ok { + r0 = rf(ski, counter) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(interface{}) + } + } + + if rf, ok := ret.Get(1).(func(string, model.MsgCounterType) *model.ErrorType); ok { + r1 = rf(ski, counter) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*model.ErrorType) + } + } + + return r0, r1 +} + +// PendingRequestsInterface_GetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetData' +type PendingRequestsInterface_GetData_Call struct { + *mock.Call +} + +// GetData is a helper method to define mock.On call +// - ski string +// - counter model.MsgCounterType +func (_e *PendingRequestsInterface_Expecter) GetData(ski interface{}, counter interface{}) *PendingRequestsInterface_GetData_Call { + return &PendingRequestsInterface_GetData_Call{Call: _e.mock.On("GetData", ski, counter)} +} + +func (_c *PendingRequestsInterface_GetData_Call) Run(run func(ski string, counter model.MsgCounterType)) *PendingRequestsInterface_GetData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(model.MsgCounterType)) + }) + return _c +} + +func (_c *PendingRequestsInterface_GetData_Call) Return(_a0 interface{}, _a1 *model.ErrorType) *PendingRequestsInterface_GetData_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PendingRequestsInterface_GetData_Call) RunAndReturn(run func(string, model.MsgCounterType) (interface{}, *model.ErrorType)) *PendingRequestsInterface_GetData_Call { + _c.Call.Return(run) + return _c +} + +// Remove provides a mock function with given fields: ski, counter +func (_m *PendingRequestsInterface) Remove(ski string, counter model.MsgCounterType) *model.ErrorType { + ret := _m.Called(ski, counter) + + if len(ret) == 0 { + panic("no return value specified for Remove") + } + + var r0 *model.ErrorType + if rf, ok := ret.Get(0).(func(string, model.MsgCounterType) *model.ErrorType); ok { + r0 = rf(ski, counter) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.ErrorType) + } + } + + return r0 +} + +// PendingRequestsInterface_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove' +type PendingRequestsInterface_Remove_Call struct { + *mock.Call +} + +// Remove is a helper method to define mock.On call +// - ski string +// - counter model.MsgCounterType +func (_e *PendingRequestsInterface_Expecter) Remove(ski interface{}, counter interface{}) *PendingRequestsInterface_Remove_Call { + return &PendingRequestsInterface_Remove_Call{Call: _e.mock.On("Remove", ski, counter)} +} + +func (_c *PendingRequestsInterface_Remove_Call) Run(run func(ski string, counter model.MsgCounterType)) *PendingRequestsInterface_Remove_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(model.MsgCounterType)) + }) + return _c +} + +func (_c *PendingRequestsInterface_Remove_Call) Return(_a0 *model.ErrorType) *PendingRequestsInterface_Remove_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PendingRequestsInterface_Remove_Call) RunAndReturn(run func(string, model.MsgCounterType) *model.ErrorType) *PendingRequestsInterface_Remove_Call { + _c.Call.Return(run) + return _c +} + +// SetData provides a mock function with given fields: ski, counter, data +func (_m *PendingRequestsInterface) SetData(ski string, counter model.MsgCounterType, data interface{}) *model.ErrorType { + ret := _m.Called(ski, counter, data) + + if len(ret) == 0 { + panic("no return value specified for SetData") + } + + var r0 *model.ErrorType + if rf, ok := ret.Get(0).(func(string, model.MsgCounterType, interface{}) *model.ErrorType); ok { + r0 = rf(ski, counter, data) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.ErrorType) + } + } + + return r0 +} + +// PendingRequestsInterface_SetData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetData' +type PendingRequestsInterface_SetData_Call struct { + *mock.Call +} + +// SetData is a helper method to define mock.On call +// - ski string +// - counter model.MsgCounterType +// - data interface{} +func (_e *PendingRequestsInterface_Expecter) SetData(ski interface{}, counter interface{}, data interface{}) *PendingRequestsInterface_SetData_Call { + return &PendingRequestsInterface_SetData_Call{Call: _e.mock.On("SetData", ski, counter, data)} +} + +func (_c *PendingRequestsInterface_SetData_Call) Run(run func(ski string, counter model.MsgCounterType, data interface{})) *PendingRequestsInterface_SetData_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(model.MsgCounterType), args[2].(interface{})) + }) + return _c +} + +func (_c *PendingRequestsInterface_SetData_Call) Return(_a0 *model.ErrorType) *PendingRequestsInterface_SetData_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PendingRequestsInterface_SetData_Call) RunAndReturn(run func(string, model.MsgCounterType, interface{}) *model.ErrorType) *PendingRequestsInterface_SetData_Call { + _c.Call.Return(run) + return _c +} + +// SetResult provides a mock function with given fields: ski, counter, errorResult +func (_m *PendingRequestsInterface) SetResult(ski string, counter model.MsgCounterType, errorResult *model.ErrorType) *model.ErrorType { + ret := _m.Called(ski, counter, errorResult) + + if len(ret) == 0 { + panic("no return value specified for SetResult") + } + + var r0 *model.ErrorType + if rf, ok := ret.Get(0).(func(string, model.MsgCounterType, *model.ErrorType) *model.ErrorType); ok { + r0 = rf(ski, counter, errorResult) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.ErrorType) + } + } + + return r0 +} + +// PendingRequestsInterface_SetResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetResult' +type PendingRequestsInterface_SetResult_Call struct { + *mock.Call +} + +// SetResult is a helper method to define mock.On call +// - ski string +// - counter model.MsgCounterType +// - errorResult *model.ErrorType +func (_e *PendingRequestsInterface_Expecter) SetResult(ski interface{}, counter interface{}, errorResult interface{}) *PendingRequestsInterface_SetResult_Call { + return &PendingRequestsInterface_SetResult_Call{Call: _e.mock.On("SetResult", ski, counter, errorResult)} +} + +func (_c *PendingRequestsInterface_SetResult_Call) Run(run func(ski string, counter model.MsgCounterType, errorResult *model.ErrorType)) *PendingRequestsInterface_SetResult_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(model.MsgCounterType), args[2].(*model.ErrorType)) + }) + return _c +} + +func (_c *PendingRequestsInterface_SetResult_Call) Return(_a0 *model.ErrorType) *PendingRequestsInterface_SetResult_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PendingRequestsInterface_SetResult_Call) RunAndReturn(run func(string, model.MsgCounterType, *model.ErrorType) *model.ErrorType) *PendingRequestsInterface_SetResult_Call { + _c.Call.Return(run) + return _c +} + +// NewPendingRequestsInterface creates a new instance of PendingRequestsInterface. 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 NewPendingRequestsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *PendingRequestsInterface { + mock := &PendingRequestsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/Sender.go b/mocks/SenderInterface.go similarity index 52% rename from mocks/Sender.go rename to mocks/SenderInterface.go index 50c3345..15043d8 100644 --- a/mocks/Sender.go +++ b/mocks/SenderInterface.go @@ -7,21 +7,21 @@ import ( mock "github.com/stretchr/testify/mock" ) -// Sender is an autogenerated mock type for the Sender type -type Sender struct { +// SenderInterface is an autogenerated mock type for the SenderInterface type +type SenderInterface struct { mock.Mock } -type Sender_Expecter struct { +type SenderInterface_Expecter struct { mock *mock.Mock } -func (_m *Sender) EXPECT() *Sender_Expecter { - return &Sender_Expecter{mock: &_m.Mock} +func (_m *SenderInterface) EXPECT() *SenderInterface_Expecter { + return &SenderInterface_Expecter{mock: &_m.Mock} } // Bind provides a mock function with given fields: senderAddress, destinationAddress, serverFeatureType -func (_m *Sender) Bind(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error) { +func (_m *SenderInterface) Bind(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error) { ret := _m.Called(senderAddress, destinationAddress, serverFeatureType) if len(ret) == 0 { @@ -50,8 +50,8 @@ func (_m *Sender) Bind(senderAddress *model.FeatureAddressType, destinationAddre return r0, r1 } -// Sender_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' -type Sender_Bind_Call struct { +// SenderInterface_Bind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bind' +type SenderInterface_Bind_Call struct { *mock.Call } @@ -59,29 +59,29 @@ type Sender_Bind_Call struct { // - senderAddress *model.FeatureAddressType // - destinationAddress *model.FeatureAddressType // - serverFeatureType model.FeatureTypeType -func (_e *Sender_Expecter) Bind(senderAddress interface{}, destinationAddress interface{}, serverFeatureType interface{}) *Sender_Bind_Call { - return &Sender_Bind_Call{Call: _e.mock.On("Bind", senderAddress, destinationAddress, serverFeatureType)} +func (_e *SenderInterface_Expecter) Bind(senderAddress interface{}, destinationAddress interface{}, serverFeatureType interface{}) *SenderInterface_Bind_Call { + return &SenderInterface_Bind_Call{Call: _e.mock.On("Bind", senderAddress, destinationAddress, serverFeatureType)} } -func (_c *Sender_Bind_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType)) *Sender_Bind_Call { +func (_c *SenderInterface_Bind_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType)) *SenderInterface_Bind_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*model.FeatureAddressType), args[1].(*model.FeatureAddressType), args[2].(model.FeatureTypeType)) }) return _c } -func (_c *Sender_Bind_Call) Return(_a0 *model.MsgCounterType, _a1 error) *Sender_Bind_Call { +func (_c *SenderInterface_Bind_Call) Return(_a0 *model.MsgCounterType, _a1 error) *SenderInterface_Bind_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Sender_Bind_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType, model.FeatureTypeType) (*model.MsgCounterType, error)) *Sender_Bind_Call { +func (_c *SenderInterface_Bind_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType, model.FeatureTypeType) (*model.MsgCounterType, error)) *SenderInterface_Bind_Call { _c.Call.Return(run) return _c } // DatagramForMsgCounter provides a mock function with given fields: msgCounter -func (_m *Sender) DatagramForMsgCounter(msgCounter model.MsgCounterType) (model.DatagramType, error) { +func (_m *SenderInterface) DatagramForMsgCounter(msgCounter model.MsgCounterType) (model.DatagramType, error) { ret := _m.Called(msgCounter) if len(ret) == 0 { @@ -108,36 +108,36 @@ func (_m *Sender) DatagramForMsgCounter(msgCounter model.MsgCounterType) (model. return r0, r1 } -// Sender_DatagramForMsgCounter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DatagramForMsgCounter' -type Sender_DatagramForMsgCounter_Call struct { +// SenderInterface_DatagramForMsgCounter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DatagramForMsgCounter' +type SenderInterface_DatagramForMsgCounter_Call struct { *mock.Call } // DatagramForMsgCounter is a helper method to define mock.On call // - msgCounter model.MsgCounterType -func (_e *Sender_Expecter) DatagramForMsgCounter(msgCounter interface{}) *Sender_DatagramForMsgCounter_Call { - return &Sender_DatagramForMsgCounter_Call{Call: _e.mock.On("DatagramForMsgCounter", msgCounter)} +func (_e *SenderInterface_Expecter) DatagramForMsgCounter(msgCounter interface{}) *SenderInterface_DatagramForMsgCounter_Call { + return &SenderInterface_DatagramForMsgCounter_Call{Call: _e.mock.On("DatagramForMsgCounter", msgCounter)} } -func (_c *Sender_DatagramForMsgCounter_Call) Run(run func(msgCounter model.MsgCounterType)) *Sender_DatagramForMsgCounter_Call { +func (_c *SenderInterface_DatagramForMsgCounter_Call) Run(run func(msgCounter model.MsgCounterType)) *SenderInterface_DatagramForMsgCounter_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(model.MsgCounterType)) }) return _c } -func (_c *Sender_DatagramForMsgCounter_Call) Return(_a0 model.DatagramType, _a1 error) *Sender_DatagramForMsgCounter_Call { +func (_c *SenderInterface_DatagramForMsgCounter_Call) Return(_a0 model.DatagramType, _a1 error) *SenderInterface_DatagramForMsgCounter_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Sender_DatagramForMsgCounter_Call) RunAndReturn(run func(model.MsgCounterType) (model.DatagramType, error)) *Sender_DatagramForMsgCounter_Call { +func (_c *SenderInterface_DatagramForMsgCounter_Call) RunAndReturn(run func(model.MsgCounterType) (model.DatagramType, error)) *SenderInterface_DatagramForMsgCounter_Call { _c.Call.Return(run) return _c } // Notify provides a mock function with given fields: senderAddress, destinationAddress, cmd -func (_m *Sender) Notify(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error) { +func (_m *SenderInterface) Notify(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error) { ret := _m.Called(senderAddress, destinationAddress, cmd) if len(ret) == 0 { @@ -166,8 +166,8 @@ func (_m *Sender) Notify(senderAddress *model.FeatureAddressType, destinationAdd return r0, r1 } -// Sender_Notify_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Notify' -type Sender_Notify_Call struct { +// SenderInterface_Notify_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Notify' +type SenderInterface_Notify_Call struct { *mock.Call } @@ -175,29 +175,29 @@ type Sender_Notify_Call struct { // - senderAddress *model.FeatureAddressType // - destinationAddress *model.FeatureAddressType // - cmd model.CmdType -func (_e *Sender_Expecter) Notify(senderAddress interface{}, destinationAddress interface{}, cmd interface{}) *Sender_Notify_Call { - return &Sender_Notify_Call{Call: _e.mock.On("Notify", senderAddress, destinationAddress, cmd)} +func (_e *SenderInterface_Expecter) Notify(senderAddress interface{}, destinationAddress interface{}, cmd interface{}) *SenderInterface_Notify_Call { + return &SenderInterface_Notify_Call{Call: _e.mock.On("Notify", senderAddress, destinationAddress, cmd)} } -func (_c *Sender_Notify_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, cmd model.CmdType)) *Sender_Notify_Call { +func (_c *SenderInterface_Notify_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, cmd model.CmdType)) *SenderInterface_Notify_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*model.FeatureAddressType), args[1].(*model.FeatureAddressType), args[2].(model.CmdType)) }) return _c } -func (_c *Sender_Notify_Call) Return(_a0 *model.MsgCounterType, _a1 error) *Sender_Notify_Call { +func (_c *SenderInterface_Notify_Call) Return(_a0 *model.MsgCounterType, _a1 error) *SenderInterface_Notify_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Sender_Notify_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType, model.CmdType) (*model.MsgCounterType, error)) *Sender_Notify_Call { +func (_c *SenderInterface_Notify_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType, model.CmdType) (*model.MsgCounterType, error)) *SenderInterface_Notify_Call { _c.Call.Return(run) return _c } // Reply provides a mock function with given fields: requestHeader, senderAddress, cmd -func (_m *Sender) Reply(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, cmd model.CmdType) error { +func (_m *SenderInterface) Reply(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, cmd model.CmdType) error { ret := _m.Called(requestHeader, senderAddress, cmd) if len(ret) == 0 { @@ -214,8 +214,8 @@ func (_m *Sender) Reply(requestHeader *model.HeaderType, senderAddress *model.Fe return r0 } -// Sender_Reply_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reply' -type Sender_Reply_Call struct { +// SenderInterface_Reply_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reply' +type SenderInterface_Reply_Call struct { *mock.Call } @@ -223,29 +223,29 @@ type Sender_Reply_Call struct { // - requestHeader *model.HeaderType // - senderAddress *model.FeatureAddressType // - cmd model.CmdType -func (_e *Sender_Expecter) Reply(requestHeader interface{}, senderAddress interface{}, cmd interface{}) *Sender_Reply_Call { - return &Sender_Reply_Call{Call: _e.mock.On("Reply", requestHeader, senderAddress, cmd)} +func (_e *SenderInterface_Expecter) Reply(requestHeader interface{}, senderAddress interface{}, cmd interface{}) *SenderInterface_Reply_Call { + return &SenderInterface_Reply_Call{Call: _e.mock.On("Reply", requestHeader, senderAddress, cmd)} } -func (_c *Sender_Reply_Call) Run(run func(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, cmd model.CmdType)) *Sender_Reply_Call { +func (_c *SenderInterface_Reply_Call) Run(run func(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, cmd model.CmdType)) *SenderInterface_Reply_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*model.HeaderType), args[1].(*model.FeatureAddressType), args[2].(model.CmdType)) }) return _c } -func (_c *Sender_Reply_Call) Return(_a0 error) *Sender_Reply_Call { +func (_c *SenderInterface_Reply_Call) Return(_a0 error) *SenderInterface_Reply_Call { _c.Call.Return(_a0) return _c } -func (_c *Sender_Reply_Call) RunAndReturn(run func(*model.HeaderType, *model.FeatureAddressType, model.CmdType) error) *Sender_Reply_Call { +func (_c *SenderInterface_Reply_Call) RunAndReturn(run func(*model.HeaderType, *model.FeatureAddressType, model.CmdType) error) *SenderInterface_Reply_Call { _c.Call.Return(run) return _c } // Request provides a mock function with given fields: cmdClassifier, senderAddress, destinationAddress, ackRequest, cmd -func (_m *Sender) Request(cmdClassifier model.CmdClassifierType, senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, ackRequest bool, cmd []model.CmdType) (*model.MsgCounterType, error) { +func (_m *SenderInterface) Request(cmdClassifier model.CmdClassifierType, senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, ackRequest bool, cmd []model.CmdType) (*model.MsgCounterType, error) { ret := _m.Called(cmdClassifier, senderAddress, destinationAddress, ackRequest, cmd) if len(ret) == 0 { @@ -274,8 +274,8 @@ func (_m *Sender) Request(cmdClassifier model.CmdClassifierType, senderAddress * return r0, r1 } -// Sender_Request_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Request' -type Sender_Request_Call struct { +// SenderInterface_Request_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Request' +type SenderInterface_Request_Call struct { *mock.Call } @@ -285,29 +285,29 @@ type Sender_Request_Call struct { // - destinationAddress *model.FeatureAddressType // - ackRequest bool // - cmd []model.CmdType -func (_e *Sender_Expecter) Request(cmdClassifier interface{}, senderAddress interface{}, destinationAddress interface{}, ackRequest interface{}, cmd interface{}) *Sender_Request_Call { - return &Sender_Request_Call{Call: _e.mock.On("Request", cmdClassifier, senderAddress, destinationAddress, ackRequest, cmd)} +func (_e *SenderInterface_Expecter) Request(cmdClassifier interface{}, senderAddress interface{}, destinationAddress interface{}, ackRequest interface{}, cmd interface{}) *SenderInterface_Request_Call { + return &SenderInterface_Request_Call{Call: _e.mock.On("Request", cmdClassifier, senderAddress, destinationAddress, ackRequest, cmd)} } -func (_c *Sender_Request_Call) Run(run func(cmdClassifier model.CmdClassifierType, senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, ackRequest bool, cmd []model.CmdType)) *Sender_Request_Call { +func (_c *SenderInterface_Request_Call) Run(run func(cmdClassifier model.CmdClassifierType, senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, ackRequest bool, cmd []model.CmdType)) *SenderInterface_Request_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(model.CmdClassifierType), args[1].(*model.FeatureAddressType), args[2].(*model.FeatureAddressType), args[3].(bool), args[4].([]model.CmdType)) }) return _c } -func (_c *Sender_Request_Call) Return(_a0 *model.MsgCounterType, _a1 error) *Sender_Request_Call { +func (_c *SenderInterface_Request_Call) Return(_a0 *model.MsgCounterType, _a1 error) *SenderInterface_Request_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Sender_Request_Call) RunAndReturn(run func(model.CmdClassifierType, *model.FeatureAddressType, *model.FeatureAddressType, bool, []model.CmdType) (*model.MsgCounterType, error)) *Sender_Request_Call { +func (_c *SenderInterface_Request_Call) RunAndReturn(run func(model.CmdClassifierType, *model.FeatureAddressType, *model.FeatureAddressType, bool, []model.CmdType) (*model.MsgCounterType, error)) *SenderInterface_Request_Call { _c.Call.Return(run) return _c } // ResultError provides a mock function with given fields: requestHeader, senderAddress, err -func (_m *Sender) ResultError(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, err *model.ErrorType) error { +func (_m *SenderInterface) ResultError(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, err *model.ErrorType) error { ret := _m.Called(requestHeader, senderAddress, err) if len(ret) == 0 { @@ -324,8 +324,8 @@ func (_m *Sender) ResultError(requestHeader *model.HeaderType, senderAddress *mo return r0 } -// Sender_ResultError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResultError' -type Sender_ResultError_Call struct { +// SenderInterface_ResultError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResultError' +type SenderInterface_ResultError_Call struct { *mock.Call } @@ -333,29 +333,29 @@ type Sender_ResultError_Call struct { // - requestHeader *model.HeaderType // - senderAddress *model.FeatureAddressType // - err *model.ErrorType -func (_e *Sender_Expecter) ResultError(requestHeader interface{}, senderAddress interface{}, err interface{}) *Sender_ResultError_Call { - return &Sender_ResultError_Call{Call: _e.mock.On("ResultError", requestHeader, senderAddress, err)} +func (_e *SenderInterface_Expecter) ResultError(requestHeader interface{}, senderAddress interface{}, err interface{}) *SenderInterface_ResultError_Call { + return &SenderInterface_ResultError_Call{Call: _e.mock.On("ResultError", requestHeader, senderAddress, err)} } -func (_c *Sender_ResultError_Call) Run(run func(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, err *model.ErrorType)) *Sender_ResultError_Call { +func (_c *SenderInterface_ResultError_Call) Run(run func(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, err *model.ErrorType)) *SenderInterface_ResultError_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*model.HeaderType), args[1].(*model.FeatureAddressType), args[2].(*model.ErrorType)) }) return _c } -func (_c *Sender_ResultError_Call) Return(_a0 error) *Sender_ResultError_Call { +func (_c *SenderInterface_ResultError_Call) Return(_a0 error) *SenderInterface_ResultError_Call { _c.Call.Return(_a0) return _c } -func (_c *Sender_ResultError_Call) RunAndReturn(run func(*model.HeaderType, *model.FeatureAddressType, *model.ErrorType) error) *Sender_ResultError_Call { +func (_c *SenderInterface_ResultError_Call) RunAndReturn(run func(*model.HeaderType, *model.FeatureAddressType, *model.ErrorType) error) *SenderInterface_ResultError_Call { _c.Call.Return(run) return _c } // ResultSuccess provides a mock function with given fields: requestHeader, senderAddress -func (_m *Sender) ResultSuccess(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType) error { +func (_m *SenderInterface) ResultSuccess(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType) error { ret := _m.Called(requestHeader, senderAddress) if len(ret) == 0 { @@ -372,37 +372,37 @@ func (_m *Sender) ResultSuccess(requestHeader *model.HeaderType, senderAddress * return r0 } -// Sender_ResultSuccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResultSuccess' -type Sender_ResultSuccess_Call struct { +// SenderInterface_ResultSuccess_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResultSuccess' +type SenderInterface_ResultSuccess_Call struct { *mock.Call } // ResultSuccess is a helper method to define mock.On call // - requestHeader *model.HeaderType // - senderAddress *model.FeatureAddressType -func (_e *Sender_Expecter) ResultSuccess(requestHeader interface{}, senderAddress interface{}) *Sender_ResultSuccess_Call { - return &Sender_ResultSuccess_Call{Call: _e.mock.On("ResultSuccess", requestHeader, senderAddress)} +func (_e *SenderInterface_Expecter) ResultSuccess(requestHeader interface{}, senderAddress interface{}) *SenderInterface_ResultSuccess_Call { + return &SenderInterface_ResultSuccess_Call{Call: _e.mock.On("ResultSuccess", requestHeader, senderAddress)} } -func (_c *Sender_ResultSuccess_Call) Run(run func(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType)) *Sender_ResultSuccess_Call { +func (_c *SenderInterface_ResultSuccess_Call) Run(run func(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType)) *SenderInterface_ResultSuccess_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*model.HeaderType), args[1].(*model.FeatureAddressType)) }) return _c } -func (_c *Sender_ResultSuccess_Call) Return(_a0 error) *Sender_ResultSuccess_Call { +func (_c *SenderInterface_ResultSuccess_Call) Return(_a0 error) *SenderInterface_ResultSuccess_Call { _c.Call.Return(_a0) return _c } -func (_c *Sender_ResultSuccess_Call) RunAndReturn(run func(*model.HeaderType, *model.FeatureAddressType) error) *Sender_ResultSuccess_Call { +func (_c *SenderInterface_ResultSuccess_Call) RunAndReturn(run func(*model.HeaderType, *model.FeatureAddressType) error) *SenderInterface_ResultSuccess_Call { _c.Call.Return(run) return _c } // Subscribe provides a mock function with given fields: senderAddress, destinationAddress, serverFeatureType -func (_m *Sender) Subscribe(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error) { +func (_m *SenderInterface) Subscribe(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error) { ret := _m.Called(senderAddress, destinationAddress, serverFeatureType) if len(ret) == 0 { @@ -431,8 +431,8 @@ func (_m *Sender) Subscribe(senderAddress *model.FeatureAddressType, destination return r0, r1 } -// Sender_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe' -type Sender_Subscribe_Call struct { +// SenderInterface_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe' +type SenderInterface_Subscribe_Call struct { *mock.Call } @@ -440,29 +440,29 @@ type Sender_Subscribe_Call struct { // - senderAddress *model.FeatureAddressType // - destinationAddress *model.FeatureAddressType // - serverFeatureType model.FeatureTypeType -func (_e *Sender_Expecter) Subscribe(senderAddress interface{}, destinationAddress interface{}, serverFeatureType interface{}) *Sender_Subscribe_Call { - return &Sender_Subscribe_Call{Call: _e.mock.On("Subscribe", senderAddress, destinationAddress, serverFeatureType)} +func (_e *SenderInterface_Expecter) Subscribe(senderAddress interface{}, destinationAddress interface{}, serverFeatureType interface{}) *SenderInterface_Subscribe_Call { + return &SenderInterface_Subscribe_Call{Call: _e.mock.On("Subscribe", senderAddress, destinationAddress, serverFeatureType)} } -func (_c *Sender_Subscribe_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType)) *Sender_Subscribe_Call { +func (_c *SenderInterface_Subscribe_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType)) *SenderInterface_Subscribe_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*model.FeatureAddressType), args[1].(*model.FeatureAddressType), args[2].(model.FeatureTypeType)) }) return _c } -func (_c *Sender_Subscribe_Call) Return(_a0 *model.MsgCounterType, _a1 error) *Sender_Subscribe_Call { +func (_c *SenderInterface_Subscribe_Call) Return(_a0 *model.MsgCounterType, _a1 error) *SenderInterface_Subscribe_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Sender_Subscribe_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType, model.FeatureTypeType) (*model.MsgCounterType, error)) *Sender_Subscribe_Call { +func (_c *SenderInterface_Subscribe_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType, model.FeatureTypeType) (*model.MsgCounterType, error)) *SenderInterface_Subscribe_Call { _c.Call.Return(run) return _c } // Unbind provides a mock function with given fields: senderAddress, destinationAddress -func (_m *Sender) Unbind(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error) { +func (_m *SenderInterface) Unbind(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error) { ret := _m.Called(senderAddress, destinationAddress) if len(ret) == 0 { @@ -491,37 +491,37 @@ func (_m *Sender) Unbind(senderAddress *model.FeatureAddressType, destinationAdd return r0, r1 } -// Sender_Unbind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unbind' -type Sender_Unbind_Call struct { +// SenderInterface_Unbind_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unbind' +type SenderInterface_Unbind_Call struct { *mock.Call } // Unbind is a helper method to define mock.On call // - senderAddress *model.FeatureAddressType // - destinationAddress *model.FeatureAddressType -func (_e *Sender_Expecter) Unbind(senderAddress interface{}, destinationAddress interface{}) *Sender_Unbind_Call { - return &Sender_Unbind_Call{Call: _e.mock.On("Unbind", senderAddress, destinationAddress)} +func (_e *SenderInterface_Expecter) Unbind(senderAddress interface{}, destinationAddress interface{}) *SenderInterface_Unbind_Call { + return &SenderInterface_Unbind_Call{Call: _e.mock.On("Unbind", senderAddress, destinationAddress)} } -func (_c *Sender_Unbind_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType)) *Sender_Unbind_Call { +func (_c *SenderInterface_Unbind_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType)) *SenderInterface_Unbind_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*model.FeatureAddressType), args[1].(*model.FeatureAddressType)) }) return _c } -func (_c *Sender_Unbind_Call) Return(_a0 *model.MsgCounterType, _a1 error) *Sender_Unbind_Call { +func (_c *SenderInterface_Unbind_Call) Return(_a0 *model.MsgCounterType, _a1 error) *SenderInterface_Unbind_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Sender_Unbind_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType) (*model.MsgCounterType, error)) *Sender_Unbind_Call { +func (_c *SenderInterface_Unbind_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType) (*model.MsgCounterType, error)) *SenderInterface_Unbind_Call { _c.Call.Return(run) return _c } // Unsubscribe provides a mock function with given fields: senderAddress, destinationAddress -func (_m *Sender) Unsubscribe(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error) { +func (_m *SenderInterface) Unsubscribe(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error) { ret := _m.Called(senderAddress, destinationAddress) if len(ret) == 0 { @@ -550,37 +550,37 @@ func (_m *Sender) Unsubscribe(senderAddress *model.FeatureAddressType, destinati return r0, r1 } -// Sender_Unsubscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unsubscribe' -type Sender_Unsubscribe_Call struct { +// SenderInterface_Unsubscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unsubscribe' +type SenderInterface_Unsubscribe_Call struct { *mock.Call } // Unsubscribe is a helper method to define mock.On call // - senderAddress *model.FeatureAddressType // - destinationAddress *model.FeatureAddressType -func (_e *Sender_Expecter) Unsubscribe(senderAddress interface{}, destinationAddress interface{}) *Sender_Unsubscribe_Call { - return &Sender_Unsubscribe_Call{Call: _e.mock.On("Unsubscribe", senderAddress, destinationAddress)} +func (_e *SenderInterface_Expecter) Unsubscribe(senderAddress interface{}, destinationAddress interface{}) *SenderInterface_Unsubscribe_Call { + return &SenderInterface_Unsubscribe_Call{Call: _e.mock.On("Unsubscribe", senderAddress, destinationAddress)} } -func (_c *Sender_Unsubscribe_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType)) *Sender_Unsubscribe_Call { +func (_c *SenderInterface_Unsubscribe_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType)) *SenderInterface_Unsubscribe_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*model.FeatureAddressType), args[1].(*model.FeatureAddressType)) }) return _c } -func (_c *Sender_Unsubscribe_Call) Return(_a0 *model.MsgCounterType, _a1 error) *Sender_Unsubscribe_Call { +func (_c *SenderInterface_Unsubscribe_Call) Return(_a0 *model.MsgCounterType, _a1 error) *SenderInterface_Unsubscribe_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Sender_Unsubscribe_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType) (*model.MsgCounterType, error)) *Sender_Unsubscribe_Call { +func (_c *SenderInterface_Unsubscribe_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType) (*model.MsgCounterType, error)) *SenderInterface_Unsubscribe_Call { _c.Call.Return(run) return _c } // Write provides a mock function with given fields: senderAddress, destinationAddress, cmd -func (_m *Sender) Write(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error) { +func (_m *SenderInterface) Write(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error) { ret := _m.Called(senderAddress, destinationAddress, cmd) if len(ret) == 0 { @@ -609,8 +609,8 @@ func (_m *Sender) Write(senderAddress *model.FeatureAddressType, destinationAddr return r0, r1 } -// Sender_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' -type Sender_Write_Call struct { +// SenderInterface_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' +type SenderInterface_Write_Call struct { *mock.Call } @@ -618,34 +618,34 @@ type Sender_Write_Call struct { // - senderAddress *model.FeatureAddressType // - destinationAddress *model.FeatureAddressType // - cmd model.CmdType -func (_e *Sender_Expecter) Write(senderAddress interface{}, destinationAddress interface{}, cmd interface{}) *Sender_Write_Call { - return &Sender_Write_Call{Call: _e.mock.On("Write", senderAddress, destinationAddress, cmd)} +func (_e *SenderInterface_Expecter) Write(senderAddress interface{}, destinationAddress interface{}, cmd interface{}) *SenderInterface_Write_Call { + return &SenderInterface_Write_Call{Call: _e.mock.On("Write", senderAddress, destinationAddress, cmd)} } -func (_c *Sender_Write_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, cmd model.CmdType)) *Sender_Write_Call { +func (_c *SenderInterface_Write_Call) Run(run func(senderAddress *model.FeatureAddressType, destinationAddress *model.FeatureAddressType, cmd model.CmdType)) *SenderInterface_Write_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*model.FeatureAddressType), args[1].(*model.FeatureAddressType), args[2].(model.CmdType)) }) return _c } -func (_c *Sender_Write_Call) Return(_a0 *model.MsgCounterType, _a1 error) *Sender_Write_Call { +func (_c *SenderInterface_Write_Call) Return(_a0 *model.MsgCounterType, _a1 error) *SenderInterface_Write_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Sender_Write_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType, model.CmdType) (*model.MsgCounterType, error)) *Sender_Write_Call { +func (_c *SenderInterface_Write_Call) RunAndReturn(run func(*model.FeatureAddressType, *model.FeatureAddressType, model.CmdType) (*model.MsgCounterType, error)) *SenderInterface_Write_Call { _c.Call.Return(run) return _c } -// NewSender creates a new instance of Sender. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// NewSenderInterface creates a new instance of SenderInterface. 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 NewSender(t interface { +func NewSenderInterface(t interface { mock.TestingT Cleanup(func()) -}) *Sender { - mock := &Sender{} +}) *SenderInterface { + mock := &SenderInterface{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) diff --git a/mocks/SpineDataConnection.go b/mocks/SpineDataConnection.go deleted file mode 100644 index 5be34a6..0000000 --- a/mocks/SpineDataConnection.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by mockery v2.39.1. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// SpineDataConnection is an autogenerated mock type for the SpineDataConnection type -type SpineDataConnection struct { - mock.Mock -} - -// WriteSpineMessage provides a mock function with given fields: message -func (_m *SpineDataConnection) WriteSpineMessage(message []byte) { - _m.Called(message) -} - -// NewSpineDataConnection creates a new instance of SpineDataConnection. 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 NewSpineDataConnection(t interface { - mock.TestingT - Cleanup(func()) -}) *SpineDataConnection { - mock := &SpineDataConnection{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/SubscriptionManager.go b/mocks/SubscriptionManager.go deleted file mode 100644 index b4accd4..0000000 --- a/mocks/SubscriptionManager.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. - -package mocks - -import ( - api "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" - - model "github.com/enbility/spine-go/model" -) - -// SubscriptionManager is an autogenerated mock type for the SubscriptionManager type -type SubscriptionManager struct { - mock.Mock -} - -type SubscriptionManager_Expecter struct { - mock *mock.Mock -} - -func (_m *SubscriptionManager) EXPECT() *SubscriptionManager_Expecter { - return &SubscriptionManager_Expecter{mock: &_m.Mock} -} - -// AddSubscription provides a mock function with given fields: remoteDevice, data -func (_m *SubscriptionManager) AddSubscription(remoteDevice api.DeviceRemote, data model.SubscriptionManagementRequestCallType) error { - ret := _m.Called(remoteDevice, data) - - if len(ret) == 0 { - panic("no return value specified for AddSubscription") - } - - var r0 error - if rf, ok := ret.Get(0).(func(api.DeviceRemote, model.SubscriptionManagementRequestCallType) error); ok { - r0 = rf(remoteDevice, data) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SubscriptionManager_AddSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddSubscription' -type SubscriptionManager_AddSubscription_Call struct { - *mock.Call -} - -// AddSubscription is a helper method to define mock.On call -// - remoteDevice api.DeviceRemote -// - data model.SubscriptionManagementRequestCallType -func (_e *SubscriptionManager_Expecter) AddSubscription(remoteDevice interface{}, data interface{}) *SubscriptionManager_AddSubscription_Call { - return &SubscriptionManager_AddSubscription_Call{Call: _e.mock.On("AddSubscription", remoteDevice, data)} -} - -func (_c *SubscriptionManager_AddSubscription_Call) Run(run func(remoteDevice api.DeviceRemote, data model.SubscriptionManagementRequestCallType)) *SubscriptionManager_AddSubscription_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.DeviceRemote), args[1].(model.SubscriptionManagementRequestCallType)) - }) - return _c -} - -func (_c *SubscriptionManager_AddSubscription_Call) Return(_a0 error) *SubscriptionManager_AddSubscription_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *SubscriptionManager_AddSubscription_Call) RunAndReturn(run func(api.DeviceRemote, model.SubscriptionManagementRequestCallType) error) *SubscriptionManager_AddSubscription_Call { - _c.Call.Return(run) - return _c -} - -// RemoveSubscription provides a mock function with given fields: data, remoteDevice -func (_m *SubscriptionManager) RemoveSubscription(data model.SubscriptionManagementDeleteCallType, remoteDevice api.DeviceRemote) error { - ret := _m.Called(data, remoteDevice) - - if len(ret) == 0 { - panic("no return value specified for RemoveSubscription") - } - - var r0 error - if rf, ok := ret.Get(0).(func(model.SubscriptionManagementDeleteCallType, api.DeviceRemote) error); ok { - r0 = rf(data, remoteDevice) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// SubscriptionManager_RemoveSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSubscription' -type SubscriptionManager_RemoveSubscription_Call struct { - *mock.Call -} - -// RemoveSubscription is a helper method to define mock.On call -// - data model.SubscriptionManagementDeleteCallType -// - remoteDevice api.DeviceRemote -func (_e *SubscriptionManager_Expecter) RemoveSubscription(data interface{}, remoteDevice interface{}) *SubscriptionManager_RemoveSubscription_Call { - return &SubscriptionManager_RemoveSubscription_Call{Call: _e.mock.On("RemoveSubscription", data, remoteDevice)} -} - -func (_c *SubscriptionManager_RemoveSubscription_Call) Run(run func(data model.SubscriptionManagementDeleteCallType, remoteDevice api.DeviceRemote)) *SubscriptionManager_RemoveSubscription_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.SubscriptionManagementDeleteCallType), args[1].(api.DeviceRemote)) - }) - return _c -} - -func (_c *SubscriptionManager_RemoveSubscription_Call) Return(_a0 error) *SubscriptionManager_RemoveSubscription_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *SubscriptionManager_RemoveSubscription_Call) RunAndReturn(run func(model.SubscriptionManagementDeleteCallType, api.DeviceRemote) error) *SubscriptionManager_RemoveSubscription_Call { - _c.Call.Return(run) - return _c -} - -// RemoveSubscriptionsForDevice provides a mock function with given fields: remoteDevice -func (_m *SubscriptionManager) RemoveSubscriptionsForDevice(remoteDevice api.DeviceRemote) { - _m.Called(remoteDevice) -} - -// SubscriptionManager_RemoveSubscriptionsForDevice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSubscriptionsForDevice' -type SubscriptionManager_RemoveSubscriptionsForDevice_Call struct { - *mock.Call -} - -// RemoveSubscriptionsForDevice is a helper method to define mock.On call -// - remoteDevice api.DeviceRemote -func (_e *SubscriptionManager_Expecter) RemoveSubscriptionsForDevice(remoteDevice interface{}) *SubscriptionManager_RemoveSubscriptionsForDevice_Call { - return &SubscriptionManager_RemoveSubscriptionsForDevice_Call{Call: _e.mock.On("RemoveSubscriptionsForDevice", remoteDevice)} -} - -func (_c *SubscriptionManager_RemoveSubscriptionsForDevice_Call) Run(run func(remoteDevice api.DeviceRemote)) *SubscriptionManager_RemoveSubscriptionsForDevice_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.DeviceRemote)) - }) - return _c -} - -func (_c *SubscriptionManager_RemoveSubscriptionsForDevice_Call) Return() *SubscriptionManager_RemoveSubscriptionsForDevice_Call { - _c.Call.Return() - return _c -} - -func (_c *SubscriptionManager_RemoveSubscriptionsForDevice_Call) RunAndReturn(run func(api.DeviceRemote)) *SubscriptionManager_RemoveSubscriptionsForDevice_Call { - _c.Call.Return(run) - return _c -} - -// RemoveSubscriptionsForEntity provides a mock function with given fields: remoteEntity -func (_m *SubscriptionManager) RemoveSubscriptionsForEntity(remoteEntity api.EntityRemote) { - _m.Called(remoteEntity) -} - -// SubscriptionManager_RemoveSubscriptionsForEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSubscriptionsForEntity' -type SubscriptionManager_RemoveSubscriptionsForEntity_Call struct { - *mock.Call -} - -// RemoveSubscriptionsForEntity is a helper method to define mock.On call -// - remoteEntity api.EntityRemote -func (_e *SubscriptionManager_Expecter) RemoveSubscriptionsForEntity(remoteEntity interface{}) *SubscriptionManager_RemoveSubscriptionsForEntity_Call { - return &SubscriptionManager_RemoveSubscriptionsForEntity_Call{Call: _e.mock.On("RemoveSubscriptionsForEntity", remoteEntity)} -} - -func (_c *SubscriptionManager_RemoveSubscriptionsForEntity_Call) Run(run func(remoteEntity api.EntityRemote)) *SubscriptionManager_RemoveSubscriptionsForEntity_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.EntityRemote)) - }) - return _c -} - -func (_c *SubscriptionManager_RemoveSubscriptionsForEntity_Call) Return() *SubscriptionManager_RemoveSubscriptionsForEntity_Call { - _c.Call.Return() - return _c -} - -func (_c *SubscriptionManager_RemoveSubscriptionsForEntity_Call) RunAndReturn(run func(api.EntityRemote)) *SubscriptionManager_RemoveSubscriptionsForEntity_Call { - _c.Call.Return(run) - return _c -} - -// Subscriptions provides a mock function with given fields: remoteDevice -func (_m *SubscriptionManager) Subscriptions(remoteDevice api.DeviceRemote) []*api.SubscriptionEntry { - ret := _m.Called(remoteDevice) - - if len(ret) == 0 { - panic("no return value specified for Subscriptions") - } - - var r0 []*api.SubscriptionEntry - if rf, ok := ret.Get(0).(func(api.DeviceRemote) []*api.SubscriptionEntry); ok { - r0 = rf(remoteDevice) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*api.SubscriptionEntry) - } - } - - return r0 -} - -// SubscriptionManager_Subscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscriptions' -type SubscriptionManager_Subscriptions_Call struct { - *mock.Call -} - -// Subscriptions is a helper method to define mock.On call -// - remoteDevice api.DeviceRemote -func (_e *SubscriptionManager_Expecter) Subscriptions(remoteDevice interface{}) *SubscriptionManager_Subscriptions_Call { - return &SubscriptionManager_Subscriptions_Call{Call: _e.mock.On("Subscriptions", remoteDevice)} -} - -func (_c *SubscriptionManager_Subscriptions_Call) Run(run func(remoteDevice api.DeviceRemote)) *SubscriptionManager_Subscriptions_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(api.DeviceRemote)) - }) - return _c -} - -func (_c *SubscriptionManager_Subscriptions_Call) Return(_a0 []*api.SubscriptionEntry) *SubscriptionManager_Subscriptions_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *SubscriptionManager_Subscriptions_Call) RunAndReturn(run func(api.DeviceRemote) []*api.SubscriptionEntry) *SubscriptionManager_Subscriptions_Call { - _c.Call.Return(run) - return _c -} - -// SubscriptionsOnFeature provides a mock function with given fields: featureAddress -func (_m *SubscriptionManager) SubscriptionsOnFeature(featureAddress model.FeatureAddressType) []*api.SubscriptionEntry { - ret := _m.Called(featureAddress) - - if len(ret) == 0 { - panic("no return value specified for SubscriptionsOnFeature") - } - - var r0 []*api.SubscriptionEntry - if rf, ok := ret.Get(0).(func(model.FeatureAddressType) []*api.SubscriptionEntry); ok { - r0 = rf(featureAddress) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*api.SubscriptionEntry) - } - } - - return r0 -} - -// SubscriptionManager_SubscriptionsOnFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscriptionsOnFeature' -type SubscriptionManager_SubscriptionsOnFeature_Call struct { - *mock.Call -} - -// SubscriptionsOnFeature is a helper method to define mock.On call -// - featureAddress model.FeatureAddressType -func (_e *SubscriptionManager_Expecter) SubscriptionsOnFeature(featureAddress interface{}) *SubscriptionManager_SubscriptionsOnFeature_Call { - return &SubscriptionManager_SubscriptionsOnFeature_Call{Call: _e.mock.On("SubscriptionsOnFeature", featureAddress)} -} - -func (_c *SubscriptionManager_SubscriptionsOnFeature_Call) Run(run func(featureAddress model.FeatureAddressType)) *SubscriptionManager_SubscriptionsOnFeature_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(model.FeatureAddressType)) - }) - return _c -} - -func (_c *SubscriptionManager_SubscriptionsOnFeature_Call) Return(_a0 []*api.SubscriptionEntry) *SubscriptionManager_SubscriptionsOnFeature_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *SubscriptionManager_SubscriptionsOnFeature_Call) RunAndReturn(run func(model.FeatureAddressType) []*api.SubscriptionEntry) *SubscriptionManager_SubscriptionsOnFeature_Call { - _c.Call.Return(run) - return _c -} - -// NewSubscriptionManager creates a new instance of SubscriptionManager. 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 NewSubscriptionManager(t interface { - mock.TestingT - Cleanup(func()) -}) *SubscriptionManager { - mock := &SubscriptionManager{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/SubscriptionManagerInterface.go b/mocks/SubscriptionManagerInterface.go new file mode 100644 index 0000000..63bc18d --- /dev/null +++ b/mocks/SubscriptionManagerInterface.go @@ -0,0 +1,293 @@ +// Code generated by mockery v2.40.1. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/spine-go/api" + mock "github.com/stretchr/testify/mock" + + model "github.com/enbility/spine-go/model" +) + +// SubscriptionManagerInterface is an autogenerated mock type for the SubscriptionManagerInterface type +type SubscriptionManagerInterface struct { + mock.Mock +} + +type SubscriptionManagerInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *SubscriptionManagerInterface) EXPECT() *SubscriptionManagerInterface_Expecter { + return &SubscriptionManagerInterface_Expecter{mock: &_m.Mock} +} + +// AddSubscription provides a mock function with given fields: remoteDevice, data +func (_m *SubscriptionManagerInterface) AddSubscription(remoteDevice api.DeviceRemoteInterface, data model.SubscriptionManagementRequestCallType) error { + ret := _m.Called(remoteDevice, data) + + if len(ret) == 0 { + panic("no return value specified for AddSubscription") + } + + var r0 error + if rf, ok := ret.Get(0).(func(api.DeviceRemoteInterface, model.SubscriptionManagementRequestCallType) error); ok { + r0 = rf(remoteDevice, data) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SubscriptionManagerInterface_AddSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddSubscription' +type SubscriptionManagerInterface_AddSubscription_Call struct { + *mock.Call +} + +// AddSubscription is a helper method to define mock.On call +// - remoteDevice api.DeviceRemoteInterface +// - data model.SubscriptionManagementRequestCallType +func (_e *SubscriptionManagerInterface_Expecter) AddSubscription(remoteDevice interface{}, data interface{}) *SubscriptionManagerInterface_AddSubscription_Call { + return &SubscriptionManagerInterface_AddSubscription_Call{Call: _e.mock.On("AddSubscription", remoteDevice, data)} +} + +func (_c *SubscriptionManagerInterface_AddSubscription_Call) Run(run func(remoteDevice api.DeviceRemoteInterface, data model.SubscriptionManagementRequestCallType)) *SubscriptionManagerInterface_AddSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.DeviceRemoteInterface), args[1].(model.SubscriptionManagementRequestCallType)) + }) + return _c +} + +func (_c *SubscriptionManagerInterface_AddSubscription_Call) Return(_a0 error) *SubscriptionManagerInterface_AddSubscription_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SubscriptionManagerInterface_AddSubscription_Call) RunAndReturn(run func(api.DeviceRemoteInterface, model.SubscriptionManagementRequestCallType) error) *SubscriptionManagerInterface_AddSubscription_Call { + _c.Call.Return(run) + return _c +} + +// RemoveSubscription provides a mock function with given fields: data, remoteDevice +func (_m *SubscriptionManagerInterface) RemoveSubscription(data model.SubscriptionManagementDeleteCallType, remoteDevice api.DeviceRemoteInterface) error { + ret := _m.Called(data, remoteDevice) + + if len(ret) == 0 { + panic("no return value specified for RemoveSubscription") + } + + var r0 error + if rf, ok := ret.Get(0).(func(model.SubscriptionManagementDeleteCallType, api.DeviceRemoteInterface) error); ok { + r0 = rf(data, remoteDevice) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SubscriptionManagerInterface_RemoveSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSubscription' +type SubscriptionManagerInterface_RemoveSubscription_Call struct { + *mock.Call +} + +// RemoveSubscription is a helper method to define mock.On call +// - data model.SubscriptionManagementDeleteCallType +// - remoteDevice api.DeviceRemoteInterface +func (_e *SubscriptionManagerInterface_Expecter) RemoveSubscription(data interface{}, remoteDevice interface{}) *SubscriptionManagerInterface_RemoveSubscription_Call { + return &SubscriptionManagerInterface_RemoveSubscription_Call{Call: _e.mock.On("RemoveSubscription", data, remoteDevice)} +} + +func (_c *SubscriptionManagerInterface_RemoveSubscription_Call) Run(run func(data model.SubscriptionManagementDeleteCallType, remoteDevice api.DeviceRemoteInterface)) *SubscriptionManagerInterface_RemoveSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.SubscriptionManagementDeleteCallType), args[1].(api.DeviceRemoteInterface)) + }) + return _c +} + +func (_c *SubscriptionManagerInterface_RemoveSubscription_Call) Return(_a0 error) *SubscriptionManagerInterface_RemoveSubscription_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SubscriptionManagerInterface_RemoveSubscription_Call) RunAndReturn(run func(model.SubscriptionManagementDeleteCallType, api.DeviceRemoteInterface) error) *SubscriptionManagerInterface_RemoveSubscription_Call { + _c.Call.Return(run) + return _c +} + +// RemoveSubscriptionsForDevice provides a mock function with given fields: remoteDevice +func (_m *SubscriptionManagerInterface) RemoveSubscriptionsForDevice(remoteDevice api.DeviceRemoteInterface) { + _m.Called(remoteDevice) +} + +// SubscriptionManagerInterface_RemoveSubscriptionsForDevice_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSubscriptionsForDevice' +type SubscriptionManagerInterface_RemoveSubscriptionsForDevice_Call struct { + *mock.Call +} + +// RemoveSubscriptionsForDevice is a helper method to define mock.On call +// - remoteDevice api.DeviceRemoteInterface +func (_e *SubscriptionManagerInterface_Expecter) RemoveSubscriptionsForDevice(remoteDevice interface{}) *SubscriptionManagerInterface_RemoveSubscriptionsForDevice_Call { + return &SubscriptionManagerInterface_RemoveSubscriptionsForDevice_Call{Call: _e.mock.On("RemoveSubscriptionsForDevice", remoteDevice)} +} + +func (_c *SubscriptionManagerInterface_RemoveSubscriptionsForDevice_Call) Run(run func(remoteDevice api.DeviceRemoteInterface)) *SubscriptionManagerInterface_RemoveSubscriptionsForDevice_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.DeviceRemoteInterface)) + }) + return _c +} + +func (_c *SubscriptionManagerInterface_RemoveSubscriptionsForDevice_Call) Return() *SubscriptionManagerInterface_RemoveSubscriptionsForDevice_Call { + _c.Call.Return() + return _c +} + +func (_c *SubscriptionManagerInterface_RemoveSubscriptionsForDevice_Call) RunAndReturn(run func(api.DeviceRemoteInterface)) *SubscriptionManagerInterface_RemoveSubscriptionsForDevice_Call { + _c.Call.Return(run) + return _c +} + +// RemoveSubscriptionsForEntity provides a mock function with given fields: remoteEntity +func (_m *SubscriptionManagerInterface) RemoveSubscriptionsForEntity(remoteEntity api.EntityRemoteInterface) { + _m.Called(remoteEntity) +} + +// SubscriptionManagerInterface_RemoveSubscriptionsForEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSubscriptionsForEntity' +type SubscriptionManagerInterface_RemoveSubscriptionsForEntity_Call struct { + *mock.Call +} + +// RemoveSubscriptionsForEntity is a helper method to define mock.On call +// - remoteEntity api.EntityRemoteInterface +func (_e *SubscriptionManagerInterface_Expecter) RemoveSubscriptionsForEntity(remoteEntity interface{}) *SubscriptionManagerInterface_RemoveSubscriptionsForEntity_Call { + return &SubscriptionManagerInterface_RemoveSubscriptionsForEntity_Call{Call: _e.mock.On("RemoveSubscriptionsForEntity", remoteEntity)} +} + +func (_c *SubscriptionManagerInterface_RemoveSubscriptionsForEntity_Call) Run(run func(remoteEntity api.EntityRemoteInterface)) *SubscriptionManagerInterface_RemoveSubscriptionsForEntity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.EntityRemoteInterface)) + }) + return _c +} + +func (_c *SubscriptionManagerInterface_RemoveSubscriptionsForEntity_Call) Return() *SubscriptionManagerInterface_RemoveSubscriptionsForEntity_Call { + _c.Call.Return() + return _c +} + +func (_c *SubscriptionManagerInterface_RemoveSubscriptionsForEntity_Call) RunAndReturn(run func(api.EntityRemoteInterface)) *SubscriptionManagerInterface_RemoveSubscriptionsForEntity_Call { + _c.Call.Return(run) + return _c +} + +// Subscriptions provides a mock function with given fields: remoteDevice +func (_m *SubscriptionManagerInterface) Subscriptions(remoteDevice api.DeviceRemoteInterface) []*api.SubscriptionEntry { + ret := _m.Called(remoteDevice) + + if len(ret) == 0 { + panic("no return value specified for Subscriptions") + } + + var r0 []*api.SubscriptionEntry + if rf, ok := ret.Get(0).(func(api.DeviceRemoteInterface) []*api.SubscriptionEntry); ok { + r0 = rf(remoteDevice) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*api.SubscriptionEntry) + } + } + + return r0 +} + +// SubscriptionManagerInterface_Subscriptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscriptions' +type SubscriptionManagerInterface_Subscriptions_Call struct { + *mock.Call +} + +// Subscriptions is a helper method to define mock.On call +// - remoteDevice api.DeviceRemoteInterface +func (_e *SubscriptionManagerInterface_Expecter) Subscriptions(remoteDevice interface{}) *SubscriptionManagerInterface_Subscriptions_Call { + return &SubscriptionManagerInterface_Subscriptions_Call{Call: _e.mock.On("Subscriptions", remoteDevice)} +} + +func (_c *SubscriptionManagerInterface_Subscriptions_Call) Run(run func(remoteDevice api.DeviceRemoteInterface)) *SubscriptionManagerInterface_Subscriptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(api.DeviceRemoteInterface)) + }) + return _c +} + +func (_c *SubscriptionManagerInterface_Subscriptions_Call) Return(_a0 []*api.SubscriptionEntry) *SubscriptionManagerInterface_Subscriptions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SubscriptionManagerInterface_Subscriptions_Call) RunAndReturn(run func(api.DeviceRemoteInterface) []*api.SubscriptionEntry) *SubscriptionManagerInterface_Subscriptions_Call { + _c.Call.Return(run) + return _c +} + +// SubscriptionsOnFeature provides a mock function with given fields: featureAddress +func (_m *SubscriptionManagerInterface) SubscriptionsOnFeature(featureAddress model.FeatureAddressType) []*api.SubscriptionEntry { + ret := _m.Called(featureAddress) + + if len(ret) == 0 { + panic("no return value specified for SubscriptionsOnFeature") + } + + var r0 []*api.SubscriptionEntry + if rf, ok := ret.Get(0).(func(model.FeatureAddressType) []*api.SubscriptionEntry); ok { + r0 = rf(featureAddress) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*api.SubscriptionEntry) + } + } + + return r0 +} + +// SubscriptionManagerInterface_SubscriptionsOnFeature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscriptionsOnFeature' +type SubscriptionManagerInterface_SubscriptionsOnFeature_Call struct { + *mock.Call +} + +// SubscriptionsOnFeature is a helper method to define mock.On call +// - featureAddress model.FeatureAddressType +func (_e *SubscriptionManagerInterface_Expecter) SubscriptionsOnFeature(featureAddress interface{}) *SubscriptionManagerInterface_SubscriptionsOnFeature_Call { + return &SubscriptionManagerInterface_SubscriptionsOnFeature_Call{Call: _e.mock.On("SubscriptionsOnFeature", featureAddress)} +} + +func (_c *SubscriptionManagerInterface_SubscriptionsOnFeature_Call) Run(run func(featureAddress model.FeatureAddressType)) *SubscriptionManagerInterface_SubscriptionsOnFeature_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.FeatureAddressType)) + }) + return _c +} + +func (_c *SubscriptionManagerInterface_SubscriptionsOnFeature_Call) Return(_a0 []*api.SubscriptionEntry) *SubscriptionManagerInterface_SubscriptionsOnFeature_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SubscriptionManagerInterface_SubscriptionsOnFeature_Call) RunAndReturn(run func(model.FeatureAddressType) []*api.SubscriptionEntry) *SubscriptionManagerInterface_SubscriptionsOnFeature_Call { + _c.Call.Return(run) + return _c +} + +// NewSubscriptionManagerInterface creates a new instance of SubscriptionManagerInterface. 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 NewSubscriptionManagerInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *SubscriptionManagerInterface { + mock := &SubscriptionManagerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/spine/binding_manager.go b/spine/binding_manager.go index 73fd2a0..65d83de 100644 --- a/spine/binding_manager.go +++ b/spine/binding_manager.go @@ -13,8 +13,8 @@ import ( "github.com/enbility/spine-go/util" ) -type BindingManagerImpl struct { - localDevice api.DeviceLocal +type BindingManager struct { + localDevice api.DeviceLocalInterface bindingNum uint64 bindingEntries []*api.BindingEntry @@ -23,8 +23,8 @@ type BindingManagerImpl struct { // TODO: add persistence } -func NewBindingManager(localDevice api.DeviceLocal) *BindingManagerImpl { - c := &BindingManagerImpl{ +func NewBindingManager(localDevice api.DeviceLocalInterface) *BindingManager { + c := &BindingManager{ bindingNum: 0, localDevice: localDevice, } @@ -33,7 +33,7 @@ func NewBindingManager(localDevice api.DeviceLocal) *BindingManagerImpl { } // is sent from the client (remote device) to the server (local device) -func (c *BindingManagerImpl) AddBinding(remoteDevice api.DeviceRemote, data model.BindingManagementRequestCallType) error { +func (c *BindingManager) AddBinding(remoteDevice api.DeviceRemoteInterface, data model.BindingManagementRequestCallType) error { serverFeature := c.localDevice.FeatureByAddress(data.ServerAddress) if serverFeature == nil { @@ -83,7 +83,7 @@ func (c *BindingManagerImpl) AddBinding(remoteDevice api.DeviceRemote, data mode return nil } -func (c *BindingManagerImpl) RemoveBinding(data model.BindingManagementDeleteCallType, remoteDevice api.DeviceRemote) error { +func (c *BindingManager) RemoveBinding(data model.BindingManagementDeleteCallType, remoteDevice api.DeviceRemoteInterface) error { var newBindingEntries []*api.BindingEntry // according to the spec 7.4.4 @@ -148,7 +148,7 @@ func (c *BindingManagerImpl) RemoveBinding(data model.BindingManagementDeleteCal } // Remove all existing bindings for a given remote device -func (c *BindingManagerImpl) RemoveBindingsForDevice(remoteDevice api.DeviceRemote) { +func (c *BindingManager) RemoveBindingsForDevice(remoteDevice api.DeviceRemoteInterface) { if remoteDevice == nil { return } @@ -159,7 +159,7 @@ func (c *BindingManagerImpl) RemoveBindingsForDevice(remoteDevice api.DeviceRemo } // Remove all existing bindings for a given remote device entity -func (c *BindingManagerImpl) RemoveBindingsForEntity(remoteEntity api.EntityRemote) { +func (c *BindingManager) RemoveBindingsForEntity(remoteEntity api.EntityRemoteInterface) { if remoteEntity == nil { return } @@ -188,7 +188,7 @@ func (c *BindingManagerImpl) RemoveBindingsForEntity(remoteEntity api.EntityRemo c.bindingEntries = newBindingEntries } -func (c *BindingManagerImpl) Bindings(remoteDevice api.DeviceRemote) []*api.BindingEntry { +func (c *BindingManager) Bindings(remoteDevice api.DeviceRemoteInterface) []*api.BindingEntry { var result []*api.BindingEntry c.mux.Lock() @@ -202,7 +202,7 @@ func (c *BindingManagerImpl) Bindings(remoteDevice api.DeviceRemote) []*api.Bind } // checks if a remote address has a binding on the local feature -func (c *BindingManagerImpl) HasLocalFeatureRemoteBinding(localAddress, remoteAddress *model.FeatureAddressType) bool { +func (c *BindingManager) HasLocalFeatureRemoteBinding(localAddress, remoteAddress *model.FeatureAddressType) bool { bindings := c.BindingsOnFeature(*localAddress) for _, item := range bindings { @@ -214,7 +214,7 @@ func (c *BindingManagerImpl) HasLocalFeatureRemoteBinding(localAddress, remoteAd return false } -func (c *BindingManagerImpl) BindingsOnFeature(featureAddress model.FeatureAddressType) []*api.BindingEntry { +func (c *BindingManager) BindingsOnFeature(featureAddress model.FeatureAddressType) []*api.BindingEntry { var result []*api.BindingEntry c.mux.Lock() @@ -227,12 +227,12 @@ func (c *BindingManagerImpl) BindingsOnFeature(featureAddress model.FeatureAddre return result } -func (c *BindingManagerImpl) bindingId() uint64 { +func (c *BindingManager) bindingId() uint64 { i := atomic.AddUint64(&c.bindingNum, 1) return i } -func (c *BindingManagerImpl) checkRoleAndType(feature api.Feature, role model.RoleType, featureType model.FeatureTypeType) error { +func (c *BindingManager) checkRoleAndType(feature api.FeatureInterface, role model.RoleType, featureType model.FeatureTypeType) error { if feature.Role() != model.RoleTypeSpecial && feature.Role() != role { return fmt.Errorf("found feature %s is not matching required role %s", feature.Type(), role) } diff --git a/spine/binding_manager_test.go b/spine/binding_manager_test.go index 90304e4..9682c11 100644 --- a/spine/binding_manager_test.go +++ b/spine/binding_manager_test.go @@ -18,41 +18,41 @@ func TestBindingManagerSuite(t *testing.T) { type BindingManagerSuite struct { suite.Suite - localDevice api.DeviceLocal + localDevice api.DeviceLocalInterface writeHandler *WriteMessageHandler - remoteDevice *DeviceRemoteImpl + remoteDevice *DeviceRemote - sut api.BindingManager + sut api.BindingManagerInterface } func (s *BindingManagerSuite) BeforeTest(suiteName, testName string) { - s.localDevice = NewDeviceLocalImpl("TestBrandName", "TestDeviceModel", "TestSerialNumber", "TestDeviceCode", + s.localDevice = NewDeviceLocal("TestBrandName", "TestDeviceModel", "TestSerialNumber", "TestDeviceCode", "TestDeviceAddress", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) remoteSki := "TestRemoteSki" s.writeHandler = &WriteMessageHandler{} sender := NewSender(s.writeHandler) - s.remoteDevice = NewDeviceRemoteImpl(s.localDevice, remoteSki, sender) + s.remoteDevice = NewDeviceRemote(s.localDevice, remoteSki, sender) s.remoteDevice.address = util.Ptr(model.AddressDeviceType("Address")) s.sut = NewBindingManager(s.localDevice) } func (suite *BindingManagerSuite) Test_Bindings() { - entity := NewEntityLocalImpl(suite.localDevice, model.EntityTypeTypeCEM, []model.AddressEntityType{1}) + entity := NewEntityLocal(suite.localDevice, model.EntityTypeTypeCEM, []model.AddressEntityType{1}) suite.localDevice.AddEntity(entity) localFeature := entity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) localClientFeature := entity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeClient) - remoteEntity := NewEntityRemoteImpl(suite.remoteDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{1}) + remoteEntity := NewEntityRemote(suite.remoteDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{1}) - remoteFeature := NewFeatureRemoteImpl(remoteEntity.NextFeatureId(), remoteEntity, model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeClient) + remoteFeature := NewFeatureRemote(remoteEntity.NextFeatureId(), remoteEntity, model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeClient) remoteFeature.Address().Device = util.Ptr(model.AddressDeviceType("remoteDevice")) remoteEntity.AddFeature(remoteFeature) - remoteServerFeature := NewFeatureRemoteImpl(remoteEntity.NextFeatureId(), remoteEntity, model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) + remoteServerFeature := NewFeatureRemote(remoteEntity.NextFeatureId(), remoteEntity, model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) remoteServerFeature.Address().Device = util.Ptr(model.AddressDeviceType("remoteDevice")) remoteEntity.AddFeature(remoteServerFeature) diff --git a/spine/device.go b/spine/device.go index c730c30..860f84c 100644 --- a/spine/device.go +++ b/spine/device.go @@ -2,7 +2,7 @@ package spine import "github.com/enbility/spine-go/model" -type DeviceImpl struct { +type Device struct { address *model.AddressDeviceType dType *model.DeviceTypeType featureSet *model.NetworkManagementFeatureSetType @@ -11,37 +11,37 @@ type DeviceImpl struct { // Initialize a new device // Both values are required for a local device but provided as empty strings for a remote device // as the address is only provided via detailed discovery response -func NewDeviceImpl(address *model.AddressDeviceType, dType *model.DeviceTypeType, featureSet *model.NetworkManagementFeatureSetType) *DeviceImpl { - deviceImpl := &DeviceImpl{} +func NewDevice(address *model.AddressDeviceType, dType *model.DeviceTypeType, featureSet *model.NetworkManagementFeatureSetType) *Device { + device := &Device{} if dType != nil { - deviceImpl.dType = dType + device.dType = dType } if address != nil { - deviceImpl.address = address + device.address = address } if featureSet != nil { - deviceImpl.featureSet = featureSet + device.featureSet = featureSet } - return deviceImpl + return device } -func (r *DeviceImpl) Address() *model.AddressDeviceType { +func (r *Device) Address() *model.AddressDeviceType { return r.address } -func (r *DeviceImpl) DeviceType() *model.DeviceTypeType { +func (r *Device) DeviceType() *model.DeviceTypeType { return r.dType } -func (r *DeviceImpl) FeatureSet() *model.NetworkManagementFeatureSetType { +func (r *Device) FeatureSet() *model.NetworkManagementFeatureSetType { return r.featureSet } -func (r *DeviceImpl) DestinationData() model.NodeManagementDestinationDataType { +func (r *Device) DestinationData() model.NodeManagementDestinationDataType { return model.NodeManagementDestinationDataType{ DeviceDescription: &model.NetworkManagementDeviceDescriptionDataType{ DeviceAddress: &model.DeviceAddressType{ diff --git a/spine/device_local.go b/spine/device_local.go index 6b19686..cfca74e 100644 --- a/spine/device_local.go +++ b/spine/device_local.go @@ -14,17 +14,17 @@ import ( "github.com/enbility/spine-go/util" ) -var _ api.DeviceLocal = (*DeviceLocalImpl)(nil) +var _ api.DeviceLocalInterface = (*DeviceLocal)(nil) -type DeviceLocalImpl struct { - *DeviceImpl - entities []api.EntityLocal - subscriptionManager api.SubscriptionManager - bindingManager api.BindingManager - heartbeatManager api.HeartbeatManager - nodeManagement *NodeManagementImpl +type DeviceLocal struct { + *Device + entities []api.EntityLocalInterface + subscriptionManager api.SubscriptionManagerInterface + bindingManager api.BindingManagerInterface + heartbeatManager api.HeartbeatManagerInterface + nodeManagement *NodeManagement - remoteDevices map[string]api.DeviceRemote + remoteDevices map[string]api.DeviceRemoteInterface brandName string deviceModel string @@ -39,11 +39,11 @@ type DeviceLocalImpl struct { // SerialNumber is the serial number // DeviceCode is the SHIP id (accessMethods.id) // DeviceAddress is the SPINE device address -func NewDeviceLocalImpl( +func NewDeviceLocal( brandName, deviceModel, serialNumber, deviceCode, deviceAddress string, deviceType model.DeviceTypeType, featureSet model.NetworkManagementFeatureSetType, - heartbeatTimeout time.Duration) *DeviceLocalImpl { + heartbeatTimeout time.Duration) *DeviceLocal { address := model.AddressDeviceType(deviceAddress) var fSet *model.NetworkManagementFeatureSetType @@ -51,9 +51,9 @@ func NewDeviceLocalImpl( fSet = &featureSet } - res := &DeviceLocalImpl{ - DeviceImpl: NewDeviceImpl(&address, &deviceType, fSet), - remoteDevices: make(map[string]api.DeviceRemote), + res := &DeviceLocal{ + Device: NewDevice(&address, &deviceType, fSet), + remoteDevices: make(map[string]api.DeviceRemoteInterface), brandName: brandName, deviceModel: deviceModel, serialNumber: serialNumber, @@ -68,7 +68,7 @@ func NewDeviceLocalImpl( return res } -func (r *DeviceLocalImpl) RemoveRemoteDeviceConnection(ski string) { +func (r *DeviceLocal) RemoveRemoteDeviceConnection(ski string) { remoteDevice := r.RemoteDeviceForSki(ski) r.RemoveRemoteDevice(ski) @@ -84,16 +84,16 @@ func (r *DeviceLocalImpl) RemoveRemoteDeviceConnection(ski string) { } // Helper method used by tests and AddRemoteDevice -func (r *DeviceLocalImpl) AddRemoteDeviceForSki(ski string, rDevice api.DeviceRemote) { +func (r *DeviceLocal) AddRemoteDeviceForSki(ski string, rDevice api.DeviceRemoteInterface) { r.mux.Lock() r.remoteDevices[ski] = rDevice r.mux.Unlock() } // Setup a new remote device with a given SKI and triggers SPINE requesting device details -func (r *DeviceLocalImpl) SetupRemoteDevice(ski string, writeI shipapi.SpineDataConnection) shipapi.SpineDataProcessing { +func (r *DeviceLocal) SetupRemoteDevice(ski string, writeI shipapi.ShipConnectionDataWriterInterface) shipapi.ShipConnectionDataReaderInterface { sender := NewSender(writeI) - rDevice := NewDeviceRemoteImpl(r, ski, sender) + rDevice := NewDeviceRemote(r, ski, sender) r.AddRemoteDeviceForSki(ski, rDevice) @@ -110,7 +110,7 @@ func (r *DeviceLocalImpl) SetupRemoteDevice(ski string, writeI shipapi.SpineData } // React to some specific events -func (r *DeviceLocalImpl) HandleEvent(payload api.EventPayload) { +func (r *DeviceLocal) HandleEvent(payload api.EventPayload) { // Subscribe to NodeManagment after DetailedDiscovery is received if payload.EventType != api.EventTypeDeviceChange || payload.ChangeType != api.ElementChangeAdd { return @@ -139,7 +139,7 @@ func (r *DeviceLocalImpl) HandleEvent(payload api.EventPayload) { } } -func (r *DeviceLocalImpl) RemoveRemoteDevice(ski string) { +func (r *DeviceLocal) RemoveRemoteDevice(ski string) { r.mux.Lock() defer r.mux.Unlock() @@ -166,11 +166,11 @@ func (r *DeviceLocalImpl) RemoveRemoteDevice(ski string) { } } -func (r *DeviceLocalImpl) RemoteDevices() []api.DeviceRemote { +func (r *DeviceLocal) RemoteDevices() []api.DeviceRemoteInterface { r.mux.Lock() defer r.mux.Unlock() - res := make([]api.DeviceRemote, 0) + res := make([]api.DeviceRemoteInterface, 0) for _, rDevice := range r.remoteDevices { res = append(res, rDevice) } @@ -178,7 +178,7 @@ func (r *DeviceLocalImpl) RemoteDevices() []api.DeviceRemote { return res } -func (r *DeviceLocalImpl) RemoteDeviceForAddress(address model.AddressDeviceType) api.DeviceRemote { +func (r *DeviceLocal) RemoteDeviceForAddress(address model.AddressDeviceType) api.DeviceRemoteInterface { r.mux.Lock() defer r.mux.Unlock() @@ -191,14 +191,14 @@ func (r *DeviceLocalImpl) RemoteDeviceForAddress(address model.AddressDeviceType return nil } -func (r *DeviceLocalImpl) RemoteDeviceForSki(ski string) api.DeviceRemote { +func (r *DeviceLocal) RemoteDeviceForSki(ski string) api.DeviceRemoteInterface { r.mux.Lock() defer r.mux.Unlock() return r.remoteDevices[ski] } -func (r *DeviceLocalImpl) ProcessCmd(datagram model.DatagramType, remoteDevice api.DeviceRemote) error { +func (r *DeviceLocal) ProcessCmd(datagram model.DatagramType, remoteDevice api.DeviceRemoteInterface) error { destAddr := datagram.Header.AddressDestination localFeature := r.FeatureByAddress(destAddr) @@ -287,23 +287,23 @@ func (r *DeviceLocalImpl) ProcessCmd(datagram model.DatagramType, remoteDevice a return nil } -func (r *DeviceLocalImpl) NodeManagement() api.NodeManagement { +func (r *DeviceLocal) NodeManagement() api.NodeManagementInterface { return r.nodeManagement } -func (r *DeviceLocalImpl) SubscriptionManager() api.SubscriptionManager { +func (r *DeviceLocal) SubscriptionManager() api.SubscriptionManagerInterface { return r.subscriptionManager } -func (r *DeviceLocalImpl) BindingManager() api.BindingManager { +func (r *DeviceLocal) BindingManager() api.BindingManagerInterface { return r.bindingManager } -func (r *DeviceLocalImpl) HeartbeatManager() api.HeartbeatManager { +func (r *DeviceLocal) HeartbeatManager() api.HeartbeatManagerInterface { return r.heartbeatManager } -func (r *DeviceLocalImpl) AddEntity(entity api.EntityLocal) { +func (r *DeviceLocal) AddEntity(entity api.EntityLocalInterface) { r.mux.Lock() defer r.mux.Unlock() @@ -312,7 +312,7 @@ func (r *DeviceLocalImpl) AddEntity(entity api.EntityLocal) { r.notifySubscribersOfEntity(entity, model.NetworkManagementStateChangeTypeAdded) } -func (r *DeviceLocalImpl) RemoveEntity(entity api.EntityLocal) { +func (r *DeviceLocal) RemoveEntity(entity api.EntityLocalInterface) { entity.RemoveAllUseCaseSupports() entity.RemoveAllSubscriptions() entity.RemoveAllBindings() @@ -320,7 +320,7 @@ func (r *DeviceLocalImpl) RemoveEntity(entity api.EntityLocal) { r.mux.Lock() defer r.mux.Unlock() - var entities []api.EntityLocal + var entities []api.EntityLocalInterface for _, e := range r.entities { if e != entity { entities = append(entities, e) @@ -332,14 +332,14 @@ func (r *DeviceLocalImpl) RemoveEntity(entity api.EntityLocal) { r.notifySubscribersOfEntity(entity, model.NetworkManagementStateChangeTypeRemoved) } -func (r *DeviceLocalImpl) Entities() []api.EntityLocal { +func (r *DeviceLocal) Entities() []api.EntityLocalInterface { r.mux.Lock() defer r.mux.Unlock() return r.entities } -func (r *DeviceLocalImpl) Entity(id []model.AddressEntityType) api.EntityLocal { +func (r *DeviceLocal) Entity(id []model.AddressEntityType) api.EntityLocalInterface { r.mux.Lock() defer r.mux.Unlock() @@ -351,7 +351,7 @@ func (r *DeviceLocalImpl) Entity(id []model.AddressEntityType) api.EntityLocal { return nil } -func (r *DeviceLocalImpl) EntityForType(entityType model.EntityTypeType) api.EntityLocal { +func (r *DeviceLocal) EntityForType(entityType model.EntityTypeType) api.EntityLocalInterface { r.mux.Lock() defer r.mux.Unlock() @@ -363,7 +363,7 @@ func (r *DeviceLocalImpl) EntityForType(entityType model.EntityTypeType) api.Ent return nil } -func (r *DeviceLocalImpl) FeatureByAddress(address *model.FeatureAddressType) api.FeatureLocal { +func (r *DeviceLocal) FeatureByAddress(address *model.FeatureAddressType) api.FeatureLocalInterface { entity := r.Entity(address.Entity) if entity != nil { return entity.Feature(address.Feature) @@ -371,7 +371,7 @@ func (r *DeviceLocalImpl) FeatureByAddress(address *model.FeatureAddressType) ap return nil } -func (r *DeviceLocalImpl) Information() *model.NodeManagementDetailedDiscoveryDeviceInformationType { +func (r *DeviceLocal) Information() *model.NodeManagementDetailedDiscoveryDeviceInformationType { res := model.NodeManagementDetailedDiscoveryDeviceInformationType{ Description: &model.NetworkManagementDeviceDescriptionDataType{ DeviceAddress: &model.DeviceAddressType{ @@ -385,7 +385,7 @@ func (r *DeviceLocalImpl) Information() *model.NodeManagementDetailedDiscoveryDe } // send a notify message to all remote devices -func (r *DeviceLocalImpl) NotifyUseCaseData() { +func (r *DeviceLocal) NotifyUseCaseData() { r.mux.Lock() defer r.mux.Unlock() @@ -395,7 +395,7 @@ func (r *DeviceLocalImpl) NotifyUseCaseData() { } } -func (r *DeviceLocalImpl) NotifySubscribers(featureAddress *model.FeatureAddressType, cmd model.CmdType) { +func (r *DeviceLocal) NotifySubscribers(featureAddress *model.FeatureAddressType, cmd model.CmdType) { subscriptions := r.SubscriptionManager().SubscriptionsOnFeature(*featureAddress) for _, subscription := range subscriptions { // TODO: error handling @@ -403,7 +403,7 @@ func (r *DeviceLocalImpl) NotifySubscribers(featureAddress *model.FeatureAddress } } -func (r *DeviceLocalImpl) notifySubscribersOfEntity(entity api.EntityLocal, state model.NetworkManagementStateChangeType) { +func (r *DeviceLocal) notifySubscribersOfEntity(entity api.EntityLocalInterface, state model.NetworkManagementStateChangeType) { deviceInformation := r.Information() entityInformation := *entity.Information() entityInformation.Description.LastStateChange = &state @@ -431,16 +431,16 @@ func (r *DeviceLocalImpl) notifySubscribersOfEntity(entity api.EntityLocal, stat r.NotifySubscribers(r.nodeManagement.Address(), cmd) } -func (r *DeviceLocalImpl) addDeviceInformation() { +func (r *DeviceLocal) addDeviceInformation() { entityType := model.EntityTypeTypeDeviceInformation - entity := NewEntityLocalImpl(r, entityType, []model.AddressEntityType{model.AddressEntityType(DeviceInformationEntityId)}) + entity := NewEntityLocal(r, entityType, []model.AddressEntityType{model.AddressEntityType(DeviceInformationEntityId)}) { - r.nodeManagement = NewNodeManagementImpl(entity.NextFeatureId(), entity) + r.nodeManagement = NewNodeManagement(entity.NextFeatureId(), entity) entity.AddFeature(r.nodeManagement) } { - f := NewFeatureLocalImpl(entity.NextFeatureId(), entity, model.FeatureTypeTypeDeviceClassification, model.RoleTypeServer) + f := NewFeatureLocal(entity.NextFeatureId(), entity, model.FeatureTypeTypeDeviceClassification, model.RoleTypeServer) f.AddFunctionType(model.FunctionTypeDeviceClassificationManufacturerData, true, false) diff --git a/spine/device_local_test.go b/spine/device_local_test.go index 38d8131..5f3742d 100644 --- a/spine/device_local_test.go +++ b/spine/device_local_test.go @@ -21,14 +21,14 @@ type DeviceLocalTestSuite struct { lastMessage string } -var _ shipapi.SpineDataConnection = (*DeviceLocalTestSuite)(nil) +var _ shipapi.ShipConnectionDataWriterInterface = (*DeviceLocalTestSuite)(nil) -func (d *DeviceLocalTestSuite) WriteSpineMessage(msg []byte) { +func (d *DeviceLocalTestSuite) WriteShipMessageWithPayload(msg []byte) { d.lastMessage = string(msg) } func (d *DeviceLocalTestSuite) Test_RemoveRemoteDevice() { - sut := NewDeviceLocalImpl("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) + sut := NewDeviceLocal("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) ski := "test" _ = sut.SetupRemoteDevice(ski, d) @@ -42,13 +42,13 @@ func (d *DeviceLocalTestSuite) Test_RemoveRemoteDevice() { } func (d *DeviceLocalTestSuite) Test_RemoteDevice() { - sut := NewDeviceLocalImpl("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) - localEntity := NewEntityLocalImpl(sut, model.EntityTypeTypeCEM, NewAddressEntityType([]uint{1})) + sut := NewDeviceLocal("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) + localEntity := NewEntityLocal(sut, model.EntityTypeTypeCEM, NewAddressEntityType([]uint{1})) sut.AddEntity(localEntity) - f := NewFeatureLocalImpl(1, localEntity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeClient) + f := NewFeatureLocal(1, localEntity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeClient) localEntity.AddFeature(f) - f = NewFeatureLocalImpl(2, localEntity, model.FeatureTypeTypeMeasurement, model.RoleTypeClient) + f = NewFeatureLocal(2, localEntity, model.FeatureTypeTypeMeasurement, model.RoleTypeClient) localEntity.AddFeature(f) ski := "test" @@ -98,8 +98,8 @@ func (d *DeviceLocalTestSuite) Test_RemoteDevice() { err := sut.SubscriptionManager().AddSubscription(remote, subscription) assert.Nil(d.T(), err) - newSubEntity := NewEntityLocalImpl(sut, model.EntityTypeTypeEV, NewAddressEntityType([]uint{1, 1})) - f = NewFeatureLocalImpl(1, newSubEntity, model.FeatureTypeTypeLoadControl, model.RoleTypeServer) + newSubEntity := NewEntityLocal(sut, model.EntityTypeTypeEV, NewAddressEntityType([]uint{1, 1})) + f = NewFeatureLocal(1, newSubEntity, model.FeatureTypeTypeLoadControl, model.RoleTypeServer) f.AddFunctionType(model.FunctionTypeLoadControlLimitListData, true, true) newSubEntity.AddFeature(f) @@ -133,8 +133,8 @@ func (d *DeviceLocalTestSuite) Test_RemoteDevice() { } func (d *DeviceLocalTestSuite) Test_ProcessCmd_Errors() { - sut := NewDeviceLocalImpl("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) - localEntity := NewEntityLocalImpl(sut, model.EntityTypeTypeCEM, NewAddressEntityType([]uint{1})) + sut := NewDeviceLocal("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) + localEntity := NewEntityLocal(sut, model.EntityTypeTypeCEM, NewAddressEntityType([]uint{1})) sut.AddEntity(localEntity) ski := "test" @@ -184,15 +184,15 @@ func (d *DeviceLocalTestSuite) Test_ProcessCmd_Errors() { } func (d *DeviceLocalTestSuite) Test_ProcessCmd() { - sut := NewDeviceLocalImpl("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) - localEntity := NewEntityLocalImpl(sut, model.EntityTypeTypeCEM, NewAddressEntityType([]uint{1})) + sut := NewDeviceLocal("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) + localEntity := NewEntityLocal(sut, model.EntityTypeTypeCEM, NewAddressEntityType([]uint{1})) sut.AddEntity(localEntity) - f1 := NewFeatureLocalImpl(1, localEntity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeClient) + f1 := NewFeatureLocal(1, localEntity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeClient) localEntity.AddFeature(f1) - f2 := NewFeatureLocalImpl(2, localEntity, model.FeatureTypeTypeMeasurement, model.RoleTypeClient) + f2 := NewFeatureLocal(2, localEntity, model.FeatureTypeTypeMeasurement, model.RoleTypeClient) localEntity.AddFeature(f2) - f3 := NewFeatureLocalImpl(3, localEntity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer) + f3 := NewFeatureLocal(3, localEntity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer) localEntity.AddFeature(f3) ski := "test" diff --git a/spine/device_remote.go b/spine/device_remote.go index 3e895cd..aafeaa5 100644 --- a/spine/device_remote.go +++ b/spine/device_remote.go @@ -13,26 +13,26 @@ import ( "github.com/enbility/spine-go/model" ) -var _ api.DeviceRemote = (*DeviceRemoteImpl)(nil) +var _ api.DeviceRemoteInterface = (*DeviceRemote)(nil) -type DeviceRemoteImpl struct { - *DeviceImpl +type DeviceRemote struct { + *Device ski string - entities []api.EntityRemote + entities []api.EntityRemoteInterface entitiesMutex sync.Mutex - sender api.Sender + sender api.SenderInterface - localDevice api.DeviceLocal + localDevice api.DeviceLocalInterface } -var _ shipapi.SpineDataProcessing = (*DeviceRemoteImpl)(nil) +var _ shipapi.ShipConnectionDataReaderInterface = (*DeviceRemote)(nil) -func NewDeviceRemoteImpl(localDevice api.DeviceLocal, ski string, sender api.Sender) *DeviceRemoteImpl { - res := DeviceRemoteImpl{ - DeviceImpl: NewDeviceImpl(nil, nil, nil), +func NewDeviceRemote(localDevice api.DeviceLocalInterface, ski string, sender api.SenderInterface) *DeviceRemote { + res := DeviceRemote{ + Device: NewDevice(nil, nil, nil), ski: ski, localDevice: localDevice, sender: sender, @@ -43,15 +43,15 @@ func NewDeviceRemoteImpl(localDevice api.DeviceLocal, ski string, sender api.Sen } // return the device SKI -func (d *DeviceRemoteImpl) Ski() string { +func (d *DeviceRemote) Ski() string { return d.ski } -func (d *DeviceRemoteImpl) SetAddress(address *model.AddressDeviceType) { +func (d *DeviceRemote) SetAddress(address *model.AddressDeviceType) { d.address = address } -func (d *DeviceRemoteImpl) HandleSpineMesssage(message []byte) (*model.MsgCounterType, error) { +func (d *DeviceRemote) HandleSpineMesssage(message []byte) (*model.MsgCounterType, error) { datagram := model.Datagram{} if err := json.Unmarshal([]byte(message), &datagram); err != nil { return nil, err @@ -65,24 +65,24 @@ func (d *DeviceRemoteImpl) HandleSpineMesssage(message []byte) (*model.MsgCounte } // processing incoming SPINE message from the associated SHIP connection -func (d *DeviceRemoteImpl) HandleIncomingSpineMesssage(message []byte) { +func (d *DeviceRemote) HandleShipPayloadMessage(message []byte) { if _, err := d.HandleSpineMesssage(message); err != nil { logging.Log().Errorf("error handling spine message", err) } } -func (d *DeviceRemoteImpl) addNodeManagement() { +func (d *DeviceRemote) addNodeManagement() { deviceInformation := d.addNewEntity(model.EntityTypeTypeDeviceInformation, NewAddressEntityType([]uint{DeviceInformationEntityId})) - nodeManagement := NewFeatureRemoteImpl(deviceInformation.NextFeatureId(), deviceInformation, model.FeatureTypeTypeNodeManagement, model.RoleTypeSpecial) + nodeManagement := NewFeatureRemote(deviceInformation.NextFeatureId(), deviceInformation, model.FeatureTypeTypeNodeManagement, model.RoleTypeSpecial) deviceInformation.AddFeature(nodeManagement) } -func (d *DeviceRemoteImpl) Sender() api.Sender { +func (d *DeviceRemote) Sender() api.SenderInterface { return d.sender } // Return an entity with a given address -func (d *DeviceRemoteImpl) Entity(id []model.AddressEntityType) api.EntityRemote { +func (d *DeviceRemote) Entity(id []model.AddressEntityType) api.EntityRemoteInterface { d.entitiesMutex.Lock() defer d.entitiesMutex.Unlock() @@ -95,12 +95,12 @@ func (d *DeviceRemoteImpl) Entity(id []model.AddressEntityType) api.EntityRemote } // Return all entities of this device -func (d *DeviceRemoteImpl) Entities() []api.EntityRemote { +func (d *DeviceRemote) Entities() []api.EntityRemoteInterface { return d.entities } // Return the feature for a given address -func (d *DeviceRemoteImpl) FeatureByAddress(address *model.FeatureAddressType) api.FeatureRemote { +func (d *DeviceRemote) FeatureByAddress(address *model.FeatureAddressType) api.FeatureRemoteInterface { entity := d.Entity(address.Entity) if entity != nil { return entity.Feature(address.Feature) @@ -109,7 +109,7 @@ func (d *DeviceRemoteImpl) FeatureByAddress(address *model.FeatureAddressType) a } // Remove an entity with a given address from this device -func (d *DeviceRemoteImpl) RemoveByAddress(addr []model.AddressEntityType) api.EntityRemote { +func (d *DeviceRemote) RemoveByAddress(addr []model.AddressEntityType) api.EntityRemoteInterface { entityForRemoval := d.Entity(addr) if entityForRemoval == nil { return nil @@ -118,7 +118,7 @@ func (d *DeviceRemoteImpl) RemoveByAddress(addr []model.AddressEntityType) api.E d.entitiesMutex.Lock() defer d.entitiesMutex.Unlock() - var newEntities []api.EntityRemote + var newEntities []api.EntityRemoteInterface for _, item := range d.entities { if !reflect.DeepEqual(item, entityForRemoval) { newEntities = append(newEntities, item) @@ -130,7 +130,7 @@ func (d *DeviceRemoteImpl) RemoveByAddress(addr []model.AddressEntityType) api.E } // Get the feature for a given entity, feature type and feature role -func (r *DeviceRemoteImpl) FeatureByEntityTypeAndRole(entity api.EntityRemote, featureType model.FeatureTypeType, role model.RoleType) api.FeatureRemote { +func (r *DeviceRemote) FeatureByEntityTypeAndRole(entity api.EntityRemoteInterface, featureType model.FeatureTypeType, role model.RoleType) api.FeatureRemoteInterface { if len(r.entities) < 1 { return nil } @@ -152,7 +152,7 @@ func (r *DeviceRemoteImpl) FeatureByEntityTypeAndRole(entity api.EntityRemote, f return nil } -func (d *DeviceRemoteImpl) UpdateDevice(description *model.NetworkManagementDeviceDescriptionDataType) { +func (d *DeviceRemote) UpdateDevice(description *model.NetworkManagementDeviceDescriptionDataType) { if description != nil { if description.DeviceAddress != nil && description.DeviceAddress.Device != nil { d.address = description.DeviceAddress.Device @@ -166,8 +166,8 @@ func (d *DeviceRemoteImpl) UpdateDevice(description *model.NetworkManagementDevi } } -func (d *DeviceRemoteImpl) AddEntityAndFeatures(initialData bool, data *model.NodeManagementDetailedDiscoveryDataType) ([]api.EntityRemote, error) { - rEntites := make([]api.EntityRemote, 0) +func (d *DeviceRemote) AddEntityAndFeatures(initialData bool, data *model.NodeManagementDetailedDiscoveryDataType) ([]api.EntityRemoteInterface, error) { + rEntites := make([]api.EntityRemoteInterface, 0) for _, ei := range data.EntityInformation { if err := d.CheckEntityInformation(initialData, ei); err != nil { @@ -204,7 +204,7 @@ func (d *DeviceRemoteImpl) AddEntityAndFeatures(initialData bool, data *model.No // check if the provided entity information is correct // provide initialData to check if the entity is new and not an update -func (d *DeviceRemoteImpl) CheckEntityInformation(initialData bool, entity model.NodeManagementDetailedDiscoveryEntityInformationType) error { +func (d *DeviceRemote) CheckEntityInformation(initialData bool, entity model.NodeManagementDetailedDiscoveryEntityInformationType) error { description := entity.Description if description == nil { return errors.New("nodemanagement.replyDetailedDiscoveryData: invalid EntityInformation.Description") @@ -231,12 +231,12 @@ func (d *DeviceRemoteImpl) CheckEntityInformation(initialData bool, entity model return nil } -func (d *DeviceRemoteImpl) addNewEntity(eType model.EntityTypeType, address []model.AddressEntityType) api.EntityRemote { - newEntity := NewEntityRemoteImpl(d, eType, address) +func (d *DeviceRemote) addNewEntity(eType model.EntityTypeType, address []model.AddressEntityType) api.EntityRemoteInterface { + newEntity := NewEntityRemote(d, eType, address) return d.AddEntity(newEntity) } -func (d *DeviceRemoteImpl) AddEntity(entity api.EntityRemote) api.EntityRemote { +func (d *DeviceRemote) AddEntity(entity api.EntityRemoteInterface) api.EntityRemoteInterface { d.entitiesMutex.Lock() defer d.entitiesMutex.Unlock() @@ -245,7 +245,7 @@ func (d *DeviceRemoteImpl) AddEntity(entity api.EntityRemote) api.EntityRemote { return entity } -func (d *DeviceRemoteImpl) UseCases() []model.UseCaseInformationDataType { +func (d *DeviceRemote) UseCases() []model.UseCaseInformationDataType { entity := d.Entity(DeviceInformationAddressEntity) nodemgmt := d.FeatureByEntityTypeAndRole(entity, model.FeatureTypeTypeNodeManagement, model.RoleTypeSpecial) @@ -260,7 +260,7 @@ func (d *DeviceRemoteImpl) UseCases() []model.UseCaseInformationDataType { // Checks if the given actor, usecasename and provided server features are available // Note: the server features are expected to be in a single entity and entity 0 is not checked! -func (d *DeviceRemoteImpl) VerifyUseCaseScenariosAndFeaturesSupport( +func (d *DeviceRemote) VerifyUseCaseScenariosAndFeaturesSupport( usecaseActor model.UseCaseActorType, usecaseName model.UseCaseNameType, scenarios []model.UseCaseScenarioSupportType, @@ -342,10 +342,10 @@ func (d *DeviceRemoteImpl) VerifyUseCaseScenariosAndFeaturesSupport( return entityWithServerFeaturesFound } -func unmarshalFeature(entity api.EntityRemote, +func unmarshalFeature(entity api.EntityRemoteInterface, featureData model.NodeManagementDetailedDiscoveryFeatureInformationType, -) (api.FeatureRemote, bool) { - var result api.FeatureRemote +) (api.FeatureRemoteInterface, bool) { + var result api.FeatureRemoteInterface fid := featureData.Description @@ -353,7 +353,7 @@ func unmarshalFeature(entity api.EntityRemote, return nil, false } - result = NewFeatureRemoteImpl(uint(*fid.FeatureAddress.Feature), entity, *fid.FeatureType, *fid.Role) + result = NewFeatureRemote(uint(*fid.FeatureAddress.Feature), entity, *fid.FeatureType, *fid.Role) result.SetDescription(fid.Description) result.SetMaxResponseDelay(fid.MaxResponseDelay) diff --git a/spine/device_remote_test.go b/spine/device_remote_test.go index 6cf2bbc..1988d76 100644 --- a/spine/device_remote_test.go +++ b/spine/device_remote_test.go @@ -22,27 +22,27 @@ func TestDeviceRemoteSuite(t *testing.T) { type DeviceRemoteSuite struct { suite.Suite - localDevice api.DeviceLocal - remoteDevice api.DeviceRemote - remoteEntity api.EntityRemote + localDevice api.DeviceLocalInterface + remoteDevice api.DeviceRemoteInterface + remoteEntity api.EntityRemoteInterface } -func (s *DeviceRemoteSuite) WriteSpineMessage([]byte) {} +func (s *DeviceRemoteSuite) WriteShipMessageWithPayload([]byte) {} func (s *DeviceRemoteSuite) SetupSuite() {} func (s *DeviceRemoteSuite) BeforeTest(suiteName, testName string) { - s.localDevice = NewDeviceLocalImpl("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) + s.localDevice = NewDeviceLocal("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) ski := "test" sender := NewSender(s) - s.remoteDevice = NewDeviceRemoteImpl(s.localDevice, ski, sender) + s.remoteDevice = NewDeviceRemote(s.localDevice, ski, sender) s.remoteDevice.SetAddress(util.Ptr(model.AddressDeviceType("test"))) _ = s.localDevice.SetupRemoteDevice(ski, s) - s.remoteEntity = NewEntityRemoteImpl(s.remoteDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{1}) + s.remoteEntity = NewEntityRemote(s.remoteDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{1}) - feature := NewFeatureRemoteImpl(0, s.remoteEntity, model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) + feature := NewFeatureRemote(0, s.remoteEntity, model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) s.remoteEntity.AddFeature(feature) s.remoteDevice.AddEntity(s.remoteEntity) @@ -242,7 +242,7 @@ func (s *DeviceRemoteSuite) Test_VerifyUseCaseScenariosAndFeaturesSupport() { entity := s.remoteDevice.Entity([]model.AddressEntityType{1}) assert.NotNil(s.T(), entity) - feature := NewFeatureRemoteImpl(0, entity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeClient) + feature := NewFeatureRemote(0, entity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeClient) entity.AddFeature(feature) result = s.remoteDevice.VerifyUseCaseScenariosAndFeaturesSupport( @@ -253,7 +253,7 @@ func (s *DeviceRemoteSuite) Test_VerifyUseCaseScenariosAndFeaturesSupport() { ) assert.Equal(s.T(), false, result) - feature = NewFeatureRemoteImpl(0, entity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer) + feature = NewFeatureRemote(0, entity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer) entity.AddFeature(feature) result = s.remoteDevice.VerifyUseCaseScenariosAndFeaturesSupport( diff --git a/spine/entity.go b/spine/entity.go index f334a71..43f4423 100644 --- a/spine/entity.go +++ b/spine/entity.go @@ -11,17 +11,17 @@ const DeviceInformationEntityId uint = 0 var DeviceInformationAddressEntity = []model.AddressEntityType{model.AddressEntityType(DeviceInformationEntityId)} -type EntityImpl struct { +type Entity struct { eType model.EntityTypeType address *model.EntityAddressType description *model.DescriptionType fIdGenerator func() uint } -var _ api.Entity = (*EntityImpl)(nil) +var _ api.EntityInterface = (*Entity)(nil) -func NewEntity(eType model.EntityTypeType, deviceAdress *model.AddressDeviceType, entityAddress []model.AddressEntityType) *EntityImpl { - entity := &EntityImpl{ +func NewEntity(eType model.EntityTypeType, deviceAdress *model.AddressDeviceType, entityAddress []model.AddressEntityType) *Entity { + entity := &Entity{ eType: eType, address: &model.EntityAddressType{ Device: deviceAdress, @@ -39,23 +39,23 @@ func NewEntity(eType model.EntityTypeType, deviceAdress *model.AddressDeviceType return entity } -func (r *EntityImpl) EntityType() model.EntityTypeType { +func (r *Entity) EntityType() model.EntityTypeType { return r.eType } -func (r *EntityImpl) Address() *model.EntityAddressType { +func (r *Entity) Address() *model.EntityAddressType { return r.address } -func (r *EntityImpl) Description() *model.DescriptionType { +func (r *Entity) Description() *model.DescriptionType { return r.description } -func (r *EntityImpl) SetDescription(d *model.DescriptionType) { +func (r *Entity) SetDescription(d *model.DescriptionType) { r.description = d } -func (r *EntityImpl) NextFeatureId() uint { +func (r *Entity) NextFeatureId() uint { return r.fIdGenerator() } diff --git a/spine/entity_local.go b/spine/entity_local.go index 2dc0b90..0f215c4 100644 --- a/spine/entity_local.go +++ b/spine/entity_local.go @@ -5,27 +5,27 @@ import ( "github.com/enbility/spine-go/model" ) -var _ api.EntityLocal = (*EntityLocalImpl)(nil) +var _ api.EntityLocalInterface = (*EntityLocal)(nil) -type EntityLocalImpl struct { - *EntityImpl - device api.DeviceLocal - features []api.FeatureLocal +type EntityLocal struct { + *Entity + device api.DeviceLocalInterface + features []api.FeatureLocalInterface } -func NewEntityLocalImpl(device api.DeviceLocal, eType model.EntityTypeType, entityAddress []model.AddressEntityType) *EntityLocalImpl { - return &EntityLocalImpl{ - EntityImpl: NewEntity(eType, device.Address(), entityAddress), - device: device, +func NewEntityLocal(device api.DeviceLocalInterface, eType model.EntityTypeType, entityAddress []model.AddressEntityType) *EntityLocal { + return &EntityLocal{ + Entity: NewEntity(eType, device.Address(), entityAddress), + device: device, } } -func (r *EntityLocalImpl) Device() api.DeviceLocal { +func (r *EntityLocal) Device() api.DeviceLocalInterface { return r.device } // Add a feature to the entity if it is not already added -func (r *EntityLocalImpl) AddFeature(f api.FeatureLocal) { +func (r *EntityLocal) AddFeature(f api.FeatureLocalInterface) { // check if this feature is already added for _, f2 := range r.features { if f2.Type() == f.Type() && f2.Role() == f.Role() { @@ -37,11 +37,11 @@ func (r *EntityLocalImpl) AddFeature(f api.FeatureLocal) { // either returns an existing feature or creates a new one // for a given entity, featuretype and role -func (r *EntityLocalImpl) GetOrAddFeature(featureType model.FeatureTypeType, role model.RoleType) api.FeatureLocal { +func (r *EntityLocal) GetOrAddFeature(featureType model.FeatureTypeType, role model.RoleType) api.FeatureLocalInterface { if f := r.FeatureOfTypeAndRole(featureType, role); f != nil { return f } - f := NewFeatureLocalImpl(r.NextFeatureId(), r, featureType, role) + f := NewFeatureLocal(r.NextFeatureId(), r, featureType, role) description := string(featureType) switch role { @@ -61,7 +61,7 @@ func (r *EntityLocalImpl) GetOrAddFeature(featureType model.FeatureTypeType, rol return f } -func (r *EntityLocalImpl) FeatureOfTypeAndRole(featureType model.FeatureTypeType, role model.RoleType) api.FeatureLocal { +func (r *EntityLocal) FeatureOfTypeAndRole(featureType model.FeatureTypeType, role model.RoleType) api.FeatureLocalInterface { for _, f := range r.features { if f.Type() == featureType && f.Role() == role { return f @@ -70,11 +70,11 @@ func (r *EntityLocalImpl) FeatureOfTypeAndRole(featureType model.FeatureTypeType return nil } -func (r *EntityLocalImpl) Features() []api.FeatureLocal { +func (r *EntityLocal) Features() []api.FeatureLocalInterface { return r.features } -func (r *EntityLocalImpl) Feature(addressFeature *model.AddressFeatureType) api.FeatureLocal { +func (r *EntityLocal) Feature(addressFeature *model.AddressFeatureType) api.FeatureLocalInterface { if addressFeature == nil { return nil } @@ -86,7 +86,7 @@ func (r *EntityLocalImpl) Feature(addressFeature *model.AddressFeatureType) api. return nil } -func (r *EntityLocalImpl) Information() *model.NodeManagementDetailedDiscoveryEntityInformationType { +func (r *EntityLocal) Information() *model.NodeManagementDetailedDiscoveryEntityInformationType { res := &model.NodeManagementDetailedDiscoveryEntityInformationType{ Description: &model.NetworkManagementEntityDescriptionDataType{ EntityAddress: r.Address(), @@ -98,7 +98,7 @@ func (r *EntityLocalImpl) Information() *model.NodeManagementDetailedDiscoveryEn } // add a new usecase -func (r *EntityLocalImpl) AddUseCaseSupport( +func (r *EntityLocal) AddUseCaseSupport( actor model.UseCaseActorType, useCaseName model.UseCaseNameType, useCaseVersion model.SpecificationVersionType, @@ -124,7 +124,7 @@ func (r *EntityLocalImpl) AddUseCaseSupport( } // Remove a usecase with a given actor ans usecase name -func (r *EntityLocalImpl) RemoveUseCaseSupport( +func (r *EntityLocal) RemoveUseCaseSupport( actor model.UseCaseActorType, useCaseName model.UseCaseNameType, ) { @@ -146,19 +146,19 @@ func (r *EntityLocalImpl) RemoveUseCaseSupport( } // Remove all usecases -func (r *EntityLocalImpl) RemoveAllUseCaseSupports() { +func (r *EntityLocal) RemoveAllUseCaseSupports() { r.RemoveUseCaseSupport("", "") } // Remove all subscriptions -func (r *EntityLocalImpl) RemoveAllSubscriptions() { +func (r *EntityLocal) RemoveAllSubscriptions() { for _, item := range r.features { item.RemoveAllSubscriptions() } } // Remove all bindings -func (r *EntityLocalImpl) RemoveAllBindings() { +func (r *EntityLocal) RemoveAllBindings() { for _, item := range r.features { item.RemoveAllBindings() } diff --git a/spine/entity_local_test.go b/spine/entity_local_test.go index 3e0f0ee..81f7af3 100644 --- a/spine/entity_local_test.go +++ b/spine/entity_local_test.go @@ -18,11 +18,11 @@ type EntityLocalTestSuite struct { } func (suite *EntityLocalTestSuite) Test_Entity() { - device := NewDeviceLocalImpl("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) - entity := NewEntityLocalImpl(device, model.EntityTypeTypeCEM, NewAddressEntityType([]uint{1})) + device := NewDeviceLocal("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) + entity := NewEntityLocal(device, model.EntityTypeTypeCEM, NewAddressEntityType([]uint{1})) device.AddEntity(entity) - f := NewFeatureLocalImpl(1, entity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeClient) + f := NewFeatureLocal(1, entity, model.FeatureTypeTypeElectricalConnection, model.RoleTypeClient) entity.AddFeature(f) assert.Equal(suite.T(), 1, len(entity.Features())) diff --git a/spine/entity_remote.go b/spine/entity_remote.go index 329ebbe..e971f8d 100644 --- a/spine/entity_remote.go +++ b/spine/entity_remote.go @@ -5,34 +5,34 @@ import ( "github.com/enbility/spine-go/model" ) -var _ api.EntityRemote = (*EntityRemoteImpl)(nil) +var _ api.EntityRemoteInterface = (*EntityRemote)(nil) -type EntityRemoteImpl struct { - *EntityImpl - device api.DeviceRemote - features []api.FeatureRemote +type EntityRemote struct { + *Entity + device api.DeviceRemoteInterface + features []api.FeatureRemoteInterface } -func NewEntityRemoteImpl(device api.DeviceRemote, eType model.EntityTypeType, entityAddress []model.AddressEntityType) *EntityRemoteImpl { - return &EntityRemoteImpl{ - EntityImpl: NewEntity(eType, device.Address(), entityAddress), - device: device, +func NewEntityRemote(device api.DeviceRemoteInterface, eType model.EntityTypeType, entityAddress []model.AddressEntityType) *EntityRemote { + return &EntityRemote{ + Entity: NewEntity(eType, device.Address(), entityAddress), + device: device, } } -func (r *EntityRemoteImpl) Device() api.DeviceRemote { +func (r *EntityRemote) Device() api.DeviceRemoteInterface { return r.device } -func (r *EntityRemoteImpl) AddFeature(f api.FeatureRemote) { +func (r *EntityRemote) AddFeature(f api.FeatureRemoteInterface) { r.features = append(r.features, f) } -func (r *EntityRemoteImpl) Features() []api.FeatureRemote { +func (r *EntityRemote) Features() []api.FeatureRemoteInterface { return r.features } -func (r *EntityRemoteImpl) Feature(addressFeature *model.AddressFeatureType) api.FeatureRemote { +func (r *EntityRemote) Feature(addressFeature *model.AddressFeatureType) api.FeatureRemoteInterface { for _, f := range r.features { if *f.Address().Feature == *addressFeature { return f @@ -41,6 +41,6 @@ func (r *EntityRemoteImpl) Feature(addressFeature *model.AddressFeatureType) api return nil } -func (r *EntityRemoteImpl) RemoveAllFeatures() { +func (r *EntityRemote) RemoveAllFeatures() { r.features = nil } diff --git a/spine/events.go b/spine/events.go index da0237a..36c9438 100644 --- a/spine/events.go +++ b/spine/events.go @@ -10,7 +10,7 @@ var Events events type eventHandlerItem struct { Level api.EventHandlerLevel - Handler api.EventHandler + Handler api.EventHandlerInterface } type events struct { @@ -21,7 +21,7 @@ type events struct { } // will be used in EEBUS core directly to access the level EventHandlerLevelCore -func (r *events) subscribe(level api.EventHandlerLevel, handler api.EventHandler) error { +func (r *events) subscribe(level api.EventHandlerLevel, handler api.EventHandlerInterface) error { r.mu.Lock() defer r.mu.Unlock() @@ -49,12 +49,12 @@ func (r *events) subscribe(level api.EventHandlerLevel, handler api.EventHandler // // returns an error if EventHandlerLevelCore is used as // that is only allowed for internal use -func (r *events) Subscribe(handler api.EventHandler) error { +func (r *events) Subscribe(handler api.EventHandlerInterface) error { return r.subscribe(api.EventHandlerLevelApplication, handler) } // will be used in EEBUS core directly to access the level EventHandlerLevelCore -func (r *events) unsubscribe(level api.EventHandlerLevel, handler api.EventHandler) error { +func (r *events) unsubscribe(level api.EventHandlerLevel, handler api.EventHandlerInterface) error { r.mu.Lock() defer r.mu.Unlock() @@ -71,7 +71,7 @@ func (r *events) unsubscribe(level api.EventHandlerLevel, handler api.EventHandl } // Unsubscribe from getting events -func (r *events) Unsubscribe(handler api.EventHandler) error { +func (r *events) Unsubscribe(handler api.EventHandlerInterface) error { return r.unsubscribe(api.EventHandlerLevelApplication, handler) } diff --git a/spine/feature.go b/spine/feature.go index f8f76d1..9b9a01b 100644 --- a/spine/feature.go +++ b/spine/feature.go @@ -8,18 +8,18 @@ import ( "github.com/enbility/spine-go/util" ) -type FeatureImpl struct { +type Feature struct { address *model.FeatureAddressType ftype model.FeatureTypeType description *model.DescriptionType role model.RoleType - operations map[model.FunctionType]api.Operations + operations map[model.FunctionType]api.OperationsInterface } -var _ api.Feature = (*FeatureImpl)(nil) +var _ api.FeatureInterface = (*Feature)(nil) -func NewFeatureImpl(address *model.FeatureAddressType, ftype model.FeatureTypeType, role model.RoleType) *FeatureImpl { - res := &FeatureImpl{ +func NewFeature(address *model.FeatureAddressType, ftype model.FeatureTypeType, role model.RoleType) *Feature { + res := &Feature{ address: address, ftype: ftype, role: role, @@ -28,35 +28,35 @@ func NewFeatureImpl(address *model.FeatureAddressType, ftype model.FeatureTypeTy return res } -func (r *FeatureImpl) Address() *model.FeatureAddressType { +func (r *Feature) Address() *model.FeatureAddressType { return r.address } -func (r *FeatureImpl) Type() model.FeatureTypeType { +func (r *Feature) Type() model.FeatureTypeType { return r.ftype } -func (r *FeatureImpl) Role() model.RoleType { +func (r *Feature) Role() model.RoleType { return r.role } -func (r *FeatureImpl) Operations() map[model.FunctionType]api.Operations { +func (r *Feature) Operations() map[model.FunctionType]api.OperationsInterface { return r.operations } -func (r *FeatureImpl) Description() *model.DescriptionType { +func (r *Feature) Description() *model.DescriptionType { return r.description } -func (r *FeatureImpl) SetDescription(d *model.DescriptionType) { +func (r *Feature) SetDescription(d *model.DescriptionType) { r.description = d } -func (r *FeatureImpl) SetDescriptionString(s string) { +func (r *Feature) SetDescriptionString(s string) { r.description = util.Ptr(model.DescriptionType(s)) } -func (r *FeatureImpl) String() string { +func (r *Feature) String() string { if r == nil { return "" } diff --git a/spine/feature_local.go b/spine/feature_local.go index 85c4f05..bc865b3 100644 --- a/spine/feature_local.go +++ b/spine/feature_local.go @@ -12,16 +12,16 @@ import ( "github.com/enbility/spine-go/util" ) -var _ api.FeatureLocal = (*FeatureLocalImpl)(nil) +var _ api.FeatureLocalInterface = (*FeatureLocal)(nil) -type FeatureLocalImpl struct { - *FeatureImpl +type FeatureLocal struct { + *Feature muxResultCB sync.Mutex - entity api.EntityLocal - functionDataMap map[model.FunctionType]api.FunctionDataCmd - pendingRequests api.PendingRequests - resultHandler []api.FeatureResult + entity api.EntityLocalInterface + functionDataMap map[model.FunctionType]api.FunctionDataCmdInterface + pendingRequests api.PendingRequestsInterface + resultHandler []api.FeatureResultInterface resultCallback map[model.MsgCounterType]func(result api.ResultMessage) bindings []*model.FeatureAddressType // bindings to remote features @@ -30,36 +30,36 @@ type FeatureLocalImpl struct { mux sync.Mutex } -func NewFeatureLocalImpl(id uint, entity api.EntityLocal, ftype model.FeatureTypeType, role model.RoleType) *FeatureLocalImpl { - res := &FeatureLocalImpl{ - FeatureImpl: NewFeatureImpl( +func NewFeatureLocal(id uint, entity api.EntityLocalInterface, ftype model.FeatureTypeType, role model.RoleType) *FeatureLocal { + res := &FeatureLocal{ + Feature: NewFeature( featureAddressType(id, entity.Address()), ftype, role), entity: entity, - functionDataMap: make(map[model.FunctionType]api.FunctionDataCmd), + functionDataMap: make(map[model.FunctionType]api.FunctionDataCmdInterface), pendingRequests: NewPendingRequest(), resultCallback: make(map[model.MsgCounterType]func(result api.ResultMessage)), } - for _, fd := range CreateFunctionData[api.FunctionDataCmd](ftype) { + for _, fd := range CreateFunctionData[api.FunctionDataCmdInterface](ftype) { res.functionDataMap[fd.Function()] = fd } - res.operations = make(map[model.FunctionType]api.Operations) + res.operations = make(map[model.FunctionType]api.OperationsInterface) return res } -func (r *FeatureLocalImpl) Device() api.DeviceLocal { +func (r *FeatureLocal) Device() api.DeviceLocalInterface { return r.entity.Device() } -func (r *FeatureLocalImpl) Entity() api.EntityLocal { +func (r *FeatureLocal) Entity() api.EntityLocalInterface { return r.entity } // Add supported function to the feature if its role is Server or Special -func (r *FeatureLocalImpl) AddFunctionType(function model.FunctionType, read, write bool) { +func (r *FeatureLocal) AddFunctionType(function model.FunctionType, read, write bool) { if r.role != model.RoleTypeServer && r.role != model.RoleTypeSpecial { return } @@ -69,7 +69,7 @@ func (r *FeatureLocalImpl) AddFunctionType(function model.FunctionType, read, wr r.operations[function] = NewOperations(read, write) } -func (r *FeatureLocalImpl) DataCopy(function model.FunctionType) any { +func (r *FeatureLocal) DataCopy(function model.FunctionType) any { r.mux.Lock() defer r.mux.Unlock() @@ -81,7 +81,7 @@ func (r *FeatureLocalImpl) DataCopy(function model.FunctionType) any { return fctData.DataCopyAny() } -func (r *FeatureLocalImpl) SetData(function model.FunctionType, data any) { +func (r *FeatureLocal) SetData(function model.FunctionType, data any) { r.mux.Lock() fd := r.functionData(function) @@ -95,7 +95,7 @@ func (r *FeatureLocalImpl) SetData(function model.FunctionType, data any) { r.Device().NotifySubscribers(r.Address(), fd.NotifyCmdType(nil, nil, false, nil)) } -func (r *FeatureLocalImpl) UpdateData(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType) { +func (r *FeatureLocal) UpdateData(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType) { r.mux.Lock() defer r.mux.Unlock() @@ -107,18 +107,18 @@ func (r *FeatureLocalImpl) UpdateData(function model.FunctionType, data any, fil fctData.UpdateDataAny(data, filterPartial, filterDelete) } -func (r *FeatureLocalImpl) AddResultHandler(handler api.FeatureResult) { +func (r *FeatureLocal) AddResultHandler(handler api.FeatureResultInterface) { r.resultHandler = append(r.resultHandler, handler) } -func (r *FeatureLocalImpl) AddResultCallback(msgCounterReference model.MsgCounterType, function func(msg api.ResultMessage)) { +func (r *FeatureLocal) AddResultCallback(msgCounterReference model.MsgCounterType, function func(msg api.ResultMessage)) { r.muxResultCB.Lock() defer r.muxResultCB.Unlock() r.resultCallback[msgCounterReference] = function } -func (r *FeatureLocalImpl) processResultCallbacks(msgCounterReference model.MsgCounterType, msg api.ResultMessage) { +func (r *FeatureLocal) processResultCallbacks(msgCounterReference model.MsgCounterType, msg api.ResultMessage) { r.muxResultCB.Lock() defer r.muxResultCB.Unlock() @@ -132,7 +132,7 @@ func (r *FeatureLocalImpl) processResultCallbacks(msgCounterReference model.MsgC delete(r.resultCallback, msgCounterReference) } -func (r *FeatureLocalImpl) Information() *model.NodeManagementDetailedDiscoveryFeatureInformationType { +func (r *FeatureLocal) Information() *model.NodeManagementDetailedDiscoveryFeatureInformationType { var funs []model.FunctionPropertyType for fun, operations := range r.operations { var functionType model.FunctionType = model.FunctionType(fun) @@ -157,11 +157,11 @@ func (r *FeatureLocalImpl) Information() *model.NodeManagementDetailedDiscoveryF return &res } -func (r *FeatureLocalImpl) RequestData( +func (r *FeatureLocal) RequestData( function model.FunctionType, selector any, elements any, - destination api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType) { + destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { fd := r.functionData(function) if fd == nil { return nil, model.NewErrorTypeFromString("function data not found") @@ -172,9 +172,9 @@ func (r *FeatureLocalImpl) RequestData( return r.RequestDataBySenderAddress(cmd, destination.Sender(), destination.Device().Ski(), destination.Address(), destination.MaxResponseDelayDuration()) } -func (r *FeatureLocalImpl) RequestDataBySenderAddress( +func (r *FeatureLocal) RequestDataBySenderAddress( cmd model.CmdType, - sender api.Sender, + sender api.SenderInterface, deviceSki string, destinationAddress *model.FeatureAddressType, maxDelay time.Duration) (*model.MsgCounterType, *model.ErrorType) { @@ -190,15 +190,15 @@ func (r *FeatureLocalImpl) RequestDataBySenderAddress( // Wait and return the response from destination for a message with the msgCounter ID // this will block until the response is received -func (r *FeatureLocalImpl) FetchRequestData( +func (r *FeatureLocal) FetchRequestData( msgCounter model.MsgCounterType, - destination api.FeatureRemote) (any, *model.ErrorType) { + destination api.FeatureRemoteInterface) (any, *model.ErrorType) { return r.pendingRequests.GetData(destination.Device().Ski(), msgCounter) } // Subscribe to a remote feature -func (r *FeatureLocalImpl) Subscribe(remoteAddress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { +func (r *FeatureLocal) Subscribe(remoteAddress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { if remoteAddress.Device == nil { return nil, model.NewErrorTypeFromString("device not found") } @@ -224,7 +224,7 @@ func (r *FeatureLocalImpl) Subscribe(remoteAddress *model.FeatureAddressType) (* } // Remove a subscriptions to a remote feature -func (r *FeatureLocalImpl) RemoveSubscription(remoteAddress *model.FeatureAddressType) { +func (r *FeatureLocal) RemoveSubscription(remoteAddress *model.FeatureAddressType) { remoteDevice := r.entity.Device().RemoteDeviceForAddress(*remoteAddress.Device) if remoteDevice == nil { return @@ -251,14 +251,14 @@ func (r *FeatureLocalImpl) RemoveSubscription(remoteAddress *model.FeatureAddres } // Remove all subscriptions to remote features -func (r *FeatureLocalImpl) RemoveAllSubscriptions() { +func (r *FeatureLocal) RemoveAllSubscriptions() { for _, item := range r.subscriptions { r.RemoveSubscription(item) } } // Bind to a remote feature -func (r *FeatureLocalImpl) Bind(remoteAddress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { +func (r *FeatureLocal) Bind(remoteAddress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType) { remoteDevice := r.entity.Device().RemoteDeviceForAddress(*remoteAddress.Device) if remoteDevice == nil { return nil, model.NewErrorTypeFromString("device not found") @@ -281,7 +281,7 @@ func (r *FeatureLocalImpl) Bind(remoteAddress *model.FeatureAddressType) (*model } // Remove a binding to a remote feature -func (r *FeatureLocalImpl) RemoveBinding(remoteAddress *model.FeatureAddressType) { +func (r *FeatureLocal) RemoveBinding(remoteAddress *model.FeatureAddressType) { remoteDevice := r.entity.Device().RemoteDeviceForAddress(*remoteAddress.Device) if remoteDevice == nil { return @@ -308,19 +308,19 @@ func (r *FeatureLocalImpl) RemoveBinding(remoteAddress *model.FeatureAddressType } // Remove all subscriptions to remote features -func (r *FeatureLocalImpl) RemoveAllBindings() { +func (r *FeatureLocal) RemoveAllBindings() { for _, item := range r.bindings { r.RemoveBinding(item) } } // Send a notification message with the current data of function to the destination -func (r *FeatureLocalImpl) NotifyData( +func (r *FeatureLocal) NotifyData( function model.FunctionType, deleteSelector, partialSelector any, partialWithoutSelector bool, deleteElements any, - destination api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType) { + destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { fd := r.functionData(function) if fd == nil { return nil, model.NewErrorTypeFromString("function data not found") @@ -336,11 +336,11 @@ func (r *FeatureLocalImpl) NotifyData( } // Send a write message with provided data of function to the destination -func (r *FeatureLocalImpl) WriteData( +func (r *FeatureLocal) WriteData( function model.FunctionType, deleteSelector, partialSelector any, deleteElements any, - destination api.FeatureRemote) (*model.MsgCounterType, *model.ErrorType) { + destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType) { fd := r.functionData(function) if fd == nil { return nil, model.NewErrorTypeFromString("function data not found") @@ -355,7 +355,7 @@ func (r *FeatureLocalImpl) WriteData( return msgCounter, nil } -func (r *FeatureLocalImpl) HandleMessage(message *api.Message) *model.ErrorType { +func (r *FeatureLocal) HandleMessage(message *api.Message) *model.ErrorType { if message.Cmd.ResultData != nil { return r.processResult(message) } @@ -392,7 +392,7 @@ func (r *FeatureLocalImpl) HandleMessage(message *api.Message) *model.ErrorType return nil } -func (r *FeatureLocalImpl) processResult(message *api.Message) *model.ErrorType { +func (r *FeatureLocal) processResult(message *api.Message) *model.ErrorType { switch message.CmdClassifier { case model.CmdClassifierTypeResult: if *message.Cmd.ResultData.ErrorNumber != model.ErrorNumberTypeNoError { @@ -437,7 +437,7 @@ func (r *FeatureLocalImpl) processResult(message *api.Message) *model.ErrorType } } -func (r *FeatureLocalImpl) processRead(function model.FunctionType, requestHeader *model.HeaderType, featureRemote api.FeatureRemote) *model.ErrorType { +func (r *FeatureLocal) processRead(function model.FunctionType, requestHeader *model.HeaderType, featureRemote api.FeatureRemoteInterface) *model.ErrorType { // is this a read request to a local server/special feature? if r.role == model.RoleTypeClient { // Read requests to a client feature are not allowed @@ -457,7 +457,7 @@ func (r *FeatureLocalImpl) processRead(function model.FunctionType, requestHeade return nil } -func (r *FeatureLocalImpl) processReply(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType, requestHeader *model.HeaderType, featureRemote api.FeatureRemote) *model.ErrorType { +func (r *FeatureLocal) processReply(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType, requestHeader *model.HeaderType, featureRemote api.FeatureRemoteInterface) *model.ErrorType { featureRemote.UpdateData(function, data, filterPartial, filterDelete) if requestHeader != nil && requestHeader.MsgCounterReference != nil { @@ -483,7 +483,7 @@ func (r *FeatureLocalImpl) processReply(function model.FunctionType, data any, f return nil } -func (r *FeatureLocalImpl) processNotify(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType, featureRemote api.FeatureRemote) *model.ErrorType { +func (r *FeatureLocal) processNotify(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType, featureRemote api.FeatureRemoteInterface) *model.ErrorType { featureRemote.UpdateData(function, data, filterPartial, filterDelete) payload := api.EventPayload{ @@ -501,7 +501,7 @@ func (r *FeatureLocalImpl) processNotify(function model.FunctionType, data any, return nil } -func (r *FeatureLocalImpl) processWrite(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType, featureRemote api.FeatureRemote) *model.ErrorType { +func (r *FeatureLocal) processWrite(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType, featureRemote api.FeatureRemoteInterface) *model.ErrorType { r.UpdateData(function, data, filterPartial, filterDelete) payload := api.EventPayload{ @@ -521,7 +521,7 @@ func (r *FeatureLocalImpl) processWrite(function model.FunctionType, data any, f return nil } -func (r *FeatureLocalImpl) functionData(function model.FunctionType) api.FunctionDataCmd { +func (r *FeatureLocal) functionData(function model.FunctionType) api.FunctionDataCmdInterface { fd, found := r.functionDataMap[function] if !found { logging.Log().Errorf("Data was not found for function '%s'", function) diff --git a/spine/feature_local_test.go b/spine/feature_local_test.go index 19ddfd4..7bfc07b 100644 --- a/spine/feature_local_test.go +++ b/spine/feature_local_test.go @@ -18,18 +18,18 @@ func TestDeviceClassificationSuite(t *testing.T) { type DeviceClassificationTestSuite struct { suite.Suite - senderMock *mocks.Sender - localDevice *DeviceLocalImpl - localEntity *EntityLocalImpl + senderMock *mocks.SenderInterface + localDevice *DeviceLocal + localEntity *EntityLocal function, serverWriteFunction model.FunctionType featureType, subFeatureType model.FeatureTypeType msgCounter model.MsgCounterType - remoteFeature, remoteServerFeature, remoteSubFeature api.FeatureRemote - localFeature, localServerFeature, localServerFeatureWrite api.FeatureLocal + remoteFeature, remoteServerFeature, remoteSubFeature api.FeatureRemoteInterface + localFeature, localServerFeature, localServerFeatureWrite api.FeatureLocalInterface } func (suite *DeviceClassificationTestSuite) BeforeTest(suiteName, testName string) { - suite.senderMock = mocks.NewSender(suite.T()) + suite.senderMock = mocks.NewSenderInterface(suite.T()) suite.function = model.FunctionTypeDeviceClassificationManufacturerData suite.featureType = model.FeatureTypeTypeDeviceClassification suite.subFeatureType = model.FeatureTypeTypeLoadControl diff --git a/spine/feature_remote.go b/spine/feature_remote.go index 517df0e..6414115 100644 --- a/spine/feature_remote.go +++ b/spine/feature_remote.go @@ -14,37 +14,37 @@ import ( const defaultMaxResponseDelay = time.Duration(time.Second * 10) -var _ api.FeatureRemote = (*FeatureRemoteImpl)(nil) +var _ api.FeatureRemoteInterface = (*FeatureRemote)(nil) -type FeatureRemoteImpl struct { - *FeatureImpl +type FeatureRemote struct { + *Feature - entity api.EntityRemote - functionDataMap map[model.FunctionType]api.FunctionData + entity api.EntityRemoteInterface + functionDataMap map[model.FunctionType]api.FunctionDataInterface maxResponseDelay *time.Duration mux sync.Mutex } -func NewFeatureRemoteImpl(id uint, entity api.EntityRemote, ftype model.FeatureTypeType, role model.RoleType) *FeatureRemoteImpl { - res := &FeatureRemoteImpl{ - FeatureImpl: NewFeatureImpl( +func NewFeatureRemote(id uint, entity api.EntityRemoteInterface, ftype model.FeatureTypeType, role model.RoleType) *FeatureRemote { + res := &FeatureRemote{ + Feature: NewFeature( featureAddressType(id, entity.Address()), ftype, role), entity: entity, - functionDataMap: make(map[model.FunctionType]api.FunctionData), + functionDataMap: make(map[model.FunctionType]api.FunctionDataInterface), } - for _, fd := range CreateFunctionData[api.FunctionData](ftype) { + for _, fd := range CreateFunctionData[api.FunctionDataInterface](ftype) { res.functionDataMap[fd.Function()] = fd } - res.operations = make(map[model.FunctionType]api.Operations) + res.operations = make(map[model.FunctionType]api.OperationsInterface) return res } -func (r *FeatureRemoteImpl) DataCopy(function model.FunctionType) any { +func (r *FeatureRemote) DataCopy(function model.FunctionType) any { r.mux.Lock() defer r.mux.Unlock() @@ -56,7 +56,7 @@ func (r *FeatureRemoteImpl) DataCopy(function model.FunctionType) any { return r.functionData(function).DataCopyAny() } -func (r *FeatureRemoteImpl) SetData(function model.FunctionType, data any) { +func (r *FeatureRemote) SetData(function model.FunctionType, data any) { r.mux.Lock() fd := r.functionData(function) @@ -67,7 +67,7 @@ func (r *FeatureRemoteImpl) SetData(function model.FunctionType, data any) { r.mux.Unlock() } -func (r *FeatureRemoteImpl) UpdateData(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType) { +func (r *FeatureRemote) UpdateData(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType) { r.mux.Lock() defer r.mux.Unlock() @@ -79,20 +79,20 @@ func (r *FeatureRemoteImpl) UpdateData(function model.FunctionType, data any, fi // TODO: fire event } -func (r *FeatureRemoteImpl) Sender() api.Sender { +func (r *FeatureRemote) Sender() api.SenderInterface { return r.Device().Sender() } -func (r *FeatureRemoteImpl) Device() api.DeviceRemote { +func (r *FeatureRemote) Device() api.DeviceRemoteInterface { return r.entity.Device() } -func (r *FeatureRemoteImpl) Entity() api.EntityRemote { +func (r *FeatureRemote) Entity() api.EntityRemoteInterface { return r.entity } -func (r *FeatureRemoteImpl) SetOperations(functions []model.FunctionPropertyType) { - r.operations = make(map[model.FunctionType]api.Operations) +func (r *FeatureRemote) SetOperations(functions []model.FunctionPropertyType) { + r.operations = make(map[model.FunctionType]api.OperationsInterface) for _, sf := range functions { if sf.PossibleOperations == nil { continue @@ -101,7 +101,7 @@ func (r *FeatureRemoteImpl) SetOperations(functions []model.FunctionPropertyType } } -func (r *FeatureRemoteImpl) SetMaxResponseDelay(delay *model.MaxResponseDelayType) { +func (r *FeatureRemote) SetMaxResponseDelay(delay *model.MaxResponseDelayType) { if delay == nil { return } @@ -113,14 +113,14 @@ func (r *FeatureRemoteImpl) SetMaxResponseDelay(delay *model.MaxResponseDelayTyp } } -func (r *FeatureRemoteImpl) MaxResponseDelayDuration() time.Duration { +func (r *FeatureRemote) MaxResponseDelayDuration() time.Duration { if r.maxResponseDelay != nil { return *r.maxResponseDelay } return defaultMaxResponseDelay } -func (r *FeatureRemoteImpl) functionData(function model.FunctionType) api.FunctionData { +func (r *FeatureRemote) functionData(function model.FunctionType) api.FunctionDataInterface { fd, found := r.functionDataMap[function] if !found { panic(fmt.Errorf("Data was not found for function '%s'", function)) diff --git a/spine/function_data.go b/spine/function_data.go index c95749d..f5b8257 100644 --- a/spine/function_data.go +++ b/spine/function_data.go @@ -10,7 +10,7 @@ import ( "github.com/enbility/spine-go/util" ) -var _ api.FunctionData = (*FunctionDataImpl[int])(nil) +var _ api.FunctionDataInterface = (*FunctionDataImpl[int])(nil) type FunctionDataImpl[T any] struct { functionType model.FunctionType diff --git a/spine/function_data_cmd.go b/spine/function_data_cmd.go index 0c3dfeb..f0a377c 100644 --- a/spine/function_data_cmd.go +++ b/spine/function_data_cmd.go @@ -6,7 +6,7 @@ import ( "github.com/enbility/spine-go/util" ) -var _ api.FunctionDataCmd = (*FunctionDataCmdImpl[int])(nil) +var _ api.FunctionDataCmdInterface = (*FunctionDataCmdImpl[int])(nil) type FunctionDataCmdImpl[T any] struct { *FunctionDataImpl[T] diff --git a/spine/function_data_factory.go b/spine/function_data_factory.go index 13947e3..90f147a 100644 --- a/spine/function_data_factory.go +++ b/spine/function_data_factory.go @@ -309,9 +309,9 @@ func CreateFunctionData[F any](featureType model.FeatureTypeType) []F { func createFunctionData[T any, F any](functionType model.FunctionType) F { x := any(new(F)) switch x.(type) { - case *api.FunctionDataCmd: + case *api.FunctionDataCmdInterface: return any(NewFunctionDataCmd[T](functionType)).(F) - case *api.FunctionData: + case *api.FunctionDataInterface: return any(NewFunctionData[T](functionType)).(F) default: panic(fmt.Errorf("only FunctionData and FunctionDataCmd are supported")) diff --git a/spine/function_data_factory_test.go b/spine/function_data_factory_test.go index 9ac4df2..213e723 100644 --- a/spine/function_data_factory_test.go +++ b/spine/function_data_factory_test.go @@ -9,35 +9,35 @@ import ( ) func TestFunctionDataFactory_FunctionData(t *testing.T) { - result := CreateFunctionData[api.FunctionData](model.FeatureTypeTypeBill) + result := CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeBill) assert.Equal(t, 3, len(result)) assert.IsType(t, &FunctionDataImpl[model.BillDescriptionListDataType]{}, result[0]) assert.IsType(t, &FunctionDataImpl[model.BillConstraintsListDataType]{}, result[1]) assert.IsType(t, &FunctionDataImpl[model.BillListDataType]{}, result[2]) - result = CreateFunctionData[api.FunctionData](model.FeatureTypeTypeDeviceClassification) + result = CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeDeviceClassification) assert.Equal(t, 2, len(result)) assert.IsType(t, &FunctionDataImpl[model.DeviceClassificationManufacturerDataType]{}, result[0]) assert.IsType(t, &FunctionDataImpl[model.DeviceClassificationUserDataType]{}, result[1]) - result = CreateFunctionData[api.FunctionData](model.FeatureTypeTypeDeviceConfiguration) + result = CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeDeviceConfiguration) assert.Equal(t, 3, len(result)) assert.IsType(t, &FunctionDataImpl[model.DeviceConfigurationKeyValueConstraintsListDataType]{}, result[0]) assert.IsType(t, &FunctionDataImpl[model.DeviceConfigurationKeyValueDescriptionListDataType]{}, result[1]) assert.IsType(t, &FunctionDataImpl[model.DeviceConfigurationKeyValueListDataType]{}, result[2]) - result = CreateFunctionData[api.FunctionData](model.FeatureTypeTypeDeviceDiagnosis) + result = CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeDeviceDiagnosis) assert.Equal(t, 3, len(result)) assert.IsType(t, &FunctionDataImpl[model.DeviceDiagnosisStateDataType]{}, result[0]) assert.IsType(t, &FunctionDataImpl[model.DeviceDiagnosisHeartbeatDataType]{}, result[1]) - result = CreateFunctionData[api.FunctionData](model.FeatureTypeTypeElectricalConnection) + result = CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeElectricalConnection) assert.Equal(t, 6, len(result)) assert.IsType(t, &FunctionDataImpl[model.ElectricalConnectionDescriptionListDataType]{}, result[0]) assert.IsType(t, &FunctionDataImpl[model.ElectricalConnectionParameterDescriptionListDataType]{}, result[1]) assert.IsType(t, &FunctionDataImpl[model.ElectricalConnectionPermittedValueSetListDataType]{}, result[2]) - result = CreateFunctionData[api.FunctionData](model.FeatureTypeTypeHvac) + result = CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeHvac) assert.Equal(t, 8, len(result)) assert.IsType(t, &FunctionDataImpl[model.HvacOperationModeDescriptionDataType]{}, result[0]) assert.IsType(t, &FunctionDataImpl[model.HvacOverrunDescriptionListDataType]{}, result[1]) @@ -45,49 +45,49 @@ func TestFunctionDataFactory_FunctionData(t *testing.T) { assert.IsType(t, &FunctionDataImpl[model.HvacSystemFunctionDescriptionDataType]{}, result[3]) assert.IsType(t, &FunctionDataImpl[model.HvacSystemFunctionListDataType]{}, result[4]) - result = CreateFunctionData[api.FunctionData](model.FeatureTypeTypeIdentification) + result = CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeIdentification) assert.Equal(t, 3, len(result)) assert.IsType(t, &FunctionDataImpl[model.IdentificationListDataType]{}, result[0]) - result = CreateFunctionData[api.FunctionData](model.FeatureTypeTypeIncentiveTable) + result = CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeIncentiveTable) assert.Equal(t, 3, len(result)) assert.IsType(t, &FunctionDataImpl[model.IncentiveTableDescriptionDataType]{}, result[0]) assert.IsType(t, &FunctionDataImpl[model.IncentiveTableConstraintsDataType]{}, result[1]) assert.IsType(t, &FunctionDataImpl[model.IncentiveTableDataType]{}, result[2]) - result = CreateFunctionData[api.FunctionData](model.FeatureTypeTypeLoadControl) + result = CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeLoadControl) assert.Equal(t, 6, len(result)) assert.IsType(t, &FunctionDataImpl[model.LoadControlEventListDataType]{}, result[0]) assert.IsType(t, &FunctionDataImpl[model.LoadControlLimitConstraintsListDataType]{}, result[1]) assert.IsType(t, &FunctionDataImpl[model.LoadControlLimitDescriptionListDataType]{}, result[2]) assert.IsType(t, &FunctionDataImpl[model.LoadControlLimitListDataType]{}, result[3]) - result = CreateFunctionData[api.FunctionData](model.FeatureTypeTypeMeasurement) + result = CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeMeasurement) assert.Equal(t, 5, len(result)) assert.IsType(t, &FunctionDataImpl[model.MeasurementListDataType]{}, result[0]) assert.IsType(t, &FunctionDataImpl[model.MeasurementDescriptionListDataType]{}, result[1]) assert.IsType(t, &FunctionDataImpl[model.MeasurementConstraintsListDataType]{}, result[2]) assert.IsType(t, &FunctionDataImpl[model.MeasurementThresholdRelationListDataType]{}, result[3]) - result = CreateFunctionData[api.FunctionData](model.FeatureTypeTypeTimeSeries) + result = CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeTimeSeries) assert.Equal(t, 3, len(result)) assert.IsType(t, &FunctionDataImpl[model.TimeSeriesDescriptionListDataType]{}, result[0]) assert.IsType(t, &FunctionDataImpl[model.TimeSeriesConstraintsListDataType]{}, result[1]) assert.IsType(t, &FunctionDataImpl[model.TimeSeriesListDataType]{}, result[2]) - result = CreateFunctionData[api.FunctionData](model.FeatureTypeTypeGeneric) + result = CreateFunctionData[api.FunctionDataInterface](model.FeatureTypeTypeGeneric) assert.Equal(t, 124, len(result)) } func TestFunctionDataFactory_FunctionDataCmd(t *testing.T) { - result := CreateFunctionData[api.FunctionDataCmd](model.FeatureTypeTypeDeviceClassification) + result := CreateFunctionData[api.FunctionDataCmdInterface](model.FeatureTypeTypeDeviceClassification) assert.Equal(t, 2, len(result)) assert.IsType(t, &FunctionDataCmdImpl[model.DeviceClassificationManufacturerDataType]{}, result[0]) assert.IsType(t, &FunctionDataCmdImpl[model.DeviceClassificationUserDataType]{}, result[1]) } func TestFunctionDataFactory_NodeMgmtFeatureType(t *testing.T) { - result := CreateFunctionData[api.FunctionDataCmd](model.FeatureTypeTypeNodeManagement) + result := CreateFunctionData[api.FunctionDataCmdInterface](model.FeatureTypeTypeNodeManagement) assert.Equal(t, 3, len(result)) } diff --git a/spine/heartbeat_manager.go b/spine/heartbeat_manager.go index 2ee1283..81fa624 100644 --- a/spine/heartbeat_manager.go +++ b/spine/heartbeat_manager.go @@ -10,22 +10,22 @@ import ( "github.com/enbility/spine-go/model" ) -type HeartbeatManagerImpl struct { - localDevice api.DeviceLocal - localEntity api.EntityLocal - localFeature api.FeatureLocal +type HeartbeatManager struct { + localDevice api.DeviceLocalInterface + localEntity api.EntityLocalInterface + localFeature api.FeatureLocalInterface heartBeatNum uint64 // see https://github.com/golang/go/issues/11891 stopHeartbeatC chan struct{} stopMux sync.Mutex - subscriptionManager api.SubscriptionManager + subscriptionManager api.SubscriptionManagerInterface heartBeatTimeout *model.DurationType } // Create a new Heartbeat Manager which handles sending of heartbeats -func NewHeartbeatManager(localDevice api.DeviceLocal, subscriptionManager api.SubscriptionManager, timeout time.Duration) *HeartbeatManagerImpl { - h := &HeartbeatManagerImpl{ +func NewHeartbeatManager(localDevice api.DeviceLocalInterface, subscriptionManager api.SubscriptionManagerInterface, timeout time.Duration) *HeartbeatManager { + h := &HeartbeatManager{ localDevice: localDevice, subscriptionManager: subscriptionManager, heartBeatTimeout: model.NewDurationType(timeout), @@ -34,7 +34,7 @@ func NewHeartbeatManager(localDevice api.DeviceLocal, subscriptionManager api.Su return h } -func (c *HeartbeatManagerImpl) IsHeartbeatRunning() bool { +func (c *HeartbeatManager) IsHeartbeatRunning() bool { c.stopMux.Lock() defer c.stopMux.Unlock() @@ -47,7 +47,7 @@ func (c *HeartbeatManagerImpl) IsHeartbeatRunning() bool { // check if there are any heartbeat subscriptions left, otherwise stop creating new ones // or start creating heartbeats again if needed -func (c *HeartbeatManagerImpl) UpdateHeartbeatOnSubscriptions() { +func (c *HeartbeatManager) UpdateHeartbeatOnSubscriptions() { if c.localEntity == nil { return } @@ -67,7 +67,7 @@ func (c *HeartbeatManagerImpl) UpdateHeartbeatOnSubscriptions() { } } -func (c *HeartbeatManagerImpl) SetLocalFeature(entity api.EntityLocal, feature api.FeatureLocal) { +func (c *HeartbeatManager) SetLocalFeature(entity api.EntityLocalInterface, feature api.FeatureLocalInterface) { c.localEntity = entity c.localFeature = feature } @@ -76,7 +76,7 @@ func (c *HeartbeatManagerImpl) SetLocalFeature(entity api.EntityLocal, feature a // Make sure the a required FeatureTypeTypeDeviceDiagnosis with the role server is present // otherwise this will end with an error // Note: Remote features need to have a subscription to get notifications -func (c *HeartbeatManagerImpl) StartHeartbeat() error { +func (c *HeartbeatManager) StartHeartbeat() error { if c.localEntity == nil { return errors.New("unknown entity") } @@ -98,13 +98,13 @@ func (c *HeartbeatManagerImpl) StartHeartbeat() error { // Stop updating heartbeat data // Note: No active subscribers will get any further notifications! -func (c *HeartbeatManagerImpl) StopHeartbeat() { +func (c *HeartbeatManager) StopHeartbeat() { if c.IsHeartbeatRunning() { close(c.stopHeartbeatC) } } -func (c *HeartbeatManagerImpl) heartbeatData(t time.Time, counter *uint64) *model.DeviceDiagnosisHeartbeatDataType { +func (c *HeartbeatManager) heartbeatData(t time.Time, counter *uint64) *model.DeviceDiagnosisHeartbeatDataType { timestamp := t.UTC().Format(time.RFC3339) return &model.DeviceDiagnosisHeartbeatDataType{ @@ -114,7 +114,7 @@ func (c *HeartbeatManagerImpl) heartbeatData(t time.Time, counter *uint64) *mode } } -func (c *HeartbeatManagerImpl) updateHearbeatData(stopC chan struct{}, d time.Duration) { +func (c *HeartbeatManager) updateHearbeatData(stopC chan struct{}, d time.Duration) { ticker := time.NewTicker(d) for { select { @@ -131,7 +131,7 @@ func (c *HeartbeatManagerImpl) updateHearbeatData(stopC chan struct{}, d time.Du } } -func (c *HeartbeatManagerImpl) isHeartbeatClosed() bool { +func (c *HeartbeatManager) isHeartbeatClosed() bool { select { case <-c.stopHeartbeatC: return true @@ -142,7 +142,7 @@ func (c *HeartbeatManagerImpl) isHeartbeatClosed() bool { } // TODO heartBeatCounter should be global on CEM level, not on connection level -func (c *HeartbeatManagerImpl) heartBeatCounter() *uint64 { +func (c *HeartbeatManager) heartBeatCounter() *uint64 { i := atomic.AddUint64(&c.heartBeatNum, 1) return &i } diff --git a/spine/heartbeat_manager_test.go b/spine/heartbeat_manager_test.go index 26b1eba..29a3100 100644 --- a/spine/heartbeat_manager_test.go +++ b/spine/heartbeat_manager_test.go @@ -18,19 +18,19 @@ func TestHeartbeatManagerSuite(t *testing.T) { type HeartBeatManagerSuite struct { suite.Suite - localDevice api.DeviceLocal - remoteDevice api.DeviceRemote - sut api.HeartbeatManager + localDevice api.DeviceLocalInterface + remoteDevice api.DeviceRemoteInterface + sut api.HeartbeatManagerInterface } -func (suite *HeartBeatManagerSuite) WriteSpineMessage([]byte) {} +func (suite *HeartBeatManagerSuite) WriteShipMessageWithPayload([]byte) {} func (suite *HeartBeatManagerSuite) SetupSuite() { - suite.localDevice = NewDeviceLocalImpl("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) + suite.localDevice = NewDeviceLocal("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) ski := "test" sender := NewSender(suite) - suite.remoteDevice = NewDeviceRemoteImpl(suite.localDevice, ski, sender) + suite.remoteDevice = NewDeviceRemote(suite.localDevice, ski, sender) _ = suite.localDevice.SetupRemoteDevice(ski, suite) @@ -43,16 +43,16 @@ func (suite *HeartBeatManagerSuite) Test_HeartbeatFailure() { } func (suite *HeartBeatManagerSuite) Test_HeartbeatSuccess() { - entity := NewEntityLocalImpl(suite.localDevice, model.EntityTypeTypeCEM, []model.AddressEntityType{1}) + entity := NewEntityLocal(suite.localDevice, model.EntityTypeTypeCEM, []model.AddressEntityType{1}) suite.localDevice.AddEntity(entity) localFeature := entity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) entity.AddFeature(localFeature) - remoteEntity := NewEntityRemoteImpl(suite.remoteDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{1}) + remoteEntity := NewEntityRemote(suite.remoteDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{1}) suite.remoteDevice.AddEntity(remoteEntity) - remoteFeature := NewFeatureRemoteImpl(remoteEntity.NextFeatureId(), remoteEntity, model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeClient) + remoteFeature := NewFeatureRemote(remoteEntity.NextFeatureId(), remoteEntity, model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeClient) remoteEntity.AddFeature(remoteFeature) subscrRequest := &model.SubscriptionManagementRequestCallType{ diff --git a/spine/helper_test.go b/spine/helper_test.go index f9213c1..9a394ea 100644 --- a/spine/helper_test.go +++ b/spine/helper_test.go @@ -28,9 +28,9 @@ type WriteMessageHandler struct { mux sync.Mutex } -var _ shipapi.SpineDataConnection = (*WriteMessageHandler)(nil) +var _ shipapi.ShipConnectionDataWriterInterface = (*WriteMessageHandler)(nil) -func (t *WriteMessageHandler) WriteSpineMessage(message []byte) { +func (t *WriteMessageHandler) WriteShipMessageWithPayload(message []byte) { t.mux.Lock() defer t.mux.Unlock() @@ -168,20 +168,20 @@ func waitForAck(t *testing.T, msgCounterReference *model.MsgCounterType, writeHa } } -func createLocalDeviceAndEntity(entityId uint) (*DeviceLocalImpl, *EntityLocalImpl) { - localDevice := NewDeviceLocalImpl("Vendor", "DeviceName", "SerialNumber", "DeviceCode", "Address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) +func createLocalDeviceAndEntity(entityId uint) (*DeviceLocal, *EntityLocal) { + localDevice := NewDeviceLocal("Vendor", "DeviceName", "SerialNumber", "DeviceCode", "Address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) localDevice.address = util.Ptr(model.AddressDeviceType("Address")) - localEntity := NewEntityLocalImpl(localDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{model.AddressEntityType(entityId)}) + localEntity := NewEntityLocal(localDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{model.AddressEntityType(entityId)}) localDevice.AddEntity(localEntity) return localDevice, localEntity } -func createLocalFeatures(localDevice *DeviceLocalImpl, localEntity *EntityLocalImpl, featureType model.FeatureTypeType, writeFunction model.FunctionType) (api.FeatureLocal, api.FeatureLocal) { - localFeature := NewFeatureLocalImpl(localEntity.NextFeatureId(), localEntity, featureType, model.RoleTypeClient) +func createLocalFeatures(localDevice *DeviceLocal, localEntity *EntityLocal, featureType model.FeatureTypeType, writeFunction model.FunctionType) (api.FeatureLocalInterface, api.FeatureLocalInterface) { + localFeature := NewFeatureLocal(localEntity.NextFeatureId(), localEntity, featureType, model.RoleTypeClient) localEntity.AddFeature(localFeature) - localServerFeature := NewFeatureLocalImpl(localEntity.NextFeatureId(), localEntity, featureType, model.RoleTypeServer) + localServerFeature := NewFeatureLocal(localEntity.NextFeatureId(), localEntity, featureType, model.RoleTypeServer) if len(string(writeFunction)) > 0 { localServerFeature.AddFunctionType(writeFunction, true, true) } @@ -190,19 +190,19 @@ func createLocalFeatures(localDevice *DeviceLocalImpl, localEntity *EntityLocalI return localFeature, localServerFeature } -func createRemoteDevice(localDevice *DeviceLocalImpl, sender api.Sender) *DeviceRemoteImpl { - remoteDevice := NewDeviceRemoteImpl(localDevice, "ski", sender) +func createRemoteDevice(localDevice *DeviceLocal, sender api.SenderInterface) *DeviceRemote { + remoteDevice := NewDeviceRemote(localDevice, "ski", sender) remoteDevice.address = util.Ptr(model.AddressDeviceType("Address")) return remoteDevice } -func createRemoteEntityAndFeature(localDevice *DeviceLocalImpl, remoteDevice *DeviceRemoteImpl, entityId uint, featureType model.FeatureTypeType) (api.FeatureRemote, api.FeatureRemote) { - remoteEntity := NewEntityRemoteImpl(remoteDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{model.AddressEntityType(entityId)}) +func createRemoteEntityAndFeature(localDevice *DeviceLocal, remoteDevice *DeviceRemote, entityId uint, featureType model.FeatureTypeType) (api.FeatureRemoteInterface, api.FeatureRemoteInterface) { + remoteEntity := NewEntityRemote(remoteDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{model.AddressEntityType(entityId)}) remoteDevice.AddEntity(remoteEntity) - remoteFeature := NewFeatureRemoteImpl(remoteEntity.NextFeatureId(), remoteEntity, featureType, model.RoleTypeClient) + remoteFeature := NewFeatureRemote(remoteEntity.NextFeatureId(), remoteEntity, featureType, model.RoleTypeClient) remoteEntity.AddFeature(remoteFeature) - remoteServerFeature := NewFeatureRemoteImpl(remoteEntity.NextFeatureId(), remoteEntity, featureType, model.RoleTypeServer) + remoteServerFeature := NewFeatureRemote(remoteEntity.NextFeatureId(), remoteEntity, featureType, model.RoleTypeServer) remoteEntity.AddFeature(remoteServerFeature) return remoteFeature, remoteServerFeature diff --git a/spine/nodemanagement.go b/spine/nodemanagement.go index fcbeee7..428c8a5 100644 --- a/spine/nodemanagement.go +++ b/spine/nodemanagement.go @@ -18,16 +18,16 @@ func NodeManagementAddress(deviceAdress *model.AddressDeviceType) *model.Feature } } -var _ api.NodeManagement = (*NodeManagementImpl)(nil) +var _ api.NodeManagementInterface = (*NodeManagement)(nil) -type NodeManagementImpl struct { - *FeatureLocalImpl - entity api.EntityLocal +type NodeManagement struct { + *FeatureLocal + entity api.EntityLocalInterface } -func NewNodeManagementImpl(id uint, entity api.EntityLocal) *NodeManagementImpl { - f := &NodeManagementImpl{ - FeatureLocalImpl: NewFeatureLocalImpl( +func NewNodeManagement(id uint, entity api.EntityLocalInterface) *NodeManagement { + f := &NodeManagement{ + FeatureLocal: NewFeatureLocal( id, entity, model.FeatureTypeTypeNodeManagement, model.RoleTypeSpecial), @@ -49,11 +49,11 @@ func NewNodeManagementImpl(id uint, entity api.EntityLocal) *NodeManagementImpl return f } -func (r *NodeManagementImpl) Device() api.DeviceLocal { +func (r *NodeManagement) Device() api.DeviceLocalInterface { return r.entity.Device() } -func (r *NodeManagementImpl) HandleMessage(message *api.Message) *model.ErrorType { +func (r *NodeManagement) HandleMessage(message *api.Message) *model.ErrorType { switch { case message.Cmd.ResultData != nil: if err := r.processResult(message); err != nil { diff --git a/spine/nodemanagement_binding.go b/spine/nodemanagement_binding.go index b07c6a7..9daf070 100644 --- a/spine/nodemanagement_binding.go +++ b/spine/nodemanagement_binding.go @@ -29,7 +29,7 @@ func NewNodeManagementBindingDeleteCallType(clientAddress *model.FeatureAddressT } // route bindings request calls to the appropriate feature implementation and add the bindings to the current list -func (r *NodeManagementImpl) processReadBindingData(message *api.Message) error { +func (r *NodeManagement) processReadBindingData(message *api.Message) error { var remoteDeviceBindings []model.BindingManagementEntryDataType remoteDeviceBindingEntries := r.Device().BindingManager().Bindings(message.FeatureRemote.Device()) @@ -50,7 +50,7 @@ func (r *NodeManagementImpl) processReadBindingData(message *api.Message) error return message.FeatureRemote.Sender().Reply(message.RequestHeader, r.Address(), cmd) } -func (r *NodeManagementImpl) handleMsgBindingData(message *api.Message) error { +func (r *NodeManagement) handleMsgBindingData(message *api.Message) error { switch message.CmdClassifier { case model.CmdClassifierTypeCall: return r.processReadBindingData(message) @@ -60,7 +60,7 @@ func (r *NodeManagementImpl) handleMsgBindingData(message *api.Message) error { } } -func (r *NodeManagementImpl) handleMsgBindingRequestCall(message *api.Message, data *model.NodeManagementBindingRequestCallType) error { +func (r *NodeManagement) handleMsgBindingRequestCall(message *api.Message, data *model.NodeManagementBindingRequestCallType) error { switch message.CmdClassifier { case model.CmdClassifierTypeCall: return r.Device().BindingManager().AddBinding(message.FeatureRemote.Device(), *data.BindingRequest) @@ -70,7 +70,7 @@ func (r *NodeManagementImpl) handleMsgBindingRequestCall(message *api.Message, d } } -func (r *NodeManagementImpl) handleMsgBindingDeleteCall(message *api.Message, data *model.NodeManagementBindingDeleteCallType) error { +func (r *NodeManagement) handleMsgBindingDeleteCall(message *api.Message, data *model.NodeManagementBindingDeleteCallType) error { switch message.CmdClassifier { case model.CmdClassifierTypeCall: return r.Device().BindingManager().RemoveBinding(*data.BindingDelete, message.FeatureRemote.Device()) diff --git a/spine/nodemanagement_destinationlist.go b/spine/nodemanagement_destinationlist.go index a22e171..f3ca25f 100644 --- a/spine/nodemanagement_destinationlist.go +++ b/spine/nodemanagement_destinationlist.go @@ -8,11 +8,11 @@ import ( "github.com/enbility/spine-go/model" ) -func (r *NodeManagementImpl) RequestDestinationListData(remoteDeviceAddress *model.AddressDeviceType, sender api.Sender) (*model.MsgCounterType, *model.ErrorType) { +func (r *NodeManagement) RequestDestinationListData(remoteDeviceAddress *model.AddressDeviceType, sender api.SenderInterface) (*model.MsgCounterType, *model.ErrorType) { return nil, model.NewErrorTypeFromString("Not implemented") } -func (r *NodeManagementImpl) processReadDestinationListData(featureRemote api.FeatureRemote, requestHeader *model.HeaderType) error { +func (r *NodeManagement) processReadDestinationListData(featureRemote api.FeatureRemoteInterface, requestHeader *model.HeaderType) error { data := []model.NodeManagementDestinationDataType{ r.Device().DestinationData(), } @@ -27,11 +27,11 @@ func (r *NodeManagementImpl) processReadDestinationListData(featureRemote api.Fe return featureRemote.Sender().Reply(requestHeader, r.Address(), cmd) } -func (r *NodeManagementImpl) processReplyDestinationListData(message *api.Message, data model.NodeManagementDestinationListDataType) error { +func (r *NodeManagement) processReplyDestinationListData(message *api.Message, data model.NodeManagementDestinationListDataType) error { return errors.New("Not implemented") } -func (r *NodeManagementImpl) handleMsgDestinationListData(message *api.Message, data *model.NodeManagementDestinationListDataType) error { +func (r *NodeManagement) handleMsgDestinationListData(message *api.Message, data *model.NodeManagementDestinationListDataType) error { switch message.CmdClassifier { case model.CmdClassifierTypeRead: return r.processReadDestinationListData(message.FeatureRemote, message.RequestHeader) diff --git a/spine/nodemanagement_detaileddiscovery.go b/spine/nodemanagement_detaileddiscovery.go index 96ea6f5..39bfc5d 100644 --- a/spine/nodemanagement_detaileddiscovery.go +++ b/spine/nodemanagement_detaileddiscovery.go @@ -9,7 +9,7 @@ import ( ) // request detailed discovery data from a remote device -func (r *NodeManagementImpl) RequestDetailedDiscovery(remoteDeviceSki string, remoteDeviceAddress *model.AddressDeviceType, sender api.Sender) (*model.MsgCounterType, *model.ErrorType) { +func (r *NodeManagement) RequestDetailedDiscovery(remoteDeviceSki string, remoteDeviceAddress *model.AddressDeviceType, sender api.SenderInterface) (*model.MsgCounterType, *model.ErrorType) { rfAdress := featureAddressType(NodeManagementFeatureId, EntityAddressType(remoteDeviceAddress, DeviceInformationAddressEntity)) cmd := model.CmdType{ NodeManagementDetailedDiscoveryData: &model.NodeManagementDetailedDiscoveryDataType{}, @@ -18,7 +18,7 @@ func (r *NodeManagementImpl) RequestDetailedDiscovery(remoteDeviceSki string, re } // handle incoming detailed discovery read call -func (r *NodeManagementImpl) processReadDetailedDiscoveryData(deviceRemote api.DeviceRemote, requestHeader *model.HeaderType) error { +func (r *NodeManagement) processReadDetailedDiscoveryData(deviceRemote api.DeviceRemoteInterface, requestHeader *model.HeaderType) error { if deviceRemote == nil { return errors.New("nodemanagement.readDetailedDiscoveryData: invalid deviceRemote") } @@ -49,7 +49,7 @@ func (r *NodeManagementImpl) processReadDetailedDiscoveryData(deviceRemote api.D } // handle incoming detailed discovery reply data -func (r *NodeManagementImpl) processReplyDetailedDiscoveryData(message *api.Message, data *model.NodeManagementDetailedDiscoveryDataType) error { +func (r *NodeManagement) processReplyDetailedDiscoveryData(message *api.Message, data *model.NodeManagementDetailedDiscoveryDataType) error { remoteDevice := message.DeviceRemote deviceDescription := data.DeviceInformation.Description @@ -91,7 +91,7 @@ func (r *NodeManagementImpl) processReplyDetailedDiscoveryData(message *api.Mess } // handle incoming detailed discovery notify data -func (r *NodeManagementImpl) processNotifyDetailedDiscoveryData(message *api.Message, data *model.NodeManagementDetailedDiscoveryDataType) error { +func (r *NodeManagement) processNotifyDetailedDiscoveryData(message *api.Message, data *model.NodeManagementDetailedDiscoveryDataType) error { // is this a partial request? if message.FilterPartial == nil { return errors.New("the received NodeManagementDetailedDiscovery.notify dataset should be partial") @@ -246,7 +246,7 @@ func (r *NodeManagementImpl) processNotifyDetailedDiscoveryData(message *api.Mes // return nil // } -func (r *NodeManagementImpl) handleMsgDetailedDiscoveryData(message *api.Message, data *model.NodeManagementDetailedDiscoveryDataType) error { +func (r *NodeManagement) handleMsgDetailedDiscoveryData(message *api.Message, data *model.NodeManagementDetailedDiscoveryDataType) error { switch message.CmdClassifier { case model.CmdClassifierTypeRead: return r.processReadDetailedDiscoveryData(message.DeviceRemote, message.RequestHeader) diff --git a/spine/nodemanagement_detaileddiscovery_test.go b/spine/nodemanagement_detaileddiscovery_test.go index 063ab66..54d41cd 100644 --- a/spine/nodemanagement_detaileddiscovery_test.go +++ b/spine/nodemanagement_detaileddiscovery_test.go @@ -28,16 +28,16 @@ func TestNodeManagementSuite(t *testing.T) { type NodeManagementSuite struct { suite.Suite - sut api.DeviceLocal + sut api.DeviceLocalInterface remoteSki string writeHandler *WriteMessageHandler - remoteDevice api.DeviceRemote + remoteDevice api.DeviceRemoteInterface } func (s *NodeManagementSuite) BeforeTest(suiteName, testName string) { - s.sut = NewDeviceLocalImpl("TestBrandName", "TestDeviceModel", "TestSerialNumber", "TestDeviceCode", + s.sut = NewDeviceLocal("TestBrandName", "TestDeviceModel", "TestSerialNumber", "TestDeviceCode", "TestDeviceAddress", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) s.remoteSki = "TestRemoteSki" diff --git a/spine/nodemanagement_subscription.go b/spine/nodemanagement_subscription.go index 675e513..d3a2fbf 100644 --- a/spine/nodemanagement_subscription.go +++ b/spine/nodemanagement_subscription.go @@ -29,7 +29,7 @@ func NewNodeManagementSubscriptionDeleteCallType(clientAddress *model.FeatureAdd } // route subscription request calls to the appropriate feature implementation and add the subscription to the current list -func (r *NodeManagementImpl) processReadSubscriptionData(message *api.Message) error { +func (r *NodeManagement) processReadSubscriptionData(message *api.Message) error { var remoteDeviceSubscriptions []model.SubscriptionManagementEntryDataType remoteDeviceSubscriptionEntries := r.Device().SubscriptionManager().Subscriptions(message.FeatureRemote.Device()) @@ -50,7 +50,7 @@ func (r *NodeManagementImpl) processReadSubscriptionData(message *api.Message) e return message.FeatureRemote.Sender().Reply(message.RequestHeader, r.Address(), cmd) } -func (r *NodeManagementImpl) handleMsgSubscriptionData(message *api.Message) error { +func (r *NodeManagement) handleMsgSubscriptionData(message *api.Message) error { switch message.CmdClassifier { case model.CmdClassifierTypeCall: return r.processReadSubscriptionData(message) @@ -60,7 +60,7 @@ func (r *NodeManagementImpl) handleMsgSubscriptionData(message *api.Message) err } } -func (r *NodeManagementImpl) handleMsgSubscriptionRequestCall(message *api.Message, data *model.NodeManagementSubscriptionRequestCallType) error { +func (r *NodeManagement) handleMsgSubscriptionRequestCall(message *api.Message, data *model.NodeManagementSubscriptionRequestCallType) error { switch message.CmdClassifier { case model.CmdClassifierTypeCall: subscriptionMgr := r.Device().SubscriptionManager() @@ -77,7 +77,7 @@ func (r *NodeManagementImpl) handleMsgSubscriptionRequestCall(message *api.Messa } } -func (r *NodeManagementImpl) handleMsgSubscriptionDeleteCall(message *api.Message, data *model.NodeManagementSubscriptionDeleteCallType) error { +func (r *NodeManagement) handleMsgSubscriptionDeleteCall(message *api.Message, data *model.NodeManagementSubscriptionDeleteCallType) error { switch message.CmdClassifier { case model.CmdClassifierTypeCall: subscriptionMgr := r.Device().SubscriptionManager() diff --git a/spine/nodemanagement_test.go b/spine/nodemanagement_test.go index d06a842..e8b2721 100644 --- a/spine/nodemanagement_test.go +++ b/spine/nodemanagement_test.go @@ -15,7 +15,7 @@ func TestNodemanagement_BindingCalls(t *testing.T) { const bindingEntityId uint = 1 const featureType = model.FeatureTypeTypeLoadControl - senderMock := mocks.NewSender(t) + senderMock := mocks.NewSenderInterface(t) localDevice, localEntity := createLocalDeviceAndEntity(bindingEntityId) _, serverFeature := createLocalFeatures(localDevice, localEntity, featureType, "") @@ -39,7 +39,7 @@ func TestNodemanagement_BindingCalls(t *testing.T) { FeatureRemote: clientFeature, } - sut := NewNodeManagementImpl(0, serverFeature.Entity()) + sut := NewNodeManagement(0, serverFeature.Entity()) // Act err := sut.HandleMessage(&requestMsg) @@ -90,7 +90,7 @@ func TestNodemanagement_SubscriptionCalls(t *testing.T) { const subscriptionEntityId uint = 1 const featureType = model.FeatureTypeTypeDeviceClassification - senderMock := mocks.NewSender(t) + senderMock := mocks.NewSenderInterface(t) localDevice, localEntity := createLocalDeviceAndEntity(subscriptionEntityId) _, serverFeature := createLocalFeatures(localDevice, localEntity, featureType, "") @@ -114,7 +114,7 @@ func TestNodemanagement_SubscriptionCalls(t *testing.T) { FeatureRemote: clientFeature, } - sut := NewNodeManagementImpl(0, serverFeature.Entity()) + sut := NewNodeManagement(0, serverFeature.Entity()) // Act err := sut.HandleMessage(&requestMsg) diff --git a/spine/nodemanagement_usecase.go b/spine/nodemanagement_usecase.go index 5e448bd..8ceda3f 100644 --- a/spine/nodemanagement_usecase.go +++ b/spine/nodemanagement_usecase.go @@ -9,7 +9,7 @@ import ( "github.com/enbility/spine-go/util" ) -func (r *NodeManagementImpl) RequestUseCaseData(remoteDeviceSki string, remoteDeviceAddress *model.AddressDeviceType, sender api.Sender) (*model.MsgCounterType, *model.ErrorType) { +func (r *NodeManagement) RequestUseCaseData(remoteDeviceSki string, remoteDeviceAddress *model.AddressDeviceType, sender api.SenderInterface) (*model.MsgCounterType, *model.ErrorType) { rfAdress := featureAddressType(NodeManagementFeatureId, EntityAddressType(remoteDeviceAddress, DeviceInformationAddressEntity)) cmd := model.CmdType{ NodeManagementUseCaseData: &model.NodeManagementUseCaseDataType{}, @@ -17,7 +17,7 @@ func (r *NodeManagementImpl) RequestUseCaseData(remoteDeviceSki string, remoteDe return r.RequestDataBySenderAddress(cmd, sender, remoteDeviceSki, rfAdress, defaultMaxResponseDelay) } -func (r *NodeManagementImpl) NotifyUseCaseData(remoteDevice api.DeviceRemote) (*model.MsgCounterType, error) { +func (r *NodeManagement) NotifyUseCaseData(remoteDevice api.DeviceRemoteInterface) (*model.MsgCounterType, error) { rfAdress := featureAddressType(NodeManagementFeatureId, EntityAddressType(remoteDevice.Address(), DeviceInformationAddressEntity)) rEntity := remoteDevice.Entity([]model.AddressEntityType{model.AddressEntityType(DeviceInformationEntityId)}) @@ -32,7 +32,7 @@ func (r *NodeManagementImpl) NotifyUseCaseData(remoteDevice api.DeviceRemote) (* return featureRemote.Sender().Notify(r.Address(), rfAdress, cmd) } -func (r *NodeManagementImpl) processReadUseCaseData(featureRemote api.FeatureRemote, requestHeader *model.HeaderType) error { +func (r *NodeManagement) processReadUseCaseData(featureRemote api.FeatureRemoteInterface, requestHeader *model.HeaderType) error { fd := r.functionData(model.FunctionTypeNodeManagementUseCaseData) if fd == nil { return errors.New("function data not found") @@ -42,7 +42,7 @@ func (r *NodeManagementImpl) processReadUseCaseData(featureRemote api.FeatureRem return featureRemote.Sender().Reply(requestHeader, r.Address(), cmd) } -func (r *NodeManagementImpl) processReplyUseCaseData(message *api.Message, data *model.NodeManagementUseCaseDataType) error { +func (r *NodeManagement) processReplyUseCaseData(message *api.Message, data *model.NodeManagementUseCaseDataType) error { message.FeatureRemote.UpdateData(model.FunctionTypeNodeManagementUseCaseData, data, nil, nil) // the data was updated, so send an event, other event handlers may watch out for this as well @@ -61,7 +61,7 @@ func (r *NodeManagementImpl) processReplyUseCaseData(message *api.Message, data return nil } -func (r *NodeManagementImpl) handleMsgUseCaseData(message *api.Message, data *model.NodeManagementUseCaseDataType) error { +func (r *NodeManagement) handleMsgUseCaseData(message *api.Message, data *model.NodeManagementUseCaseDataType) error { switch message.CmdClassifier { case model.CmdClassifierTypeRead: return r.processReadUseCaseData(message.FeatureRemote, message.RequestHeader) diff --git a/spine/operations.go b/spine/operations.go index 5868d8d..358b732 100644 --- a/spine/operations.go +++ b/spine/operations.go @@ -9,7 +9,7 @@ type Operations struct { read, write bool } -var _ api.Operations = (*Operations)(nil) +var _ api.OperationsInterface = (*Operations)(nil) func NewOperations(read, write bool) *Operations { return &Operations{ diff --git a/spine/pending_requests.go b/spine/pending_requests.go index 139a724..29f2fd6 100644 --- a/spine/pending_requests.go +++ b/spine/pending_requests.go @@ -28,17 +28,17 @@ func (r *request) setTimeoutResult() { } } -type PendingRequestsImpl struct { +type PendingRequests struct { requestMap sync.Map } -func NewPendingRequest() api.PendingRequests { - return &PendingRequestsImpl{ +func NewPendingRequest() api.PendingRequestsInterface { + return &PendingRequests{ requestMap: sync.Map{}, } } -func (r *PendingRequestsImpl) Add(ski string, counter model.MsgCounterType, maxDelay time.Duration) { +func (r *PendingRequests) Add(ski string, counter model.MsgCounterType, maxDelay time.Duration) { newRequest := &request{ ski: ski, counter: counter, @@ -50,15 +50,15 @@ func (r *PendingRequestsImpl) Add(ski string, counter model.MsgCounterType, maxD r.requestMap.Store(r.mapKey(ski, counter), newRequest) } -func (r *PendingRequestsImpl) SetData(ski string, counter model.MsgCounterType, data any) *model.ErrorType { +func (r *PendingRequests) SetData(ski string, counter model.MsgCounterType, data any) *model.ErrorType { return r.setResponse(ski, counter, data, nil) } -func (r *PendingRequestsImpl) SetResult(ski string, counter model.MsgCounterType, errorResult *model.ErrorType) *model.ErrorType { +func (r *PendingRequests) SetResult(ski string, counter model.MsgCounterType, errorResult *model.ErrorType) *model.ErrorType { return r.setResponse(ski, counter, nil, errorResult) } -func (r *PendingRequestsImpl) GetData(ski string, counter model.MsgCounterType) (any, *model.ErrorType) { +func (r *PendingRequests) GetData(ski string, counter model.MsgCounterType) (any, *model.ErrorType) { request, err := r.getRequest(ski, counter) if err != nil { return nil, err @@ -70,7 +70,7 @@ func (r *PendingRequestsImpl) GetData(ski string, counter model.MsgCounterType) return data.data, data.errorResult } -func (r *PendingRequestsImpl) Remove(ski string, counter model.MsgCounterType) *model.ErrorType { +func (r *PendingRequests) Remove(ski string, counter model.MsgCounterType) *model.ErrorType { request, err := r.getRequest(ski, counter) if err != nil { return err @@ -79,16 +79,16 @@ func (r *PendingRequestsImpl) Remove(ski string, counter model.MsgCounterType) * return nil } -func (r *PendingRequestsImpl) mapKey(ski string, counter model.MsgCounterType) string { +func (r *PendingRequests) mapKey(ski string, counter model.MsgCounterType) string { return fmt.Sprintf("%s:%d", ski, counter) } -func (r *PendingRequestsImpl) removeRequest(request *request) { +func (r *PendingRequests) removeRequest(request *request) { request.countdown.Stop() r.requestMap.Delete(r.mapKey(request.ski, request.counter)) } -func (r *PendingRequestsImpl) getRequest(ski string, counter model.MsgCounterType) (*request, *model.ErrorType) { +func (r *PendingRequests) getRequest(ski string, counter model.MsgCounterType) (*request, *model.ErrorType) { rq, exists := r.requestMap.Load(r.mapKey(ski, counter)) if !exists { return nil, model.NewErrorTypeFromString(fmt.Sprintf("No pending request with message counter '%s' found", counter.String())) @@ -97,7 +97,7 @@ func (r *PendingRequestsImpl) getRequest(ski string, counter model.MsgCounterTyp return rq.(*request), nil } -func (r *PendingRequestsImpl) setResponse(ski string, counter model.MsgCounterType, data any, errorResult *model.ErrorType) *model.ErrorType { +func (r *PendingRequests) setResponse(ski string, counter model.MsgCounterType, data any, errorResult *model.ErrorType) *model.ErrorType { request, err := r.getRequest(ski, counter) if err != nil { diff --git a/spine/pending_requests_test.go b/spine/pending_requests_test.go index 64f503c..5982ab3 100644 --- a/spine/pending_requests_test.go +++ b/spine/pending_requests_test.go @@ -12,7 +12,7 @@ import ( type PendingRequestsTestSuite struct { suite.Suite - sut api.PendingRequests + sut api.PendingRequestsInterface ski string counter model.MsgCounterType } diff --git a/spine/send.go b/spine/send.go index 5bd9d74..817446c 100644 --- a/spine/send.go +++ b/spine/send.go @@ -13,27 +13,27 @@ import ( lru "github.com/hashicorp/golang-lru/v2" ) -type SenderImpl struct { +type Sender struct { msgNum uint64 // 64bit values need to be defined on top of the struct to make atomic commands work on 32bit systems // we cache the last 100 notify messages, so we can find the matching item for result errors being returned datagramNotifyCache *lru.Cache[model.MsgCounterType, model.DatagramType] - writeHandler shipapi.SpineDataConnection + writeHandler shipapi.ShipConnectionDataWriterInterface } -var _ api.Sender = (*SenderImpl)(nil) +var _ api.SenderInterface = (*Sender)(nil) -func NewSender(writeI shipapi.SpineDataConnection) api.Sender { +func NewSender(writeI shipapi.ShipConnectionDataWriterInterface) api.SenderInterface { cache, _ := lru.New[model.MsgCounterType, model.DatagramType](100) - return &SenderImpl{ + return &Sender{ datagramNotifyCache: cache, writeHandler: writeI, } } // return the datagram for a given msgCounter (only availbe for Notify messasges!), error if not found -func (c *SenderImpl) DatagramForMsgCounter(msgCounter model.MsgCounterType) (model.DatagramType, error) { +func (c *Sender) DatagramForMsgCounter(msgCounter model.MsgCounterType) (model.DatagramType, error) { if datagram, ok := c.datagramNotifyCache.Get(msgCounter); ok { return datagram, nil } @@ -41,7 +41,7 @@ func (c *SenderImpl) DatagramForMsgCounter(msgCounter model.MsgCounterType) (mod return model.DatagramType{}, errors.New("msgCounter not found") } -func (c *SenderImpl) sendSpineMessage(datagram model.DatagramType) error { +func (c *Sender) sendSpineMessage(datagram model.DatagramType) error { // pack into datagram data := model.Datagram{ Datagram: datagram, @@ -64,13 +64,13 @@ func (c *SenderImpl) sendSpineMessage(datagram model.DatagramType) error { logging.Log().Debug(datagram.PrintMessageOverview(true, "", "")) // write to channel - c.writeHandler.WriteSpineMessage(msg) + c.writeHandler.WriteShipMessageWithPayload(msg) return nil } // Sends request -func (c *SenderImpl) Request(cmdClassifier model.CmdClassifierType, senderAddress, destinationAddress *model.FeatureAddressType, ackRequest bool, cmd []model.CmdType) (*model.MsgCounterType, error) { +func (c *Sender) Request(cmdClassifier model.CmdClassifierType, senderAddress, destinationAddress *model.FeatureAddressType, ackRequest bool, cmd []model.CmdType) (*model.MsgCounterType, error) { msgCounter := c.getMsgCounter() datagram := model.DatagramType{ @@ -93,16 +93,16 @@ func (c *SenderImpl) Request(cmdClassifier model.CmdClassifierType, senderAddres return msgCounter, c.sendSpineMessage(datagram) } -func (c *SenderImpl) ResultSuccess(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType) error { +func (c *Sender) ResultSuccess(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType) error { return c.result(requestHeader, senderAddress, nil) } -func (c *SenderImpl) ResultError(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, err *model.ErrorType) error { +func (c *Sender) ResultError(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, err *model.ErrorType) error { return c.result(requestHeader, senderAddress, err) } // sends a result for a request -func (c *SenderImpl) result(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, err *model.ErrorType) error { +func (c *Sender) result(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, err *model.ErrorType) error { cmdClassifier := model.CmdClassifierTypeResult addressSource := *requestHeader.AddressDestination @@ -142,7 +142,7 @@ func (c *SenderImpl) result(requestHeader *model.HeaderType, senderAddress *mode } // Reply sends reply to original sender -func (c *SenderImpl) Reply(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, cmd model.CmdType) error { +func (c *Sender) Reply(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, cmd model.CmdType) error { cmdClassifier := model.CmdClassifierTypeReply addressSource := *requestHeader.AddressDestination @@ -166,7 +166,7 @@ func (c *SenderImpl) Reply(requestHeader *model.HeaderType, senderAddress *model } // Notify sends notification to destination -func (c *SenderImpl) Notify(senderAddress, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error) { +func (c *Sender) Notify(senderAddress, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error) { msgCounter := c.getMsgCounter() cmdClassifier := model.CmdClassifierTypeNotify @@ -190,7 +190,7 @@ func (c *SenderImpl) Notify(senderAddress, destinationAddress *model.FeatureAddr } // Write sends notification to destination -func (c *SenderImpl) Write(senderAddress, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error) { +func (c *Sender) Write(senderAddress, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error) { msgCounter := c.getMsgCounter() cmdClassifier := model.CmdClassifierTypeWrite @@ -214,7 +214,7 @@ func (c *SenderImpl) Write(senderAddress, destinationAddress *model.FeatureAddre } // Send a subscription request to a remote server feature -func (c *SenderImpl) Subscribe(senderAddress, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error) { +func (c *Sender) Subscribe(senderAddress, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error) { cmd := model.CmdType{ NodeManagementSubscriptionRequestCall: NewNodeManagementSubscriptionRequestCallType(senderAddress, destinationAddress, serverFeatureType), @@ -228,7 +228,7 @@ func (c *SenderImpl) Subscribe(senderAddress, destinationAddress *model.FeatureA } // Send a subscription deletion request to a remote server feature -func (c *SenderImpl) Unsubscribe(senderAddress, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error) { +func (c *Sender) Unsubscribe(senderAddress, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error) { cmd := model.CmdType{ NodeManagementSubscriptionDeleteCall: NewNodeManagementSubscriptionDeleteCallType(senderAddress, destinationAddress), @@ -242,7 +242,7 @@ func (c *SenderImpl) Unsubscribe(senderAddress, destinationAddress *model.Featur } // Send a binding request to a remote server feature -func (c *SenderImpl) Bind(senderAddress, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error) { +func (c *Sender) Bind(senderAddress, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error) { cmd := model.CmdType{ NodeManagementBindingRequestCall: NewNodeManagementBindingRequestCallType(senderAddress, destinationAddress, serverFeatureType), } @@ -255,7 +255,7 @@ func (c *SenderImpl) Bind(senderAddress, destinationAddress *model.FeatureAddres } // Send a binding request to a remote server feature -func (c *SenderImpl) Unbind(senderAddress, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error) { +func (c *Sender) Unbind(senderAddress, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error) { cmd := model.CmdType{ NodeManagementBindingDeleteCall: NewNodeManagementBindingDeleteCallType(senderAddress, destinationAddress), } @@ -267,7 +267,7 @@ func (c *SenderImpl) Unbind(senderAddress, destinationAddress *model.FeatureAddr return c.Request(model.CmdClassifierTypeCall, localAddress, remoteAddress, true, []model.CmdType{cmd}) } -func (c *SenderImpl) getMsgCounter() *model.MsgCounterType { +func (c *Sender) getMsgCounter() *model.MsgCounterType { // TODO: persistence i := model.MsgCounterType(atomic.AddUint64(&c.msgNum, 1)) return &i diff --git a/spine/subscription_manager.go b/spine/subscription_manager.go index 63515ed..0b7d560 100644 --- a/spine/subscription_manager.go +++ b/spine/subscription_manager.go @@ -13,8 +13,8 @@ import ( "github.com/enbility/spine-go/util" ) -type SubscriptionManagerImpl struct { - localDevice api.DeviceLocal +type SubscriptionManager struct { + localDevice api.DeviceLocalInterface subscriptionNum uint64 subscriptionEntries []*api.SubscriptionEntry @@ -23,8 +23,8 @@ type SubscriptionManagerImpl struct { // TODO: add persistence } -func NewSubscriptionManager(localDevice api.DeviceLocal) *SubscriptionManagerImpl { - c := &SubscriptionManagerImpl{ +func NewSubscriptionManager(localDevice api.DeviceLocalInterface) *SubscriptionManager { + c := &SubscriptionManager{ subscriptionNum: 0, localDevice: localDevice, } @@ -33,7 +33,7 @@ func NewSubscriptionManager(localDevice api.DeviceLocal) *SubscriptionManagerImp } // is sent from the client (remote device) to the server (local device) -func (c *SubscriptionManagerImpl) AddSubscription(remoteDevice api.DeviceRemote, data model.SubscriptionManagementRequestCallType) error { +func (c *SubscriptionManager) AddSubscription(remoteDevice api.DeviceRemoteInterface, data model.SubscriptionManagementRequestCallType) error { serverFeature := c.localDevice.FeatureByAddress(data.ServerAddress) if serverFeature == nil { @@ -81,7 +81,7 @@ func (c *SubscriptionManagerImpl) AddSubscription(remoteDevice api.DeviceRemote, } // Remove a specific subscription that is provided by a delete message from a remote device -func (c *SubscriptionManagerImpl) RemoveSubscription(data model.SubscriptionManagementDeleteCallType, remoteDevice api.DeviceRemote) error { +func (c *SubscriptionManager) RemoveSubscription(data model.SubscriptionManagementDeleteCallType, remoteDevice api.DeviceRemoteInterface) error { var newSubscriptionEntries []*api.SubscriptionEntry // according to the spec 7.4.4 @@ -138,7 +138,7 @@ func (c *SubscriptionManagerImpl) RemoveSubscription(data model.SubscriptionMana } // Remove all existing subscriptions for a given remote device -func (c *SubscriptionManagerImpl) RemoveSubscriptionsForDevice(remoteDevice api.DeviceRemote) { +func (c *SubscriptionManager) RemoveSubscriptionsForDevice(remoteDevice api.DeviceRemoteInterface) { if remoteDevice == nil { return } @@ -149,7 +149,7 @@ func (c *SubscriptionManagerImpl) RemoveSubscriptionsForDevice(remoteDevice api. } // Remove all existing subscriptions for a given remote device entity -func (c *SubscriptionManagerImpl) RemoveSubscriptionsForEntity(remoteEntity api.EntityRemote) { +func (c *SubscriptionManager) RemoveSubscriptionsForEntity(remoteEntity api.EntityRemoteInterface) { if remoteEntity == nil { return } @@ -178,7 +178,7 @@ func (c *SubscriptionManagerImpl) RemoveSubscriptionsForEntity(remoteEntity api. c.subscriptionEntries = newSubscriptionEntries } -func (c *SubscriptionManagerImpl) Subscriptions(remoteDevice api.DeviceRemote) []*api.SubscriptionEntry { +func (c *SubscriptionManager) Subscriptions(remoteDevice api.DeviceRemoteInterface) []*api.SubscriptionEntry { var result []*api.SubscriptionEntry c.mux.Lock() @@ -191,7 +191,7 @@ func (c *SubscriptionManagerImpl) Subscriptions(remoteDevice api.DeviceRemote) [ return result } -func (c *SubscriptionManagerImpl) SubscriptionsOnFeature(featureAddress model.FeatureAddressType) []*api.SubscriptionEntry { +func (c *SubscriptionManager) SubscriptionsOnFeature(featureAddress model.FeatureAddressType) []*api.SubscriptionEntry { var result []*api.SubscriptionEntry c.mux.Lock() @@ -204,12 +204,12 @@ func (c *SubscriptionManagerImpl) SubscriptionsOnFeature(featureAddress model.Fe return result } -func (c *SubscriptionManagerImpl) subscriptionId() uint64 { +func (c *SubscriptionManager) subscriptionId() uint64 { i := atomic.AddUint64(&c.subscriptionNum, 1) return i } -func (c *SubscriptionManagerImpl) checkRoleAndType(feature api.Feature, role model.RoleType, featureType model.FeatureTypeType) error { +func (c *SubscriptionManager) checkRoleAndType(feature api.FeatureInterface, role model.RoleType, featureType model.FeatureTypeType) error { if feature.Role() != model.RoleTypeSpecial && feature.Role() != role { return fmt.Errorf("found feature %s is not matching required role %s", feature.Type(), role) } diff --git a/spine/subscription_manager_test.go b/spine/subscription_manager_test.go index 524abf7..a3cc455 100644 --- a/spine/subscription_manager_test.go +++ b/spine/subscription_manager_test.go @@ -18,19 +18,19 @@ func TestSubscriptionManagerSuite(t *testing.T) { type SubscriptionManagerSuite struct { suite.Suite - localDevice api.DeviceLocal - remoteDevice api.DeviceRemote - sut api.SubscriptionManager + localDevice api.DeviceLocalInterface + remoteDevice api.DeviceRemoteInterface + sut api.SubscriptionManagerInterface } -func (suite *SubscriptionManagerSuite) WriteSpineMessage([]byte) {} +func (suite *SubscriptionManagerSuite) WriteShipMessageWithPayload([]byte) {} func (suite *SubscriptionManagerSuite) SetupSuite() { - suite.localDevice = NewDeviceLocalImpl("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) + suite.localDevice = NewDeviceLocal("brand", "model", "serial", "code", "address", model.DeviceTypeTypeEnergyManagementSystem, model.NetworkManagementFeatureSetTypeSmart, time.Second*4) ski := "test" sender := NewSender(suite) - suite.remoteDevice = NewDeviceRemoteImpl(suite.localDevice, ski, sender) + suite.remoteDevice = NewDeviceRemote(suite.localDevice, ski, sender) _ = suite.localDevice.SetupRemoteDevice(ski, suite) @@ -38,15 +38,15 @@ func (suite *SubscriptionManagerSuite) SetupSuite() { } func (suite *SubscriptionManagerSuite) Test_Subscriptions() { - entity := NewEntityLocalImpl(suite.localDevice, model.EntityTypeTypeCEM, []model.AddressEntityType{1}) + entity := NewEntityLocal(suite.localDevice, model.EntityTypeTypeCEM, []model.AddressEntityType{1}) suite.localDevice.AddEntity(entity) localFeature := entity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) - remoteEntity := NewEntityRemoteImpl(suite.remoteDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{1}) + remoteEntity := NewEntityRemote(suite.remoteDevice, model.EntityTypeTypeEVSE, []model.AddressEntityType{1}) suite.remoteDevice.AddEntity(remoteEntity) - remoteFeature := NewFeatureRemoteImpl(remoteEntity.NextFeatureId(), remoteEntity, model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeClient) + remoteFeature := NewFeatureRemote(remoteEntity.NextFeatureId(), remoteEntity, model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeClient) remoteFeature.Address().Device = util.Ptr(model.AddressDeviceType("remoteDevice")) remoteEntity.AddFeature(remoteFeature)