diff --git a/api/api.go b/api/api.go index 8b1fc95e..f67b3e1b 100644 --- a/api/api.go +++ b/api/api.go @@ -28,7 +28,7 @@ type ServiceInterface interface { IsRunning() bool // add a use case to the service - AddUseCase(useCase UseCaseInterface) + AddUseCase(useCase UseCaseInterface) error // set logging interface SetLogging(logger logging.LoggingInterface) diff --git a/api/featuresserver.go b/api/featuresserver.go index 23e79fd8..edc57f0f 100644 --- a/api/featuresserver.go +++ b/api/featuresserver.go @@ -109,6 +109,13 @@ type ElectricalConnectionServerInterface interface { deleteSelector *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, deleteElements *model.ElectricalConnectionPermittedValueSetDataElementsType, ) error + + // either returns the given description id or creates a new one for the given description + // + // will return error if could not add the new description + GetOrAddIdForDescription( + electricalConnectionDescription model.ElectricalConnectionDescriptionDataType, + ) (*model.ElectricalConnectionIdType, error) } type LoadControlLimitDataForID struct { diff --git a/api/usecases.go b/api/usecases.go index bb120ee7..37203270 100644 --- a/api/usecases.go +++ b/api/usecases.go @@ -56,6 +56,15 @@ type UseCaseBaseInterface interface { type UseCaseInterface interface { UseCaseBaseInterface - // add the features - AddFeatures() + // add the features described by the Use Case + // + // returns an error if any Feature could not be added + // - errors should not occur during normal usage of eebus-go, and should + // generally be considered fatal implementation errors + // - if an error occurs while adding features to a new Entity, that Entity + // will be in an incomplete state and should not be added to the service + // + // No cleanup occurs on error, some features may end up partially + // configured and unused + AddFeatures() error } diff --git a/examples/ced/main.go b/examples/ced/main.go index 114c5d14..0a3ac020 100644 --- a/examples/ced/main.go +++ b/examples/ced/main.go @@ -99,12 +99,18 @@ func (h *controlbox) run() { localEntity := h.myService.LocalDevice().EntityForType(model.EntityTypeTypeHeatPumpAppliance) h.uclpc = lpc.NewLPC(localEntity, h.OnLPCEvent) - h.myService.AddUseCase(h.uclpc) + err = h.myService.AddUseCase(h.uclpc) + if err != nil { + log.Fatal(err) + } // h.uclpp = lpp.NewLPP(localEntity, h.OnLPPEvent) // h.myService.AddUseCase(h.uclpp) h.ucmpc = mpc.NewMPC(localEntity, h.OnMPCEvent) - h.myService.AddUseCase(h.ucmpc) + err = h.myService.AddUseCase(h.ucmpc) + if err != nil { + log.Fatal(err) + } if len(remoteSki) == 0 { os.Exit(0) diff --git a/examples/controlbox/main.go b/examples/controlbox/main.go index 75a12386..2fda0ba2 100644 --- a/examples/controlbox/main.go +++ b/examples/controlbox/main.go @@ -95,10 +95,16 @@ func (h *controlbox) run() { localEntity := h.myService.LocalDevice().EntityForType(model.EntityTypeTypeGridGuard) h.uclpc = lpc.NewLPC(localEntity, h.OnLPCEvent) - h.myService.AddUseCase(h.uclpc) + err = h.myService.AddUseCase(h.uclpc) + if err != nil { + log.Fatal(err) + } h.uclpp = lpp.NewLPP(localEntity, h.OnLPPEvent) - h.myService.AddUseCase(h.uclpp) + err = h.myService.AddUseCase(h.uclpp) + if err != nil { + log.Fatal(err) + } if len(remoteSki) == 0 { os.Exit(0) diff --git a/examples/evse/main.go b/examples/evse/main.go index 26256724..3fc19197 100644 --- a/examples/evse/main.go +++ b/examples/evse/main.go @@ -92,7 +92,10 @@ func (h *evse) run() { localEntity := h.myService.LocalDevice().EntityForType(model.EntityTypeTypeEVSE) h.uclpc = lpc.NewLPC(localEntity, h.OnLPCEvent) - h.myService.AddUseCase(h.uclpc) + err = h.myService.AddUseCase(h.uclpc) + if err != nil { + log.Fatal(err) + } // Initialize local server data _ = h.uclpc.SetConsumptionNominalMax(32000) diff --git a/examples/hems/main.go b/examples/hems/main.go index 73ec2451..b8f4e500 100644 --- a/examples/hems/main.go +++ b/examples/hems/main.go @@ -102,19 +102,46 @@ func (h *hems) run() { localEntity := h.myService.LocalDevice().EntityForType(model.EntityTypeTypeCEM) h.uccslpc = cslpc.NewLPC(localEntity, h.OnLPCEvent) - h.myService.AddUseCase(h.uccslpc) + err = h.myService.AddUseCase(h.uccslpc) + if err != nil { + log.Fatal(err) + } + h.uccslpp = cslpp.NewLPP(localEntity, h.OnLPPEvent) - h.myService.AddUseCase(h.uccslpp) + err = h.myService.AddUseCase(h.uccslpp) + if err != nil { + log.Fatal(err) + } + h.uceglpc = eglpc.NewLPC(localEntity, nil) - h.myService.AddUseCase(h.uceglpc) + err = h.myService.AddUseCase(h.uceglpc) + if err != nil { + log.Fatal(err) + } + h.uceglpp = eglpp.NewLPP(localEntity, nil) - h.myService.AddUseCase(h.uceglpp) + err = h.myService.AddUseCase(h.uceglpp) + if err != nil { + log.Fatal(err) + } + h.ucmamgcp = mgcp.NewMGCP(localEntity, h.OnMGCPEvent) - h.myService.AddUseCase(h.ucmamgcp) + err = h.myService.AddUseCase(h.ucmamgcp) + if err != nil { + log.Fatal(err) + } + h.uccemvabd = vabd.NewVABD(localEntity, h.OnVABDEvent) - h.myService.AddUseCase(h.uccemvabd) + err = h.myService.AddUseCase(h.uccemvabd) + if err != nil { + log.Fatal(err) + } + h.uccemvapd = vapd.NewVAPD(localEntity, h.OnVAPDEvent) - h.myService.AddUseCase(h.uccemvapd) + err = h.myService.AddUseCase(h.uccemvapd) + if err != nil { + log.Fatal(err) + } // Initialize local server data _ = h.uccslpc.SetConsumptionNominalMax(32000) diff --git a/examples/remote/ucs.go b/examples/remote/ucs.go index 457963a2..1adb2b66 100644 --- a/examples/remote/ucs.go +++ b/examples/remote/ucs.go @@ -3,6 +3,7 @@ package main import ( "context" "fmt" + "log" "github.com/enbility/eebus-go/api" spineapi "github.com/enbility/spine-go/api" @@ -31,7 +32,10 @@ func (r *Remote) RegisterUseCase(entityType model.EntityTypeType, usecaseId stri ) { r.PropagateEvent(identifier, ski, device, entity, event) }) - r.service.AddUseCase(uc) + err := r.service.AddUseCase(uc) + if err != nil { + log.Fatal(err) + } return r.registerStaticReceiverProxy(usecaseId, uc) } diff --git a/features/server/electricalconnection.go b/features/server/electricalconnection.go index 39bef0a7..3a37e5de 100644 --- a/features/server/electricalconnection.go +++ b/features/server/electricalconnection.go @@ -31,6 +31,51 @@ func NewElectricalConnection(localEntity spineapi.EntityLocalInterface) (*Electr return ec, nil } +// Get or add the id for a electrical connection with a given electricalConnectionDescription +// +// NOTE: This can be used instead of AddDescription to be sure it exists only one id for the same description +// +// will return the id for the electrical connection with the given description +func (e *ElectricalConnection) GetOrAddIdForDescription( + electricalConnectionDescription model.ElectricalConnectionDescriptionDataType, +) (*model.ElectricalConnectionIdType, error) { + electricalConnectionId := (*model.ElectricalConnectionIdType)(nil) + highestExistingElectricalConnectionId := model.ElectricalConnectionIdType(0) + + descriptionData := e.featureLocal.DataCopy(model.FunctionTypeElectricalConnectionDescriptionListData).(*model.ElectricalConnectionDescriptionListDataType) + + if descriptionData != nil && descriptionData.ElectricalConnectionDescriptionData != nil { + for _, description := range descriptionData.ElectricalConnectionDescriptionData { + if description.ElectricalConnectionId != nil && + description.PowerSupplyType == electricalConnectionDescription.PowerSupplyType && + description.AcConnectedPhases == electricalConnectionDescription.AcConnectedPhases && + description.AcRmsPeriodDuration == electricalConnectionDescription.AcRmsPeriodDuration && + description.PositiveEnergyDirection == electricalConnectionDescription.PositiveEnergyDirection && + description.ScopeType == electricalConnectionDescription.ScopeType && + description.Label == electricalConnectionDescription.Label && + description.Description == electricalConnectionDescription.Description { + electricalConnectionId = description.ElectricalConnectionId + return electricalConnectionId, nil + } else if description.ElectricalConnectionId != nil { + if *description.ElectricalConnectionId > highestExistingElectricalConnectionId { + highestExistingElectricalConnectionId = *description.ElectricalConnectionId + } + } + } + } + + electricalConnectionId = util.Ptr(highestExistingElectricalConnectionId + 1) + description := electricalConnectionDescription + description.ElectricalConnectionId = electricalConnectionId + if errType := e.featureLocal.UpdateData(model.FunctionTypeElectricalConnectionDescriptionListData, &model.ElectricalConnectionDescriptionListDataType{ + ElectricalConnectionDescriptionData: []model.ElectricalConnectionDescriptionDataType{description}, + }, model.NewFilterTypePartial(), nil); errType != nil { + return nil, errors.New("could not add description data") + } + + return electricalConnectionId, nil +} + // Add a new description data set // // NOTE: the electricalConnectionId has to be provided diff --git a/features/server/electricalconnection_test.go b/features/server/electricalconnection_test.go index b89e4172..c84ca1fd 100644 --- a/features/server/electricalconnection_test.go +++ b/features/server/electricalconnection_test.go @@ -119,6 +119,40 @@ func (s *ElectricalConnectionSuite) Test_Description() { assert.NotNil(s.T(), data) } +func (s *ElectricalConnectionSuite) Test_GetOrAddIdForDescription() { + filter := model.ElectricalConnectionDescriptionDataType{} + + data, err := s.sut.GetDescriptionsForFilter(filter) + assert.NotNil(s.T(), err) + assert.Nil(s.T(), data) + + desc1 := model.ElectricalConnectionDescriptionDataType{ + PowerSupplyType: util.Ptr(model.ElectricalConnectionVoltageTypeTypeDc), + ScopeType: util.Ptr(model.ScopeTypeTypeACPowerTotal), + } + + eConnectionId, err := s.sut.GetOrAddIdForDescription(desc1) + assert.Nil(s.T(), err) + assert.Equal(s.T(), model.ElectricalConnectionIdType(1), *eConnectionId) + + eConnectionId, err = s.sut.GetOrAddIdForDescription(desc1) + assert.Nil(s.T(), err) + assert.Equal(s.T(), model.ElectricalConnectionIdType(1), *eConnectionId) + + desc2 := model.ElectricalConnectionDescriptionDataType{ + PowerSupplyType: util.Ptr(model.ElectricalConnectionVoltageTypeTypeAc), + ScopeType: util.Ptr(model.ScopeTypeTypeACPowerTotal), + } + + eConnectionId2, err := s.sut.GetOrAddIdForDescription(desc2) + assert.Nil(s.T(), err) + assert.Equal(s.T(), model.ElectricalConnectionIdType(2), *eConnectionId2) + + eConnectionId, err = s.sut.GetOrAddIdForDescription(desc1) + assert.Nil(s.T(), err) + assert.Equal(s.T(), model.ElectricalConnectionIdType(1), *eConnectionId) +} + func (s *ElectricalConnectionSuite) Test_ParameterDescription() { filter := model.ElectricalConnectionParameterDescriptionDataType{} diff --git a/mocks/DeviceClassificationClientInterface.go b/mocks/DeviceClassificationClientInterface.go index 76bcffae..65148766 100644 --- a/mocks/DeviceClassificationClientInterface.go +++ b/mocks/DeviceClassificationClientInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewDeviceClassificationClientInterface creates a new instance of DeviceClassificationClientInterface. 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 NewDeviceClassificationClientInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *DeviceClassificationClientInterface { - mock := &DeviceClassificationClientInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // DeviceClassificationClientInterface is an autogenerated mock type for the DeviceClassificationClientInterface type type DeviceClassificationClientInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *DeviceClassificationClientInterface) EXPECT() *DeviceClassificationCli return &DeviceClassificationClientInterface_Expecter{mock: &_m.Mock} } -// RequestManufacturerDetails provides a mock function for the type DeviceClassificationClientInterface -func (_mock *DeviceClassificationClientInterface) RequestManufacturerDetails() (*model.MsgCounterType, error) { - ret := _mock.Called() +// RequestManufacturerDetails provides a mock function with no fields +func (_m *DeviceClassificationClientInterface) RequestManufacturerDetails() (*model.MsgCounterType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RequestManufacturerDetails") @@ -46,21 +30,23 @@ func (_mock *DeviceClassificationClientInterface) RequestManufacturerDetails() ( var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.MsgCounterType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.MsgCounterType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -81,8 +67,8 @@ func (_c *DeviceClassificationClientInterface_RequestManufacturerDetails_Call) R return _c } -func (_c *DeviceClassificationClientInterface_RequestManufacturerDetails_Call) Return(msgCounterType *model.MsgCounterType, err error) *DeviceClassificationClientInterface_RequestManufacturerDetails_Call { - _c.Call.Return(msgCounterType, err) +func (_c *DeviceClassificationClientInterface_RequestManufacturerDetails_Call) Return(_a0 *model.MsgCounterType, _a1 error) *DeviceClassificationClientInterface_RequestManufacturerDetails_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -90,3 +76,17 @@ func (_c *DeviceClassificationClientInterface_RequestManufacturerDetails_Call) R _c.Call.Return(run) return _c } + +// NewDeviceClassificationClientInterface creates a new instance of DeviceClassificationClientInterface. 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 NewDeviceClassificationClientInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *DeviceClassificationClientInterface { + mock := &DeviceClassificationClientInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/DeviceClassificationCommonInterface.go b/mocks/DeviceClassificationCommonInterface.go index 41d3e52d..cd265b04 100644 --- a/mocks/DeviceClassificationCommonInterface.go +++ b/mocks/DeviceClassificationCommonInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewDeviceClassificationCommonInterface creates a new instance of DeviceClassificationCommonInterface. 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 NewDeviceClassificationCommonInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *DeviceClassificationCommonInterface { - mock := &DeviceClassificationCommonInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // DeviceClassificationCommonInterface is an autogenerated mock type for the DeviceClassificationCommonInterface type type DeviceClassificationCommonInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *DeviceClassificationCommonInterface) EXPECT() *DeviceClassificationCom return &DeviceClassificationCommonInterface_Expecter{mock: &_m.Mock} } -// GetManufacturerDetails provides a mock function for the type DeviceClassificationCommonInterface -func (_mock *DeviceClassificationCommonInterface) GetManufacturerDetails() (*model.DeviceClassificationManufacturerDataType, error) { - ret := _mock.Called() +// GetManufacturerDetails provides a mock function with no fields +func (_m *DeviceClassificationCommonInterface) GetManufacturerDetails() (*model.DeviceClassificationManufacturerDataType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetManufacturerDetails") @@ -46,21 +30,23 @@ func (_mock *DeviceClassificationCommonInterface) GetManufacturerDetails() (*mod var r0 *model.DeviceClassificationManufacturerDataType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.DeviceClassificationManufacturerDataType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.DeviceClassificationManufacturerDataType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.DeviceClassificationManufacturerDataType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.DeviceClassificationManufacturerDataType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceClassificationManufacturerDataType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -81,8 +67,8 @@ func (_c *DeviceClassificationCommonInterface_GetManufacturerDetails_Call) Run(r return _c } -func (_c *DeviceClassificationCommonInterface_GetManufacturerDetails_Call) Return(deviceClassificationManufacturerDataType *model.DeviceClassificationManufacturerDataType, err error) *DeviceClassificationCommonInterface_GetManufacturerDetails_Call { - _c.Call.Return(deviceClassificationManufacturerDataType, err) +func (_c *DeviceClassificationCommonInterface_GetManufacturerDetails_Call) Return(_a0 *model.DeviceClassificationManufacturerDataType, _a1 error) *DeviceClassificationCommonInterface_GetManufacturerDetails_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -90,3 +76,17 @@ func (_c *DeviceClassificationCommonInterface_GetManufacturerDetails_Call) RunAn _c.Call.Return(run) return _c } + +// NewDeviceClassificationCommonInterface creates a new instance of DeviceClassificationCommonInterface. 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 NewDeviceClassificationCommonInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *DeviceClassificationCommonInterface { + mock := &DeviceClassificationCommonInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/DeviceClassificationServerInterface.go b/mocks/DeviceClassificationServerInterface.go index 5c732083..f62c6fd1 100644 --- a/mocks/DeviceClassificationServerInterface.go +++ b/mocks/DeviceClassificationServerInterface.go @@ -1,12 +1,21 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks -import ( - mock "github.com/stretchr/testify/mock" -) +import mock "github.com/stretchr/testify/mock" + +// DeviceClassificationServerInterface is an autogenerated mock type for the DeviceClassificationServerInterface type +type DeviceClassificationServerInterface struct { + mock.Mock +} + +type DeviceClassificationServerInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *DeviceClassificationServerInterface) EXPECT() *DeviceClassificationServerInterface_Expecter { + return &DeviceClassificationServerInterface_Expecter{mock: &_m.Mock} +} // NewDeviceClassificationServerInterface creates a new instance of DeviceClassificationServerInterface. 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. @@ -21,16 +30,3 @@ func NewDeviceClassificationServerInterface(t interface { return mock } - -// DeviceClassificationServerInterface is an autogenerated mock type for the DeviceClassificationServerInterface type -type DeviceClassificationServerInterface struct { - mock.Mock -} - -type DeviceClassificationServerInterface_Expecter struct { - mock *mock.Mock -} - -func (_m *DeviceClassificationServerInterface) EXPECT() *DeviceClassificationServerInterface_Expecter { - return &DeviceClassificationServerInterface_Expecter{mock: &_m.Mock} -} diff --git a/mocks/DeviceConfigurationClientInterface.go b/mocks/DeviceConfigurationClientInterface.go index 1d196160..cd0b6ef3 100644 --- a/mocks/DeviceConfigurationClientInterface.go +++ b/mocks/DeviceConfigurationClientInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewDeviceConfigurationClientInterface creates a new instance of DeviceConfigurationClientInterface. 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 NewDeviceConfigurationClientInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *DeviceConfigurationClientInterface { - mock := &DeviceConfigurationClientInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // DeviceConfigurationClientInterface is an autogenerated mock type for the DeviceConfigurationClientInterface type type DeviceConfigurationClientInterface struct { mock.Mock @@ -36,20 +20,21 @@ func (_m *DeviceConfigurationClientInterface) EXPECT() *DeviceConfigurationClien return &DeviceConfigurationClientInterface_Expecter{mock: &_m.Mock} } -// CheckEventPayloadDataForFilter provides a mock function for the type DeviceConfigurationClientInterface -func (_mock *DeviceConfigurationClientInterface) CheckEventPayloadDataForFilter(payloadData any, filter any) bool { - ret := _mock.Called(payloadData, filter) +// CheckEventPayloadDataForFilter provides a mock function with given fields: payloadData, filter +func (_m *DeviceConfigurationClientInterface) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) bool { + ret := _m.Called(payloadData, filter) if len(ret) == 0 { panic("no return value specified for CheckEventPayloadDataForFilter") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(any, any) bool); ok { - r0 = returnFunc(payloadData, filter) + if rf, ok := ret.Get(0).(func(interface{}, interface{}) bool); ok { + r0 = rf(payloadData, filter) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -59,43 +44,32 @@ type DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call stru } // CheckEventPayloadDataForFilter is a helper method to define mock.On call -// - payloadData any -// - filter any +// - payloadData interface{} +// - filter interface{} func (_e *DeviceConfigurationClientInterface_Expecter) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call { return &DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call{Call: _e.mock.On("CheckEventPayloadDataForFilter", payloadData, filter)} } -func (_c *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData any, filter any)) *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call { +func (_c *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData interface{}, filter interface{})) *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 any - if args[0] != nil { - arg0 = args[0].(any) - } - var arg1 any - if args[1] != nil { - arg1 = args[1].(any) - } - run( - arg0, - arg1, - ) + run(args[0].(interface{}), args[1].(interface{})) }) return _c } -func (_c *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call) Return(b bool) *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call { - _c.Call.Return(b) +func (_c *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call) Return(_a0 bool) *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call { + _c.Call.Return(_a0) return _c } -func (_c *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(payloadData any, filter any) bool) *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call { +func (_c *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(interface{}, interface{}) bool) *DeviceConfigurationClientInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Return(run) return _c } -// GetKeyValueDataForFilter provides a mock function for the type DeviceConfigurationClientInterface -func (_mock *DeviceConfigurationClientInterface) GetKeyValueDataForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error) { - ret := _mock.Called(filter) +// GetKeyValueDataForFilter provides a mock function with given fields: filter +func (_m *DeviceConfigurationClientInterface) GetKeyValueDataForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetKeyValueDataForFilter") @@ -103,21 +77,23 @@ func (_mock *DeviceConfigurationClientInterface) GetKeyValueDataForFilter(filter var r0 *model.DeviceConfigurationKeyValueDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyValueDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyValueDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceConfigurationKeyValueDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -134,30 +110,24 @@ func (_e *DeviceConfigurationClientInterface_Expecter) GetKeyValueDataForFilter( func (_c *DeviceConfigurationClientInterface_GetKeyValueDataForFilter_Call) Run(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType)) *DeviceConfigurationClientInterface_GetKeyValueDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyValueDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyValueDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyValueDescriptionDataType)) }) return _c } -func (_c *DeviceConfigurationClientInterface_GetKeyValueDataForFilter_Call) Return(deviceConfigurationKeyValueDataType *model.DeviceConfigurationKeyValueDataType, err error) *DeviceConfigurationClientInterface_GetKeyValueDataForFilter_Call { - _c.Call.Return(deviceConfigurationKeyValueDataType, err) +func (_c *DeviceConfigurationClientInterface_GetKeyValueDataForFilter_Call) Return(_a0 *model.DeviceConfigurationKeyValueDataType, _a1 error) *DeviceConfigurationClientInterface_GetKeyValueDataForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationClientInterface_GetKeyValueDataForFilter_Call) RunAndReturn(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationClientInterface_GetKeyValueDataForFilter_Call { +func (_c *DeviceConfigurationClientInterface_GetKeyValueDataForFilter_Call) RunAndReturn(run func(model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationClientInterface_GetKeyValueDataForFilter_Call { _c.Call.Return(run) return _c } -// GetKeyValueDataForKeyId provides a mock function for the type DeviceConfigurationClientInterface -func (_mock *DeviceConfigurationClientInterface) GetKeyValueDataForKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error) { - ret := _mock.Called(keyId) +// GetKeyValueDataForKeyId provides a mock function with given fields: keyId +func (_m *DeviceConfigurationClientInterface) GetKeyValueDataForKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error) { + ret := _m.Called(keyId) if len(ret) == 0 { panic("no return value specified for GetKeyValueDataForKeyId") @@ -165,21 +135,23 @@ func (_mock *DeviceConfigurationClientInterface) GetKeyValueDataForKeyId(keyId m var r0 *model.DeviceConfigurationKeyValueDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { - return returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { + return rf(keyId) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDataType); ok { - r0 = returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDataType); ok { + r0 = rf(keyId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceConfigurationKeyValueDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { - r1 = returnFunc(keyId) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { + r1 = rf(keyId) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -196,30 +168,24 @@ func (_e *DeviceConfigurationClientInterface_Expecter) GetKeyValueDataForKeyId(k func (_c *DeviceConfigurationClientInterface_GetKeyValueDataForKeyId_Call) Run(run func(keyId model.DeviceConfigurationKeyIdType)) *DeviceConfigurationClientInterface_GetKeyValueDataForKeyId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyIdType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyIdType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyIdType)) }) return _c } -func (_c *DeviceConfigurationClientInterface_GetKeyValueDataForKeyId_Call) Return(deviceConfigurationKeyValueDataType *model.DeviceConfigurationKeyValueDataType, err error) *DeviceConfigurationClientInterface_GetKeyValueDataForKeyId_Call { - _c.Call.Return(deviceConfigurationKeyValueDataType, err) +func (_c *DeviceConfigurationClientInterface_GetKeyValueDataForKeyId_Call) Return(_a0 *model.DeviceConfigurationKeyValueDataType, _a1 error) *DeviceConfigurationClientInterface_GetKeyValueDataForKeyId_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationClientInterface_GetKeyValueDataForKeyId_Call) RunAndReturn(run func(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationClientInterface_GetKeyValueDataForKeyId_Call { +func (_c *DeviceConfigurationClientInterface_GetKeyValueDataForKeyId_Call) RunAndReturn(run func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationClientInterface_GetKeyValueDataForKeyId_Call { _c.Call.Return(run) return _c } -// GetKeyValueDescriptionFoKeyId provides a mock function for the type DeviceConfigurationClientInterface -func (_mock *DeviceConfigurationClientInterface) GetKeyValueDescriptionFoKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error) { - ret := _mock.Called(keyId) +// GetKeyValueDescriptionFoKeyId provides a mock function with given fields: keyId +func (_m *DeviceConfigurationClientInterface) GetKeyValueDescriptionFoKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error) { + ret := _m.Called(keyId) if len(ret) == 0 { panic("no return value specified for GetKeyValueDescriptionFoKeyId") @@ -227,21 +193,23 @@ func (_mock *DeviceConfigurationClientInterface) GetKeyValueDescriptionFoKeyId(k var r0 *model.DeviceConfigurationKeyValueDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { - return returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { + return rf(keyId) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDescriptionDataType); ok { - r0 = returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDescriptionDataType); ok { + r0 = rf(keyId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceConfigurationKeyValueDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { - r1 = returnFunc(keyId) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { + r1 = rf(keyId) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -258,30 +226,24 @@ func (_e *DeviceConfigurationClientInterface_Expecter) GetKeyValueDescriptionFoK func (_c *DeviceConfigurationClientInterface_GetKeyValueDescriptionFoKeyId_Call) Run(run func(keyId model.DeviceConfigurationKeyIdType)) *DeviceConfigurationClientInterface_GetKeyValueDescriptionFoKeyId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyIdType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyIdType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyIdType)) }) return _c } -func (_c *DeviceConfigurationClientInterface_GetKeyValueDescriptionFoKeyId_Call) Return(deviceConfigurationKeyValueDescriptionDataType *model.DeviceConfigurationKeyValueDescriptionDataType, err error) *DeviceConfigurationClientInterface_GetKeyValueDescriptionFoKeyId_Call { - _c.Call.Return(deviceConfigurationKeyValueDescriptionDataType, err) +func (_c *DeviceConfigurationClientInterface_GetKeyValueDescriptionFoKeyId_Call) Return(_a0 *model.DeviceConfigurationKeyValueDescriptionDataType, _a1 error) *DeviceConfigurationClientInterface_GetKeyValueDescriptionFoKeyId_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationClientInterface_GetKeyValueDescriptionFoKeyId_Call) RunAndReturn(run func(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationClientInterface_GetKeyValueDescriptionFoKeyId_Call { +func (_c *DeviceConfigurationClientInterface_GetKeyValueDescriptionFoKeyId_Call) RunAndReturn(run func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationClientInterface_GetKeyValueDescriptionFoKeyId_Call { _c.Call.Return(run) return _c } -// GetKeyValueDescriptionsForFilter provides a mock function for the type DeviceConfigurationClientInterface -func (_mock *DeviceConfigurationClientInterface) GetKeyValueDescriptionsForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetKeyValueDescriptionsForFilter provides a mock function with given fields: filter +func (_m *DeviceConfigurationClientInterface) GetKeyValueDescriptionsForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetKeyValueDescriptionsForFilter") @@ -289,21 +251,23 @@ func (_mock *DeviceConfigurationClientInterface) GetKeyValueDescriptionsForFilte var r0 []model.DeviceConfigurationKeyValueDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) []model.DeviceConfigurationKeyValueDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) []model.DeviceConfigurationKeyValueDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.DeviceConfigurationKeyValueDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -320,30 +284,24 @@ func (_e *DeviceConfigurationClientInterface_Expecter) GetKeyValueDescriptionsFo func (_c *DeviceConfigurationClientInterface_GetKeyValueDescriptionsForFilter_Call) Run(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType)) *DeviceConfigurationClientInterface_GetKeyValueDescriptionsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyValueDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyValueDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyValueDescriptionDataType)) }) return _c } -func (_c *DeviceConfigurationClientInterface_GetKeyValueDescriptionsForFilter_Call) Return(deviceConfigurationKeyValueDescriptionDataTypes []model.DeviceConfigurationKeyValueDescriptionDataType, err error) *DeviceConfigurationClientInterface_GetKeyValueDescriptionsForFilter_Call { - _c.Call.Return(deviceConfigurationKeyValueDescriptionDataTypes, err) +func (_c *DeviceConfigurationClientInterface_GetKeyValueDescriptionsForFilter_Call) Return(_a0 []model.DeviceConfigurationKeyValueDescriptionDataType, _a1 error) *DeviceConfigurationClientInterface_GetKeyValueDescriptionsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationClientInterface_GetKeyValueDescriptionsForFilter_Call) RunAndReturn(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationClientInterface_GetKeyValueDescriptionsForFilter_Call { +func (_c *DeviceConfigurationClientInterface_GetKeyValueDescriptionsForFilter_Call) RunAndReturn(run func(model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationClientInterface_GetKeyValueDescriptionsForFilter_Call { _c.Call.Return(run) return _c } -// RequestKeyValueDescriptions provides a mock function for the type DeviceConfigurationClientInterface -func (_mock *DeviceConfigurationClientInterface) RequestKeyValueDescriptions(selector *model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType, elements *model.DeviceConfigurationKeyValueDescriptionDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestKeyValueDescriptions provides a mock function with given fields: selector, elements +func (_m *DeviceConfigurationClientInterface) RequestKeyValueDescriptions(selector *model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType, elements *model.DeviceConfigurationKeyValueDescriptionDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestKeyValueDescriptions") @@ -351,21 +309,23 @@ func (_mock *DeviceConfigurationClientInterface) RequestKeyValueDescriptions(sel var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType, *model.DeviceConfigurationKeyValueDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType, *model.DeviceConfigurationKeyValueDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType, *model.DeviceConfigurationKeyValueDescriptionDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType, *model.DeviceConfigurationKeyValueDescriptionDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType, *model.DeviceConfigurationKeyValueDescriptionDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType, *model.DeviceConfigurationKeyValueDescriptionDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -383,35 +343,24 @@ func (_e *DeviceConfigurationClientInterface_Expecter) RequestKeyValueDescriptio func (_c *DeviceConfigurationClientInterface_RequestKeyValueDescriptions_Call) Run(run func(selector *model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType, elements *model.DeviceConfigurationKeyValueDescriptionDataElementsType)) *DeviceConfigurationClientInterface_RequestKeyValueDescriptions_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType) - } - var arg1 *model.DeviceConfigurationKeyValueDescriptionDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.DeviceConfigurationKeyValueDescriptionDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType), args[1].(*model.DeviceConfigurationKeyValueDescriptionDataElementsType)) }) return _c } -func (_c *DeviceConfigurationClientInterface_RequestKeyValueDescriptions_Call) Return(msgCounterType *model.MsgCounterType, err error) *DeviceConfigurationClientInterface_RequestKeyValueDescriptions_Call { - _c.Call.Return(msgCounterType, err) +func (_c *DeviceConfigurationClientInterface_RequestKeyValueDescriptions_Call) Return(_a0 *model.MsgCounterType, _a1 error) *DeviceConfigurationClientInterface_RequestKeyValueDescriptions_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationClientInterface_RequestKeyValueDescriptions_Call) RunAndReturn(run func(selector *model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType, elements *model.DeviceConfigurationKeyValueDescriptionDataElementsType) (*model.MsgCounterType, error)) *DeviceConfigurationClientInterface_RequestKeyValueDescriptions_Call { +func (_c *DeviceConfigurationClientInterface_RequestKeyValueDescriptions_Call) RunAndReturn(run func(*model.DeviceConfigurationKeyValueDescriptionListDataSelectorsType, *model.DeviceConfigurationKeyValueDescriptionDataElementsType) (*model.MsgCounterType, error)) *DeviceConfigurationClientInterface_RequestKeyValueDescriptions_Call { _c.Call.Return(run) return _c } -// RequestKeyValues provides a mock function for the type DeviceConfigurationClientInterface -func (_mock *DeviceConfigurationClientInterface) RequestKeyValues(selector *model.DeviceConfigurationKeyValueListDataSelectorsType, elements *model.DeviceConfigurationKeyValueDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestKeyValues provides a mock function with given fields: selector, elements +func (_m *DeviceConfigurationClientInterface) RequestKeyValues(selector *model.DeviceConfigurationKeyValueListDataSelectorsType, elements *model.DeviceConfigurationKeyValueDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestKeyValues") @@ -419,21 +368,23 @@ func (_mock *DeviceConfigurationClientInterface) RequestKeyValues(selector *mode var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.DeviceConfigurationKeyValueListDataSelectorsType, *model.DeviceConfigurationKeyValueDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.DeviceConfigurationKeyValueListDataSelectorsType, *model.DeviceConfigurationKeyValueDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.DeviceConfigurationKeyValueListDataSelectorsType, *model.DeviceConfigurationKeyValueDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.DeviceConfigurationKeyValueListDataSelectorsType, *model.DeviceConfigurationKeyValueDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.DeviceConfigurationKeyValueListDataSelectorsType, *model.DeviceConfigurationKeyValueDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.DeviceConfigurationKeyValueListDataSelectorsType, *model.DeviceConfigurationKeyValueDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -451,35 +402,24 @@ func (_e *DeviceConfigurationClientInterface_Expecter) RequestKeyValues(selector func (_c *DeviceConfigurationClientInterface_RequestKeyValues_Call) Run(run func(selector *model.DeviceConfigurationKeyValueListDataSelectorsType, elements *model.DeviceConfigurationKeyValueDataElementsType)) *DeviceConfigurationClientInterface_RequestKeyValues_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.DeviceConfigurationKeyValueListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.DeviceConfigurationKeyValueListDataSelectorsType) - } - var arg1 *model.DeviceConfigurationKeyValueDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.DeviceConfigurationKeyValueDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.DeviceConfigurationKeyValueListDataSelectorsType), args[1].(*model.DeviceConfigurationKeyValueDataElementsType)) }) return _c } -func (_c *DeviceConfigurationClientInterface_RequestKeyValues_Call) Return(msgCounterType *model.MsgCounterType, err error) *DeviceConfigurationClientInterface_RequestKeyValues_Call { - _c.Call.Return(msgCounterType, err) +func (_c *DeviceConfigurationClientInterface_RequestKeyValues_Call) Return(_a0 *model.MsgCounterType, _a1 error) *DeviceConfigurationClientInterface_RequestKeyValues_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationClientInterface_RequestKeyValues_Call) RunAndReturn(run func(selector *model.DeviceConfigurationKeyValueListDataSelectorsType, elements *model.DeviceConfigurationKeyValueDataElementsType) (*model.MsgCounterType, error)) *DeviceConfigurationClientInterface_RequestKeyValues_Call { +func (_c *DeviceConfigurationClientInterface_RequestKeyValues_Call) RunAndReturn(run func(*model.DeviceConfigurationKeyValueListDataSelectorsType, *model.DeviceConfigurationKeyValueDataElementsType) (*model.MsgCounterType, error)) *DeviceConfigurationClientInterface_RequestKeyValues_Call { _c.Call.Return(run) return _c } -// WriteKeyValues provides a mock function for the type DeviceConfigurationClientInterface -func (_mock *DeviceConfigurationClientInterface) WriteKeyValues(data []model.DeviceConfigurationKeyValueDataType) (*model.MsgCounterType, error) { - ret := _mock.Called(data) +// WriteKeyValues provides a mock function with given fields: data +func (_m *DeviceConfigurationClientInterface) WriteKeyValues(data []model.DeviceConfigurationKeyValueDataType) (*model.MsgCounterType, error) { + ret := _m.Called(data) if len(ret) == 0 { panic("no return value specified for WriteKeyValues") @@ -487,21 +427,23 @@ func (_mock *DeviceConfigurationClientInterface) WriteKeyValues(data []model.Dev var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func([]model.DeviceConfigurationKeyValueDataType) (*model.MsgCounterType, error)); ok { - return returnFunc(data) + if rf, ok := ret.Get(0).(func([]model.DeviceConfigurationKeyValueDataType) (*model.MsgCounterType, error)); ok { + return rf(data) } - if returnFunc, ok := ret.Get(0).(func([]model.DeviceConfigurationKeyValueDataType) *model.MsgCounterType); ok { - r0 = returnFunc(data) + if rf, ok := ret.Get(0).(func([]model.DeviceConfigurationKeyValueDataType) *model.MsgCounterType); ok { + r0 = rf(data) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func([]model.DeviceConfigurationKeyValueDataType) error); ok { - r1 = returnFunc(data) + + if rf, ok := ret.Get(1).(func([]model.DeviceConfigurationKeyValueDataType) error); ok { + r1 = rf(data) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -518,23 +460,31 @@ func (_e *DeviceConfigurationClientInterface_Expecter) WriteKeyValues(data inter func (_c *DeviceConfigurationClientInterface_WriteKeyValues_Call) Run(run func(data []model.DeviceConfigurationKeyValueDataType)) *DeviceConfigurationClientInterface_WriteKeyValues_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []model.DeviceConfigurationKeyValueDataType - if args[0] != nil { - arg0 = args[0].([]model.DeviceConfigurationKeyValueDataType) - } - run( - arg0, - ) + run(args[0].([]model.DeviceConfigurationKeyValueDataType)) }) return _c } -func (_c *DeviceConfigurationClientInterface_WriteKeyValues_Call) Return(msgCounterType *model.MsgCounterType, err error) *DeviceConfigurationClientInterface_WriteKeyValues_Call { - _c.Call.Return(msgCounterType, err) +func (_c *DeviceConfigurationClientInterface_WriteKeyValues_Call) Return(_a0 *model.MsgCounterType, _a1 error) *DeviceConfigurationClientInterface_WriteKeyValues_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationClientInterface_WriteKeyValues_Call) RunAndReturn(run func(data []model.DeviceConfigurationKeyValueDataType) (*model.MsgCounterType, error)) *DeviceConfigurationClientInterface_WriteKeyValues_Call { +func (_c *DeviceConfigurationClientInterface_WriteKeyValues_Call) RunAndReturn(run func([]model.DeviceConfigurationKeyValueDataType) (*model.MsgCounterType, error)) *DeviceConfigurationClientInterface_WriteKeyValues_Call { _c.Call.Return(run) return _c } + +// NewDeviceConfigurationClientInterface creates a new instance of DeviceConfigurationClientInterface. 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 NewDeviceConfigurationClientInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *DeviceConfigurationClientInterface { + mock := &DeviceConfigurationClientInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/DeviceConfigurationCommonInterface.go b/mocks/DeviceConfigurationCommonInterface.go index 469b445d..56fdc8a7 100644 --- a/mocks/DeviceConfigurationCommonInterface.go +++ b/mocks/DeviceConfigurationCommonInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewDeviceConfigurationCommonInterface creates a new instance of DeviceConfigurationCommonInterface. 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 NewDeviceConfigurationCommonInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *DeviceConfigurationCommonInterface { - mock := &DeviceConfigurationCommonInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // DeviceConfigurationCommonInterface is an autogenerated mock type for the DeviceConfigurationCommonInterface type type DeviceConfigurationCommonInterface struct { mock.Mock @@ -36,20 +20,21 @@ func (_m *DeviceConfigurationCommonInterface) EXPECT() *DeviceConfigurationCommo return &DeviceConfigurationCommonInterface_Expecter{mock: &_m.Mock} } -// CheckEventPayloadDataForFilter provides a mock function for the type DeviceConfigurationCommonInterface -func (_mock *DeviceConfigurationCommonInterface) CheckEventPayloadDataForFilter(payloadData any, filter any) bool { - ret := _mock.Called(payloadData, filter) +// CheckEventPayloadDataForFilter provides a mock function with given fields: payloadData, filter +func (_m *DeviceConfigurationCommonInterface) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) bool { + ret := _m.Called(payloadData, filter) if len(ret) == 0 { panic("no return value specified for CheckEventPayloadDataForFilter") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(any, any) bool); ok { - r0 = returnFunc(payloadData, filter) + if rf, ok := ret.Get(0).(func(interface{}, interface{}) bool); ok { + r0 = rf(payloadData, filter) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -59,43 +44,32 @@ type DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call stru } // CheckEventPayloadDataForFilter is a helper method to define mock.On call -// - payloadData any -// - filter any +// - payloadData interface{} +// - filter interface{} func (_e *DeviceConfigurationCommonInterface_Expecter) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call { return &DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call{Call: _e.mock.On("CheckEventPayloadDataForFilter", payloadData, filter)} } -func (_c *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData any, filter any)) *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call { +func (_c *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData interface{}, filter interface{})) *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 any - if args[0] != nil { - arg0 = args[0].(any) - } - var arg1 any - if args[1] != nil { - arg1 = args[1].(any) - } - run( - arg0, - arg1, - ) + run(args[0].(interface{}), args[1].(interface{})) }) return _c } -func (_c *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call) Return(b bool) *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call { - _c.Call.Return(b) +func (_c *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call) Return(_a0 bool) *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call { + _c.Call.Return(_a0) return _c } -func (_c *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(payloadData any, filter any) bool) *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call { +func (_c *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(interface{}, interface{}) bool) *DeviceConfigurationCommonInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Return(run) return _c } -// GetKeyValueDataForFilter provides a mock function for the type DeviceConfigurationCommonInterface -func (_mock *DeviceConfigurationCommonInterface) GetKeyValueDataForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error) { - ret := _mock.Called(filter) +// GetKeyValueDataForFilter provides a mock function with given fields: filter +func (_m *DeviceConfigurationCommonInterface) GetKeyValueDataForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetKeyValueDataForFilter") @@ -103,21 +77,23 @@ func (_mock *DeviceConfigurationCommonInterface) GetKeyValueDataForFilter(filter var r0 *model.DeviceConfigurationKeyValueDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyValueDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyValueDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceConfigurationKeyValueDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -134,30 +110,24 @@ func (_e *DeviceConfigurationCommonInterface_Expecter) GetKeyValueDataForFilter( func (_c *DeviceConfigurationCommonInterface_GetKeyValueDataForFilter_Call) Run(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType)) *DeviceConfigurationCommonInterface_GetKeyValueDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyValueDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyValueDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyValueDescriptionDataType)) }) return _c } -func (_c *DeviceConfigurationCommonInterface_GetKeyValueDataForFilter_Call) Return(deviceConfigurationKeyValueDataType *model.DeviceConfigurationKeyValueDataType, err error) *DeviceConfigurationCommonInterface_GetKeyValueDataForFilter_Call { - _c.Call.Return(deviceConfigurationKeyValueDataType, err) +func (_c *DeviceConfigurationCommonInterface_GetKeyValueDataForFilter_Call) Return(_a0 *model.DeviceConfigurationKeyValueDataType, _a1 error) *DeviceConfigurationCommonInterface_GetKeyValueDataForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationCommonInterface_GetKeyValueDataForFilter_Call) RunAndReturn(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationCommonInterface_GetKeyValueDataForFilter_Call { +func (_c *DeviceConfigurationCommonInterface_GetKeyValueDataForFilter_Call) RunAndReturn(run func(model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationCommonInterface_GetKeyValueDataForFilter_Call { _c.Call.Return(run) return _c } -// GetKeyValueDataForKeyId provides a mock function for the type DeviceConfigurationCommonInterface -func (_mock *DeviceConfigurationCommonInterface) GetKeyValueDataForKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error) { - ret := _mock.Called(keyId) +// GetKeyValueDataForKeyId provides a mock function with given fields: keyId +func (_m *DeviceConfigurationCommonInterface) GetKeyValueDataForKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error) { + ret := _m.Called(keyId) if len(ret) == 0 { panic("no return value specified for GetKeyValueDataForKeyId") @@ -165,21 +135,23 @@ func (_mock *DeviceConfigurationCommonInterface) GetKeyValueDataForKeyId(keyId m var r0 *model.DeviceConfigurationKeyValueDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { - return returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { + return rf(keyId) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDataType); ok { - r0 = returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDataType); ok { + r0 = rf(keyId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceConfigurationKeyValueDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { - r1 = returnFunc(keyId) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { + r1 = rf(keyId) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -196,30 +168,24 @@ func (_e *DeviceConfigurationCommonInterface_Expecter) GetKeyValueDataForKeyId(k func (_c *DeviceConfigurationCommonInterface_GetKeyValueDataForKeyId_Call) Run(run func(keyId model.DeviceConfigurationKeyIdType)) *DeviceConfigurationCommonInterface_GetKeyValueDataForKeyId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyIdType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyIdType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyIdType)) }) return _c } -func (_c *DeviceConfigurationCommonInterface_GetKeyValueDataForKeyId_Call) Return(deviceConfigurationKeyValueDataType *model.DeviceConfigurationKeyValueDataType, err error) *DeviceConfigurationCommonInterface_GetKeyValueDataForKeyId_Call { - _c.Call.Return(deviceConfigurationKeyValueDataType, err) +func (_c *DeviceConfigurationCommonInterface_GetKeyValueDataForKeyId_Call) Return(_a0 *model.DeviceConfigurationKeyValueDataType, _a1 error) *DeviceConfigurationCommonInterface_GetKeyValueDataForKeyId_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationCommonInterface_GetKeyValueDataForKeyId_Call) RunAndReturn(run func(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationCommonInterface_GetKeyValueDataForKeyId_Call { +func (_c *DeviceConfigurationCommonInterface_GetKeyValueDataForKeyId_Call) RunAndReturn(run func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationCommonInterface_GetKeyValueDataForKeyId_Call { _c.Call.Return(run) return _c } -// GetKeyValueDescriptionFoKeyId provides a mock function for the type DeviceConfigurationCommonInterface -func (_mock *DeviceConfigurationCommonInterface) GetKeyValueDescriptionFoKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error) { - ret := _mock.Called(keyId) +// GetKeyValueDescriptionFoKeyId provides a mock function with given fields: keyId +func (_m *DeviceConfigurationCommonInterface) GetKeyValueDescriptionFoKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error) { + ret := _m.Called(keyId) if len(ret) == 0 { panic("no return value specified for GetKeyValueDescriptionFoKeyId") @@ -227,21 +193,23 @@ func (_mock *DeviceConfigurationCommonInterface) GetKeyValueDescriptionFoKeyId(k var r0 *model.DeviceConfigurationKeyValueDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { - return returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { + return rf(keyId) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDescriptionDataType); ok { - r0 = returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDescriptionDataType); ok { + r0 = rf(keyId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceConfigurationKeyValueDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { - r1 = returnFunc(keyId) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { + r1 = rf(keyId) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -258,30 +226,24 @@ func (_e *DeviceConfigurationCommonInterface_Expecter) GetKeyValueDescriptionFoK func (_c *DeviceConfigurationCommonInterface_GetKeyValueDescriptionFoKeyId_Call) Run(run func(keyId model.DeviceConfigurationKeyIdType)) *DeviceConfigurationCommonInterface_GetKeyValueDescriptionFoKeyId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyIdType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyIdType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyIdType)) }) return _c } -func (_c *DeviceConfigurationCommonInterface_GetKeyValueDescriptionFoKeyId_Call) Return(deviceConfigurationKeyValueDescriptionDataType *model.DeviceConfigurationKeyValueDescriptionDataType, err error) *DeviceConfigurationCommonInterface_GetKeyValueDescriptionFoKeyId_Call { - _c.Call.Return(deviceConfigurationKeyValueDescriptionDataType, err) +func (_c *DeviceConfigurationCommonInterface_GetKeyValueDescriptionFoKeyId_Call) Return(_a0 *model.DeviceConfigurationKeyValueDescriptionDataType, _a1 error) *DeviceConfigurationCommonInterface_GetKeyValueDescriptionFoKeyId_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationCommonInterface_GetKeyValueDescriptionFoKeyId_Call) RunAndReturn(run func(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationCommonInterface_GetKeyValueDescriptionFoKeyId_Call { +func (_c *DeviceConfigurationCommonInterface_GetKeyValueDescriptionFoKeyId_Call) RunAndReturn(run func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationCommonInterface_GetKeyValueDescriptionFoKeyId_Call { _c.Call.Return(run) return _c } -// GetKeyValueDescriptionsForFilter provides a mock function for the type DeviceConfigurationCommonInterface -func (_mock *DeviceConfigurationCommonInterface) GetKeyValueDescriptionsForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetKeyValueDescriptionsForFilter provides a mock function with given fields: filter +func (_m *DeviceConfigurationCommonInterface) GetKeyValueDescriptionsForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetKeyValueDescriptionsForFilter") @@ -289,21 +251,23 @@ func (_mock *DeviceConfigurationCommonInterface) GetKeyValueDescriptionsForFilte var r0 []model.DeviceConfigurationKeyValueDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) []model.DeviceConfigurationKeyValueDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) []model.DeviceConfigurationKeyValueDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.DeviceConfigurationKeyValueDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -320,23 +284,31 @@ func (_e *DeviceConfigurationCommonInterface_Expecter) GetKeyValueDescriptionsFo func (_c *DeviceConfigurationCommonInterface_GetKeyValueDescriptionsForFilter_Call) Run(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType)) *DeviceConfigurationCommonInterface_GetKeyValueDescriptionsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyValueDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyValueDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyValueDescriptionDataType)) }) return _c } -func (_c *DeviceConfigurationCommonInterface_GetKeyValueDescriptionsForFilter_Call) Return(deviceConfigurationKeyValueDescriptionDataTypes []model.DeviceConfigurationKeyValueDescriptionDataType, err error) *DeviceConfigurationCommonInterface_GetKeyValueDescriptionsForFilter_Call { - _c.Call.Return(deviceConfigurationKeyValueDescriptionDataTypes, err) +func (_c *DeviceConfigurationCommonInterface_GetKeyValueDescriptionsForFilter_Call) Return(_a0 []model.DeviceConfigurationKeyValueDescriptionDataType, _a1 error) *DeviceConfigurationCommonInterface_GetKeyValueDescriptionsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationCommonInterface_GetKeyValueDescriptionsForFilter_Call) RunAndReturn(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationCommonInterface_GetKeyValueDescriptionsForFilter_Call { +func (_c *DeviceConfigurationCommonInterface_GetKeyValueDescriptionsForFilter_Call) RunAndReturn(run func(model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationCommonInterface_GetKeyValueDescriptionsForFilter_Call { _c.Call.Return(run) return _c } + +// NewDeviceConfigurationCommonInterface creates a new instance of DeviceConfigurationCommonInterface. 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 NewDeviceConfigurationCommonInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *DeviceConfigurationCommonInterface { + mock := &DeviceConfigurationCommonInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/DeviceConfigurationServerInterface.go b/mocks/DeviceConfigurationServerInterface.go index ed35a0e0..157065da 100644 --- a/mocks/DeviceConfigurationServerInterface.go +++ b/mocks/DeviceConfigurationServerInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewDeviceConfigurationServerInterface creates a new instance of DeviceConfigurationServerInterface. 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 NewDeviceConfigurationServerInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *DeviceConfigurationServerInterface { - mock := &DeviceConfigurationServerInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // DeviceConfigurationServerInterface is an autogenerated mock type for the DeviceConfigurationServerInterface type type DeviceConfigurationServerInterface struct { mock.Mock @@ -36,22 +20,23 @@ func (_m *DeviceConfigurationServerInterface) EXPECT() *DeviceConfigurationServe return &DeviceConfigurationServerInterface_Expecter{mock: &_m.Mock} } -// AddKeyValueDescription provides a mock function for the type DeviceConfigurationServerInterface -func (_mock *DeviceConfigurationServerInterface) AddKeyValueDescription(description model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyIdType { - ret := _mock.Called(description) +// AddKeyValueDescription provides a mock function with given fields: description +func (_m *DeviceConfigurationServerInterface) AddKeyValueDescription(description model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyIdType { + ret := _m.Called(description) if len(ret) == 0 { panic("no return value specified for AddKeyValueDescription") } var r0 *model.DeviceConfigurationKeyIdType - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyIdType); ok { - r0 = returnFunc(description) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyIdType); ok { + r0 = rf(description) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceConfigurationKeyIdType) } } + return r0 } @@ -68,41 +53,36 @@ func (_e *DeviceConfigurationServerInterface_Expecter) AddKeyValueDescription(de func (_c *DeviceConfigurationServerInterface_AddKeyValueDescription_Call) Run(run func(description model.DeviceConfigurationKeyValueDescriptionDataType)) *DeviceConfigurationServerInterface_AddKeyValueDescription_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyValueDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyValueDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyValueDescriptionDataType)) }) return _c } -func (_c *DeviceConfigurationServerInterface_AddKeyValueDescription_Call) Return(deviceConfigurationKeyIdType *model.DeviceConfigurationKeyIdType) *DeviceConfigurationServerInterface_AddKeyValueDescription_Call { - _c.Call.Return(deviceConfigurationKeyIdType) +func (_c *DeviceConfigurationServerInterface_AddKeyValueDescription_Call) Return(_a0 *model.DeviceConfigurationKeyIdType) *DeviceConfigurationServerInterface_AddKeyValueDescription_Call { + _c.Call.Return(_a0) return _c } -func (_c *DeviceConfigurationServerInterface_AddKeyValueDescription_Call) RunAndReturn(run func(description model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyIdType) *DeviceConfigurationServerInterface_AddKeyValueDescription_Call { +func (_c *DeviceConfigurationServerInterface_AddKeyValueDescription_Call) RunAndReturn(run func(model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyIdType) *DeviceConfigurationServerInterface_AddKeyValueDescription_Call { _c.Call.Return(run) return _c } -// CheckEventPayloadDataForFilter provides a mock function for the type DeviceConfigurationServerInterface -func (_mock *DeviceConfigurationServerInterface) CheckEventPayloadDataForFilter(payloadData any, filter any) bool { - ret := _mock.Called(payloadData, filter) +// CheckEventPayloadDataForFilter provides a mock function with given fields: payloadData, filter +func (_m *DeviceConfigurationServerInterface) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) bool { + ret := _m.Called(payloadData, filter) if len(ret) == 0 { panic("no return value specified for CheckEventPayloadDataForFilter") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(any, any) bool); ok { - r0 = returnFunc(payloadData, filter) + if rf, ok := ret.Get(0).(func(interface{}, interface{}) bool); ok { + r0 = rf(payloadData, filter) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -112,43 +92,32 @@ type DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call stru } // CheckEventPayloadDataForFilter is a helper method to define mock.On call -// - payloadData any -// - filter any +// - payloadData interface{} +// - filter interface{} func (_e *DeviceConfigurationServerInterface_Expecter) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call { return &DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call{Call: _e.mock.On("CheckEventPayloadDataForFilter", payloadData, filter)} } -func (_c *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData any, filter any)) *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call { +func (_c *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData interface{}, filter interface{})) *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 any - if args[0] != nil { - arg0 = args[0].(any) - } - var arg1 any - if args[1] != nil { - arg1 = args[1].(any) - } - run( - arg0, - arg1, - ) + run(args[0].(interface{}), args[1].(interface{})) }) return _c } -func (_c *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call) Return(b bool) *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call { - _c.Call.Return(b) +func (_c *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call) Return(_a0 bool) *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call { + _c.Call.Return(_a0) return _c } -func (_c *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(payloadData any, filter any) bool) *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call { +func (_c *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(interface{}, interface{}) bool) *DeviceConfigurationServerInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Return(run) return _c } -// GetKeyValueDataForFilter provides a mock function for the type DeviceConfigurationServerInterface -func (_mock *DeviceConfigurationServerInterface) GetKeyValueDataForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error) { - ret := _mock.Called(filter) +// GetKeyValueDataForFilter provides a mock function with given fields: filter +func (_m *DeviceConfigurationServerInterface) GetKeyValueDataForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetKeyValueDataForFilter") @@ -156,21 +125,23 @@ func (_mock *DeviceConfigurationServerInterface) GetKeyValueDataForFilter(filter var r0 *model.DeviceConfigurationKeyValueDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyValueDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) *model.DeviceConfigurationKeyValueDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceConfigurationKeyValueDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -187,30 +158,24 @@ func (_e *DeviceConfigurationServerInterface_Expecter) GetKeyValueDataForFilter( func (_c *DeviceConfigurationServerInterface_GetKeyValueDataForFilter_Call) Run(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType)) *DeviceConfigurationServerInterface_GetKeyValueDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyValueDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyValueDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyValueDescriptionDataType)) }) return _c } -func (_c *DeviceConfigurationServerInterface_GetKeyValueDataForFilter_Call) Return(deviceConfigurationKeyValueDataType *model.DeviceConfigurationKeyValueDataType, err error) *DeviceConfigurationServerInterface_GetKeyValueDataForFilter_Call { - _c.Call.Return(deviceConfigurationKeyValueDataType, err) +func (_c *DeviceConfigurationServerInterface_GetKeyValueDataForFilter_Call) Return(_a0 *model.DeviceConfigurationKeyValueDataType, _a1 error) *DeviceConfigurationServerInterface_GetKeyValueDataForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationServerInterface_GetKeyValueDataForFilter_Call) RunAndReturn(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationServerInterface_GetKeyValueDataForFilter_Call { +func (_c *DeviceConfigurationServerInterface_GetKeyValueDataForFilter_Call) RunAndReturn(run func(model.DeviceConfigurationKeyValueDescriptionDataType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationServerInterface_GetKeyValueDataForFilter_Call { _c.Call.Return(run) return _c } -// GetKeyValueDataForKeyId provides a mock function for the type DeviceConfigurationServerInterface -func (_mock *DeviceConfigurationServerInterface) GetKeyValueDataForKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error) { - ret := _mock.Called(keyId) +// GetKeyValueDataForKeyId provides a mock function with given fields: keyId +func (_m *DeviceConfigurationServerInterface) GetKeyValueDataForKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error) { + ret := _m.Called(keyId) if len(ret) == 0 { panic("no return value specified for GetKeyValueDataForKeyId") @@ -218,21 +183,23 @@ func (_mock *DeviceConfigurationServerInterface) GetKeyValueDataForKeyId(keyId m var r0 *model.DeviceConfigurationKeyValueDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { - return returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)); ok { + return rf(keyId) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDataType); ok { - r0 = returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDataType); ok { + r0 = rf(keyId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceConfigurationKeyValueDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { - r1 = returnFunc(keyId) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { + r1 = rf(keyId) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -249,30 +216,24 @@ func (_e *DeviceConfigurationServerInterface_Expecter) GetKeyValueDataForKeyId(k func (_c *DeviceConfigurationServerInterface_GetKeyValueDataForKeyId_Call) Run(run func(keyId model.DeviceConfigurationKeyIdType)) *DeviceConfigurationServerInterface_GetKeyValueDataForKeyId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyIdType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyIdType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyIdType)) }) return _c } -func (_c *DeviceConfigurationServerInterface_GetKeyValueDataForKeyId_Call) Return(deviceConfigurationKeyValueDataType *model.DeviceConfigurationKeyValueDataType, err error) *DeviceConfigurationServerInterface_GetKeyValueDataForKeyId_Call { - _c.Call.Return(deviceConfigurationKeyValueDataType, err) +func (_c *DeviceConfigurationServerInterface_GetKeyValueDataForKeyId_Call) Return(_a0 *model.DeviceConfigurationKeyValueDataType, _a1 error) *DeviceConfigurationServerInterface_GetKeyValueDataForKeyId_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationServerInterface_GetKeyValueDataForKeyId_Call) RunAndReturn(run func(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationServerInterface_GetKeyValueDataForKeyId_Call { +func (_c *DeviceConfigurationServerInterface_GetKeyValueDataForKeyId_Call) RunAndReturn(run func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDataType, error)) *DeviceConfigurationServerInterface_GetKeyValueDataForKeyId_Call { _c.Call.Return(run) return _c } -// GetKeyValueDescriptionFoKeyId provides a mock function for the type DeviceConfigurationServerInterface -func (_mock *DeviceConfigurationServerInterface) GetKeyValueDescriptionFoKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error) { - ret := _mock.Called(keyId) +// GetKeyValueDescriptionFoKeyId provides a mock function with given fields: keyId +func (_m *DeviceConfigurationServerInterface) GetKeyValueDescriptionFoKeyId(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error) { + ret := _m.Called(keyId) if len(ret) == 0 { panic("no return value specified for GetKeyValueDescriptionFoKeyId") @@ -280,21 +241,23 @@ func (_mock *DeviceConfigurationServerInterface) GetKeyValueDescriptionFoKeyId(k var r0 *model.DeviceConfigurationKeyValueDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { - return returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { + return rf(keyId) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDescriptionDataType); ok { - r0 = returnFunc(keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyIdType) *model.DeviceConfigurationKeyValueDescriptionDataType); ok { + r0 = rf(keyId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceConfigurationKeyValueDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { - r1 = returnFunc(keyId) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyIdType) error); ok { + r1 = rf(keyId) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -311,30 +274,24 @@ func (_e *DeviceConfigurationServerInterface_Expecter) GetKeyValueDescriptionFoK func (_c *DeviceConfigurationServerInterface_GetKeyValueDescriptionFoKeyId_Call) Run(run func(keyId model.DeviceConfigurationKeyIdType)) *DeviceConfigurationServerInterface_GetKeyValueDescriptionFoKeyId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyIdType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyIdType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyIdType)) }) return _c } -func (_c *DeviceConfigurationServerInterface_GetKeyValueDescriptionFoKeyId_Call) Return(deviceConfigurationKeyValueDescriptionDataType *model.DeviceConfigurationKeyValueDescriptionDataType, err error) *DeviceConfigurationServerInterface_GetKeyValueDescriptionFoKeyId_Call { - _c.Call.Return(deviceConfigurationKeyValueDescriptionDataType, err) +func (_c *DeviceConfigurationServerInterface_GetKeyValueDescriptionFoKeyId_Call) Return(_a0 *model.DeviceConfigurationKeyValueDescriptionDataType, _a1 error) *DeviceConfigurationServerInterface_GetKeyValueDescriptionFoKeyId_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationServerInterface_GetKeyValueDescriptionFoKeyId_Call) RunAndReturn(run func(keyId model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationServerInterface_GetKeyValueDescriptionFoKeyId_Call { +func (_c *DeviceConfigurationServerInterface_GetKeyValueDescriptionFoKeyId_Call) RunAndReturn(run func(model.DeviceConfigurationKeyIdType) (*model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationServerInterface_GetKeyValueDescriptionFoKeyId_Call { _c.Call.Return(run) return _c } -// GetKeyValueDescriptionsForFilter provides a mock function for the type DeviceConfigurationServerInterface -func (_mock *DeviceConfigurationServerInterface) GetKeyValueDescriptionsForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetKeyValueDescriptionsForFilter provides a mock function with given fields: filter +func (_m *DeviceConfigurationServerInterface) GetKeyValueDescriptionsForFilter(filter model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetKeyValueDescriptionsForFilter") @@ -342,21 +299,23 @@ func (_mock *DeviceConfigurationServerInterface) GetKeyValueDescriptionsForFilte var r0 []model.DeviceConfigurationKeyValueDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) []model.DeviceConfigurationKeyValueDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDescriptionDataType) []model.DeviceConfigurationKeyValueDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.DeviceConfigurationKeyValueDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -373,41 +332,36 @@ func (_e *DeviceConfigurationServerInterface_Expecter) GetKeyValueDescriptionsFo func (_c *DeviceConfigurationServerInterface_GetKeyValueDescriptionsForFilter_Call) Run(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType)) *DeviceConfigurationServerInterface_GetKeyValueDescriptionsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyValueDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyValueDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.DeviceConfigurationKeyValueDescriptionDataType)) }) return _c } -func (_c *DeviceConfigurationServerInterface_GetKeyValueDescriptionsForFilter_Call) Return(deviceConfigurationKeyValueDescriptionDataTypes []model.DeviceConfigurationKeyValueDescriptionDataType, err error) *DeviceConfigurationServerInterface_GetKeyValueDescriptionsForFilter_Call { - _c.Call.Return(deviceConfigurationKeyValueDescriptionDataTypes, err) +func (_c *DeviceConfigurationServerInterface_GetKeyValueDescriptionsForFilter_Call) Return(_a0 []model.DeviceConfigurationKeyValueDescriptionDataType, _a1 error) *DeviceConfigurationServerInterface_GetKeyValueDescriptionsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *DeviceConfigurationServerInterface_GetKeyValueDescriptionsForFilter_Call) RunAndReturn(run func(filter model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationServerInterface_GetKeyValueDescriptionsForFilter_Call { +func (_c *DeviceConfigurationServerInterface_GetKeyValueDescriptionsForFilter_Call) RunAndReturn(run func(model.DeviceConfigurationKeyValueDescriptionDataType) ([]model.DeviceConfigurationKeyValueDescriptionDataType, error)) *DeviceConfigurationServerInterface_GetKeyValueDescriptionsForFilter_Call { _c.Call.Return(run) return _c } -// UpdateKeyValueDataForFilter provides a mock function for the type DeviceConfigurationServerInterface -func (_mock *DeviceConfigurationServerInterface) UpdateKeyValueDataForFilter(data model.DeviceConfigurationKeyValueDataType, deleteElements *model.DeviceConfigurationKeyValueDataElementsType, filter model.DeviceConfigurationKeyValueDescriptionDataType) error { - ret := _mock.Called(data, deleteElements, filter) +// UpdateKeyValueDataForFilter provides a mock function with given fields: data, deleteElements, filter +func (_m *DeviceConfigurationServerInterface) UpdateKeyValueDataForFilter(data model.DeviceConfigurationKeyValueDataType, deleteElements *model.DeviceConfigurationKeyValueDataElementsType, filter model.DeviceConfigurationKeyValueDescriptionDataType) error { + ret := _m.Called(data, deleteElements, filter) if len(ret) == 0 { panic("no return value specified for UpdateKeyValueDataForFilter") } var r0 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDataType, *model.DeviceConfigurationKeyValueDataElementsType, model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { - r0 = returnFunc(data, deleteElements, filter) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDataType, *model.DeviceConfigurationKeyValueDataElementsType, model.DeviceConfigurationKeyValueDescriptionDataType) error); ok { + r0 = rf(data, deleteElements, filter) } else { r0 = ret.Error(0) } + return r0 } @@ -426,51 +380,36 @@ func (_e *DeviceConfigurationServerInterface_Expecter) UpdateKeyValueDataForFilt func (_c *DeviceConfigurationServerInterface_UpdateKeyValueDataForFilter_Call) Run(run func(data model.DeviceConfigurationKeyValueDataType, deleteElements *model.DeviceConfigurationKeyValueDataElementsType, filter model.DeviceConfigurationKeyValueDescriptionDataType)) *DeviceConfigurationServerInterface_UpdateKeyValueDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyValueDataType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyValueDataType) - } - var arg1 *model.DeviceConfigurationKeyValueDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.DeviceConfigurationKeyValueDataElementsType) - } - var arg2 model.DeviceConfigurationKeyValueDescriptionDataType - if args[2] != nil { - arg2 = args[2].(model.DeviceConfigurationKeyValueDescriptionDataType) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].(model.DeviceConfigurationKeyValueDataType), args[1].(*model.DeviceConfigurationKeyValueDataElementsType), args[2].(model.DeviceConfigurationKeyValueDescriptionDataType)) }) return _c } -func (_c *DeviceConfigurationServerInterface_UpdateKeyValueDataForFilter_Call) Return(err error) *DeviceConfigurationServerInterface_UpdateKeyValueDataForFilter_Call { - _c.Call.Return(err) +func (_c *DeviceConfigurationServerInterface_UpdateKeyValueDataForFilter_Call) Return(_a0 error) *DeviceConfigurationServerInterface_UpdateKeyValueDataForFilter_Call { + _c.Call.Return(_a0) return _c } -func (_c *DeviceConfigurationServerInterface_UpdateKeyValueDataForFilter_Call) RunAndReturn(run func(data model.DeviceConfigurationKeyValueDataType, deleteElements *model.DeviceConfigurationKeyValueDataElementsType, filter model.DeviceConfigurationKeyValueDescriptionDataType) error) *DeviceConfigurationServerInterface_UpdateKeyValueDataForFilter_Call { +func (_c *DeviceConfigurationServerInterface_UpdateKeyValueDataForFilter_Call) RunAndReturn(run func(model.DeviceConfigurationKeyValueDataType, *model.DeviceConfigurationKeyValueDataElementsType, model.DeviceConfigurationKeyValueDescriptionDataType) error) *DeviceConfigurationServerInterface_UpdateKeyValueDataForFilter_Call { _c.Call.Return(run) return _c } -// UpdateKeyValueDataForKeyId provides a mock function for the type DeviceConfigurationServerInterface -func (_mock *DeviceConfigurationServerInterface) UpdateKeyValueDataForKeyId(data model.DeviceConfigurationKeyValueDataType, deleteElements *model.DeviceConfigurationKeyValueDataElementsType, keyId model.DeviceConfigurationKeyIdType) error { - ret := _mock.Called(data, deleteElements, keyId) +// UpdateKeyValueDataForKeyId provides a mock function with given fields: data, deleteElements, keyId +func (_m *DeviceConfigurationServerInterface) UpdateKeyValueDataForKeyId(data model.DeviceConfigurationKeyValueDataType, deleteElements *model.DeviceConfigurationKeyValueDataElementsType, keyId model.DeviceConfigurationKeyIdType) error { + ret := _m.Called(data, deleteElements, keyId) if len(ret) == 0 { panic("no return value specified for UpdateKeyValueDataForKeyId") } var r0 error - if returnFunc, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDataType, *model.DeviceConfigurationKeyValueDataElementsType, model.DeviceConfigurationKeyIdType) error); ok { - r0 = returnFunc(data, deleteElements, keyId) + if rf, ok := ret.Get(0).(func(model.DeviceConfigurationKeyValueDataType, *model.DeviceConfigurationKeyValueDataElementsType, model.DeviceConfigurationKeyIdType) error); ok { + r0 = rf(data, deleteElements, keyId) } else { r0 = ret.Error(0) } + return r0 } @@ -489,33 +428,31 @@ func (_e *DeviceConfigurationServerInterface_Expecter) UpdateKeyValueDataForKeyI func (_c *DeviceConfigurationServerInterface_UpdateKeyValueDataForKeyId_Call) Run(run func(data model.DeviceConfigurationKeyValueDataType, deleteElements *model.DeviceConfigurationKeyValueDataElementsType, keyId model.DeviceConfigurationKeyIdType)) *DeviceConfigurationServerInterface_UpdateKeyValueDataForKeyId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceConfigurationKeyValueDataType - if args[0] != nil { - arg0 = args[0].(model.DeviceConfigurationKeyValueDataType) - } - var arg1 *model.DeviceConfigurationKeyValueDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.DeviceConfigurationKeyValueDataElementsType) - } - var arg2 model.DeviceConfigurationKeyIdType - if args[2] != nil { - arg2 = args[2].(model.DeviceConfigurationKeyIdType) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].(model.DeviceConfigurationKeyValueDataType), args[1].(*model.DeviceConfigurationKeyValueDataElementsType), args[2].(model.DeviceConfigurationKeyIdType)) }) return _c } -func (_c *DeviceConfigurationServerInterface_UpdateKeyValueDataForKeyId_Call) Return(err error) *DeviceConfigurationServerInterface_UpdateKeyValueDataForKeyId_Call { - _c.Call.Return(err) +func (_c *DeviceConfigurationServerInterface_UpdateKeyValueDataForKeyId_Call) Return(_a0 error) *DeviceConfigurationServerInterface_UpdateKeyValueDataForKeyId_Call { + _c.Call.Return(_a0) return _c } -func (_c *DeviceConfigurationServerInterface_UpdateKeyValueDataForKeyId_Call) RunAndReturn(run func(data model.DeviceConfigurationKeyValueDataType, deleteElements *model.DeviceConfigurationKeyValueDataElementsType, keyId model.DeviceConfigurationKeyIdType) error) *DeviceConfigurationServerInterface_UpdateKeyValueDataForKeyId_Call { +func (_c *DeviceConfigurationServerInterface_UpdateKeyValueDataForKeyId_Call) RunAndReturn(run func(model.DeviceConfigurationKeyValueDataType, *model.DeviceConfigurationKeyValueDataElementsType, model.DeviceConfigurationKeyIdType) error) *DeviceConfigurationServerInterface_UpdateKeyValueDataForKeyId_Call { _c.Call.Return(run) return _c } + +// NewDeviceConfigurationServerInterface creates a new instance of DeviceConfigurationServerInterface. 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 NewDeviceConfigurationServerInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *DeviceConfigurationServerInterface { + mock := &DeviceConfigurationServerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/DeviceDiagnosisClientInterface.go b/mocks/DeviceDiagnosisClientInterface.go index 5c055802..cd1c0aba 100644 --- a/mocks/DeviceDiagnosisClientInterface.go +++ b/mocks/DeviceDiagnosisClientInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewDeviceDiagnosisClientInterface creates a new instance of DeviceDiagnosisClientInterface. 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 NewDeviceDiagnosisClientInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *DeviceDiagnosisClientInterface { - mock := &DeviceDiagnosisClientInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // DeviceDiagnosisClientInterface is an autogenerated mock type for the DeviceDiagnosisClientInterface type type DeviceDiagnosisClientInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *DeviceDiagnosisClientInterface) EXPECT() *DeviceDiagnosisClientInterfa return &DeviceDiagnosisClientInterface_Expecter{mock: &_m.Mock} } -// RequestHeartbeat provides a mock function for the type DeviceDiagnosisClientInterface -func (_mock *DeviceDiagnosisClientInterface) RequestHeartbeat() (*model.MsgCounterType, error) { - ret := _mock.Called() +// RequestHeartbeat provides a mock function with no fields +func (_m *DeviceDiagnosisClientInterface) RequestHeartbeat() (*model.MsgCounterType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RequestHeartbeat") @@ -46,21 +30,23 @@ func (_mock *DeviceDiagnosisClientInterface) RequestHeartbeat() (*model.MsgCount var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.MsgCounterType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.MsgCounterType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -81,8 +67,8 @@ func (_c *DeviceDiagnosisClientInterface_RequestHeartbeat_Call) Run(run func()) return _c } -func (_c *DeviceDiagnosisClientInterface_RequestHeartbeat_Call) Return(msgCounterType *model.MsgCounterType, err error) *DeviceDiagnosisClientInterface_RequestHeartbeat_Call { - _c.Call.Return(msgCounterType, err) +func (_c *DeviceDiagnosisClientInterface_RequestHeartbeat_Call) Return(_a0 *model.MsgCounterType, _a1 error) *DeviceDiagnosisClientInterface_RequestHeartbeat_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -91,9 +77,9 @@ func (_c *DeviceDiagnosisClientInterface_RequestHeartbeat_Call) RunAndReturn(run return _c } -// RequestState provides a mock function for the type DeviceDiagnosisClientInterface -func (_mock *DeviceDiagnosisClientInterface) RequestState() (*model.MsgCounterType, error) { - ret := _mock.Called() +// RequestState provides a mock function with no fields +func (_m *DeviceDiagnosisClientInterface) RequestState() (*model.MsgCounterType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RequestState") @@ -101,21 +87,23 @@ func (_mock *DeviceDiagnosisClientInterface) RequestState() (*model.MsgCounterTy var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.MsgCounterType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.MsgCounterType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -136,8 +124,8 @@ func (_c *DeviceDiagnosisClientInterface_RequestState_Call) Run(run func()) *Dev return _c } -func (_c *DeviceDiagnosisClientInterface_RequestState_Call) Return(msgCounterType *model.MsgCounterType, err error) *DeviceDiagnosisClientInterface_RequestState_Call { - _c.Call.Return(msgCounterType, err) +func (_c *DeviceDiagnosisClientInterface_RequestState_Call) Return(_a0 *model.MsgCounterType, _a1 error) *DeviceDiagnosisClientInterface_RequestState_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -145,3 +133,17 @@ func (_c *DeviceDiagnosisClientInterface_RequestState_Call) RunAndReturn(run fun _c.Call.Return(run) return _c } + +// NewDeviceDiagnosisClientInterface creates a new instance of DeviceDiagnosisClientInterface. 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 NewDeviceDiagnosisClientInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *DeviceDiagnosisClientInterface { + mock := &DeviceDiagnosisClientInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/DeviceDiagnosisCommonInterface.go b/mocks/DeviceDiagnosisCommonInterface.go index 68533d23..5a7a1da3 100644 --- a/mocks/DeviceDiagnosisCommonInterface.go +++ b/mocks/DeviceDiagnosisCommonInterface.go @@ -1,29 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "time" - - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" -) -// NewDeviceDiagnosisCommonInterface creates a new instance of DeviceDiagnosisCommonInterface. 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 NewDeviceDiagnosisCommonInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *DeviceDiagnosisCommonInterface { - mock := &DeviceDiagnosisCommonInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} + time "time" +) // DeviceDiagnosisCommonInterface is an autogenerated mock type for the DeviceDiagnosisCommonInterface type type DeviceDiagnosisCommonInterface struct { @@ -38,9 +22,9 @@ func (_m *DeviceDiagnosisCommonInterface) EXPECT() *DeviceDiagnosisCommonInterfa return &DeviceDiagnosisCommonInterface_Expecter{mock: &_m.Mock} } -// GetState provides a mock function for the type DeviceDiagnosisCommonInterface -func (_mock *DeviceDiagnosisCommonInterface) GetState() (*model.DeviceDiagnosisStateDataType, error) { - ret := _mock.Called() +// GetState provides a mock function with no fields +func (_m *DeviceDiagnosisCommonInterface) GetState() (*model.DeviceDiagnosisStateDataType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetState") @@ -48,21 +32,23 @@ func (_mock *DeviceDiagnosisCommonInterface) GetState() (*model.DeviceDiagnosisS var r0 *model.DeviceDiagnosisStateDataType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.DeviceDiagnosisStateDataType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.DeviceDiagnosisStateDataType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.DeviceDiagnosisStateDataType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.DeviceDiagnosisStateDataType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.DeviceDiagnosisStateDataType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -83,8 +69,8 @@ func (_c *DeviceDiagnosisCommonInterface_GetState_Call) Run(run func()) *DeviceD return _c } -func (_c *DeviceDiagnosisCommonInterface_GetState_Call) Return(deviceDiagnosisStateDataType *model.DeviceDiagnosisStateDataType, err error) *DeviceDiagnosisCommonInterface_GetState_Call { - _c.Call.Return(deviceDiagnosisStateDataType, err) +func (_c *DeviceDiagnosisCommonInterface_GetState_Call) Return(_a0 *model.DeviceDiagnosisStateDataType, _a1 error) *DeviceDiagnosisCommonInterface_GetState_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -93,20 +79,21 @@ func (_c *DeviceDiagnosisCommonInterface_GetState_Call) RunAndReturn(run func() return _c } -// IsHeartbeatWithinDuration provides a mock function for the type DeviceDiagnosisCommonInterface -func (_mock *DeviceDiagnosisCommonInterface) IsHeartbeatWithinDuration(duration time.Duration) bool { - ret := _mock.Called(duration) +// IsHeartbeatWithinDuration provides a mock function with given fields: duration +func (_m *DeviceDiagnosisCommonInterface) IsHeartbeatWithinDuration(duration time.Duration) bool { + ret := _m.Called(duration) if len(ret) == 0 { panic("no return value specified for IsHeartbeatWithinDuration") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(time.Duration) bool); ok { - r0 = returnFunc(duration) + if rf, ok := ret.Get(0).(func(time.Duration) bool); ok { + r0 = rf(duration) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -123,23 +110,31 @@ func (_e *DeviceDiagnosisCommonInterface_Expecter) IsHeartbeatWithinDuration(dur func (_c *DeviceDiagnosisCommonInterface_IsHeartbeatWithinDuration_Call) Run(run func(duration time.Duration)) *DeviceDiagnosisCommonInterface_IsHeartbeatWithinDuration_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 time.Duration - if args[0] != nil { - arg0 = args[0].(time.Duration) - } - run( - arg0, - ) + run(args[0].(time.Duration)) }) return _c } -func (_c *DeviceDiagnosisCommonInterface_IsHeartbeatWithinDuration_Call) Return(b bool) *DeviceDiagnosisCommonInterface_IsHeartbeatWithinDuration_Call { - _c.Call.Return(b) +func (_c *DeviceDiagnosisCommonInterface_IsHeartbeatWithinDuration_Call) Return(_a0 bool) *DeviceDiagnosisCommonInterface_IsHeartbeatWithinDuration_Call { + _c.Call.Return(_a0) return _c } -func (_c *DeviceDiagnosisCommonInterface_IsHeartbeatWithinDuration_Call) RunAndReturn(run func(duration time.Duration) bool) *DeviceDiagnosisCommonInterface_IsHeartbeatWithinDuration_Call { +func (_c *DeviceDiagnosisCommonInterface_IsHeartbeatWithinDuration_Call) RunAndReturn(run func(time.Duration) bool) *DeviceDiagnosisCommonInterface_IsHeartbeatWithinDuration_Call { _c.Call.Return(run) return _c } + +// NewDeviceDiagnosisCommonInterface creates a new instance of DeviceDiagnosisCommonInterface. 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 NewDeviceDiagnosisCommonInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *DeviceDiagnosisCommonInterface { + mock := &DeviceDiagnosisCommonInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/DeviceDiagnosisServerInterface.go b/mocks/DeviceDiagnosisServerInterface.go index f3bda40e..ed83c1b0 100644 --- a/mocks/DeviceDiagnosisServerInterface.go +++ b/mocks/DeviceDiagnosisServerInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewDeviceDiagnosisServerInterface creates a new instance of DeviceDiagnosisServerInterface. 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 NewDeviceDiagnosisServerInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *DeviceDiagnosisServerInterface { - mock := &DeviceDiagnosisServerInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // DeviceDiagnosisServerInterface is an autogenerated mock type for the DeviceDiagnosisServerInterface type type DeviceDiagnosisServerInterface struct { mock.Mock @@ -36,10 +20,9 @@ func (_m *DeviceDiagnosisServerInterface) EXPECT() *DeviceDiagnosisServerInterfa return &DeviceDiagnosisServerInterface_Expecter{mock: &_m.Mock} } -// SetLocalOperatingState provides a mock function for the type DeviceDiagnosisServerInterface -func (_mock *DeviceDiagnosisServerInterface) SetLocalOperatingState(operatingState model.DeviceDiagnosisOperatingStateType) { - _mock.Called(operatingState) - return +// SetLocalOperatingState provides a mock function with given fields: operatingState +func (_m *DeviceDiagnosisServerInterface) SetLocalOperatingState(operatingState model.DeviceDiagnosisOperatingStateType) { + _m.Called(operatingState) } // DeviceDiagnosisServerInterface_SetLocalOperatingState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLocalOperatingState' @@ -55,13 +38,7 @@ func (_e *DeviceDiagnosisServerInterface_Expecter) SetLocalOperatingState(operat func (_c *DeviceDiagnosisServerInterface_SetLocalOperatingState_Call) Run(run func(operatingState model.DeviceDiagnosisOperatingStateType)) *DeviceDiagnosisServerInterface_SetLocalOperatingState_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.DeviceDiagnosisOperatingStateType - if args[0] != nil { - arg0 = args[0].(model.DeviceDiagnosisOperatingStateType) - } - run( - arg0, - ) + run(args[0].(model.DeviceDiagnosisOperatingStateType)) }) return _c } @@ -71,15 +48,14 @@ func (_c *DeviceDiagnosisServerInterface_SetLocalOperatingState_Call) Return() * return _c } -func (_c *DeviceDiagnosisServerInterface_SetLocalOperatingState_Call) RunAndReturn(run func(operatingState model.DeviceDiagnosisOperatingStateType)) *DeviceDiagnosisServerInterface_SetLocalOperatingState_Call { +func (_c *DeviceDiagnosisServerInterface_SetLocalOperatingState_Call) RunAndReturn(run func(model.DeviceDiagnosisOperatingStateType)) *DeviceDiagnosisServerInterface_SetLocalOperatingState_Call { _c.Run(run) return _c } -// SetLocalState provides a mock function for the type DeviceDiagnosisServerInterface -func (_mock *DeviceDiagnosisServerInterface) SetLocalState(statetate *model.DeviceDiagnosisStateDataType) { - _mock.Called(statetate) - return +// SetLocalState provides a mock function with given fields: statetate +func (_m *DeviceDiagnosisServerInterface) SetLocalState(statetate *model.DeviceDiagnosisStateDataType) { + _m.Called(statetate) } // DeviceDiagnosisServerInterface_SetLocalState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLocalState' @@ -95,13 +71,7 @@ func (_e *DeviceDiagnosisServerInterface_Expecter) SetLocalState(statetate inter func (_c *DeviceDiagnosisServerInterface_SetLocalState_Call) Run(run func(statetate *model.DeviceDiagnosisStateDataType)) *DeviceDiagnosisServerInterface_SetLocalState_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.DeviceDiagnosisStateDataType - if args[0] != nil { - arg0 = args[0].(*model.DeviceDiagnosisStateDataType) - } - run( - arg0, - ) + run(args[0].(*model.DeviceDiagnosisStateDataType)) }) return _c } @@ -111,7 +81,21 @@ func (_c *DeviceDiagnosisServerInterface_SetLocalState_Call) Return() *DeviceDia return _c } -func (_c *DeviceDiagnosisServerInterface_SetLocalState_Call) RunAndReturn(run func(statetate *model.DeviceDiagnosisStateDataType)) *DeviceDiagnosisServerInterface_SetLocalState_Call { +func (_c *DeviceDiagnosisServerInterface_SetLocalState_Call) RunAndReturn(run func(*model.DeviceDiagnosisStateDataType)) *DeviceDiagnosisServerInterface_SetLocalState_Call { _c.Run(run) return _c } + +// NewDeviceDiagnosisServerInterface creates a new instance of DeviceDiagnosisServerInterface. 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 NewDeviceDiagnosisServerInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *DeviceDiagnosisServerInterface { + mock := &DeviceDiagnosisServerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/ElectricalConnectionClientInterface.go b/mocks/ElectricalConnectionClientInterface.go index 71343d3b..e71ec37f 100644 --- a/mocks/ElectricalConnectionClientInterface.go +++ b/mocks/ElectricalConnectionClientInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewElectricalConnectionClientInterface creates a new instance of ElectricalConnectionClientInterface. 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 NewElectricalConnectionClientInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *ElectricalConnectionClientInterface { - mock := &ElectricalConnectionClientInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // ElectricalConnectionClientInterface is an autogenerated mock type for the ElectricalConnectionClientInterface type type ElectricalConnectionClientInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *ElectricalConnectionClientInterface) EXPECT() *ElectricalConnectionCli return &ElectricalConnectionClientInterface_Expecter{mock: &_m.Mock} } -// RequestCharacteristics provides a mock function for the type ElectricalConnectionClientInterface -func (_mock *ElectricalConnectionClientInterface) RequestCharacteristics(selector *model.ElectricalConnectionCharacteristicListDataSelectorsType, elements *model.ElectricalConnectionCharacteristicDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestCharacteristics provides a mock function with given fields: selector, elements +func (_m *ElectricalConnectionClientInterface) RequestCharacteristics(selector *model.ElectricalConnectionCharacteristicListDataSelectorsType, elements *model.ElectricalConnectionCharacteristicDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestCharacteristics") @@ -46,21 +30,23 @@ func (_mock *ElectricalConnectionClientInterface) RequestCharacteristics(selecto var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.ElectricalConnectionCharacteristicListDataSelectorsType, *model.ElectricalConnectionCharacteristicDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.ElectricalConnectionCharacteristicListDataSelectorsType, *model.ElectricalConnectionCharacteristicDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.ElectricalConnectionCharacteristicListDataSelectorsType, *model.ElectricalConnectionCharacteristicDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.ElectricalConnectionCharacteristicListDataSelectorsType, *model.ElectricalConnectionCharacteristicDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.ElectricalConnectionCharacteristicListDataSelectorsType, *model.ElectricalConnectionCharacteristicDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.ElectricalConnectionCharacteristicListDataSelectorsType, *model.ElectricalConnectionCharacteristicDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -78,35 +64,24 @@ func (_e *ElectricalConnectionClientInterface_Expecter) RequestCharacteristics(s func (_c *ElectricalConnectionClientInterface_RequestCharacteristics_Call) Run(run func(selector *model.ElectricalConnectionCharacteristicListDataSelectorsType, elements *model.ElectricalConnectionCharacteristicDataElementsType)) *ElectricalConnectionClientInterface_RequestCharacteristics_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.ElectricalConnectionCharacteristicListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.ElectricalConnectionCharacteristicListDataSelectorsType) - } - var arg1 *model.ElectricalConnectionCharacteristicDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.ElectricalConnectionCharacteristicDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.ElectricalConnectionCharacteristicListDataSelectorsType), args[1].(*model.ElectricalConnectionCharacteristicDataElementsType)) }) return _c } -func (_c *ElectricalConnectionClientInterface_RequestCharacteristics_Call) Return(msgCounterType *model.MsgCounterType, err error) *ElectricalConnectionClientInterface_RequestCharacteristics_Call { - _c.Call.Return(msgCounterType, err) +func (_c *ElectricalConnectionClientInterface_RequestCharacteristics_Call) Return(_a0 *model.MsgCounterType, _a1 error) *ElectricalConnectionClientInterface_RequestCharacteristics_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionClientInterface_RequestCharacteristics_Call) RunAndReturn(run func(selector *model.ElectricalConnectionCharacteristicListDataSelectorsType, elements *model.ElectricalConnectionCharacteristicDataElementsType) (*model.MsgCounterType, error)) *ElectricalConnectionClientInterface_RequestCharacteristics_Call { +func (_c *ElectricalConnectionClientInterface_RequestCharacteristics_Call) RunAndReturn(run func(*model.ElectricalConnectionCharacteristicListDataSelectorsType, *model.ElectricalConnectionCharacteristicDataElementsType) (*model.MsgCounterType, error)) *ElectricalConnectionClientInterface_RequestCharacteristics_Call { _c.Call.Return(run) return _c } -// RequestDescriptions provides a mock function for the type ElectricalConnectionClientInterface -func (_mock *ElectricalConnectionClientInterface) RequestDescriptions(selector *model.ElectricalConnectionDescriptionListDataSelectorsType, elements *model.ElectricalConnectionDescriptionDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestDescriptions provides a mock function with given fields: selector, elements +func (_m *ElectricalConnectionClientInterface) RequestDescriptions(selector *model.ElectricalConnectionDescriptionListDataSelectorsType, elements *model.ElectricalConnectionDescriptionDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestDescriptions") @@ -114,21 +89,23 @@ func (_mock *ElectricalConnectionClientInterface) RequestDescriptions(selector * var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.ElectricalConnectionDescriptionListDataSelectorsType, *model.ElectricalConnectionDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.ElectricalConnectionDescriptionListDataSelectorsType, *model.ElectricalConnectionDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.ElectricalConnectionDescriptionListDataSelectorsType, *model.ElectricalConnectionDescriptionDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.ElectricalConnectionDescriptionListDataSelectorsType, *model.ElectricalConnectionDescriptionDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.ElectricalConnectionDescriptionListDataSelectorsType, *model.ElectricalConnectionDescriptionDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.ElectricalConnectionDescriptionListDataSelectorsType, *model.ElectricalConnectionDescriptionDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -146,35 +123,24 @@ func (_e *ElectricalConnectionClientInterface_Expecter) RequestDescriptions(sele func (_c *ElectricalConnectionClientInterface_RequestDescriptions_Call) Run(run func(selector *model.ElectricalConnectionDescriptionListDataSelectorsType, elements *model.ElectricalConnectionDescriptionDataElementsType)) *ElectricalConnectionClientInterface_RequestDescriptions_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.ElectricalConnectionDescriptionListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.ElectricalConnectionDescriptionListDataSelectorsType) - } - var arg1 *model.ElectricalConnectionDescriptionDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.ElectricalConnectionDescriptionDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.ElectricalConnectionDescriptionListDataSelectorsType), args[1].(*model.ElectricalConnectionDescriptionDataElementsType)) }) return _c } -func (_c *ElectricalConnectionClientInterface_RequestDescriptions_Call) Return(msgCounterType *model.MsgCounterType, err error) *ElectricalConnectionClientInterface_RequestDescriptions_Call { - _c.Call.Return(msgCounterType, err) +func (_c *ElectricalConnectionClientInterface_RequestDescriptions_Call) Return(_a0 *model.MsgCounterType, _a1 error) *ElectricalConnectionClientInterface_RequestDescriptions_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionClientInterface_RequestDescriptions_Call) RunAndReturn(run func(selector *model.ElectricalConnectionDescriptionListDataSelectorsType, elements *model.ElectricalConnectionDescriptionDataElementsType) (*model.MsgCounterType, error)) *ElectricalConnectionClientInterface_RequestDescriptions_Call { +func (_c *ElectricalConnectionClientInterface_RequestDescriptions_Call) RunAndReturn(run func(*model.ElectricalConnectionDescriptionListDataSelectorsType, *model.ElectricalConnectionDescriptionDataElementsType) (*model.MsgCounterType, error)) *ElectricalConnectionClientInterface_RequestDescriptions_Call { _c.Call.Return(run) return _c } -// RequestParameterDescriptions provides a mock function for the type ElectricalConnectionClientInterface -func (_mock *ElectricalConnectionClientInterface) RequestParameterDescriptions(selector *model.ElectricalConnectionParameterDescriptionListDataSelectorsType, elements *model.ElectricalConnectionParameterDescriptionDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestParameterDescriptions provides a mock function with given fields: selector, elements +func (_m *ElectricalConnectionClientInterface) RequestParameterDescriptions(selector *model.ElectricalConnectionParameterDescriptionListDataSelectorsType, elements *model.ElectricalConnectionParameterDescriptionDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestParameterDescriptions") @@ -182,21 +148,23 @@ func (_mock *ElectricalConnectionClientInterface) RequestParameterDescriptions(s var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.ElectricalConnectionParameterDescriptionListDataSelectorsType, *model.ElectricalConnectionParameterDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.ElectricalConnectionParameterDescriptionListDataSelectorsType, *model.ElectricalConnectionParameterDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.ElectricalConnectionParameterDescriptionListDataSelectorsType, *model.ElectricalConnectionParameterDescriptionDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.ElectricalConnectionParameterDescriptionListDataSelectorsType, *model.ElectricalConnectionParameterDescriptionDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.ElectricalConnectionParameterDescriptionListDataSelectorsType, *model.ElectricalConnectionParameterDescriptionDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.ElectricalConnectionParameterDescriptionListDataSelectorsType, *model.ElectricalConnectionParameterDescriptionDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -214,35 +182,24 @@ func (_e *ElectricalConnectionClientInterface_Expecter) RequestParameterDescript func (_c *ElectricalConnectionClientInterface_RequestParameterDescriptions_Call) Run(run func(selector *model.ElectricalConnectionParameterDescriptionListDataSelectorsType, elements *model.ElectricalConnectionParameterDescriptionDataElementsType)) *ElectricalConnectionClientInterface_RequestParameterDescriptions_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.ElectricalConnectionParameterDescriptionListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.ElectricalConnectionParameterDescriptionListDataSelectorsType) - } - var arg1 *model.ElectricalConnectionParameterDescriptionDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.ElectricalConnectionParameterDescriptionDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.ElectricalConnectionParameterDescriptionListDataSelectorsType), args[1].(*model.ElectricalConnectionParameterDescriptionDataElementsType)) }) return _c } -func (_c *ElectricalConnectionClientInterface_RequestParameterDescriptions_Call) Return(msgCounterType *model.MsgCounterType, err error) *ElectricalConnectionClientInterface_RequestParameterDescriptions_Call { - _c.Call.Return(msgCounterType, err) +func (_c *ElectricalConnectionClientInterface_RequestParameterDescriptions_Call) Return(_a0 *model.MsgCounterType, _a1 error) *ElectricalConnectionClientInterface_RequestParameterDescriptions_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionClientInterface_RequestParameterDescriptions_Call) RunAndReturn(run func(selector *model.ElectricalConnectionParameterDescriptionListDataSelectorsType, elements *model.ElectricalConnectionParameterDescriptionDataElementsType) (*model.MsgCounterType, error)) *ElectricalConnectionClientInterface_RequestParameterDescriptions_Call { +func (_c *ElectricalConnectionClientInterface_RequestParameterDescriptions_Call) RunAndReturn(run func(*model.ElectricalConnectionParameterDescriptionListDataSelectorsType, *model.ElectricalConnectionParameterDescriptionDataElementsType) (*model.MsgCounterType, error)) *ElectricalConnectionClientInterface_RequestParameterDescriptions_Call { _c.Call.Return(run) return _c } -// RequestPermittedValueSets provides a mock function for the type ElectricalConnectionClientInterface -func (_mock *ElectricalConnectionClientInterface) RequestPermittedValueSets(selector *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, elements *model.ElectricalConnectionPermittedValueSetDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestPermittedValueSets provides a mock function with given fields: selector, elements +func (_m *ElectricalConnectionClientInterface) RequestPermittedValueSets(selector *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, elements *model.ElectricalConnectionPermittedValueSetDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestPermittedValueSets") @@ -250,21 +207,23 @@ func (_mock *ElectricalConnectionClientInterface) RequestPermittedValueSets(sele var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.ElectricalConnectionPermittedValueSetListDataSelectorsType, *model.ElectricalConnectionPermittedValueSetDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.ElectricalConnectionPermittedValueSetListDataSelectorsType, *model.ElectricalConnectionPermittedValueSetDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.ElectricalConnectionPermittedValueSetListDataSelectorsType, *model.ElectricalConnectionPermittedValueSetDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.ElectricalConnectionPermittedValueSetListDataSelectorsType, *model.ElectricalConnectionPermittedValueSetDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.ElectricalConnectionPermittedValueSetListDataSelectorsType, *model.ElectricalConnectionPermittedValueSetDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.ElectricalConnectionPermittedValueSetListDataSelectorsType, *model.ElectricalConnectionPermittedValueSetDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -282,28 +241,31 @@ func (_e *ElectricalConnectionClientInterface_Expecter) RequestPermittedValueSet func (_c *ElectricalConnectionClientInterface_RequestPermittedValueSets_Call) Run(run func(selector *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, elements *model.ElectricalConnectionPermittedValueSetDataElementsType)) *ElectricalConnectionClientInterface_RequestPermittedValueSets_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.ElectricalConnectionPermittedValueSetListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.ElectricalConnectionPermittedValueSetListDataSelectorsType) - } - var arg1 *model.ElectricalConnectionPermittedValueSetDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.ElectricalConnectionPermittedValueSetDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.ElectricalConnectionPermittedValueSetListDataSelectorsType), args[1].(*model.ElectricalConnectionPermittedValueSetDataElementsType)) }) return _c } -func (_c *ElectricalConnectionClientInterface_RequestPermittedValueSets_Call) Return(msgCounterType *model.MsgCounterType, err error) *ElectricalConnectionClientInterface_RequestPermittedValueSets_Call { - _c.Call.Return(msgCounterType, err) +func (_c *ElectricalConnectionClientInterface_RequestPermittedValueSets_Call) Return(_a0 *model.MsgCounterType, _a1 error) *ElectricalConnectionClientInterface_RequestPermittedValueSets_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionClientInterface_RequestPermittedValueSets_Call) RunAndReturn(run func(selector *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, elements *model.ElectricalConnectionPermittedValueSetDataElementsType) (*model.MsgCounterType, error)) *ElectricalConnectionClientInterface_RequestPermittedValueSets_Call { +func (_c *ElectricalConnectionClientInterface_RequestPermittedValueSets_Call) RunAndReturn(run func(*model.ElectricalConnectionPermittedValueSetListDataSelectorsType, *model.ElectricalConnectionPermittedValueSetDataElementsType) (*model.MsgCounterType, error)) *ElectricalConnectionClientInterface_RequestPermittedValueSets_Call { _c.Call.Return(run) return _c } + +// NewElectricalConnectionClientInterface creates a new instance of ElectricalConnectionClientInterface. 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 NewElectricalConnectionClientInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ElectricalConnectionClientInterface { + mock := &ElectricalConnectionClientInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/ElectricalConnectionCommonInterface.go b/mocks/ElectricalConnectionCommonInterface.go index 1faafc8b..20e466cc 100644 --- a/mocks/ElectricalConnectionCommonInterface.go +++ b/mocks/ElectricalConnectionCommonInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewElectricalConnectionCommonInterface creates a new instance of ElectricalConnectionCommonInterface. 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 NewElectricalConnectionCommonInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *ElectricalConnectionCommonInterface { - mock := &ElectricalConnectionCommonInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // ElectricalConnectionCommonInterface is an autogenerated mock type for the ElectricalConnectionCommonInterface type type ElectricalConnectionCommonInterface struct { mock.Mock @@ -36,20 +20,21 @@ func (_m *ElectricalConnectionCommonInterface) EXPECT() *ElectricalConnectionCom return &ElectricalConnectionCommonInterface_Expecter{mock: &_m.Mock} } -// AdjustValueToBeWithinPermittedValuesForParameterId provides a mock function for the type ElectricalConnectionCommonInterface -func (_mock *ElectricalConnectionCommonInterface) AdjustValueToBeWithinPermittedValuesForParameterId(value float64, parameterId model.ElectricalConnectionParameterIdType) float64 { - ret := _mock.Called(value, parameterId) +// AdjustValueToBeWithinPermittedValuesForParameterId provides a mock function with given fields: value, parameterId +func (_m *ElectricalConnectionCommonInterface) AdjustValueToBeWithinPermittedValuesForParameterId(value float64, parameterId model.ElectricalConnectionParameterIdType) float64 { + ret := _m.Called(value, parameterId) if len(ret) == 0 { panic("no return value specified for AdjustValueToBeWithinPermittedValuesForParameterId") } var r0 float64 - if returnFunc, ok := ret.Get(0).(func(float64, model.ElectricalConnectionParameterIdType) float64); ok { - r0 = returnFunc(value, parameterId) + if rf, ok := ret.Get(0).(func(float64, model.ElectricalConnectionParameterIdType) float64); ok { + r0 = rf(value, parameterId) } else { r0 = ret.Get(0).(float64) } + return r0 } @@ -67,46 +52,36 @@ func (_e *ElectricalConnectionCommonInterface_Expecter) AdjustValueToBeWithinPer func (_c *ElectricalConnectionCommonInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call) Run(run func(value float64, parameterId model.ElectricalConnectionParameterIdType)) *ElectricalConnectionCommonInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 float64 - if args[0] != nil { - arg0 = args[0].(float64) - } - var arg1 model.ElectricalConnectionParameterIdType - if args[1] != nil { - arg1 = args[1].(model.ElectricalConnectionParameterIdType) - } - run( - arg0, - arg1, - ) + run(args[0].(float64), args[1].(model.ElectricalConnectionParameterIdType)) }) return _c } -func (_c *ElectricalConnectionCommonInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call) Return(f float64) *ElectricalConnectionCommonInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call { - _c.Call.Return(f) +func (_c *ElectricalConnectionCommonInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call) Return(_a0 float64) *ElectricalConnectionCommonInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call { + _c.Call.Return(_a0) return _c } -func (_c *ElectricalConnectionCommonInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call) RunAndReturn(run func(value float64, parameterId model.ElectricalConnectionParameterIdType) float64) *ElectricalConnectionCommonInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call { +func (_c *ElectricalConnectionCommonInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call) RunAndReturn(run func(float64, model.ElectricalConnectionParameterIdType) float64) *ElectricalConnectionCommonInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call { _c.Call.Return(run) return _c } -// CheckEventPayloadDataForFilter provides a mock function for the type ElectricalConnectionCommonInterface -func (_mock *ElectricalConnectionCommonInterface) CheckEventPayloadDataForFilter(payloadData any, filter any) bool { - ret := _mock.Called(payloadData, filter) +// CheckEventPayloadDataForFilter provides a mock function with given fields: payloadData, filter +func (_m *ElectricalConnectionCommonInterface) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) bool { + ret := _m.Called(payloadData, filter) if len(ret) == 0 { panic("no return value specified for CheckEventPayloadDataForFilter") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(any, any) bool); ok { - r0 = returnFunc(payloadData, filter) + if rf, ok := ret.Get(0).(func(interface{}, interface{}) bool); ok { + r0 = rf(payloadData, filter) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -116,43 +91,32 @@ type ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call str } // CheckEventPayloadDataForFilter is a helper method to define mock.On call -// - payloadData any -// - filter any +// - payloadData interface{} +// - filter interface{} func (_e *ElectricalConnectionCommonInterface_Expecter) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call { return &ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call{Call: _e.mock.On("CheckEventPayloadDataForFilter", payloadData, filter)} } -func (_c *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData any, filter any)) *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call { +func (_c *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData interface{}, filter interface{})) *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 any - if args[0] != nil { - arg0 = args[0].(any) - } - var arg1 any - if args[1] != nil { - arg1 = args[1].(any) - } - run( - arg0, - arg1, - ) + run(args[0].(interface{}), args[1].(interface{})) }) return _c } -func (_c *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call) Return(b bool) *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call { - _c.Call.Return(b) +func (_c *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call) Return(_a0 bool) *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call { + _c.Call.Return(_a0) return _c } -func (_c *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(payloadData any, filter any) bool) *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call { +func (_c *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(interface{}, interface{}) bool) *ElectricalConnectionCommonInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Return(run) return _c } -// GetCharacteristicsForFilter provides a mock function for the type ElectricalConnectionCommonInterface -func (_mock *ElectricalConnectionCommonInterface) GetCharacteristicsForFilter(filter model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error) { - ret := _mock.Called(filter) +// GetCharacteristicsForFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionCommonInterface) GetCharacteristicsForFilter(filter model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetCharacteristicsForFilter") @@ -160,21 +124,23 @@ func (_mock *ElectricalConnectionCommonInterface) GetCharacteristicsForFilter(fi var r0 []model.ElectricalConnectionCharacteristicDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) []model.ElectricalConnectionCharacteristicDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) []model.ElectricalConnectionCharacteristicDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.ElectricalConnectionCharacteristicDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionCharacteristicDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionCharacteristicDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -191,30 +157,24 @@ func (_e *ElectricalConnectionCommonInterface_Expecter) GetCharacteristicsForFil func (_c *ElectricalConnectionCommonInterface_GetCharacteristicsForFilter_Call) Run(run func(filter model.ElectricalConnectionCharacteristicDataType)) *ElectricalConnectionCommonInterface_GetCharacteristicsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionCharacteristicDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionCharacteristicDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionCharacteristicDataType)) }) return _c } -func (_c *ElectricalConnectionCommonInterface_GetCharacteristicsForFilter_Call) Return(electricalConnectionCharacteristicDataTypes []model.ElectricalConnectionCharacteristicDataType, err error) *ElectricalConnectionCommonInterface_GetCharacteristicsForFilter_Call { - _c.Call.Return(electricalConnectionCharacteristicDataTypes, err) +func (_c *ElectricalConnectionCommonInterface_GetCharacteristicsForFilter_Call) Return(_a0 []model.ElectricalConnectionCharacteristicDataType, _a1 error) *ElectricalConnectionCommonInterface_GetCharacteristicsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionCommonInterface_GetCharacteristicsForFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error)) *ElectricalConnectionCommonInterface_GetCharacteristicsForFilter_Call { +func (_c *ElectricalConnectionCommonInterface_GetCharacteristicsForFilter_Call) RunAndReturn(run func(model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error)) *ElectricalConnectionCommonInterface_GetCharacteristicsForFilter_Call { _c.Call.Return(run) return _c } -// GetDescriptionForParameterDescriptionFilter provides a mock function for the type ElectricalConnectionCommonInterface -func (_mock *ElectricalConnectionCommonInterface) GetDescriptionForParameterDescriptionFilter(filter model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetDescriptionForParameterDescriptionFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionCommonInterface) GetDescriptionForParameterDescriptionFilter(filter model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetDescriptionForParameterDescriptionFilter") @@ -222,21 +182,23 @@ func (_mock *ElectricalConnectionCommonInterface) GetDescriptionForParameterDesc var r0 *model.ElectricalConnectionDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) *model.ElectricalConnectionDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) *model.ElectricalConnectionDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.ElectricalConnectionDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionParameterDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionParameterDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -253,30 +215,24 @@ func (_e *ElectricalConnectionCommonInterface_Expecter) GetDescriptionForParamet func (_c *ElectricalConnectionCommonInterface_GetDescriptionForParameterDescriptionFilter_Call) Run(run func(filter model.ElectricalConnectionParameterDescriptionDataType)) *ElectricalConnectionCommonInterface_GetDescriptionForParameterDescriptionFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionParameterDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionParameterDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionParameterDescriptionDataType)) }) return _c } -func (_c *ElectricalConnectionCommonInterface_GetDescriptionForParameterDescriptionFilter_Call) Return(electricalConnectionDescriptionDataType *model.ElectricalConnectionDescriptionDataType, err error) *ElectricalConnectionCommonInterface_GetDescriptionForParameterDescriptionFilter_Call { - _c.Call.Return(electricalConnectionDescriptionDataType, err) +func (_c *ElectricalConnectionCommonInterface_GetDescriptionForParameterDescriptionFilter_Call) Return(_a0 *model.ElectricalConnectionDescriptionDataType, _a1 error) *ElectricalConnectionCommonInterface_GetDescriptionForParameterDescriptionFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionCommonInterface_GetDescriptionForParameterDescriptionFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error)) *ElectricalConnectionCommonInterface_GetDescriptionForParameterDescriptionFilter_Call { +func (_c *ElectricalConnectionCommonInterface_GetDescriptionForParameterDescriptionFilter_Call) RunAndReturn(run func(model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error)) *ElectricalConnectionCommonInterface_GetDescriptionForParameterDescriptionFilter_Call { _c.Call.Return(run) return _c } -// GetDescriptionsForFilter provides a mock function for the type ElectricalConnectionCommonInterface -func (_mock *ElectricalConnectionCommonInterface) GetDescriptionsForFilter(filter model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetDescriptionsForFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionCommonInterface) GetDescriptionsForFilter(filter model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetDescriptionsForFilter") @@ -284,21 +240,23 @@ func (_mock *ElectricalConnectionCommonInterface) GetDescriptionsForFilter(filte var r0 []model.ElectricalConnectionDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) []model.ElectricalConnectionDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) []model.ElectricalConnectionDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.ElectricalConnectionDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -315,30 +273,24 @@ func (_e *ElectricalConnectionCommonInterface_Expecter) GetDescriptionsForFilter func (_c *ElectricalConnectionCommonInterface_GetDescriptionsForFilter_Call) Run(run func(filter model.ElectricalConnectionDescriptionDataType)) *ElectricalConnectionCommonInterface_GetDescriptionsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionDescriptionDataType)) }) return _c } -func (_c *ElectricalConnectionCommonInterface_GetDescriptionsForFilter_Call) Return(electricalConnectionDescriptionDataTypes []model.ElectricalConnectionDescriptionDataType, err error) *ElectricalConnectionCommonInterface_GetDescriptionsForFilter_Call { - _c.Call.Return(electricalConnectionDescriptionDataTypes, err) +func (_c *ElectricalConnectionCommonInterface_GetDescriptionsForFilter_Call) Return(_a0 []model.ElectricalConnectionDescriptionDataType, _a1 error) *ElectricalConnectionCommonInterface_GetDescriptionsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionCommonInterface_GetDescriptionsForFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error)) *ElectricalConnectionCommonInterface_GetDescriptionsForFilter_Call { +func (_c *ElectricalConnectionCommonInterface_GetDescriptionsForFilter_Call) RunAndReturn(run func(model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error)) *ElectricalConnectionCommonInterface_GetDescriptionsForFilter_Call { _c.Call.Return(run) return _c } -// GetParameterDescriptionsForFilter provides a mock function for the type ElectricalConnectionCommonInterface -func (_mock *ElectricalConnectionCommonInterface) GetParameterDescriptionsForFilter(filter model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetParameterDescriptionsForFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionCommonInterface) GetParameterDescriptionsForFilter(filter model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetParameterDescriptionsForFilter") @@ -346,21 +298,23 @@ func (_mock *ElectricalConnectionCommonInterface) GetParameterDescriptionsForFil var r0 []model.ElectricalConnectionParameterDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) []model.ElectricalConnectionParameterDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) []model.ElectricalConnectionParameterDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.ElectricalConnectionParameterDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionParameterDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionParameterDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -377,30 +331,24 @@ func (_e *ElectricalConnectionCommonInterface_Expecter) GetParameterDescriptions func (_c *ElectricalConnectionCommonInterface_GetParameterDescriptionsForFilter_Call) Run(run func(filter model.ElectricalConnectionParameterDescriptionDataType)) *ElectricalConnectionCommonInterface_GetParameterDescriptionsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionParameterDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionParameterDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionParameterDescriptionDataType)) }) return _c } -func (_c *ElectricalConnectionCommonInterface_GetParameterDescriptionsForFilter_Call) Return(electricalConnectionParameterDescriptionDataTypes []model.ElectricalConnectionParameterDescriptionDataType, err error) *ElectricalConnectionCommonInterface_GetParameterDescriptionsForFilter_Call { - _c.Call.Return(electricalConnectionParameterDescriptionDataTypes, err) +func (_c *ElectricalConnectionCommonInterface_GetParameterDescriptionsForFilter_Call) Return(_a0 []model.ElectricalConnectionParameterDescriptionDataType, _a1 error) *ElectricalConnectionCommonInterface_GetParameterDescriptionsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionCommonInterface_GetParameterDescriptionsForFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error)) *ElectricalConnectionCommonInterface_GetParameterDescriptionsForFilter_Call { +func (_c *ElectricalConnectionCommonInterface_GetParameterDescriptionsForFilter_Call) RunAndReturn(run func(model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error)) *ElectricalConnectionCommonInterface_GetParameterDescriptionsForFilter_Call { _c.Call.Return(run) return _c } -// GetPermittedValueDataForFilter provides a mock function for the type ElectricalConnectionCommonInterface -func (_mock *ElectricalConnectionCommonInterface) GetPermittedValueDataForFilter(filter model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error) { - ret := _mock.Called(filter) +// GetPermittedValueDataForFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionCommonInterface) GetPermittedValueDataForFilter(filter model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetPermittedValueDataForFilter") @@ -410,29 +358,33 @@ func (_mock *ElectricalConnectionCommonInterface) GetPermittedValueDataForFilter var r1 float64 var r2 float64 var r3 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { + r0 = rf(filter) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { + r1 = rf(filter) } else { r1 = ret.Get(1).(float64) } - if returnFunc, ok := ret.Get(2).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { - r2 = returnFunc(filter) + + if rf, ok := ret.Get(2).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { + r2 = rf(filter) } else { r2 = ret.Get(2).(float64) } - if returnFunc, ok := ret.Get(3).(func(model.ElectricalConnectionPermittedValueSetDataType) error); ok { - r3 = returnFunc(filter) + + if rf, ok := ret.Get(3).(func(model.ElectricalConnectionPermittedValueSetDataType) error); ok { + r3 = rf(filter) } else { r3 = ret.Error(3) } + return r0, r1, r2, r3 } @@ -449,30 +401,24 @@ func (_e *ElectricalConnectionCommonInterface_Expecter) GetPermittedValueDataFor func (_c *ElectricalConnectionCommonInterface_GetPermittedValueDataForFilter_Call) Run(run func(filter model.ElectricalConnectionPermittedValueSetDataType)) *ElectricalConnectionCommonInterface_GetPermittedValueDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionPermittedValueSetDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionPermittedValueSetDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionPermittedValueSetDataType)) }) return _c } -func (_c *ElectricalConnectionCommonInterface_GetPermittedValueDataForFilter_Call) Return(f float64, f1 float64, f2 float64, err error) *ElectricalConnectionCommonInterface_GetPermittedValueDataForFilter_Call { - _c.Call.Return(f, f1, f2, err) +func (_c *ElectricalConnectionCommonInterface_GetPermittedValueDataForFilter_Call) Return(_a0 float64, _a1 float64, _a2 float64, _a3 error) *ElectricalConnectionCommonInterface_GetPermittedValueDataForFilter_Call { + _c.Call.Return(_a0, _a1, _a2, _a3) return _c } -func (_c *ElectricalConnectionCommonInterface_GetPermittedValueDataForFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error)) *ElectricalConnectionCommonInterface_GetPermittedValueDataForFilter_Call { +func (_c *ElectricalConnectionCommonInterface_GetPermittedValueDataForFilter_Call) RunAndReturn(run func(model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error)) *ElectricalConnectionCommonInterface_GetPermittedValueDataForFilter_Call { _c.Call.Return(run) return _c } -// GetPermittedValueSetForFilter provides a mock function for the type ElectricalConnectionCommonInterface -func (_mock *ElectricalConnectionCommonInterface) GetPermittedValueSetForFilter(filter model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error) { - ret := _mock.Called(filter) +// GetPermittedValueSetForFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionCommonInterface) GetPermittedValueSetForFilter(filter model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetPermittedValueSetForFilter") @@ -480,21 +426,23 @@ func (_mock *ElectricalConnectionCommonInterface) GetPermittedValueSetForFilter( var r0 []model.ElectricalConnectionPermittedValueSetDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) []model.ElectricalConnectionPermittedValueSetDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) []model.ElectricalConnectionPermittedValueSetDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.ElectricalConnectionPermittedValueSetDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionPermittedValueSetDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionPermittedValueSetDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -511,30 +459,24 @@ func (_e *ElectricalConnectionCommonInterface_Expecter) GetPermittedValueSetForF func (_c *ElectricalConnectionCommonInterface_GetPermittedValueSetForFilter_Call) Run(run func(filter model.ElectricalConnectionPermittedValueSetDataType)) *ElectricalConnectionCommonInterface_GetPermittedValueSetForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionPermittedValueSetDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionPermittedValueSetDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionPermittedValueSetDataType)) }) return _c } -func (_c *ElectricalConnectionCommonInterface_GetPermittedValueSetForFilter_Call) Return(electricalConnectionPermittedValueSetDataTypes []model.ElectricalConnectionPermittedValueSetDataType, err error) *ElectricalConnectionCommonInterface_GetPermittedValueSetForFilter_Call { - _c.Call.Return(electricalConnectionPermittedValueSetDataTypes, err) +func (_c *ElectricalConnectionCommonInterface_GetPermittedValueSetForFilter_Call) Return(_a0 []model.ElectricalConnectionPermittedValueSetDataType, _a1 error) *ElectricalConnectionCommonInterface_GetPermittedValueSetForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionCommonInterface_GetPermittedValueSetForFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error)) *ElectricalConnectionCommonInterface_GetPermittedValueSetForFilter_Call { +func (_c *ElectricalConnectionCommonInterface_GetPermittedValueSetForFilter_Call) RunAndReturn(run func(model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error)) *ElectricalConnectionCommonInterface_GetPermittedValueSetForFilter_Call { _c.Call.Return(run) return _c } -// GetPhaseCurrentLimits provides a mock function for the type ElectricalConnectionCommonInterface -func (_mock *ElectricalConnectionCommonInterface) GetPhaseCurrentLimits(measDesc []model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error) { - ret := _mock.Called(measDesc) +// GetPhaseCurrentLimits provides a mock function with given fields: measDesc +func (_m *ElectricalConnectionCommonInterface) GetPhaseCurrentLimits(measDesc []model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error) { + ret := _m.Called(measDesc) if len(ret) == 0 { panic("no return value specified for GetPhaseCurrentLimits") @@ -544,35 +486,39 @@ func (_mock *ElectricalConnectionCommonInterface) GetPhaseCurrentLimits(measDesc var r1 []float64 var r2 []float64 var r3 error - if returnFunc, ok := ret.Get(0).(func([]model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error)); ok { - return returnFunc(measDesc) + if rf, ok := ret.Get(0).(func([]model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error)); ok { + return rf(measDesc) } - if returnFunc, ok := ret.Get(0).(func([]model.MeasurementDescriptionDataType) []float64); ok { - r0 = returnFunc(measDesc) + if rf, ok := ret.Get(0).(func([]model.MeasurementDescriptionDataType) []float64); ok { + r0 = rf(measDesc) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]float64) } } - if returnFunc, ok := ret.Get(1).(func([]model.MeasurementDescriptionDataType) []float64); ok { - r1 = returnFunc(measDesc) + + if rf, ok := ret.Get(1).(func([]model.MeasurementDescriptionDataType) []float64); ok { + r1 = rf(measDesc) } else { if ret.Get(1) != nil { r1 = ret.Get(1).([]float64) } } - if returnFunc, ok := ret.Get(2).(func([]model.MeasurementDescriptionDataType) []float64); ok { - r2 = returnFunc(measDesc) + + if rf, ok := ret.Get(2).(func([]model.MeasurementDescriptionDataType) []float64); ok { + r2 = rf(measDesc) } else { if ret.Get(2) != nil { r2 = ret.Get(2).([]float64) } } - if returnFunc, ok := ret.Get(3).(func([]model.MeasurementDescriptionDataType) error); ok { - r3 = returnFunc(measDesc) + + if rf, ok := ret.Get(3).(func([]model.MeasurementDescriptionDataType) error); ok { + r3 = rf(measDesc) } else { r3 = ret.Error(3) } + return r0, r1, r2, r3 } @@ -589,13 +535,7 @@ func (_e *ElectricalConnectionCommonInterface_Expecter) GetPhaseCurrentLimits(me func (_c *ElectricalConnectionCommonInterface_GetPhaseCurrentLimits_Call) Run(run func(measDesc []model.MeasurementDescriptionDataType)) *ElectricalConnectionCommonInterface_GetPhaseCurrentLimits_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []model.MeasurementDescriptionDataType - if args[0] != nil { - arg0 = args[0].([]model.MeasurementDescriptionDataType) - } - run( - arg0, - ) + run(args[0].([]model.MeasurementDescriptionDataType)) }) return _c } @@ -605,7 +545,21 @@ func (_c *ElectricalConnectionCommonInterface_GetPhaseCurrentLimits_Call) Return return _c } -func (_c *ElectricalConnectionCommonInterface_GetPhaseCurrentLimits_Call) RunAndReturn(run func(measDesc []model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error)) *ElectricalConnectionCommonInterface_GetPhaseCurrentLimits_Call { +func (_c *ElectricalConnectionCommonInterface_GetPhaseCurrentLimits_Call) RunAndReturn(run func([]model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error)) *ElectricalConnectionCommonInterface_GetPhaseCurrentLimits_Call { _c.Call.Return(run) return _c } + +// NewElectricalConnectionCommonInterface creates a new instance of ElectricalConnectionCommonInterface. 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 NewElectricalConnectionCommonInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ElectricalConnectionCommonInterface { + mock := &ElectricalConnectionCommonInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/ElectricalConnectionServerInterface.go b/mocks/ElectricalConnectionServerInterface.go index 101b49b3..4443bd8c 100644 --- a/mocks/ElectricalConnectionServerInterface.go +++ b/mocks/ElectricalConnectionServerInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/eebus-go/api" - "github.com/enbility/spine-go/model" + api "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) - -// NewElectricalConnectionServerInterface creates a new instance of ElectricalConnectionServerInterface. 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 NewElectricalConnectionServerInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *ElectricalConnectionServerInterface { - mock := &ElectricalConnectionServerInterface{} - mock.Mock.Test(t) - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} + model "github.com/enbility/spine-go/model" +) // ElectricalConnectionServerInterface is an autogenerated mock type for the ElectricalConnectionServerInterface type type ElectricalConnectionServerInterface struct { @@ -37,9 +22,9 @@ func (_m *ElectricalConnectionServerInterface) EXPECT() *ElectricalConnectionSer return &ElectricalConnectionServerInterface_Expecter{mock: &_m.Mock} } -// AddCharacteristic provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) AddCharacteristic(data model.ElectricalConnectionCharacteristicDataType) (*model.ElectricalConnectionCharacteristicIdType, error) { - ret := _mock.Called(data) +// AddCharacteristic provides a mock function with given fields: data +func (_m *ElectricalConnectionServerInterface) AddCharacteristic(data model.ElectricalConnectionCharacteristicDataType) (*model.ElectricalConnectionCharacteristicIdType, error) { + ret := _m.Called(data) if len(ret) == 0 { panic("no return value specified for AddCharacteristic") @@ -47,21 +32,23 @@ func (_mock *ElectricalConnectionServerInterface) AddCharacteristic(data model.E var r0 *model.ElectricalConnectionCharacteristicIdType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) (*model.ElectricalConnectionCharacteristicIdType, error)); ok { - return returnFunc(data) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) (*model.ElectricalConnectionCharacteristicIdType, error)); ok { + return rf(data) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) *model.ElectricalConnectionCharacteristicIdType); ok { - r0 = returnFunc(data) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) *model.ElectricalConnectionCharacteristicIdType); ok { + r0 = rf(data) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.ElectricalConnectionCharacteristicIdType) } } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionCharacteristicDataType) error); ok { - r1 = returnFunc(data) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionCharacteristicDataType) error); ok { + r1 = rf(data) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -78,41 +65,36 @@ func (_e *ElectricalConnectionServerInterface_Expecter) AddCharacteristic(data i func (_c *ElectricalConnectionServerInterface_AddCharacteristic_Call) Run(run func(data model.ElectricalConnectionCharacteristicDataType)) *ElectricalConnectionServerInterface_AddCharacteristic_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionCharacteristicDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionCharacteristicDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionCharacteristicDataType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_AddCharacteristic_Call) Return(electricalConnectionCharacteristicIdType *model.ElectricalConnectionCharacteristicIdType, err error) *ElectricalConnectionServerInterface_AddCharacteristic_Call { - _c.Call.Return(electricalConnectionCharacteristicIdType, err) +func (_c *ElectricalConnectionServerInterface_AddCharacteristic_Call) Return(_a0 *model.ElectricalConnectionCharacteristicIdType, _a1 error) *ElectricalConnectionServerInterface_AddCharacteristic_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionServerInterface_AddCharacteristic_Call) RunAndReturn(run func(data model.ElectricalConnectionCharacteristicDataType) (*model.ElectricalConnectionCharacteristicIdType, error)) *ElectricalConnectionServerInterface_AddCharacteristic_Call { +func (_c *ElectricalConnectionServerInterface_AddCharacteristic_Call) RunAndReturn(run func(model.ElectricalConnectionCharacteristicDataType) (*model.ElectricalConnectionCharacteristicIdType, error)) *ElectricalConnectionServerInterface_AddCharacteristic_Call { _c.Call.Return(run) return _c } -// AddDescription provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) AddDescription(description model.ElectricalConnectionDescriptionDataType) error { - ret := _mock.Called(description) +// AddDescription provides a mock function with given fields: description +func (_m *ElectricalConnectionServerInterface) AddDescription(description model.ElectricalConnectionDescriptionDataType) error { + ret := _m.Called(description) if len(ret) == 0 { panic("no return value specified for AddDescription") } var r0 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) error); ok { - r0 = returnFunc(description) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) error); ok { + r0 = rf(description) } else { r0 = ret.Error(0) } + return r0 } @@ -129,43 +111,38 @@ func (_e *ElectricalConnectionServerInterface_Expecter) AddDescription(descripti func (_c *ElectricalConnectionServerInterface_AddDescription_Call) Run(run func(description model.ElectricalConnectionDescriptionDataType)) *ElectricalConnectionServerInterface_AddDescription_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionDescriptionDataType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_AddDescription_Call) Return(err error) *ElectricalConnectionServerInterface_AddDescription_Call { - _c.Call.Return(err) +func (_c *ElectricalConnectionServerInterface_AddDescription_Call) Return(_a0 error) *ElectricalConnectionServerInterface_AddDescription_Call { + _c.Call.Return(_a0) return _c } -func (_c *ElectricalConnectionServerInterface_AddDescription_Call) RunAndReturn(run func(description model.ElectricalConnectionDescriptionDataType) error) *ElectricalConnectionServerInterface_AddDescription_Call { +func (_c *ElectricalConnectionServerInterface_AddDescription_Call) RunAndReturn(run func(model.ElectricalConnectionDescriptionDataType) error) *ElectricalConnectionServerInterface_AddDescription_Call { _c.Call.Return(run) return _c } -// AddParameterDescription provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) AddParameterDescription(description model.ElectricalConnectionParameterDescriptionDataType) *model.ElectricalConnectionParameterIdType { - ret := _mock.Called(description) +// AddParameterDescription provides a mock function with given fields: description +func (_m *ElectricalConnectionServerInterface) AddParameterDescription(description model.ElectricalConnectionParameterDescriptionDataType) *model.ElectricalConnectionParameterIdType { + ret := _m.Called(description) if len(ret) == 0 { panic("no return value specified for AddParameterDescription") } var r0 *model.ElectricalConnectionParameterIdType - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) *model.ElectricalConnectionParameterIdType); ok { - r0 = returnFunc(description) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) *model.ElectricalConnectionParameterIdType); ok { + r0 = rf(description) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.ElectricalConnectionParameterIdType) } } + return r0 } @@ -182,41 +159,36 @@ func (_e *ElectricalConnectionServerInterface_Expecter) AddParameterDescription( func (_c *ElectricalConnectionServerInterface_AddParameterDescription_Call) Run(run func(description model.ElectricalConnectionParameterDescriptionDataType)) *ElectricalConnectionServerInterface_AddParameterDescription_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionParameterDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionParameterDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionParameterDescriptionDataType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_AddParameterDescription_Call) Return(electricalConnectionParameterIdType *model.ElectricalConnectionParameterIdType) *ElectricalConnectionServerInterface_AddParameterDescription_Call { - _c.Call.Return(electricalConnectionParameterIdType) +func (_c *ElectricalConnectionServerInterface_AddParameterDescription_Call) Return(_a0 *model.ElectricalConnectionParameterIdType) *ElectricalConnectionServerInterface_AddParameterDescription_Call { + _c.Call.Return(_a0) return _c } -func (_c *ElectricalConnectionServerInterface_AddParameterDescription_Call) RunAndReturn(run func(description model.ElectricalConnectionParameterDescriptionDataType) *model.ElectricalConnectionParameterIdType) *ElectricalConnectionServerInterface_AddParameterDescription_Call { +func (_c *ElectricalConnectionServerInterface_AddParameterDescription_Call) RunAndReturn(run func(model.ElectricalConnectionParameterDescriptionDataType) *model.ElectricalConnectionParameterIdType) *ElectricalConnectionServerInterface_AddParameterDescription_Call { _c.Call.Return(run) return _c } -// AdjustValueToBeWithinPermittedValuesForParameterId provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) AdjustValueToBeWithinPermittedValuesForParameterId(value float64, parameterId model.ElectricalConnectionParameterIdType) float64 { - ret := _mock.Called(value, parameterId) +// AdjustValueToBeWithinPermittedValuesForParameterId provides a mock function with given fields: value, parameterId +func (_m *ElectricalConnectionServerInterface) AdjustValueToBeWithinPermittedValuesForParameterId(value float64, parameterId model.ElectricalConnectionParameterIdType) float64 { + ret := _m.Called(value, parameterId) if len(ret) == 0 { panic("no return value specified for AdjustValueToBeWithinPermittedValuesForParameterId") } var r0 float64 - if returnFunc, ok := ret.Get(0).(func(float64, model.ElectricalConnectionParameterIdType) float64); ok { - r0 = returnFunc(value, parameterId) + if rf, ok := ret.Get(0).(func(float64, model.ElectricalConnectionParameterIdType) float64); ok { + r0 = rf(value, parameterId) } else { r0 = ret.Get(0).(float64) } + return r0 } @@ -234,46 +206,36 @@ func (_e *ElectricalConnectionServerInterface_Expecter) AdjustValueToBeWithinPer func (_c *ElectricalConnectionServerInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call) Run(run func(value float64, parameterId model.ElectricalConnectionParameterIdType)) *ElectricalConnectionServerInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 float64 - if args[0] != nil { - arg0 = args[0].(float64) - } - var arg1 model.ElectricalConnectionParameterIdType - if args[1] != nil { - arg1 = args[1].(model.ElectricalConnectionParameterIdType) - } - run( - arg0, - arg1, - ) + run(args[0].(float64), args[1].(model.ElectricalConnectionParameterIdType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call) Return(f float64) *ElectricalConnectionServerInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call { - _c.Call.Return(f) +func (_c *ElectricalConnectionServerInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call) Return(_a0 float64) *ElectricalConnectionServerInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call { + _c.Call.Return(_a0) return _c } -func (_c *ElectricalConnectionServerInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call) RunAndReturn(run func(value float64, parameterId model.ElectricalConnectionParameterIdType) float64) *ElectricalConnectionServerInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call { +func (_c *ElectricalConnectionServerInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call) RunAndReturn(run func(float64, model.ElectricalConnectionParameterIdType) float64) *ElectricalConnectionServerInterface_AdjustValueToBeWithinPermittedValuesForParameterId_Call { _c.Call.Return(run) return _c } -// CheckEventPayloadDataForFilter provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) CheckEventPayloadDataForFilter(payloadData any, filter any) bool { - ret := _mock.Called(payloadData, filter) +// CheckEventPayloadDataForFilter provides a mock function with given fields: payloadData, filter +func (_m *ElectricalConnectionServerInterface) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) bool { + ret := _m.Called(payloadData, filter) if len(ret) == 0 { panic("no return value specified for CheckEventPayloadDataForFilter") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(any, any) bool); ok { - r0 = returnFunc(payloadData, filter) + if rf, ok := ret.Get(0).(func(interface{}, interface{}) bool); ok { + r0 = rf(payloadData, filter) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -283,43 +245,32 @@ type ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call str } // CheckEventPayloadDataForFilter is a helper method to define mock.On call -// - payloadData any -// - filter any +// - payloadData interface{} +// - filter interface{} func (_e *ElectricalConnectionServerInterface_Expecter) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call { return &ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call{Call: _e.mock.On("CheckEventPayloadDataForFilter", payloadData, filter)} } -func (_c *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData any, filter any)) *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call { +func (_c *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData interface{}, filter interface{})) *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 any - if args[0] != nil { - arg0 = args[0].(any) - } - var arg1 any - if args[1] != nil { - arg1 = args[1].(any) - } - run( - arg0, - arg1, - ) + run(args[0].(interface{}), args[1].(interface{})) }) return _c } -func (_c *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call) Return(b bool) *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call { - _c.Call.Return(b) +func (_c *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call) Return(_a0 bool) *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call { + _c.Call.Return(_a0) return _c } -func (_c *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(payloadData any, filter any) bool) *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call { +func (_c *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(interface{}, interface{}) bool) *ElectricalConnectionServerInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Return(run) return _c } -// GetCharacteristicsForFilter provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) GetCharacteristicsForFilter(filter model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error) { - ret := _mock.Called(filter) +// GetCharacteristicsForFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionServerInterface) GetCharacteristicsForFilter(filter model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetCharacteristicsForFilter") @@ -327,21 +278,23 @@ func (_mock *ElectricalConnectionServerInterface) GetCharacteristicsForFilter(fi var r0 []model.ElectricalConnectionCharacteristicDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) []model.ElectricalConnectionCharacteristicDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType) []model.ElectricalConnectionCharacteristicDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.ElectricalConnectionCharacteristicDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionCharacteristicDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionCharacteristicDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -358,30 +311,24 @@ func (_e *ElectricalConnectionServerInterface_Expecter) GetCharacteristicsForFil func (_c *ElectricalConnectionServerInterface_GetCharacteristicsForFilter_Call) Run(run func(filter model.ElectricalConnectionCharacteristicDataType)) *ElectricalConnectionServerInterface_GetCharacteristicsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionCharacteristicDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionCharacteristicDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionCharacteristicDataType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_GetCharacteristicsForFilter_Call) Return(electricalConnectionCharacteristicDataTypes []model.ElectricalConnectionCharacteristicDataType, err error) *ElectricalConnectionServerInterface_GetCharacteristicsForFilter_Call { - _c.Call.Return(electricalConnectionCharacteristicDataTypes, err) +func (_c *ElectricalConnectionServerInterface_GetCharacteristicsForFilter_Call) Return(_a0 []model.ElectricalConnectionCharacteristicDataType, _a1 error) *ElectricalConnectionServerInterface_GetCharacteristicsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionServerInterface_GetCharacteristicsForFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error)) *ElectricalConnectionServerInterface_GetCharacteristicsForFilter_Call { +func (_c *ElectricalConnectionServerInterface_GetCharacteristicsForFilter_Call) RunAndReturn(run func(model.ElectricalConnectionCharacteristicDataType) ([]model.ElectricalConnectionCharacteristicDataType, error)) *ElectricalConnectionServerInterface_GetCharacteristicsForFilter_Call { _c.Call.Return(run) return _c } -// GetDescriptionForParameterDescriptionFilter provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) GetDescriptionForParameterDescriptionFilter(filter model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetDescriptionForParameterDescriptionFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionServerInterface) GetDescriptionForParameterDescriptionFilter(filter model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetDescriptionForParameterDescriptionFilter") @@ -389,21 +336,23 @@ func (_mock *ElectricalConnectionServerInterface) GetDescriptionForParameterDesc var r0 *model.ElectricalConnectionDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) *model.ElectricalConnectionDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) *model.ElectricalConnectionDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.ElectricalConnectionDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionParameterDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionParameterDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -420,30 +369,24 @@ func (_e *ElectricalConnectionServerInterface_Expecter) GetDescriptionForParamet func (_c *ElectricalConnectionServerInterface_GetDescriptionForParameterDescriptionFilter_Call) Run(run func(filter model.ElectricalConnectionParameterDescriptionDataType)) *ElectricalConnectionServerInterface_GetDescriptionForParameterDescriptionFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionParameterDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionParameterDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionParameterDescriptionDataType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_GetDescriptionForParameterDescriptionFilter_Call) Return(electricalConnectionDescriptionDataType *model.ElectricalConnectionDescriptionDataType, err error) *ElectricalConnectionServerInterface_GetDescriptionForParameterDescriptionFilter_Call { - _c.Call.Return(electricalConnectionDescriptionDataType, err) +func (_c *ElectricalConnectionServerInterface_GetDescriptionForParameterDescriptionFilter_Call) Return(_a0 *model.ElectricalConnectionDescriptionDataType, _a1 error) *ElectricalConnectionServerInterface_GetDescriptionForParameterDescriptionFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionServerInterface_GetDescriptionForParameterDescriptionFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error)) *ElectricalConnectionServerInterface_GetDescriptionForParameterDescriptionFilter_Call { +func (_c *ElectricalConnectionServerInterface_GetDescriptionForParameterDescriptionFilter_Call) RunAndReturn(run func(model.ElectricalConnectionParameterDescriptionDataType) (*model.ElectricalConnectionDescriptionDataType, error)) *ElectricalConnectionServerInterface_GetDescriptionForParameterDescriptionFilter_Call { _c.Call.Return(run) return _c } -// GetDescriptionsForFilter provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) GetDescriptionsForFilter(filter model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetDescriptionsForFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionServerInterface) GetDescriptionsForFilter(filter model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetDescriptionsForFilter") @@ -451,21 +394,23 @@ func (_mock *ElectricalConnectionServerInterface) GetDescriptionsForFilter(filte var r0 []model.ElectricalConnectionDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) []model.ElectricalConnectionDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) []model.ElectricalConnectionDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.ElectricalConnectionDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -482,30 +427,82 @@ func (_e *ElectricalConnectionServerInterface_Expecter) GetDescriptionsForFilter func (_c *ElectricalConnectionServerInterface_GetDescriptionsForFilter_Call) Run(run func(filter model.ElectricalConnectionDescriptionDataType)) *ElectricalConnectionServerInterface_GetDescriptionsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionDescriptionDataType) + run(args[0].(model.ElectricalConnectionDescriptionDataType)) + }) + return _c +} + +func (_c *ElectricalConnectionServerInterface_GetDescriptionsForFilter_Call) Return(_a0 []model.ElectricalConnectionDescriptionDataType, _a1 error) *ElectricalConnectionServerInterface_GetDescriptionsForFilter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ElectricalConnectionServerInterface_GetDescriptionsForFilter_Call) RunAndReturn(run func(model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error)) *ElectricalConnectionServerInterface_GetDescriptionsForFilter_Call { + _c.Call.Return(run) + return _c +} + +// GetOrAddIdForDescription provides a mock function with given fields: electricalConnectionDescription +func (_m *ElectricalConnectionServerInterface) GetOrAddIdForDescription(electricalConnectionDescription model.ElectricalConnectionDescriptionDataType) (*model.ElectricalConnectionIdType, error) { + ret := _m.Called(electricalConnectionDescription) + + if len(ret) == 0 { + panic("no return value specified for GetOrAddIdForDescription") + } + + var r0 *model.ElectricalConnectionIdType + var r1 error + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) (*model.ElectricalConnectionIdType, error)); ok { + return rf(electricalConnectionDescription) + } + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionDescriptionDataType) *model.ElectricalConnectionIdType); ok { + r0 = rf(electricalConnectionDescription) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*model.ElectricalConnectionIdType) } - run( - arg0, - ) + } + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionDescriptionDataType) error); ok { + r1 = rf(electricalConnectionDescription) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ElectricalConnectionServerInterface_GetOrAddIdForDescription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrAddIdForDescription' +type ElectricalConnectionServerInterface_GetOrAddIdForDescription_Call struct { + *mock.Call +} + +// GetOrAddIdForDescription is a helper method to define mock.On call +// - electricalConnectionDescription model.ElectricalConnectionDescriptionDataType +func (_e *ElectricalConnectionServerInterface_Expecter) GetOrAddIdForDescription(electricalConnectionDescription interface{}) *ElectricalConnectionServerInterface_GetOrAddIdForDescription_Call { + return &ElectricalConnectionServerInterface_GetOrAddIdForDescription_Call{Call: _e.mock.On("GetOrAddIdForDescription", electricalConnectionDescription)} +} + +func (_c *ElectricalConnectionServerInterface_GetOrAddIdForDescription_Call) Run(run func(electricalConnectionDescription model.ElectricalConnectionDescriptionDataType)) *ElectricalConnectionServerInterface_GetOrAddIdForDescription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(model.ElectricalConnectionDescriptionDataType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_GetDescriptionsForFilter_Call) Return(electricalConnectionDescriptionDataTypes []model.ElectricalConnectionDescriptionDataType, err error) *ElectricalConnectionServerInterface_GetDescriptionsForFilter_Call { - _c.Call.Return(electricalConnectionDescriptionDataTypes, err) +func (_c *ElectricalConnectionServerInterface_GetOrAddIdForDescription_Call) Return(_a0 *model.ElectricalConnectionIdType, _a1 error) *ElectricalConnectionServerInterface_GetOrAddIdForDescription_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionServerInterface_GetDescriptionsForFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionDescriptionDataType) ([]model.ElectricalConnectionDescriptionDataType, error)) *ElectricalConnectionServerInterface_GetDescriptionsForFilter_Call { +func (_c *ElectricalConnectionServerInterface_GetOrAddIdForDescription_Call) RunAndReturn(run func(model.ElectricalConnectionDescriptionDataType) (*model.ElectricalConnectionIdType, error)) *ElectricalConnectionServerInterface_GetOrAddIdForDescription_Call { _c.Call.Return(run) return _c } -// GetParameterDescriptionsForFilter provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) GetParameterDescriptionsForFilter(filter model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetParameterDescriptionsForFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionServerInterface) GetParameterDescriptionsForFilter(filter model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetParameterDescriptionsForFilter") @@ -513,21 +510,23 @@ func (_mock *ElectricalConnectionServerInterface) GetParameterDescriptionsForFil var r0 []model.ElectricalConnectionParameterDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) []model.ElectricalConnectionParameterDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionParameterDescriptionDataType) []model.ElectricalConnectionParameterDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.ElectricalConnectionParameterDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionParameterDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionParameterDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -544,30 +543,24 @@ func (_e *ElectricalConnectionServerInterface_Expecter) GetParameterDescriptions func (_c *ElectricalConnectionServerInterface_GetParameterDescriptionsForFilter_Call) Run(run func(filter model.ElectricalConnectionParameterDescriptionDataType)) *ElectricalConnectionServerInterface_GetParameterDescriptionsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionParameterDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionParameterDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionParameterDescriptionDataType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_GetParameterDescriptionsForFilter_Call) Return(electricalConnectionParameterDescriptionDataTypes []model.ElectricalConnectionParameterDescriptionDataType, err error) *ElectricalConnectionServerInterface_GetParameterDescriptionsForFilter_Call { - _c.Call.Return(electricalConnectionParameterDescriptionDataTypes, err) +func (_c *ElectricalConnectionServerInterface_GetParameterDescriptionsForFilter_Call) Return(_a0 []model.ElectricalConnectionParameterDescriptionDataType, _a1 error) *ElectricalConnectionServerInterface_GetParameterDescriptionsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionServerInterface_GetParameterDescriptionsForFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error)) *ElectricalConnectionServerInterface_GetParameterDescriptionsForFilter_Call { +func (_c *ElectricalConnectionServerInterface_GetParameterDescriptionsForFilter_Call) RunAndReturn(run func(model.ElectricalConnectionParameterDescriptionDataType) ([]model.ElectricalConnectionParameterDescriptionDataType, error)) *ElectricalConnectionServerInterface_GetParameterDescriptionsForFilter_Call { _c.Call.Return(run) return _c } -// GetPermittedValueDataForFilter provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) GetPermittedValueDataForFilter(filter model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error) { - ret := _mock.Called(filter) +// GetPermittedValueDataForFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionServerInterface) GetPermittedValueDataForFilter(filter model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetPermittedValueDataForFilter") @@ -577,29 +570,33 @@ func (_mock *ElectricalConnectionServerInterface) GetPermittedValueDataForFilter var r1 float64 var r2 float64 var r3 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { + r0 = rf(filter) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { + r1 = rf(filter) } else { r1 = ret.Get(1).(float64) } - if returnFunc, ok := ret.Get(2).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { - r2 = returnFunc(filter) + + if rf, ok := ret.Get(2).(func(model.ElectricalConnectionPermittedValueSetDataType) float64); ok { + r2 = rf(filter) } else { r2 = ret.Get(2).(float64) } - if returnFunc, ok := ret.Get(3).(func(model.ElectricalConnectionPermittedValueSetDataType) error); ok { - r3 = returnFunc(filter) + + if rf, ok := ret.Get(3).(func(model.ElectricalConnectionPermittedValueSetDataType) error); ok { + r3 = rf(filter) } else { r3 = ret.Error(3) } + return r0, r1, r2, r3 } @@ -616,30 +613,24 @@ func (_e *ElectricalConnectionServerInterface_Expecter) GetPermittedValueDataFor func (_c *ElectricalConnectionServerInterface_GetPermittedValueDataForFilter_Call) Run(run func(filter model.ElectricalConnectionPermittedValueSetDataType)) *ElectricalConnectionServerInterface_GetPermittedValueDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionPermittedValueSetDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionPermittedValueSetDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionPermittedValueSetDataType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_GetPermittedValueDataForFilter_Call) Return(f float64, f1 float64, f2 float64, err error) *ElectricalConnectionServerInterface_GetPermittedValueDataForFilter_Call { - _c.Call.Return(f, f1, f2, err) +func (_c *ElectricalConnectionServerInterface_GetPermittedValueDataForFilter_Call) Return(_a0 float64, _a1 float64, _a2 float64, _a3 error) *ElectricalConnectionServerInterface_GetPermittedValueDataForFilter_Call { + _c.Call.Return(_a0, _a1, _a2, _a3) return _c } -func (_c *ElectricalConnectionServerInterface_GetPermittedValueDataForFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error)) *ElectricalConnectionServerInterface_GetPermittedValueDataForFilter_Call { +func (_c *ElectricalConnectionServerInterface_GetPermittedValueDataForFilter_Call) RunAndReturn(run func(model.ElectricalConnectionPermittedValueSetDataType) (float64, float64, float64, error)) *ElectricalConnectionServerInterface_GetPermittedValueDataForFilter_Call { _c.Call.Return(run) return _c } -// GetPermittedValueSetForFilter provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) GetPermittedValueSetForFilter(filter model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error) { - ret := _mock.Called(filter) +// GetPermittedValueSetForFilter provides a mock function with given fields: filter +func (_m *ElectricalConnectionServerInterface) GetPermittedValueSetForFilter(filter model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetPermittedValueSetForFilter") @@ -647,21 +638,23 @@ func (_mock *ElectricalConnectionServerInterface) GetPermittedValueSetForFilter( var r0 []model.ElectricalConnectionPermittedValueSetDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) []model.ElectricalConnectionPermittedValueSetDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionPermittedValueSetDataType) []model.ElectricalConnectionPermittedValueSetDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.ElectricalConnectionPermittedValueSetDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.ElectricalConnectionPermittedValueSetDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.ElectricalConnectionPermittedValueSetDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -678,30 +671,24 @@ func (_e *ElectricalConnectionServerInterface_Expecter) GetPermittedValueSetForF func (_c *ElectricalConnectionServerInterface_GetPermittedValueSetForFilter_Call) Run(run func(filter model.ElectricalConnectionPermittedValueSetDataType)) *ElectricalConnectionServerInterface_GetPermittedValueSetForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionPermittedValueSetDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionPermittedValueSetDataType) - } - run( - arg0, - ) + run(args[0].(model.ElectricalConnectionPermittedValueSetDataType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_GetPermittedValueSetForFilter_Call) Return(electricalConnectionPermittedValueSetDataTypes []model.ElectricalConnectionPermittedValueSetDataType, err error) *ElectricalConnectionServerInterface_GetPermittedValueSetForFilter_Call { - _c.Call.Return(electricalConnectionPermittedValueSetDataTypes, err) +func (_c *ElectricalConnectionServerInterface_GetPermittedValueSetForFilter_Call) Return(_a0 []model.ElectricalConnectionPermittedValueSetDataType, _a1 error) *ElectricalConnectionServerInterface_GetPermittedValueSetForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *ElectricalConnectionServerInterface_GetPermittedValueSetForFilter_Call) RunAndReturn(run func(filter model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error)) *ElectricalConnectionServerInterface_GetPermittedValueSetForFilter_Call { +func (_c *ElectricalConnectionServerInterface_GetPermittedValueSetForFilter_Call) RunAndReturn(run func(model.ElectricalConnectionPermittedValueSetDataType) ([]model.ElectricalConnectionPermittedValueSetDataType, error)) *ElectricalConnectionServerInterface_GetPermittedValueSetForFilter_Call { _c.Call.Return(run) return _c } -// GetPhaseCurrentLimits provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) GetPhaseCurrentLimits(measDesc []model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error) { - ret := _mock.Called(measDesc) +// GetPhaseCurrentLimits provides a mock function with given fields: measDesc +func (_m *ElectricalConnectionServerInterface) GetPhaseCurrentLimits(measDesc []model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error) { + ret := _m.Called(measDesc) if len(ret) == 0 { panic("no return value specified for GetPhaseCurrentLimits") @@ -711,35 +698,39 @@ func (_mock *ElectricalConnectionServerInterface) GetPhaseCurrentLimits(measDesc var r1 []float64 var r2 []float64 var r3 error - if returnFunc, ok := ret.Get(0).(func([]model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error)); ok { - return returnFunc(measDesc) + if rf, ok := ret.Get(0).(func([]model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error)); ok { + return rf(measDesc) } - if returnFunc, ok := ret.Get(0).(func([]model.MeasurementDescriptionDataType) []float64); ok { - r0 = returnFunc(measDesc) + if rf, ok := ret.Get(0).(func([]model.MeasurementDescriptionDataType) []float64); ok { + r0 = rf(measDesc) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]float64) } } - if returnFunc, ok := ret.Get(1).(func([]model.MeasurementDescriptionDataType) []float64); ok { - r1 = returnFunc(measDesc) + + if rf, ok := ret.Get(1).(func([]model.MeasurementDescriptionDataType) []float64); ok { + r1 = rf(measDesc) } else { if ret.Get(1) != nil { r1 = ret.Get(1).([]float64) } } - if returnFunc, ok := ret.Get(2).(func([]model.MeasurementDescriptionDataType) []float64); ok { - r2 = returnFunc(measDesc) + + if rf, ok := ret.Get(2).(func([]model.MeasurementDescriptionDataType) []float64); ok { + r2 = rf(measDesc) } else { if ret.Get(2) != nil { r2 = ret.Get(2).([]float64) } } - if returnFunc, ok := ret.Get(3).(func([]model.MeasurementDescriptionDataType) error); ok { - r3 = returnFunc(measDesc) + + if rf, ok := ret.Get(3).(func([]model.MeasurementDescriptionDataType) error); ok { + r3 = rf(measDesc) } else { r3 = ret.Error(3) } + return r0, r1, r2, r3 } @@ -756,13 +747,7 @@ func (_e *ElectricalConnectionServerInterface_Expecter) GetPhaseCurrentLimits(me func (_c *ElectricalConnectionServerInterface_GetPhaseCurrentLimits_Call) Run(run func(measDesc []model.MeasurementDescriptionDataType)) *ElectricalConnectionServerInterface_GetPhaseCurrentLimits_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []model.MeasurementDescriptionDataType - if args[0] != nil { - arg0 = args[0].([]model.MeasurementDescriptionDataType) - } - run( - arg0, - ) + run(args[0].([]model.MeasurementDescriptionDataType)) }) return _c } @@ -772,25 +757,26 @@ func (_c *ElectricalConnectionServerInterface_GetPhaseCurrentLimits_Call) Return return _c } -func (_c *ElectricalConnectionServerInterface_GetPhaseCurrentLimits_Call) RunAndReturn(run func(measDesc []model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error)) *ElectricalConnectionServerInterface_GetPhaseCurrentLimits_Call { +func (_c *ElectricalConnectionServerInterface_GetPhaseCurrentLimits_Call) RunAndReturn(run func([]model.MeasurementDescriptionDataType) ([]float64, []float64, []float64, error)) *ElectricalConnectionServerInterface_GetPhaseCurrentLimits_Call { _c.Call.Return(run) return _c } -// UpdateCharacteristic provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) UpdateCharacteristic(data model.ElectricalConnectionCharacteristicDataType, deleteElements *model.ElectricalConnectionCharacteristicDataElementsType) error { - ret := _mock.Called(data, deleteElements) +// UpdateCharacteristic provides a mock function with given fields: data, deleteElements +func (_m *ElectricalConnectionServerInterface) UpdateCharacteristic(data model.ElectricalConnectionCharacteristicDataType, deleteElements *model.ElectricalConnectionCharacteristicDataElementsType) error { + ret := _m.Called(data, deleteElements) if len(ret) == 0 { panic("no return value specified for UpdateCharacteristic") } var r0 error - if returnFunc, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType, *model.ElectricalConnectionCharacteristicDataElementsType) error); ok { - r0 = returnFunc(data, deleteElements) + if rf, ok := ret.Get(0).(func(model.ElectricalConnectionCharacteristicDataType, *model.ElectricalConnectionCharacteristicDataElementsType) error); ok { + r0 = rf(data, deleteElements) } else { r0 = ret.Error(0) } + return r0 } @@ -808,46 +794,36 @@ func (_e *ElectricalConnectionServerInterface_Expecter) UpdateCharacteristic(dat func (_c *ElectricalConnectionServerInterface_UpdateCharacteristic_Call) Run(run func(data model.ElectricalConnectionCharacteristicDataType, deleteElements *model.ElectricalConnectionCharacteristicDataElementsType)) *ElectricalConnectionServerInterface_UpdateCharacteristic_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.ElectricalConnectionCharacteristicDataType - if args[0] != nil { - arg0 = args[0].(model.ElectricalConnectionCharacteristicDataType) - } - var arg1 *model.ElectricalConnectionCharacteristicDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.ElectricalConnectionCharacteristicDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(model.ElectricalConnectionCharacteristicDataType), args[1].(*model.ElectricalConnectionCharacteristicDataElementsType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_UpdateCharacteristic_Call) Return(err error) *ElectricalConnectionServerInterface_UpdateCharacteristic_Call { - _c.Call.Return(err) +func (_c *ElectricalConnectionServerInterface_UpdateCharacteristic_Call) Return(_a0 error) *ElectricalConnectionServerInterface_UpdateCharacteristic_Call { + _c.Call.Return(_a0) return _c } -func (_c *ElectricalConnectionServerInterface_UpdateCharacteristic_Call) RunAndReturn(run func(data model.ElectricalConnectionCharacteristicDataType, deleteElements *model.ElectricalConnectionCharacteristicDataElementsType) error) *ElectricalConnectionServerInterface_UpdateCharacteristic_Call { +func (_c *ElectricalConnectionServerInterface_UpdateCharacteristic_Call) RunAndReturn(run func(model.ElectricalConnectionCharacteristicDataType, *model.ElectricalConnectionCharacteristicDataElementsType) error) *ElectricalConnectionServerInterface_UpdateCharacteristic_Call { _c.Call.Return(run) return _c } -// UpdatePermittedValueSetForFilters provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) UpdatePermittedValueSetForFilters(data []api.ElectricalConnectionPermittedValueSetForFilter, deleteSelector *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, deleteElements *model.ElectricalConnectionPermittedValueSetDataElementsType) error { - ret := _mock.Called(data, deleteSelector, deleteElements) +// UpdatePermittedValueSetForFilters provides a mock function with given fields: data, deleteSelector, deleteElements +func (_m *ElectricalConnectionServerInterface) UpdatePermittedValueSetForFilters(data []api.ElectricalConnectionPermittedValueSetForFilter, deleteSelector *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, deleteElements *model.ElectricalConnectionPermittedValueSetDataElementsType) error { + ret := _m.Called(data, deleteSelector, deleteElements) if len(ret) == 0 { panic("no return value specified for UpdatePermittedValueSetForFilters") } var r0 error - if returnFunc, ok := ret.Get(0).(func([]api.ElectricalConnectionPermittedValueSetForFilter, *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, *model.ElectricalConnectionPermittedValueSetDataElementsType) error); ok { - r0 = returnFunc(data, deleteSelector, deleteElements) + if rf, ok := ret.Get(0).(func([]api.ElectricalConnectionPermittedValueSetForFilter, *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, *model.ElectricalConnectionPermittedValueSetDataElementsType) error); ok { + r0 = rf(data, deleteSelector, deleteElements) } else { r0 = ret.Error(0) } + return r0 } @@ -866,51 +842,36 @@ func (_e *ElectricalConnectionServerInterface_Expecter) UpdatePermittedValueSetF func (_c *ElectricalConnectionServerInterface_UpdatePermittedValueSetForFilters_Call) Run(run func(data []api.ElectricalConnectionPermittedValueSetForFilter, deleteSelector *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, deleteElements *model.ElectricalConnectionPermittedValueSetDataElementsType)) *ElectricalConnectionServerInterface_UpdatePermittedValueSetForFilters_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []api.ElectricalConnectionPermittedValueSetForFilter - if args[0] != nil { - arg0 = args[0].([]api.ElectricalConnectionPermittedValueSetForFilter) - } - var arg1 *model.ElectricalConnectionPermittedValueSetListDataSelectorsType - if args[1] != nil { - arg1 = args[1].(*model.ElectricalConnectionPermittedValueSetListDataSelectorsType) - } - var arg2 *model.ElectricalConnectionPermittedValueSetDataElementsType - if args[2] != nil { - arg2 = args[2].(*model.ElectricalConnectionPermittedValueSetDataElementsType) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].([]api.ElectricalConnectionPermittedValueSetForFilter), args[1].(*model.ElectricalConnectionPermittedValueSetListDataSelectorsType), args[2].(*model.ElectricalConnectionPermittedValueSetDataElementsType)) }) return _c } -func (_c *ElectricalConnectionServerInterface_UpdatePermittedValueSetForFilters_Call) Return(err error) *ElectricalConnectionServerInterface_UpdatePermittedValueSetForFilters_Call { - _c.Call.Return(err) +func (_c *ElectricalConnectionServerInterface_UpdatePermittedValueSetForFilters_Call) Return(_a0 error) *ElectricalConnectionServerInterface_UpdatePermittedValueSetForFilters_Call { + _c.Call.Return(_a0) return _c } -func (_c *ElectricalConnectionServerInterface_UpdatePermittedValueSetForFilters_Call) RunAndReturn(run func(data []api.ElectricalConnectionPermittedValueSetForFilter, deleteSelector *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, deleteElements *model.ElectricalConnectionPermittedValueSetDataElementsType) error) *ElectricalConnectionServerInterface_UpdatePermittedValueSetForFilters_Call { +func (_c *ElectricalConnectionServerInterface_UpdatePermittedValueSetForFilters_Call) RunAndReturn(run func([]api.ElectricalConnectionPermittedValueSetForFilter, *model.ElectricalConnectionPermittedValueSetListDataSelectorsType, *model.ElectricalConnectionPermittedValueSetDataElementsType) error) *ElectricalConnectionServerInterface_UpdatePermittedValueSetForFilters_Call { _c.Call.Return(run) return _c } -// UpdatePermittedValueSetForIds provides a mock function for the type ElectricalConnectionServerInterface -func (_mock *ElectricalConnectionServerInterface) UpdatePermittedValueSetForIds(data []api.ElectricalConnectionPermittedValueSetForID) error { - ret := _mock.Called(data) +// UpdatePermittedValueSetForIds provides a mock function with given fields: data +func (_m *ElectricalConnectionServerInterface) UpdatePermittedValueSetForIds(data []api.ElectricalConnectionPermittedValueSetForID) error { + ret := _m.Called(data) if len(ret) == 0 { panic("no return value specified for UpdatePermittedValueSetForIds") } var r0 error - if returnFunc, ok := ret.Get(0).(func([]api.ElectricalConnectionPermittedValueSetForID) error); ok { - r0 = returnFunc(data) + if rf, ok := ret.Get(0).(func([]api.ElectricalConnectionPermittedValueSetForID) error); ok { + r0 = rf(data) } else { r0 = ret.Error(0) } + return r0 } @@ -927,23 +888,31 @@ func (_e *ElectricalConnectionServerInterface_Expecter) UpdatePermittedValueSetF func (_c *ElectricalConnectionServerInterface_UpdatePermittedValueSetForIds_Call) Run(run func(data []api.ElectricalConnectionPermittedValueSetForID)) *ElectricalConnectionServerInterface_UpdatePermittedValueSetForIds_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []api.ElectricalConnectionPermittedValueSetForID - if args[0] != nil { - arg0 = args[0].([]api.ElectricalConnectionPermittedValueSetForID) - } - run( - arg0, - ) + run(args[0].([]api.ElectricalConnectionPermittedValueSetForID)) }) return _c } -func (_c *ElectricalConnectionServerInterface_UpdatePermittedValueSetForIds_Call) Return(err error) *ElectricalConnectionServerInterface_UpdatePermittedValueSetForIds_Call { - _c.Call.Return(err) +func (_c *ElectricalConnectionServerInterface_UpdatePermittedValueSetForIds_Call) Return(_a0 error) *ElectricalConnectionServerInterface_UpdatePermittedValueSetForIds_Call { + _c.Call.Return(_a0) return _c } -func (_c *ElectricalConnectionServerInterface_UpdatePermittedValueSetForIds_Call) RunAndReturn(run func(data []api.ElectricalConnectionPermittedValueSetForID) error) *ElectricalConnectionServerInterface_UpdatePermittedValueSetForIds_Call { +func (_c *ElectricalConnectionServerInterface_UpdatePermittedValueSetForIds_Call) RunAndReturn(run func([]api.ElectricalConnectionPermittedValueSetForID) error) *ElectricalConnectionServerInterface_UpdatePermittedValueSetForIds_Call { _c.Call.Return(run) return _c } + +// NewElectricalConnectionServerInterface creates a new instance of ElectricalConnectionServerInterface. 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 NewElectricalConnectionServerInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ElectricalConnectionServerInterface { + mock := &ElectricalConnectionServerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/EntityEventCallback.go b/mocks/EntityEventCallback.go index 042ca199..b0dd293f 100644 --- a/mocks/EntityEventCallback.go +++ b/mocks/EntityEventCallback.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks @@ -54,7 +54,7 @@ func (_c *EntityEventCallback_Execute_Call) Return() *EntityEventCallback_Execut } func (_c *EntityEventCallback_Execute_Call) RunAndReturn(run func(string, api.DeviceRemoteInterface, api.EntityRemoteInterface, eebus_goapi.EventType)) *EntityEventCallback_Execute_Call { - _c.Call.Return(run) + _c.Run(run) return _c } diff --git a/mocks/FeatureClientInterface.go b/mocks/FeatureClientInterface.go index dac163c1..c6bc5ba7 100644 --- a/mocks/FeatureClientInterface.go +++ b/mocks/FeatureClientInterface.go @@ -1,28 +1,14 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/api" - "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" -) - -// NewFeatureClientInterface creates a new instance of FeatureClientInterface. 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 NewFeatureClientInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *FeatureClientInterface { - mock := &FeatureClientInterface{} - mock.Mock.Test(t) + api "github.com/enbility/spine-go/api" - t.Cleanup(func() { mock.AssertExpectations(t) }) + mock "github.com/stretchr/testify/mock" - return mock -} + model "github.com/enbility/spine-go/model" +) // FeatureClientInterface is an autogenerated mock type for the FeatureClientInterface type type FeatureClientInterface struct { @@ -37,20 +23,21 @@ func (_m *FeatureClientInterface) EXPECT() *FeatureClientInterface_Expecter { return &FeatureClientInterface_Expecter{mock: &_m.Mock} } -// AddResponseCallback provides a mock function for the type FeatureClientInterface -func (_mock *FeatureClientInterface) AddResponseCallback(msgCounterReference model.MsgCounterType, function func(msg api.ResponseMessage)) error { - ret := _mock.Called(msgCounterReference, function) +// AddResponseCallback provides a mock function with given fields: msgCounterReference, function +func (_m *FeatureClientInterface) AddResponseCallback(msgCounterReference model.MsgCounterType, function func(api.ResponseMessage)) error { + ret := _m.Called(msgCounterReference, function) if len(ret) == 0 { panic("no return value specified for AddResponseCallback") } var r0 error - if returnFunc, ok := ret.Get(0).(func(model.MsgCounterType, func(msg api.ResponseMessage)) error); ok { - r0 = returnFunc(msgCounterReference, function) + if rf, ok := ret.Get(0).(func(model.MsgCounterType, func(api.ResponseMessage)) error); ok { + r0 = rf(msgCounterReference, function) } else { r0 = ret.Error(0) } + return r0 } @@ -61,43 +48,31 @@ type FeatureClientInterface_AddResponseCallback_Call struct { // AddResponseCallback is a helper method to define mock.On call // - msgCounterReference model.MsgCounterType -// - function func(msg api.ResponseMessage) +// - function func(api.ResponseMessage) func (_e *FeatureClientInterface_Expecter) AddResponseCallback(msgCounterReference interface{}, function interface{}) *FeatureClientInterface_AddResponseCallback_Call { return &FeatureClientInterface_AddResponseCallback_Call{Call: _e.mock.On("AddResponseCallback", msgCounterReference, function)} } -func (_c *FeatureClientInterface_AddResponseCallback_Call) Run(run func(msgCounterReference model.MsgCounterType, function func(msg api.ResponseMessage))) *FeatureClientInterface_AddResponseCallback_Call { +func (_c *FeatureClientInterface_AddResponseCallback_Call) Run(run func(msgCounterReference model.MsgCounterType, function func(api.ResponseMessage))) *FeatureClientInterface_AddResponseCallback_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.MsgCounterType - if args[0] != nil { - arg0 = args[0].(model.MsgCounterType) - } - var arg1 func(msg api.ResponseMessage) - if args[1] != nil { - arg1 = args[1].(func(msg api.ResponseMessage)) - } - run( - arg0, - arg1, - ) + run(args[0].(model.MsgCounterType), args[1].(func(api.ResponseMessage))) }) return _c } -func (_c *FeatureClientInterface_AddResponseCallback_Call) Return(err error) *FeatureClientInterface_AddResponseCallback_Call { - _c.Call.Return(err) +func (_c *FeatureClientInterface_AddResponseCallback_Call) Return(_a0 error) *FeatureClientInterface_AddResponseCallback_Call { + _c.Call.Return(_a0) return _c } -func (_c *FeatureClientInterface_AddResponseCallback_Call) RunAndReturn(run func(msgCounterReference model.MsgCounterType, function func(msg api.ResponseMessage)) error) *FeatureClientInterface_AddResponseCallback_Call { +func (_c *FeatureClientInterface_AddResponseCallback_Call) RunAndReturn(run func(model.MsgCounterType, func(api.ResponseMessage)) error) *FeatureClientInterface_AddResponseCallback_Call { _c.Call.Return(run) return _c } -// AddResultCallback provides a mock function for the type FeatureClientInterface -func (_mock *FeatureClientInterface) AddResultCallback(function func(msg api.ResponseMessage)) { - _mock.Called(function) - return +// AddResultCallback provides a mock function with given fields: function +func (_m *FeatureClientInterface) AddResultCallback(function func(api.ResponseMessage)) { + _m.Called(function) } // FeatureClientInterface_AddResultCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddResultCallback' @@ -106,20 +81,14 @@ type FeatureClientInterface_AddResultCallback_Call struct { } // AddResultCallback is a helper method to define mock.On call -// - function func(msg api.ResponseMessage) +// - function func(api.ResponseMessage) func (_e *FeatureClientInterface_Expecter) AddResultCallback(function interface{}) *FeatureClientInterface_AddResultCallback_Call { return &FeatureClientInterface_AddResultCallback_Call{Call: _e.mock.On("AddResultCallback", function)} } -func (_c *FeatureClientInterface_AddResultCallback_Call) Run(run func(function func(msg api.ResponseMessage))) *FeatureClientInterface_AddResultCallback_Call { +func (_c *FeatureClientInterface_AddResultCallback_Call) Run(run func(function func(api.ResponseMessage))) *FeatureClientInterface_AddResultCallback_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 func(msg api.ResponseMessage) - if args[0] != nil { - arg0 = args[0].(func(msg api.ResponseMessage)) - } - run( - arg0, - ) + run(args[0].(func(api.ResponseMessage))) }) return _c } @@ -129,14 +98,14 @@ func (_c *FeatureClientInterface_AddResultCallback_Call) Return() *FeatureClient return _c } -func (_c *FeatureClientInterface_AddResultCallback_Call) RunAndReturn(run func(function func(msg api.ResponseMessage))) *FeatureClientInterface_AddResultCallback_Call { +func (_c *FeatureClientInterface_AddResultCallback_Call) RunAndReturn(run func(func(api.ResponseMessage))) *FeatureClientInterface_AddResultCallback_Call { _c.Run(run) return _c } -// Bind provides a mock function for the type FeatureClientInterface -func (_mock *FeatureClientInterface) Bind() (*model.MsgCounterType, error) { - ret := _mock.Called() +// Bind provides a mock function with no fields +func (_m *FeatureClientInterface) Bind() (*model.MsgCounterType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for Bind") @@ -144,21 +113,23 @@ func (_mock *FeatureClientInterface) Bind() (*model.MsgCounterType, error) { var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.MsgCounterType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.MsgCounterType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -179,8 +150,8 @@ func (_c *FeatureClientInterface_Bind_Call) Run(run func()) *FeatureClientInterf return _c } -func (_c *FeatureClientInterface_Bind_Call) Return(msgCounterType *model.MsgCounterType, err error) *FeatureClientInterface_Bind_Call { - _c.Call.Return(msgCounterType, err) +func (_c *FeatureClientInterface_Bind_Call) Return(_a0 *model.MsgCounterType, _a1 error) *FeatureClientInterface_Bind_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -189,20 +160,21 @@ func (_c *FeatureClientInterface_Bind_Call) RunAndReturn(run func() (*model.MsgC return _c } -// HasBinding provides a mock function for the type FeatureClientInterface -func (_mock *FeatureClientInterface) HasBinding() bool { - ret := _mock.Called() +// HasBinding provides a mock function with no fields +func (_m *FeatureClientInterface) HasBinding() bool { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for HasBinding") } var r0 bool - if returnFunc, ok := ret.Get(0).(func() bool); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -223,8 +195,8 @@ func (_c *FeatureClientInterface_HasBinding_Call) Run(run func()) *FeatureClient return _c } -func (_c *FeatureClientInterface_HasBinding_Call) Return(b bool) *FeatureClientInterface_HasBinding_Call { - _c.Call.Return(b) +func (_c *FeatureClientInterface_HasBinding_Call) Return(_a0 bool) *FeatureClientInterface_HasBinding_Call { + _c.Call.Return(_a0) return _c } @@ -233,20 +205,21 @@ func (_c *FeatureClientInterface_HasBinding_Call) RunAndReturn(run func() bool) return _c } -// HasSubscription provides a mock function for the type FeatureClientInterface -func (_mock *FeatureClientInterface) HasSubscription() bool { - ret := _mock.Called() +// HasSubscription provides a mock function with no fields +func (_m *FeatureClientInterface) HasSubscription() bool { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for HasSubscription") } var r0 bool - if returnFunc, ok := ret.Get(0).(func() bool); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -267,8 +240,8 @@ func (_c *FeatureClientInterface_HasSubscription_Call) Run(run func()) *FeatureC return _c } -func (_c *FeatureClientInterface_HasSubscription_Call) Return(b bool) *FeatureClientInterface_HasSubscription_Call { - _c.Call.Return(b) +func (_c *FeatureClientInterface_HasSubscription_Call) Return(_a0 bool) *FeatureClientInterface_HasSubscription_Call { + _c.Call.Return(_a0) return _c } @@ -277,9 +250,9 @@ func (_c *FeatureClientInterface_HasSubscription_Call) RunAndReturn(run func() b return _c } -// Subscribe provides a mock function for the type FeatureClientInterface -func (_mock *FeatureClientInterface) Subscribe() (*model.MsgCounterType, error) { - ret := _mock.Called() +// Subscribe provides a mock function with no fields +func (_m *FeatureClientInterface) Subscribe() (*model.MsgCounterType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for Subscribe") @@ -287,21 +260,23 @@ func (_mock *FeatureClientInterface) Subscribe() (*model.MsgCounterType, error) var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.MsgCounterType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.MsgCounterType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -322,8 +297,8 @@ func (_c *FeatureClientInterface_Subscribe_Call) Run(run func()) *FeatureClientI return _c } -func (_c *FeatureClientInterface_Subscribe_Call) Return(msgCounterType *model.MsgCounterType, err error) *FeatureClientInterface_Subscribe_Call { - _c.Call.Return(msgCounterType, err) +func (_c *FeatureClientInterface_Subscribe_Call) Return(_a0 *model.MsgCounterType, _a1 error) *FeatureClientInterface_Subscribe_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -331,3 +306,17 @@ func (_c *FeatureClientInterface_Subscribe_Call) RunAndReturn(run func() (*model _c.Call.Return(run) return _c } + +// NewFeatureClientInterface creates a new instance of FeatureClientInterface. 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 NewFeatureClientInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *FeatureClientInterface { + mock := &FeatureClientInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/FeatureServerInterface.go b/mocks/FeatureServerInterface.go index 2698e67d..fe726d65 100644 --- a/mocks/FeatureServerInterface.go +++ b/mocks/FeatureServerInterface.go @@ -1,12 +1,21 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks -import ( - mock "github.com/stretchr/testify/mock" -) +import mock "github.com/stretchr/testify/mock" + +// FeatureServerInterface is an autogenerated mock type for the FeatureServerInterface type +type FeatureServerInterface struct { + mock.Mock +} + +type FeatureServerInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *FeatureServerInterface) EXPECT() *FeatureServerInterface_Expecter { + return &FeatureServerInterface_Expecter{mock: &_m.Mock} +} // NewFeatureServerInterface creates a new instance of FeatureServerInterface. 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. @@ -21,16 +30,3 @@ func NewFeatureServerInterface(t interface { return mock } - -// FeatureServerInterface is an autogenerated mock type for the FeatureServerInterface type -type FeatureServerInterface struct { - mock.Mock -} - -type FeatureServerInterface_Expecter struct { - mock *mock.Mock -} - -func (_m *FeatureServerInterface) EXPECT() *FeatureServerInterface_Expecter { - return &FeatureServerInterface_Expecter{mock: &_m.Mock} -} diff --git a/mocks/IdentificationClientInterface.go b/mocks/IdentificationClientInterface.go index 03182d03..e63f3fc9 100644 --- a/mocks/IdentificationClientInterface.go +++ b/mocks/IdentificationClientInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewIdentificationClientInterface creates a new instance of IdentificationClientInterface. 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 NewIdentificationClientInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *IdentificationClientInterface { - mock := &IdentificationClientInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // IdentificationClientInterface is an autogenerated mock type for the IdentificationClientInterface type type IdentificationClientInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *IdentificationClientInterface) EXPECT() *IdentificationClientInterface return &IdentificationClientInterface_Expecter{mock: &_m.Mock} } -// RequestValues provides a mock function for the type IdentificationClientInterface -func (_mock *IdentificationClientInterface) RequestValues() (*model.MsgCounterType, error) { - ret := _mock.Called() +// RequestValues provides a mock function with no fields +func (_m *IdentificationClientInterface) RequestValues() (*model.MsgCounterType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RequestValues") @@ -46,21 +30,23 @@ func (_mock *IdentificationClientInterface) RequestValues() (*model.MsgCounterTy var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.MsgCounterType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.MsgCounterType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -81,8 +67,8 @@ func (_c *IdentificationClientInterface_RequestValues_Call) Run(run func()) *Ide return _c } -func (_c *IdentificationClientInterface_RequestValues_Call) Return(msgCounterType *model.MsgCounterType, err error) *IdentificationClientInterface_RequestValues_Call { - _c.Call.Return(msgCounterType, err) +func (_c *IdentificationClientInterface_RequestValues_Call) Return(_a0 *model.MsgCounterType, _a1 error) *IdentificationClientInterface_RequestValues_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -90,3 +76,17 @@ func (_c *IdentificationClientInterface_RequestValues_Call) RunAndReturn(run fun _c.Call.Return(run) return _c } + +// NewIdentificationClientInterface creates a new instance of IdentificationClientInterface. 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 NewIdentificationClientInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *IdentificationClientInterface { + mock := &IdentificationClientInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/IdentificationCommonInterface.go b/mocks/IdentificationCommonInterface.go index b2299ff6..7332ca28 100644 --- a/mocks/IdentificationCommonInterface.go +++ b/mocks/IdentificationCommonInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewIdentificationCommonInterface creates a new instance of IdentificationCommonInterface. 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 NewIdentificationCommonInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *IdentificationCommonInterface { - mock := &IdentificationCommonInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // IdentificationCommonInterface is an autogenerated mock type for the IdentificationCommonInterface type type IdentificationCommonInterface struct { mock.Mock @@ -36,20 +20,21 @@ func (_m *IdentificationCommonInterface) EXPECT() *IdentificationCommonInterface return &IdentificationCommonInterface_Expecter{mock: &_m.Mock} } -// CheckEventPayloadDataForFilter provides a mock function for the type IdentificationCommonInterface -func (_mock *IdentificationCommonInterface) CheckEventPayloadDataForFilter(payloadData any) bool { - ret := _mock.Called(payloadData) +// CheckEventPayloadDataForFilter provides a mock function with given fields: payloadData +func (_m *IdentificationCommonInterface) CheckEventPayloadDataForFilter(payloadData interface{}) bool { + ret := _m.Called(payloadData) if len(ret) == 0 { panic("no return value specified for CheckEventPayloadDataForFilter") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(any) bool); ok { - r0 = returnFunc(payloadData) + if rf, ok := ret.Get(0).(func(interface{}) bool); ok { + r0 = rf(payloadData) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -59,37 +44,31 @@ type IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call struct { } // CheckEventPayloadDataForFilter is a helper method to define mock.On call -// - payloadData any +// - payloadData interface{} func (_e *IdentificationCommonInterface_Expecter) CheckEventPayloadDataForFilter(payloadData interface{}) *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call { return &IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call{Call: _e.mock.On("CheckEventPayloadDataForFilter", payloadData)} } -func (_c *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData any)) *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call { +func (_c *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData interface{})) *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 any - if args[0] != nil { - arg0 = args[0].(any) - } - run( - arg0, - ) + run(args[0].(interface{})) }) return _c } -func (_c *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call) Return(b bool) *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call { - _c.Call.Return(b) +func (_c *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call) Return(_a0 bool) *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call { + _c.Call.Return(_a0) return _c } -func (_c *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(payloadData any) bool) *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call { +func (_c *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(interface{}) bool) *IdentificationCommonInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Return(run) return _c } -// GetDataForFilter provides a mock function for the type IdentificationCommonInterface -func (_mock *IdentificationCommonInterface) GetDataForFilter(filter model.IdentificationDataType) ([]model.IdentificationDataType, error) { - ret := _mock.Called(filter) +// GetDataForFilter provides a mock function with given fields: filter +func (_m *IdentificationCommonInterface) GetDataForFilter(filter model.IdentificationDataType) ([]model.IdentificationDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetDataForFilter") @@ -97,21 +76,23 @@ func (_mock *IdentificationCommonInterface) GetDataForFilter(filter model.Identi var r0 []model.IdentificationDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.IdentificationDataType) ([]model.IdentificationDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.IdentificationDataType) ([]model.IdentificationDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.IdentificationDataType) []model.IdentificationDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.IdentificationDataType) []model.IdentificationDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.IdentificationDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.IdentificationDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.IdentificationDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -128,23 +109,31 @@ func (_e *IdentificationCommonInterface_Expecter) GetDataForFilter(filter interf func (_c *IdentificationCommonInterface_GetDataForFilter_Call) Run(run func(filter model.IdentificationDataType)) *IdentificationCommonInterface_GetDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.IdentificationDataType - if args[0] != nil { - arg0 = args[0].(model.IdentificationDataType) - } - run( - arg0, - ) + run(args[0].(model.IdentificationDataType)) }) return _c } -func (_c *IdentificationCommonInterface_GetDataForFilter_Call) Return(identificationDataTypes []model.IdentificationDataType, err error) *IdentificationCommonInterface_GetDataForFilter_Call { - _c.Call.Return(identificationDataTypes, err) +func (_c *IdentificationCommonInterface_GetDataForFilter_Call) Return(_a0 []model.IdentificationDataType, _a1 error) *IdentificationCommonInterface_GetDataForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *IdentificationCommonInterface_GetDataForFilter_Call) RunAndReturn(run func(filter model.IdentificationDataType) ([]model.IdentificationDataType, error)) *IdentificationCommonInterface_GetDataForFilter_Call { +func (_c *IdentificationCommonInterface_GetDataForFilter_Call) RunAndReturn(run func(model.IdentificationDataType) ([]model.IdentificationDataType, error)) *IdentificationCommonInterface_GetDataForFilter_Call { _c.Call.Return(run) return _c } + +// NewIdentificationCommonInterface creates a new instance of IdentificationCommonInterface. 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 NewIdentificationCommonInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *IdentificationCommonInterface { + mock := &IdentificationCommonInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/IdentificationServerInterface.go b/mocks/IdentificationServerInterface.go index fabac804..a7e06bfc 100644 --- a/mocks/IdentificationServerInterface.go +++ b/mocks/IdentificationServerInterface.go @@ -1,12 +1,21 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks -import ( - mock "github.com/stretchr/testify/mock" -) +import mock "github.com/stretchr/testify/mock" + +// IdentificationServerInterface is an autogenerated mock type for the IdentificationServerInterface type +type IdentificationServerInterface struct { + mock.Mock +} + +type IdentificationServerInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *IdentificationServerInterface) EXPECT() *IdentificationServerInterface_Expecter { + return &IdentificationServerInterface_Expecter{mock: &_m.Mock} +} // NewIdentificationServerInterface creates a new instance of IdentificationServerInterface. 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. @@ -21,16 +30,3 @@ func NewIdentificationServerInterface(t interface { return mock } - -// IdentificationServerInterface is an autogenerated mock type for the IdentificationServerInterface type -type IdentificationServerInterface struct { - mock.Mock -} - -type IdentificationServerInterface_Expecter struct { - mock *mock.Mock -} - -func (_m *IdentificationServerInterface) EXPECT() *IdentificationServerInterface_Expecter { - return &IdentificationServerInterface_Expecter{mock: &_m.Mock} -} diff --git a/mocks/IncentiveTableClientInterface.go b/mocks/IncentiveTableClientInterface.go index 8229e884..0c5428a9 100644 --- a/mocks/IncentiveTableClientInterface.go +++ b/mocks/IncentiveTableClientInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewIncentiveTableClientInterface creates a new instance of IncentiveTableClientInterface. 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 NewIncentiveTableClientInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *IncentiveTableClientInterface { - mock := &IncentiveTableClientInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // IncentiveTableClientInterface is an autogenerated mock type for the IncentiveTableClientInterface type type IncentiveTableClientInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *IncentiveTableClientInterface) EXPECT() *IncentiveTableClientInterface return &IncentiveTableClientInterface_Expecter{mock: &_m.Mock} } -// RequestConstraints provides a mock function for the type IncentiveTableClientInterface -func (_mock *IncentiveTableClientInterface) RequestConstraints() (*model.MsgCounterType, error) { - ret := _mock.Called() +// RequestConstraints provides a mock function with no fields +func (_m *IncentiveTableClientInterface) RequestConstraints() (*model.MsgCounterType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RequestConstraints") @@ -46,21 +30,23 @@ func (_mock *IncentiveTableClientInterface) RequestConstraints() (*model.MsgCoun var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.MsgCounterType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.MsgCounterType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -81,8 +67,8 @@ func (_c *IncentiveTableClientInterface_RequestConstraints_Call) Run(run func()) return _c } -func (_c *IncentiveTableClientInterface_RequestConstraints_Call) Return(msgCounterType *model.MsgCounterType, err error) *IncentiveTableClientInterface_RequestConstraints_Call { - _c.Call.Return(msgCounterType, err) +func (_c *IncentiveTableClientInterface_RequestConstraints_Call) Return(_a0 *model.MsgCounterType, _a1 error) *IncentiveTableClientInterface_RequestConstraints_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -91,9 +77,9 @@ func (_c *IncentiveTableClientInterface_RequestConstraints_Call) RunAndReturn(ru return _c } -// RequestDescriptions provides a mock function for the type IncentiveTableClientInterface -func (_mock *IncentiveTableClientInterface) RequestDescriptions() (*model.MsgCounterType, error) { - ret := _mock.Called() +// RequestDescriptions provides a mock function with no fields +func (_m *IncentiveTableClientInterface) RequestDescriptions() (*model.MsgCounterType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RequestDescriptions") @@ -101,21 +87,23 @@ func (_mock *IncentiveTableClientInterface) RequestDescriptions() (*model.MsgCou var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.MsgCounterType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.MsgCounterType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -136,8 +124,8 @@ func (_c *IncentiveTableClientInterface_RequestDescriptions_Call) Run(run func() return _c } -func (_c *IncentiveTableClientInterface_RequestDescriptions_Call) Return(msgCounterType *model.MsgCounterType, err error) *IncentiveTableClientInterface_RequestDescriptions_Call { - _c.Call.Return(msgCounterType, err) +func (_c *IncentiveTableClientInterface_RequestDescriptions_Call) Return(_a0 *model.MsgCounterType, _a1 error) *IncentiveTableClientInterface_RequestDescriptions_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -146,9 +134,9 @@ func (_c *IncentiveTableClientInterface_RequestDescriptions_Call) RunAndReturn(r return _c } -// RequestValues provides a mock function for the type IncentiveTableClientInterface -func (_mock *IncentiveTableClientInterface) RequestValues() (*model.MsgCounterType, error) { - ret := _mock.Called() +// RequestValues provides a mock function with no fields +func (_m *IncentiveTableClientInterface) RequestValues() (*model.MsgCounterType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RequestValues") @@ -156,21 +144,23 @@ func (_mock *IncentiveTableClientInterface) RequestValues() (*model.MsgCounterTy var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.MsgCounterType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.MsgCounterType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -191,8 +181,8 @@ func (_c *IncentiveTableClientInterface_RequestValues_Call) Run(run func()) *Inc return _c } -func (_c *IncentiveTableClientInterface_RequestValues_Call) Return(msgCounterType *model.MsgCounterType, err error) *IncentiveTableClientInterface_RequestValues_Call { - _c.Call.Return(msgCounterType, err) +func (_c *IncentiveTableClientInterface_RequestValues_Call) Return(_a0 *model.MsgCounterType, _a1 error) *IncentiveTableClientInterface_RequestValues_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -201,9 +191,9 @@ func (_c *IncentiveTableClientInterface_RequestValues_Call) RunAndReturn(run fun return _c } -// WriteDescriptions provides a mock function for the type IncentiveTableClientInterface -func (_mock *IncentiveTableClientInterface) WriteDescriptions(data []model.IncentiveTableDescriptionType) (*model.MsgCounterType, error) { - ret := _mock.Called(data) +// WriteDescriptions provides a mock function with given fields: data +func (_m *IncentiveTableClientInterface) WriteDescriptions(data []model.IncentiveTableDescriptionType) (*model.MsgCounterType, error) { + ret := _m.Called(data) if len(ret) == 0 { panic("no return value specified for WriteDescriptions") @@ -211,21 +201,23 @@ func (_mock *IncentiveTableClientInterface) WriteDescriptions(data []model.Incen var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func([]model.IncentiveTableDescriptionType) (*model.MsgCounterType, error)); ok { - return returnFunc(data) + if rf, ok := ret.Get(0).(func([]model.IncentiveTableDescriptionType) (*model.MsgCounterType, error)); ok { + return rf(data) } - if returnFunc, ok := ret.Get(0).(func([]model.IncentiveTableDescriptionType) *model.MsgCounterType); ok { - r0 = returnFunc(data) + if rf, ok := ret.Get(0).(func([]model.IncentiveTableDescriptionType) *model.MsgCounterType); ok { + r0 = rf(data) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func([]model.IncentiveTableDescriptionType) error); ok { - r1 = returnFunc(data) + + if rf, ok := ret.Get(1).(func([]model.IncentiveTableDescriptionType) error); ok { + r1 = rf(data) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -242,30 +234,24 @@ func (_e *IncentiveTableClientInterface_Expecter) WriteDescriptions(data interfa func (_c *IncentiveTableClientInterface_WriteDescriptions_Call) Run(run func(data []model.IncentiveTableDescriptionType)) *IncentiveTableClientInterface_WriteDescriptions_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []model.IncentiveTableDescriptionType - if args[0] != nil { - arg0 = args[0].([]model.IncentiveTableDescriptionType) - } - run( - arg0, - ) + run(args[0].([]model.IncentiveTableDescriptionType)) }) return _c } -func (_c *IncentiveTableClientInterface_WriteDescriptions_Call) Return(msgCounterType *model.MsgCounterType, err error) *IncentiveTableClientInterface_WriteDescriptions_Call { - _c.Call.Return(msgCounterType, err) +func (_c *IncentiveTableClientInterface_WriteDescriptions_Call) Return(_a0 *model.MsgCounterType, _a1 error) *IncentiveTableClientInterface_WriteDescriptions_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *IncentiveTableClientInterface_WriteDescriptions_Call) RunAndReturn(run func(data []model.IncentiveTableDescriptionType) (*model.MsgCounterType, error)) *IncentiveTableClientInterface_WriteDescriptions_Call { +func (_c *IncentiveTableClientInterface_WriteDescriptions_Call) RunAndReturn(run func([]model.IncentiveTableDescriptionType) (*model.MsgCounterType, error)) *IncentiveTableClientInterface_WriteDescriptions_Call { _c.Call.Return(run) return _c } -// WriteValues provides a mock function for the type IncentiveTableClientInterface -func (_mock *IncentiveTableClientInterface) WriteValues(data []model.IncentiveTableType) (*model.MsgCounterType, error) { - ret := _mock.Called(data) +// WriteValues provides a mock function with given fields: data +func (_m *IncentiveTableClientInterface) WriteValues(data []model.IncentiveTableType) (*model.MsgCounterType, error) { + ret := _m.Called(data) if len(ret) == 0 { panic("no return value specified for WriteValues") @@ -273,21 +259,23 @@ func (_mock *IncentiveTableClientInterface) WriteValues(data []model.IncentiveTa var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func([]model.IncentiveTableType) (*model.MsgCounterType, error)); ok { - return returnFunc(data) + if rf, ok := ret.Get(0).(func([]model.IncentiveTableType) (*model.MsgCounterType, error)); ok { + return rf(data) } - if returnFunc, ok := ret.Get(0).(func([]model.IncentiveTableType) *model.MsgCounterType); ok { - r0 = returnFunc(data) + if rf, ok := ret.Get(0).(func([]model.IncentiveTableType) *model.MsgCounterType); ok { + r0 = rf(data) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func([]model.IncentiveTableType) error); ok { - r1 = returnFunc(data) + + if rf, ok := ret.Get(1).(func([]model.IncentiveTableType) error); ok { + r1 = rf(data) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -304,23 +292,31 @@ func (_e *IncentiveTableClientInterface_Expecter) WriteValues(data interface{}) func (_c *IncentiveTableClientInterface_WriteValues_Call) Run(run func(data []model.IncentiveTableType)) *IncentiveTableClientInterface_WriteValues_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []model.IncentiveTableType - if args[0] != nil { - arg0 = args[0].([]model.IncentiveTableType) - } - run( - arg0, - ) + run(args[0].([]model.IncentiveTableType)) }) return _c } -func (_c *IncentiveTableClientInterface_WriteValues_Call) Return(msgCounterType *model.MsgCounterType, err error) *IncentiveTableClientInterface_WriteValues_Call { - _c.Call.Return(msgCounterType, err) +func (_c *IncentiveTableClientInterface_WriteValues_Call) Return(_a0 *model.MsgCounterType, _a1 error) *IncentiveTableClientInterface_WriteValues_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *IncentiveTableClientInterface_WriteValues_Call) RunAndReturn(run func(data []model.IncentiveTableType) (*model.MsgCounterType, error)) *IncentiveTableClientInterface_WriteValues_Call { +func (_c *IncentiveTableClientInterface_WriteValues_Call) RunAndReturn(run func([]model.IncentiveTableType) (*model.MsgCounterType, error)) *IncentiveTableClientInterface_WriteValues_Call { _c.Call.Return(run) return _c } + +// NewIncentiveTableClientInterface creates a new instance of IncentiveTableClientInterface. 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 NewIncentiveTableClientInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *IncentiveTableClientInterface { + mock := &IncentiveTableClientInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/IncentiveTableCommonInterface.go b/mocks/IncentiveTableCommonInterface.go index b465d1b1..f4536ef3 100644 --- a/mocks/IncentiveTableCommonInterface.go +++ b/mocks/IncentiveTableCommonInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewIncentiveTableCommonInterface creates a new instance of IncentiveTableCommonInterface. 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 NewIncentiveTableCommonInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *IncentiveTableCommonInterface { - mock := &IncentiveTableCommonInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // IncentiveTableCommonInterface is an autogenerated mock type for the IncentiveTableCommonInterface type type IncentiveTableCommonInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *IncentiveTableCommonInterface) EXPECT() *IncentiveTableCommonInterface return &IncentiveTableCommonInterface_Expecter{mock: &_m.Mock} } -// GetConstraints provides a mock function for the type IncentiveTableCommonInterface -func (_mock *IncentiveTableCommonInterface) GetConstraints() ([]model.IncentiveTableConstraintsType, error) { - ret := _mock.Called() +// GetConstraints provides a mock function with no fields +func (_m *IncentiveTableCommonInterface) GetConstraints() ([]model.IncentiveTableConstraintsType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetConstraints") @@ -46,21 +30,23 @@ func (_mock *IncentiveTableCommonInterface) GetConstraints() ([]model.IncentiveT var r0 []model.IncentiveTableConstraintsType var r1 error - if returnFunc, ok := ret.Get(0).(func() ([]model.IncentiveTableConstraintsType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() ([]model.IncentiveTableConstraintsType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() []model.IncentiveTableConstraintsType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() []model.IncentiveTableConstraintsType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.IncentiveTableConstraintsType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -81,8 +67,8 @@ func (_c *IncentiveTableCommonInterface_GetConstraints_Call) Run(run func()) *In return _c } -func (_c *IncentiveTableCommonInterface_GetConstraints_Call) Return(incentiveTableConstraintsTypes []model.IncentiveTableConstraintsType, err error) *IncentiveTableCommonInterface_GetConstraints_Call { - _c.Call.Return(incentiveTableConstraintsTypes, err) +func (_c *IncentiveTableCommonInterface_GetConstraints_Call) Return(_a0 []model.IncentiveTableConstraintsType, _a1 error) *IncentiveTableCommonInterface_GetConstraints_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -91,9 +77,9 @@ func (_c *IncentiveTableCommonInterface_GetConstraints_Call) RunAndReturn(run fu return _c } -// GetData provides a mock function for the type IncentiveTableCommonInterface -func (_mock *IncentiveTableCommonInterface) GetData() ([]model.IncentiveTableType, error) { - ret := _mock.Called() +// GetData provides a mock function with no fields +func (_m *IncentiveTableCommonInterface) GetData() ([]model.IncentiveTableType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetData") @@ -101,21 +87,23 @@ func (_mock *IncentiveTableCommonInterface) GetData() ([]model.IncentiveTableTyp var r0 []model.IncentiveTableType var r1 error - if returnFunc, ok := ret.Get(0).(func() ([]model.IncentiveTableType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() ([]model.IncentiveTableType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() []model.IncentiveTableType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() []model.IncentiveTableType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.IncentiveTableType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -136,8 +124,8 @@ func (_c *IncentiveTableCommonInterface_GetData_Call) Run(run func()) *Incentive return _c } -func (_c *IncentiveTableCommonInterface_GetData_Call) Return(incentiveTableTypes []model.IncentiveTableType, err error) *IncentiveTableCommonInterface_GetData_Call { - _c.Call.Return(incentiveTableTypes, err) +func (_c *IncentiveTableCommonInterface_GetData_Call) Return(_a0 []model.IncentiveTableType, _a1 error) *IncentiveTableCommonInterface_GetData_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -146,9 +134,9 @@ func (_c *IncentiveTableCommonInterface_GetData_Call) RunAndReturn(run func() ([ return _c } -// GetDescriptionsForFilter provides a mock function for the type IncentiveTableCommonInterface -func (_mock *IncentiveTableCommonInterface) GetDescriptionsForFilter(filter model.TariffDescriptionDataType) ([]model.IncentiveTableDescriptionType, error) { - ret := _mock.Called(filter) +// GetDescriptionsForFilter provides a mock function with given fields: filter +func (_m *IncentiveTableCommonInterface) GetDescriptionsForFilter(filter model.TariffDescriptionDataType) ([]model.IncentiveTableDescriptionType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetDescriptionsForFilter") @@ -156,21 +144,23 @@ func (_mock *IncentiveTableCommonInterface) GetDescriptionsForFilter(filter mode var r0 []model.IncentiveTableDescriptionType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.TariffDescriptionDataType) ([]model.IncentiveTableDescriptionType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.TariffDescriptionDataType) ([]model.IncentiveTableDescriptionType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.TariffDescriptionDataType) []model.IncentiveTableDescriptionType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.TariffDescriptionDataType) []model.IncentiveTableDescriptionType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.IncentiveTableDescriptionType) } } - if returnFunc, ok := ret.Get(1).(func(model.TariffDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.TariffDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -187,23 +177,31 @@ func (_e *IncentiveTableCommonInterface_Expecter) GetDescriptionsForFilter(filte func (_c *IncentiveTableCommonInterface_GetDescriptionsForFilter_Call) Run(run func(filter model.TariffDescriptionDataType)) *IncentiveTableCommonInterface_GetDescriptionsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.TariffDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.TariffDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.TariffDescriptionDataType)) }) return _c } -func (_c *IncentiveTableCommonInterface_GetDescriptionsForFilter_Call) Return(incentiveTableDescriptionTypes []model.IncentiveTableDescriptionType, err error) *IncentiveTableCommonInterface_GetDescriptionsForFilter_Call { - _c.Call.Return(incentiveTableDescriptionTypes, err) +func (_c *IncentiveTableCommonInterface_GetDescriptionsForFilter_Call) Return(_a0 []model.IncentiveTableDescriptionType, _a1 error) *IncentiveTableCommonInterface_GetDescriptionsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *IncentiveTableCommonInterface_GetDescriptionsForFilter_Call) RunAndReturn(run func(filter model.TariffDescriptionDataType) ([]model.IncentiveTableDescriptionType, error)) *IncentiveTableCommonInterface_GetDescriptionsForFilter_Call { +func (_c *IncentiveTableCommonInterface_GetDescriptionsForFilter_Call) RunAndReturn(run func(model.TariffDescriptionDataType) ([]model.IncentiveTableDescriptionType, error)) *IncentiveTableCommonInterface_GetDescriptionsForFilter_Call { _c.Call.Return(run) return _c } + +// NewIncentiveTableCommonInterface creates a new instance of IncentiveTableCommonInterface. 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 NewIncentiveTableCommonInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *IncentiveTableCommonInterface { + mock := &IncentiveTableCommonInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/IncentiveTableServerInterface.go b/mocks/IncentiveTableServerInterface.go index 8d9eaaab..b4b61ec4 100644 --- a/mocks/IncentiveTableServerInterface.go +++ b/mocks/IncentiveTableServerInterface.go @@ -1,12 +1,21 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks -import ( - mock "github.com/stretchr/testify/mock" -) +import mock "github.com/stretchr/testify/mock" + +// IncentiveTableServerInterface is an autogenerated mock type for the IncentiveTableServerInterface type +type IncentiveTableServerInterface struct { + mock.Mock +} + +type IncentiveTableServerInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *IncentiveTableServerInterface) EXPECT() *IncentiveTableServerInterface_Expecter { + return &IncentiveTableServerInterface_Expecter{mock: &_m.Mock} +} // NewIncentiveTableServerInterface creates a new instance of IncentiveTableServerInterface. 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. @@ -21,16 +30,3 @@ func NewIncentiveTableServerInterface(t interface { return mock } - -// IncentiveTableServerInterface is an autogenerated mock type for the IncentiveTableServerInterface type -type IncentiveTableServerInterface struct { - mock.Mock -} - -type IncentiveTableServerInterface_Expecter struct { - mock *mock.Mock -} - -func (_m *IncentiveTableServerInterface) EXPECT() *IncentiveTableServerInterface_Expecter { - return &IncentiveTableServerInterface_Expecter{mock: &_m.Mock} -} diff --git a/mocks/LoadControlClientInterface.go b/mocks/LoadControlClientInterface.go index 79d2bf60..cbd5ab7f 100644 --- a/mocks/LoadControlClientInterface.go +++ b/mocks/LoadControlClientInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewLoadControlClientInterface creates a new instance of LoadControlClientInterface. 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 NewLoadControlClientInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *LoadControlClientInterface { - mock := &LoadControlClientInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // LoadControlClientInterface is an autogenerated mock type for the LoadControlClientInterface type type LoadControlClientInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *LoadControlClientInterface) EXPECT() *LoadControlClientInterface_Expec return &LoadControlClientInterface_Expecter{mock: &_m.Mock} } -// RequestLimitConstraints provides a mock function for the type LoadControlClientInterface -func (_mock *LoadControlClientInterface) RequestLimitConstraints(selector *model.LoadControlLimitConstraintsListDataSelectorsType, elements *model.LoadControlLimitConstraintsDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestLimitConstraints provides a mock function with given fields: selector, elements +func (_m *LoadControlClientInterface) RequestLimitConstraints(selector *model.LoadControlLimitConstraintsListDataSelectorsType, elements *model.LoadControlLimitConstraintsDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestLimitConstraints") @@ -46,21 +30,23 @@ func (_mock *LoadControlClientInterface) RequestLimitConstraints(selector *model var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.LoadControlLimitConstraintsListDataSelectorsType, *model.LoadControlLimitConstraintsDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.LoadControlLimitConstraintsListDataSelectorsType, *model.LoadControlLimitConstraintsDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.LoadControlLimitConstraintsListDataSelectorsType, *model.LoadControlLimitConstraintsDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.LoadControlLimitConstraintsListDataSelectorsType, *model.LoadControlLimitConstraintsDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.LoadControlLimitConstraintsListDataSelectorsType, *model.LoadControlLimitConstraintsDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.LoadControlLimitConstraintsListDataSelectorsType, *model.LoadControlLimitConstraintsDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -78,35 +64,24 @@ func (_e *LoadControlClientInterface_Expecter) RequestLimitConstraints(selector func (_c *LoadControlClientInterface_RequestLimitConstraints_Call) Run(run func(selector *model.LoadControlLimitConstraintsListDataSelectorsType, elements *model.LoadControlLimitConstraintsDataElementsType)) *LoadControlClientInterface_RequestLimitConstraints_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.LoadControlLimitConstraintsListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.LoadControlLimitConstraintsListDataSelectorsType) - } - var arg1 *model.LoadControlLimitConstraintsDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.LoadControlLimitConstraintsDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.LoadControlLimitConstraintsListDataSelectorsType), args[1].(*model.LoadControlLimitConstraintsDataElementsType)) }) return _c } -func (_c *LoadControlClientInterface_RequestLimitConstraints_Call) Return(msgCounterType *model.MsgCounterType, err error) *LoadControlClientInterface_RequestLimitConstraints_Call { - _c.Call.Return(msgCounterType, err) +func (_c *LoadControlClientInterface_RequestLimitConstraints_Call) Return(_a0 *model.MsgCounterType, _a1 error) *LoadControlClientInterface_RequestLimitConstraints_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *LoadControlClientInterface_RequestLimitConstraints_Call) RunAndReturn(run func(selector *model.LoadControlLimitConstraintsListDataSelectorsType, elements *model.LoadControlLimitConstraintsDataElementsType) (*model.MsgCounterType, error)) *LoadControlClientInterface_RequestLimitConstraints_Call { +func (_c *LoadControlClientInterface_RequestLimitConstraints_Call) RunAndReturn(run func(*model.LoadControlLimitConstraintsListDataSelectorsType, *model.LoadControlLimitConstraintsDataElementsType) (*model.MsgCounterType, error)) *LoadControlClientInterface_RequestLimitConstraints_Call { _c.Call.Return(run) return _c } -// RequestLimitData provides a mock function for the type LoadControlClientInterface -func (_mock *LoadControlClientInterface) RequestLimitData(selector *model.LoadControlLimitListDataSelectorsType, elements *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestLimitData provides a mock function with given fields: selector, elements +func (_m *LoadControlClientInterface) RequestLimitData(selector *model.LoadControlLimitListDataSelectorsType, elements *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestLimitData") @@ -114,21 +89,23 @@ func (_mock *LoadControlClientInterface) RequestLimitData(selector *model.LoadCo var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -146,35 +123,24 @@ func (_e *LoadControlClientInterface_Expecter) RequestLimitData(selector interfa func (_c *LoadControlClientInterface_RequestLimitData_Call) Run(run func(selector *model.LoadControlLimitListDataSelectorsType, elements *model.LoadControlLimitDataElementsType)) *LoadControlClientInterface_RequestLimitData_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.LoadControlLimitListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.LoadControlLimitListDataSelectorsType) - } - var arg1 *model.LoadControlLimitDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.LoadControlLimitDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.LoadControlLimitListDataSelectorsType), args[1].(*model.LoadControlLimitDataElementsType)) }) return _c } -func (_c *LoadControlClientInterface_RequestLimitData_Call) Return(msgCounterType *model.MsgCounterType, err error) *LoadControlClientInterface_RequestLimitData_Call { - _c.Call.Return(msgCounterType, err) +func (_c *LoadControlClientInterface_RequestLimitData_Call) Return(_a0 *model.MsgCounterType, _a1 error) *LoadControlClientInterface_RequestLimitData_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *LoadControlClientInterface_RequestLimitData_Call) RunAndReturn(run func(selector *model.LoadControlLimitListDataSelectorsType, elements *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error)) *LoadControlClientInterface_RequestLimitData_Call { +func (_c *LoadControlClientInterface_RequestLimitData_Call) RunAndReturn(run func(*model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error)) *LoadControlClientInterface_RequestLimitData_Call { _c.Call.Return(run) return _c } -// RequestLimitDescriptions provides a mock function for the type LoadControlClientInterface -func (_mock *LoadControlClientInterface) RequestLimitDescriptions(selector *model.LoadControlLimitDescriptionListDataSelectorsType, elements *model.LoadControlLimitDescriptionDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestLimitDescriptions provides a mock function with given fields: selector, elements +func (_m *LoadControlClientInterface) RequestLimitDescriptions(selector *model.LoadControlLimitDescriptionListDataSelectorsType, elements *model.LoadControlLimitDescriptionDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestLimitDescriptions") @@ -182,21 +148,23 @@ func (_mock *LoadControlClientInterface) RequestLimitDescriptions(selector *mode var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.LoadControlLimitDescriptionListDataSelectorsType, *model.LoadControlLimitDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.LoadControlLimitDescriptionListDataSelectorsType, *model.LoadControlLimitDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.LoadControlLimitDescriptionListDataSelectorsType, *model.LoadControlLimitDescriptionDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.LoadControlLimitDescriptionListDataSelectorsType, *model.LoadControlLimitDescriptionDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.LoadControlLimitDescriptionListDataSelectorsType, *model.LoadControlLimitDescriptionDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.LoadControlLimitDescriptionListDataSelectorsType, *model.LoadControlLimitDescriptionDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -214,35 +182,24 @@ func (_e *LoadControlClientInterface_Expecter) RequestLimitDescriptions(selector func (_c *LoadControlClientInterface_RequestLimitDescriptions_Call) Run(run func(selector *model.LoadControlLimitDescriptionListDataSelectorsType, elements *model.LoadControlLimitDescriptionDataElementsType)) *LoadControlClientInterface_RequestLimitDescriptions_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.LoadControlLimitDescriptionListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.LoadControlLimitDescriptionListDataSelectorsType) - } - var arg1 *model.LoadControlLimitDescriptionDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.LoadControlLimitDescriptionDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.LoadControlLimitDescriptionListDataSelectorsType), args[1].(*model.LoadControlLimitDescriptionDataElementsType)) }) return _c } -func (_c *LoadControlClientInterface_RequestLimitDescriptions_Call) Return(msgCounterType *model.MsgCounterType, err error) *LoadControlClientInterface_RequestLimitDescriptions_Call { - _c.Call.Return(msgCounterType, err) +func (_c *LoadControlClientInterface_RequestLimitDescriptions_Call) Return(_a0 *model.MsgCounterType, _a1 error) *LoadControlClientInterface_RequestLimitDescriptions_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *LoadControlClientInterface_RequestLimitDescriptions_Call) RunAndReturn(run func(selector *model.LoadControlLimitDescriptionListDataSelectorsType, elements *model.LoadControlLimitDescriptionDataElementsType) (*model.MsgCounterType, error)) *LoadControlClientInterface_RequestLimitDescriptions_Call { +func (_c *LoadControlClientInterface_RequestLimitDescriptions_Call) RunAndReturn(run func(*model.LoadControlLimitDescriptionListDataSelectorsType, *model.LoadControlLimitDescriptionDataElementsType) (*model.MsgCounterType, error)) *LoadControlClientInterface_RequestLimitDescriptions_Call { _c.Call.Return(run) return _c } -// WriteLimitData provides a mock function for the type LoadControlClientInterface -func (_mock *LoadControlClientInterface) WriteLimitData(data []model.LoadControlLimitDataType, deleteSelectors *model.LoadControlLimitListDataSelectorsType, deleteElements *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(data, deleteSelectors, deleteElements) +// WriteLimitData provides a mock function with given fields: data, deleteSelectors, deleteElements +func (_m *LoadControlClientInterface) WriteLimitData(data []model.LoadControlLimitDataType, deleteSelectors *model.LoadControlLimitListDataSelectorsType, deleteElements *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(data, deleteSelectors, deleteElements) if len(ret) == 0 { panic("no return value specified for WriteLimitData") @@ -250,21 +207,23 @@ func (_mock *LoadControlClientInterface) WriteLimitData(data []model.LoadControl var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func([]model.LoadControlLimitDataType, *model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(data, deleteSelectors, deleteElements) + if rf, ok := ret.Get(0).(func([]model.LoadControlLimitDataType, *model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(data, deleteSelectors, deleteElements) } - if returnFunc, ok := ret.Get(0).(func([]model.LoadControlLimitDataType, *model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(data, deleteSelectors, deleteElements) + if rf, ok := ret.Get(0).(func([]model.LoadControlLimitDataType, *model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) *model.MsgCounterType); ok { + r0 = rf(data, deleteSelectors, deleteElements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func([]model.LoadControlLimitDataType, *model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) error); ok { - r1 = returnFunc(data, deleteSelectors, deleteElements) + + if rf, ok := ret.Get(1).(func([]model.LoadControlLimitDataType, *model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) error); ok { + r1 = rf(data, deleteSelectors, deleteElements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -283,33 +242,31 @@ func (_e *LoadControlClientInterface_Expecter) WriteLimitData(data interface{}, func (_c *LoadControlClientInterface_WriteLimitData_Call) Run(run func(data []model.LoadControlLimitDataType, deleteSelectors *model.LoadControlLimitListDataSelectorsType, deleteElements *model.LoadControlLimitDataElementsType)) *LoadControlClientInterface_WriteLimitData_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []model.LoadControlLimitDataType - if args[0] != nil { - arg0 = args[0].([]model.LoadControlLimitDataType) - } - var arg1 *model.LoadControlLimitListDataSelectorsType - if args[1] != nil { - arg1 = args[1].(*model.LoadControlLimitListDataSelectorsType) - } - var arg2 *model.LoadControlLimitDataElementsType - if args[2] != nil { - arg2 = args[2].(*model.LoadControlLimitDataElementsType) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].([]model.LoadControlLimitDataType), args[1].(*model.LoadControlLimitListDataSelectorsType), args[2].(*model.LoadControlLimitDataElementsType)) }) return _c } -func (_c *LoadControlClientInterface_WriteLimitData_Call) Return(msgCounterType *model.MsgCounterType, err error) *LoadControlClientInterface_WriteLimitData_Call { - _c.Call.Return(msgCounterType, err) +func (_c *LoadControlClientInterface_WriteLimitData_Call) Return(_a0 *model.MsgCounterType, _a1 error) *LoadControlClientInterface_WriteLimitData_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *LoadControlClientInterface_WriteLimitData_Call) RunAndReturn(run func(data []model.LoadControlLimitDataType, deleteSelectors *model.LoadControlLimitListDataSelectorsType, deleteElements *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error)) *LoadControlClientInterface_WriteLimitData_Call { +func (_c *LoadControlClientInterface_WriteLimitData_Call) RunAndReturn(run func([]model.LoadControlLimitDataType, *model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) (*model.MsgCounterType, error)) *LoadControlClientInterface_WriteLimitData_Call { _c.Call.Return(run) return _c } + +// NewLoadControlClientInterface creates a new instance of LoadControlClientInterface. 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 NewLoadControlClientInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *LoadControlClientInterface { + mock := &LoadControlClientInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/LoadControlCommonInterface.go b/mocks/LoadControlCommonInterface.go index 0c4ed62d..a6f29166 100644 --- a/mocks/LoadControlCommonInterface.go +++ b/mocks/LoadControlCommonInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewLoadControlCommonInterface creates a new instance of LoadControlCommonInterface. 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 NewLoadControlCommonInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *LoadControlCommonInterface { - mock := &LoadControlCommonInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // LoadControlCommonInterface is an autogenerated mock type for the LoadControlCommonInterface type type LoadControlCommonInterface struct { mock.Mock @@ -36,20 +20,21 @@ func (_m *LoadControlCommonInterface) EXPECT() *LoadControlCommonInterface_Expec return &LoadControlCommonInterface_Expecter{mock: &_m.Mock} } -// CheckEventPayloadDataForFilter provides a mock function for the type LoadControlCommonInterface -func (_mock *LoadControlCommonInterface) CheckEventPayloadDataForFilter(payloadData any, filter any) bool { - ret := _mock.Called(payloadData, filter) +// CheckEventPayloadDataForFilter provides a mock function with given fields: payloadData, filter +func (_m *LoadControlCommonInterface) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) bool { + ret := _m.Called(payloadData, filter) if len(ret) == 0 { panic("no return value specified for CheckEventPayloadDataForFilter") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(any, any) bool); ok { - r0 = returnFunc(payloadData, filter) + if rf, ok := ret.Get(0).(func(interface{}, interface{}) bool); ok { + r0 = rf(payloadData, filter) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -59,43 +44,32 @@ type LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call struct { } // CheckEventPayloadDataForFilter is a helper method to define mock.On call -// - payloadData any -// - filter any +// - payloadData interface{} +// - filter interface{} func (_e *LoadControlCommonInterface_Expecter) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call { return &LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call{Call: _e.mock.On("CheckEventPayloadDataForFilter", payloadData, filter)} } -func (_c *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData any, filter any)) *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call { +func (_c *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData interface{}, filter interface{})) *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 any - if args[0] != nil { - arg0 = args[0].(any) - } - var arg1 any - if args[1] != nil { - arg1 = args[1].(any) - } - run( - arg0, - arg1, - ) + run(args[0].(interface{}), args[1].(interface{})) }) return _c } -func (_c *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call) Return(b bool) *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call { - _c.Call.Return(b) +func (_c *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call) Return(_a0 bool) *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call { + _c.Call.Return(_a0) return _c } -func (_c *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(payloadData any, filter any) bool) *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call { +func (_c *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(interface{}, interface{}) bool) *LoadControlCommonInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Return(run) return _c } -// GetLimitDataForFilter provides a mock function for the type LoadControlCommonInterface -func (_mock *LoadControlCommonInterface) GetLimitDataForFilter(filter model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDataType, error) { - ret := _mock.Called(filter) +// GetLimitDataForFilter provides a mock function with given fields: filter +func (_m *LoadControlCommonInterface) GetLimitDataForFilter(filter model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetLimitDataForFilter") @@ -103,21 +77,23 @@ func (_mock *LoadControlCommonInterface) GetLimitDataForFilter(filter model.Load var r0 []model.LoadControlLimitDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.LoadControlLimitDescriptionDataType) []model.LoadControlLimitDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.LoadControlLimitDescriptionDataType) []model.LoadControlLimitDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.LoadControlLimitDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.LoadControlLimitDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.LoadControlLimitDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -134,30 +110,24 @@ func (_e *LoadControlCommonInterface_Expecter) GetLimitDataForFilter(filter inte func (_c *LoadControlCommonInterface_GetLimitDataForFilter_Call) Run(run func(filter model.LoadControlLimitDescriptionDataType)) *LoadControlCommonInterface_GetLimitDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.LoadControlLimitDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.LoadControlLimitDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.LoadControlLimitDescriptionDataType)) }) return _c } -func (_c *LoadControlCommonInterface_GetLimitDataForFilter_Call) Return(loadControlLimitDataTypes []model.LoadControlLimitDataType, err error) *LoadControlCommonInterface_GetLimitDataForFilter_Call { - _c.Call.Return(loadControlLimitDataTypes, err) +func (_c *LoadControlCommonInterface_GetLimitDataForFilter_Call) Return(_a0 []model.LoadControlLimitDataType, _a1 error) *LoadControlCommonInterface_GetLimitDataForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *LoadControlCommonInterface_GetLimitDataForFilter_Call) RunAndReturn(run func(filter model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDataType, error)) *LoadControlCommonInterface_GetLimitDataForFilter_Call { +func (_c *LoadControlCommonInterface_GetLimitDataForFilter_Call) RunAndReturn(run func(model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDataType, error)) *LoadControlCommonInterface_GetLimitDataForFilter_Call { _c.Call.Return(run) return _c } -// GetLimitDataForId provides a mock function for the type LoadControlCommonInterface -func (_mock *LoadControlCommonInterface) GetLimitDataForId(limitId model.LoadControlLimitIdType) (*model.LoadControlLimitDataType, error) { - ret := _mock.Called(limitId) +// GetLimitDataForId provides a mock function with given fields: limitId +func (_m *LoadControlCommonInterface) GetLimitDataForId(limitId model.LoadControlLimitIdType) (*model.LoadControlLimitDataType, error) { + ret := _m.Called(limitId) if len(ret) == 0 { panic("no return value specified for GetLimitDataForId") @@ -165,21 +135,23 @@ func (_mock *LoadControlCommonInterface) GetLimitDataForId(limitId model.LoadCon var r0 *model.LoadControlLimitDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.LoadControlLimitIdType) (*model.LoadControlLimitDataType, error)); ok { - return returnFunc(limitId) + if rf, ok := ret.Get(0).(func(model.LoadControlLimitIdType) (*model.LoadControlLimitDataType, error)); ok { + return rf(limitId) } - if returnFunc, ok := ret.Get(0).(func(model.LoadControlLimitIdType) *model.LoadControlLimitDataType); ok { - r0 = returnFunc(limitId) + if rf, ok := ret.Get(0).(func(model.LoadControlLimitIdType) *model.LoadControlLimitDataType); ok { + r0 = rf(limitId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.LoadControlLimitDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.LoadControlLimitIdType) error); ok { - r1 = returnFunc(limitId) + + if rf, ok := ret.Get(1).(func(model.LoadControlLimitIdType) error); ok { + r1 = rf(limitId) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -196,30 +168,24 @@ func (_e *LoadControlCommonInterface_Expecter) GetLimitDataForId(limitId interfa func (_c *LoadControlCommonInterface_GetLimitDataForId_Call) Run(run func(limitId model.LoadControlLimitIdType)) *LoadControlCommonInterface_GetLimitDataForId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.LoadControlLimitIdType - if args[0] != nil { - arg0 = args[0].(model.LoadControlLimitIdType) - } - run( - arg0, - ) + run(args[0].(model.LoadControlLimitIdType)) }) return _c } -func (_c *LoadControlCommonInterface_GetLimitDataForId_Call) Return(loadControlLimitDataType *model.LoadControlLimitDataType, err error) *LoadControlCommonInterface_GetLimitDataForId_Call { - _c.Call.Return(loadControlLimitDataType, err) +func (_c *LoadControlCommonInterface_GetLimitDataForId_Call) Return(_a0 *model.LoadControlLimitDataType, _a1 error) *LoadControlCommonInterface_GetLimitDataForId_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *LoadControlCommonInterface_GetLimitDataForId_Call) RunAndReturn(run func(limitId model.LoadControlLimitIdType) (*model.LoadControlLimitDataType, error)) *LoadControlCommonInterface_GetLimitDataForId_Call { +func (_c *LoadControlCommonInterface_GetLimitDataForId_Call) RunAndReturn(run func(model.LoadControlLimitIdType) (*model.LoadControlLimitDataType, error)) *LoadControlCommonInterface_GetLimitDataForId_Call { _c.Call.Return(run) return _c } -// GetLimitDescriptionForId provides a mock function for the type LoadControlCommonInterface -func (_mock *LoadControlCommonInterface) GetLimitDescriptionForId(limitId model.LoadControlLimitIdType) (*model.LoadControlLimitDescriptionDataType, error) { - ret := _mock.Called(limitId) +// GetLimitDescriptionForId provides a mock function with given fields: limitId +func (_m *LoadControlCommonInterface) GetLimitDescriptionForId(limitId model.LoadControlLimitIdType) (*model.LoadControlLimitDescriptionDataType, error) { + ret := _m.Called(limitId) if len(ret) == 0 { panic("no return value specified for GetLimitDescriptionForId") @@ -227,21 +193,23 @@ func (_mock *LoadControlCommonInterface) GetLimitDescriptionForId(limitId model. var r0 *model.LoadControlLimitDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.LoadControlLimitIdType) (*model.LoadControlLimitDescriptionDataType, error)); ok { - return returnFunc(limitId) + if rf, ok := ret.Get(0).(func(model.LoadControlLimitIdType) (*model.LoadControlLimitDescriptionDataType, error)); ok { + return rf(limitId) } - if returnFunc, ok := ret.Get(0).(func(model.LoadControlLimitIdType) *model.LoadControlLimitDescriptionDataType); ok { - r0 = returnFunc(limitId) + if rf, ok := ret.Get(0).(func(model.LoadControlLimitIdType) *model.LoadControlLimitDescriptionDataType); ok { + r0 = rf(limitId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.LoadControlLimitDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.LoadControlLimitIdType) error); ok { - r1 = returnFunc(limitId) + + if rf, ok := ret.Get(1).(func(model.LoadControlLimitIdType) error); ok { + r1 = rf(limitId) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -258,30 +226,24 @@ func (_e *LoadControlCommonInterface_Expecter) GetLimitDescriptionForId(limitId func (_c *LoadControlCommonInterface_GetLimitDescriptionForId_Call) Run(run func(limitId model.LoadControlLimitIdType)) *LoadControlCommonInterface_GetLimitDescriptionForId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.LoadControlLimitIdType - if args[0] != nil { - arg0 = args[0].(model.LoadControlLimitIdType) - } - run( - arg0, - ) + run(args[0].(model.LoadControlLimitIdType)) }) return _c } -func (_c *LoadControlCommonInterface_GetLimitDescriptionForId_Call) Return(loadControlLimitDescriptionDataType *model.LoadControlLimitDescriptionDataType, err error) *LoadControlCommonInterface_GetLimitDescriptionForId_Call { - _c.Call.Return(loadControlLimitDescriptionDataType, err) +func (_c *LoadControlCommonInterface_GetLimitDescriptionForId_Call) Return(_a0 *model.LoadControlLimitDescriptionDataType, _a1 error) *LoadControlCommonInterface_GetLimitDescriptionForId_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *LoadControlCommonInterface_GetLimitDescriptionForId_Call) RunAndReturn(run func(limitId model.LoadControlLimitIdType) (*model.LoadControlLimitDescriptionDataType, error)) *LoadControlCommonInterface_GetLimitDescriptionForId_Call { +func (_c *LoadControlCommonInterface_GetLimitDescriptionForId_Call) RunAndReturn(run func(model.LoadControlLimitIdType) (*model.LoadControlLimitDescriptionDataType, error)) *LoadControlCommonInterface_GetLimitDescriptionForId_Call { _c.Call.Return(run) return _c } -// GetLimitDescriptionsForFilter provides a mock function for the type LoadControlCommonInterface -func (_mock *LoadControlCommonInterface) GetLimitDescriptionsForFilter(filter model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetLimitDescriptionsForFilter provides a mock function with given fields: filter +func (_m *LoadControlCommonInterface) GetLimitDescriptionsForFilter(filter model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetLimitDescriptionsForFilter") @@ -289,21 +251,23 @@ func (_mock *LoadControlCommonInterface) GetLimitDescriptionsForFilter(filter mo var r0 []model.LoadControlLimitDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.LoadControlLimitDescriptionDataType) []model.LoadControlLimitDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.LoadControlLimitDescriptionDataType) []model.LoadControlLimitDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.LoadControlLimitDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.LoadControlLimitDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.LoadControlLimitDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -320,23 +284,31 @@ func (_e *LoadControlCommonInterface_Expecter) GetLimitDescriptionsForFilter(fil func (_c *LoadControlCommonInterface_GetLimitDescriptionsForFilter_Call) Run(run func(filter model.LoadControlLimitDescriptionDataType)) *LoadControlCommonInterface_GetLimitDescriptionsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.LoadControlLimitDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.LoadControlLimitDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.LoadControlLimitDescriptionDataType)) }) return _c } -func (_c *LoadControlCommonInterface_GetLimitDescriptionsForFilter_Call) Return(loadControlLimitDescriptionDataTypes []model.LoadControlLimitDescriptionDataType, err error) *LoadControlCommonInterface_GetLimitDescriptionsForFilter_Call { - _c.Call.Return(loadControlLimitDescriptionDataTypes, err) +func (_c *LoadControlCommonInterface_GetLimitDescriptionsForFilter_Call) Return(_a0 []model.LoadControlLimitDescriptionDataType, _a1 error) *LoadControlCommonInterface_GetLimitDescriptionsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *LoadControlCommonInterface_GetLimitDescriptionsForFilter_Call) RunAndReturn(run func(filter model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDescriptionDataType, error)) *LoadControlCommonInterface_GetLimitDescriptionsForFilter_Call { +func (_c *LoadControlCommonInterface_GetLimitDescriptionsForFilter_Call) RunAndReturn(run func(model.LoadControlLimitDescriptionDataType) ([]model.LoadControlLimitDescriptionDataType, error)) *LoadControlCommonInterface_GetLimitDescriptionsForFilter_Call { _c.Call.Return(run) return _c } + +// NewLoadControlCommonInterface creates a new instance of LoadControlCommonInterface. 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 NewLoadControlCommonInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *LoadControlCommonInterface { + mock := &LoadControlCommonInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/LoadControlServerInterface.go b/mocks/LoadControlServerInterface.go index 902d3e0d..2f404640 100644 --- a/mocks/LoadControlServerInterface.go +++ b/mocks/LoadControlServerInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/eebus-go/api" - "github.com/enbility/spine-go/model" + api "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) - -// NewLoadControlServerInterface creates a new instance of LoadControlServerInterface. 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 NewLoadControlServerInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *LoadControlServerInterface { - mock := &LoadControlServerInterface{} - mock.Mock.Test(t) - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} + model "github.com/enbility/spine-go/model" +) // LoadControlServerInterface is an autogenerated mock type for the LoadControlServerInterface type type LoadControlServerInterface struct { @@ -37,22 +22,23 @@ func (_m *LoadControlServerInterface) EXPECT() *LoadControlServerInterface_Expec return &LoadControlServerInterface_Expecter{mock: &_m.Mock} } -// AddLimitDescription provides a mock function for the type LoadControlServerInterface -func (_mock *LoadControlServerInterface) AddLimitDescription(description model.LoadControlLimitDescriptionDataType) *model.LoadControlLimitIdType { - ret := _mock.Called(description) +// AddLimitDescription provides a mock function with given fields: description +func (_m *LoadControlServerInterface) AddLimitDescription(description model.LoadControlLimitDescriptionDataType) *model.LoadControlLimitIdType { + ret := _m.Called(description) if len(ret) == 0 { panic("no return value specified for AddLimitDescription") } var r0 *model.LoadControlLimitIdType - if returnFunc, ok := ret.Get(0).(func(model.LoadControlLimitDescriptionDataType) *model.LoadControlLimitIdType); ok { - r0 = returnFunc(description) + if rf, ok := ret.Get(0).(func(model.LoadControlLimitDescriptionDataType) *model.LoadControlLimitIdType); ok { + r0 = rf(description) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.LoadControlLimitIdType) } } + return r0 } @@ -69,41 +55,36 @@ func (_e *LoadControlServerInterface_Expecter) AddLimitDescription(description i func (_c *LoadControlServerInterface_AddLimitDescription_Call) Run(run func(description model.LoadControlLimitDescriptionDataType)) *LoadControlServerInterface_AddLimitDescription_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.LoadControlLimitDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.LoadControlLimitDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.LoadControlLimitDescriptionDataType)) }) return _c } -func (_c *LoadControlServerInterface_AddLimitDescription_Call) Return(loadControlLimitIdType *model.LoadControlLimitIdType) *LoadControlServerInterface_AddLimitDescription_Call { - _c.Call.Return(loadControlLimitIdType) +func (_c *LoadControlServerInterface_AddLimitDescription_Call) Return(_a0 *model.LoadControlLimitIdType) *LoadControlServerInterface_AddLimitDescription_Call { + _c.Call.Return(_a0) return _c } -func (_c *LoadControlServerInterface_AddLimitDescription_Call) RunAndReturn(run func(description model.LoadControlLimitDescriptionDataType) *model.LoadControlLimitIdType) *LoadControlServerInterface_AddLimitDescription_Call { +func (_c *LoadControlServerInterface_AddLimitDescription_Call) RunAndReturn(run func(model.LoadControlLimitDescriptionDataType) *model.LoadControlLimitIdType) *LoadControlServerInterface_AddLimitDescription_Call { _c.Call.Return(run) return _c } -// UpdateLimitDataForFilter provides a mock function for the type LoadControlServerInterface -func (_mock *LoadControlServerInterface) UpdateLimitDataForFilter(data []api.LoadControlLimitDataForFilter, deleteSelector *model.LoadControlLimitListDataSelectorsType, deleteElements *model.LoadControlLimitDataElementsType) error { - ret := _mock.Called(data, deleteSelector, deleteElements) +// UpdateLimitDataForFilter provides a mock function with given fields: data, deleteSelector, deleteElements +func (_m *LoadControlServerInterface) UpdateLimitDataForFilter(data []api.LoadControlLimitDataForFilter, deleteSelector *model.LoadControlLimitListDataSelectorsType, deleteElements *model.LoadControlLimitDataElementsType) error { + ret := _m.Called(data, deleteSelector, deleteElements) if len(ret) == 0 { panic("no return value specified for UpdateLimitDataForFilter") } var r0 error - if returnFunc, ok := ret.Get(0).(func([]api.LoadControlLimitDataForFilter, *model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) error); ok { - r0 = returnFunc(data, deleteSelector, deleteElements) + if rf, ok := ret.Get(0).(func([]api.LoadControlLimitDataForFilter, *model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) error); ok { + r0 = rf(data, deleteSelector, deleteElements) } else { r0 = ret.Error(0) } + return r0 } @@ -122,51 +103,36 @@ func (_e *LoadControlServerInterface_Expecter) UpdateLimitDataForFilter(data int func (_c *LoadControlServerInterface_UpdateLimitDataForFilter_Call) Run(run func(data []api.LoadControlLimitDataForFilter, deleteSelector *model.LoadControlLimitListDataSelectorsType, deleteElements *model.LoadControlLimitDataElementsType)) *LoadControlServerInterface_UpdateLimitDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []api.LoadControlLimitDataForFilter - if args[0] != nil { - arg0 = args[0].([]api.LoadControlLimitDataForFilter) - } - var arg1 *model.LoadControlLimitListDataSelectorsType - if args[1] != nil { - arg1 = args[1].(*model.LoadControlLimitListDataSelectorsType) - } - var arg2 *model.LoadControlLimitDataElementsType - if args[2] != nil { - arg2 = args[2].(*model.LoadControlLimitDataElementsType) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].([]api.LoadControlLimitDataForFilter), args[1].(*model.LoadControlLimitListDataSelectorsType), args[2].(*model.LoadControlLimitDataElementsType)) }) return _c } -func (_c *LoadControlServerInterface_UpdateLimitDataForFilter_Call) Return(err error) *LoadControlServerInterface_UpdateLimitDataForFilter_Call { - _c.Call.Return(err) +func (_c *LoadControlServerInterface_UpdateLimitDataForFilter_Call) Return(_a0 error) *LoadControlServerInterface_UpdateLimitDataForFilter_Call { + _c.Call.Return(_a0) return _c } -func (_c *LoadControlServerInterface_UpdateLimitDataForFilter_Call) RunAndReturn(run func(data []api.LoadControlLimitDataForFilter, deleteSelector *model.LoadControlLimitListDataSelectorsType, deleteElements *model.LoadControlLimitDataElementsType) error) *LoadControlServerInterface_UpdateLimitDataForFilter_Call { +func (_c *LoadControlServerInterface_UpdateLimitDataForFilter_Call) RunAndReturn(run func([]api.LoadControlLimitDataForFilter, *model.LoadControlLimitListDataSelectorsType, *model.LoadControlLimitDataElementsType) error) *LoadControlServerInterface_UpdateLimitDataForFilter_Call { _c.Call.Return(run) return _c } -// UpdateLimitDataForIds provides a mock function for the type LoadControlServerInterface -func (_mock *LoadControlServerInterface) UpdateLimitDataForIds(data []api.LoadControlLimitDataForID) error { - ret := _mock.Called(data) +// UpdateLimitDataForIds provides a mock function with given fields: data +func (_m *LoadControlServerInterface) UpdateLimitDataForIds(data []api.LoadControlLimitDataForID) error { + ret := _m.Called(data) if len(ret) == 0 { panic("no return value specified for UpdateLimitDataForIds") } var r0 error - if returnFunc, ok := ret.Get(0).(func([]api.LoadControlLimitDataForID) error); ok { - r0 = returnFunc(data) + if rf, ok := ret.Get(0).(func([]api.LoadControlLimitDataForID) error); ok { + r0 = rf(data) } else { r0 = ret.Error(0) } + return r0 } @@ -183,23 +149,31 @@ func (_e *LoadControlServerInterface_Expecter) UpdateLimitDataForIds(data interf func (_c *LoadControlServerInterface_UpdateLimitDataForIds_Call) Run(run func(data []api.LoadControlLimitDataForID)) *LoadControlServerInterface_UpdateLimitDataForIds_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []api.LoadControlLimitDataForID - if args[0] != nil { - arg0 = args[0].([]api.LoadControlLimitDataForID) - } - run( - arg0, - ) + run(args[0].([]api.LoadControlLimitDataForID)) }) return _c } -func (_c *LoadControlServerInterface_UpdateLimitDataForIds_Call) Return(err error) *LoadControlServerInterface_UpdateLimitDataForIds_Call { - _c.Call.Return(err) +func (_c *LoadControlServerInterface_UpdateLimitDataForIds_Call) Return(_a0 error) *LoadControlServerInterface_UpdateLimitDataForIds_Call { + _c.Call.Return(_a0) return _c } -func (_c *LoadControlServerInterface_UpdateLimitDataForIds_Call) RunAndReturn(run func(data []api.LoadControlLimitDataForID) error) *LoadControlServerInterface_UpdateLimitDataForIds_Call { +func (_c *LoadControlServerInterface_UpdateLimitDataForIds_Call) RunAndReturn(run func([]api.LoadControlLimitDataForID) error) *LoadControlServerInterface_UpdateLimitDataForIds_Call { _c.Call.Return(run) return _c } + +// NewLoadControlServerInterface creates a new instance of LoadControlServerInterface. 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 NewLoadControlServerInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *LoadControlServerInterface { + mock := &LoadControlServerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/MeasurementClientInterface.go b/mocks/MeasurementClientInterface.go index 4c3cdd92..9b7c08ac 100644 --- a/mocks/MeasurementClientInterface.go +++ b/mocks/MeasurementClientInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewMeasurementClientInterface creates a new instance of MeasurementClientInterface. 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 NewMeasurementClientInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *MeasurementClientInterface { - mock := &MeasurementClientInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // MeasurementClientInterface is an autogenerated mock type for the MeasurementClientInterface type type MeasurementClientInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *MeasurementClientInterface) EXPECT() *MeasurementClientInterface_Expec return &MeasurementClientInterface_Expecter{mock: &_m.Mock} } -// RequestConstraints provides a mock function for the type MeasurementClientInterface -func (_mock *MeasurementClientInterface) RequestConstraints(selector *model.MeasurementConstraintsListDataSelectorsType, elements *model.MeasurementConstraintsDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestConstraints provides a mock function with given fields: selector, elements +func (_m *MeasurementClientInterface) RequestConstraints(selector *model.MeasurementConstraintsListDataSelectorsType, elements *model.MeasurementConstraintsDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestConstraints") @@ -46,21 +30,23 @@ func (_mock *MeasurementClientInterface) RequestConstraints(selector *model.Meas var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.MeasurementConstraintsListDataSelectorsType, *model.MeasurementConstraintsDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.MeasurementConstraintsListDataSelectorsType, *model.MeasurementConstraintsDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.MeasurementConstraintsListDataSelectorsType, *model.MeasurementConstraintsDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.MeasurementConstraintsListDataSelectorsType, *model.MeasurementConstraintsDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.MeasurementConstraintsListDataSelectorsType, *model.MeasurementConstraintsDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.MeasurementConstraintsListDataSelectorsType, *model.MeasurementConstraintsDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -78,35 +64,24 @@ func (_e *MeasurementClientInterface_Expecter) RequestConstraints(selector inter func (_c *MeasurementClientInterface_RequestConstraints_Call) Run(run func(selector *model.MeasurementConstraintsListDataSelectorsType, elements *model.MeasurementConstraintsDataElementsType)) *MeasurementClientInterface_RequestConstraints_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.MeasurementConstraintsListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.MeasurementConstraintsListDataSelectorsType) - } - var arg1 *model.MeasurementConstraintsDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.MeasurementConstraintsDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.MeasurementConstraintsListDataSelectorsType), args[1].(*model.MeasurementConstraintsDataElementsType)) }) return _c } -func (_c *MeasurementClientInterface_RequestConstraints_Call) Return(msgCounterType *model.MsgCounterType, err error) *MeasurementClientInterface_RequestConstraints_Call { - _c.Call.Return(msgCounterType, err) +func (_c *MeasurementClientInterface_RequestConstraints_Call) Return(_a0 *model.MsgCounterType, _a1 error) *MeasurementClientInterface_RequestConstraints_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MeasurementClientInterface_RequestConstraints_Call) RunAndReturn(run func(selector *model.MeasurementConstraintsListDataSelectorsType, elements *model.MeasurementConstraintsDataElementsType) (*model.MsgCounterType, error)) *MeasurementClientInterface_RequestConstraints_Call { +func (_c *MeasurementClientInterface_RequestConstraints_Call) RunAndReturn(run func(*model.MeasurementConstraintsListDataSelectorsType, *model.MeasurementConstraintsDataElementsType) (*model.MsgCounterType, error)) *MeasurementClientInterface_RequestConstraints_Call { _c.Call.Return(run) return _c } -// RequestData provides a mock function for the type MeasurementClientInterface -func (_mock *MeasurementClientInterface) RequestData(selector *model.MeasurementListDataSelectorsType, elements *model.MeasurementDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestData provides a mock function with given fields: selector, elements +func (_m *MeasurementClientInterface) RequestData(selector *model.MeasurementListDataSelectorsType, elements *model.MeasurementDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestData") @@ -114,21 +89,23 @@ func (_mock *MeasurementClientInterface) RequestData(selector *model.Measurement var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.MeasurementListDataSelectorsType, *model.MeasurementDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.MeasurementListDataSelectorsType, *model.MeasurementDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.MeasurementListDataSelectorsType, *model.MeasurementDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.MeasurementListDataSelectorsType, *model.MeasurementDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.MeasurementListDataSelectorsType, *model.MeasurementDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.MeasurementListDataSelectorsType, *model.MeasurementDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -146,35 +123,24 @@ func (_e *MeasurementClientInterface_Expecter) RequestData(selector interface{}, func (_c *MeasurementClientInterface_RequestData_Call) Run(run func(selector *model.MeasurementListDataSelectorsType, elements *model.MeasurementDataElementsType)) *MeasurementClientInterface_RequestData_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.MeasurementListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.MeasurementListDataSelectorsType) - } - var arg1 *model.MeasurementDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.MeasurementDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.MeasurementListDataSelectorsType), args[1].(*model.MeasurementDataElementsType)) }) return _c } -func (_c *MeasurementClientInterface_RequestData_Call) Return(msgCounterType *model.MsgCounterType, err error) *MeasurementClientInterface_RequestData_Call { - _c.Call.Return(msgCounterType, err) +func (_c *MeasurementClientInterface_RequestData_Call) Return(_a0 *model.MsgCounterType, _a1 error) *MeasurementClientInterface_RequestData_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MeasurementClientInterface_RequestData_Call) RunAndReturn(run func(selector *model.MeasurementListDataSelectorsType, elements *model.MeasurementDataElementsType) (*model.MsgCounterType, error)) *MeasurementClientInterface_RequestData_Call { +func (_c *MeasurementClientInterface_RequestData_Call) RunAndReturn(run func(*model.MeasurementListDataSelectorsType, *model.MeasurementDataElementsType) (*model.MsgCounterType, error)) *MeasurementClientInterface_RequestData_Call { _c.Call.Return(run) return _c } -// RequestDescriptions provides a mock function for the type MeasurementClientInterface -func (_mock *MeasurementClientInterface) RequestDescriptions(selector *model.MeasurementDescriptionListDataSelectorsType, elements *model.MeasurementDescriptionDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestDescriptions provides a mock function with given fields: selector, elements +func (_m *MeasurementClientInterface) RequestDescriptions(selector *model.MeasurementDescriptionListDataSelectorsType, elements *model.MeasurementDescriptionDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestDescriptions") @@ -182,21 +148,23 @@ func (_mock *MeasurementClientInterface) RequestDescriptions(selector *model.Mea var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.MeasurementDescriptionListDataSelectorsType, *model.MeasurementDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.MeasurementDescriptionListDataSelectorsType, *model.MeasurementDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.MeasurementDescriptionListDataSelectorsType, *model.MeasurementDescriptionDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.MeasurementDescriptionListDataSelectorsType, *model.MeasurementDescriptionDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.MeasurementDescriptionListDataSelectorsType, *model.MeasurementDescriptionDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.MeasurementDescriptionListDataSelectorsType, *model.MeasurementDescriptionDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -214,28 +182,31 @@ func (_e *MeasurementClientInterface_Expecter) RequestDescriptions(selector inte func (_c *MeasurementClientInterface_RequestDescriptions_Call) Run(run func(selector *model.MeasurementDescriptionListDataSelectorsType, elements *model.MeasurementDescriptionDataElementsType)) *MeasurementClientInterface_RequestDescriptions_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.MeasurementDescriptionListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.MeasurementDescriptionListDataSelectorsType) - } - var arg1 *model.MeasurementDescriptionDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.MeasurementDescriptionDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.MeasurementDescriptionListDataSelectorsType), args[1].(*model.MeasurementDescriptionDataElementsType)) }) return _c } -func (_c *MeasurementClientInterface_RequestDescriptions_Call) Return(msgCounterType *model.MsgCounterType, err error) *MeasurementClientInterface_RequestDescriptions_Call { - _c.Call.Return(msgCounterType, err) +func (_c *MeasurementClientInterface_RequestDescriptions_Call) Return(_a0 *model.MsgCounterType, _a1 error) *MeasurementClientInterface_RequestDescriptions_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MeasurementClientInterface_RequestDescriptions_Call) RunAndReturn(run func(selector *model.MeasurementDescriptionListDataSelectorsType, elements *model.MeasurementDescriptionDataElementsType) (*model.MsgCounterType, error)) *MeasurementClientInterface_RequestDescriptions_Call { +func (_c *MeasurementClientInterface_RequestDescriptions_Call) RunAndReturn(run func(*model.MeasurementDescriptionListDataSelectorsType, *model.MeasurementDescriptionDataElementsType) (*model.MsgCounterType, error)) *MeasurementClientInterface_RequestDescriptions_Call { _c.Call.Return(run) return _c } + +// NewMeasurementClientInterface creates a new instance of MeasurementClientInterface. 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 NewMeasurementClientInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MeasurementClientInterface { + mock := &MeasurementClientInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/MeasurementCommonInterface.go b/mocks/MeasurementCommonInterface.go index 76af646f..083c9681 100644 --- a/mocks/MeasurementCommonInterface.go +++ b/mocks/MeasurementCommonInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewMeasurementCommonInterface creates a new instance of MeasurementCommonInterface. 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 NewMeasurementCommonInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *MeasurementCommonInterface { - mock := &MeasurementCommonInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // MeasurementCommonInterface is an autogenerated mock type for the MeasurementCommonInterface type type MeasurementCommonInterface struct { mock.Mock @@ -36,20 +20,21 @@ func (_m *MeasurementCommonInterface) EXPECT() *MeasurementCommonInterface_Expec return &MeasurementCommonInterface_Expecter{mock: &_m.Mock} } -// CheckEventPayloadDataForFilter provides a mock function for the type MeasurementCommonInterface -func (_mock *MeasurementCommonInterface) CheckEventPayloadDataForFilter(payloadData any, filter any) bool { - ret := _mock.Called(payloadData, filter) +// CheckEventPayloadDataForFilter provides a mock function with given fields: payloadData, filter +func (_m *MeasurementCommonInterface) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) bool { + ret := _m.Called(payloadData, filter) if len(ret) == 0 { panic("no return value specified for CheckEventPayloadDataForFilter") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(any, any) bool); ok { - r0 = returnFunc(payloadData, filter) + if rf, ok := ret.Get(0).(func(interface{}, interface{}) bool); ok { + r0 = rf(payloadData, filter) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -59,43 +44,32 @@ type MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call struct { } // CheckEventPayloadDataForFilter is a helper method to define mock.On call -// - payloadData any -// - filter any +// - payloadData interface{} +// - filter interface{} func (_e *MeasurementCommonInterface_Expecter) CheckEventPayloadDataForFilter(payloadData interface{}, filter interface{}) *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call { return &MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call{Call: _e.mock.On("CheckEventPayloadDataForFilter", payloadData, filter)} } -func (_c *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData any, filter any)) *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call { +func (_c *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call) Run(run func(payloadData interface{}, filter interface{})) *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 any - if args[0] != nil { - arg0 = args[0].(any) - } - var arg1 any - if args[1] != nil { - arg1 = args[1].(any) - } - run( - arg0, - arg1, - ) + run(args[0].(interface{}), args[1].(interface{})) }) return _c } -func (_c *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call) Return(b bool) *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call { - _c.Call.Return(b) +func (_c *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call) Return(_a0 bool) *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call { + _c.Call.Return(_a0) return _c } -func (_c *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(payloadData any, filter any) bool) *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call { +func (_c *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call) RunAndReturn(run func(interface{}, interface{}) bool) *MeasurementCommonInterface_CheckEventPayloadDataForFilter_Call { _c.Call.Return(run) return _c } -// GetConstraintsForFilter provides a mock function for the type MeasurementCommonInterface -func (_mock *MeasurementCommonInterface) GetConstraintsForFilter(filter model.MeasurementConstraintsDataType) ([]model.MeasurementConstraintsDataType, error) { - ret := _mock.Called(filter) +// GetConstraintsForFilter provides a mock function with given fields: filter +func (_m *MeasurementCommonInterface) GetConstraintsForFilter(filter model.MeasurementConstraintsDataType) ([]model.MeasurementConstraintsDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetConstraintsForFilter") @@ -103,21 +77,23 @@ func (_mock *MeasurementCommonInterface) GetConstraintsForFilter(filter model.Me var r0 []model.MeasurementConstraintsDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.MeasurementConstraintsDataType) ([]model.MeasurementConstraintsDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.MeasurementConstraintsDataType) ([]model.MeasurementConstraintsDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.MeasurementConstraintsDataType) []model.MeasurementConstraintsDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.MeasurementConstraintsDataType) []model.MeasurementConstraintsDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.MeasurementConstraintsDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.MeasurementConstraintsDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.MeasurementConstraintsDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -134,30 +110,24 @@ func (_e *MeasurementCommonInterface_Expecter) GetConstraintsForFilter(filter in func (_c *MeasurementCommonInterface_GetConstraintsForFilter_Call) Run(run func(filter model.MeasurementConstraintsDataType)) *MeasurementCommonInterface_GetConstraintsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.MeasurementConstraintsDataType - if args[0] != nil { - arg0 = args[0].(model.MeasurementConstraintsDataType) - } - run( - arg0, - ) + run(args[0].(model.MeasurementConstraintsDataType)) }) return _c } -func (_c *MeasurementCommonInterface_GetConstraintsForFilter_Call) Return(measurementConstraintsDataTypes []model.MeasurementConstraintsDataType, err error) *MeasurementCommonInterface_GetConstraintsForFilter_Call { - _c.Call.Return(measurementConstraintsDataTypes, err) +func (_c *MeasurementCommonInterface_GetConstraintsForFilter_Call) Return(_a0 []model.MeasurementConstraintsDataType, _a1 error) *MeasurementCommonInterface_GetConstraintsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MeasurementCommonInterface_GetConstraintsForFilter_Call) RunAndReturn(run func(filter model.MeasurementConstraintsDataType) ([]model.MeasurementConstraintsDataType, error)) *MeasurementCommonInterface_GetConstraintsForFilter_Call { +func (_c *MeasurementCommonInterface_GetConstraintsForFilter_Call) RunAndReturn(run func(model.MeasurementConstraintsDataType) ([]model.MeasurementConstraintsDataType, error)) *MeasurementCommonInterface_GetConstraintsForFilter_Call { _c.Call.Return(run) return _c } -// GetDataForFilter provides a mock function for the type MeasurementCommonInterface -func (_mock *MeasurementCommonInterface) GetDataForFilter(filter model.MeasurementDescriptionDataType) ([]model.MeasurementDataType, error) { - ret := _mock.Called(filter) +// GetDataForFilter provides a mock function with given fields: filter +func (_m *MeasurementCommonInterface) GetDataForFilter(filter model.MeasurementDescriptionDataType) ([]model.MeasurementDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetDataForFilter") @@ -165,21 +135,23 @@ func (_mock *MeasurementCommonInterface) GetDataForFilter(filter model.Measureme var r0 []model.MeasurementDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.MeasurementDescriptionDataType) ([]model.MeasurementDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.MeasurementDescriptionDataType) ([]model.MeasurementDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.MeasurementDescriptionDataType) []model.MeasurementDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.MeasurementDescriptionDataType) []model.MeasurementDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.MeasurementDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.MeasurementDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.MeasurementDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -196,30 +168,24 @@ func (_e *MeasurementCommonInterface_Expecter) GetDataForFilter(filter interface func (_c *MeasurementCommonInterface_GetDataForFilter_Call) Run(run func(filter model.MeasurementDescriptionDataType)) *MeasurementCommonInterface_GetDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.MeasurementDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.MeasurementDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.MeasurementDescriptionDataType)) }) return _c } -func (_c *MeasurementCommonInterface_GetDataForFilter_Call) Return(measurementDataTypes []model.MeasurementDataType, err error) *MeasurementCommonInterface_GetDataForFilter_Call { - _c.Call.Return(measurementDataTypes, err) +func (_c *MeasurementCommonInterface_GetDataForFilter_Call) Return(_a0 []model.MeasurementDataType, _a1 error) *MeasurementCommonInterface_GetDataForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MeasurementCommonInterface_GetDataForFilter_Call) RunAndReturn(run func(filter model.MeasurementDescriptionDataType) ([]model.MeasurementDataType, error)) *MeasurementCommonInterface_GetDataForFilter_Call { +func (_c *MeasurementCommonInterface_GetDataForFilter_Call) RunAndReturn(run func(model.MeasurementDescriptionDataType) ([]model.MeasurementDataType, error)) *MeasurementCommonInterface_GetDataForFilter_Call { _c.Call.Return(run) return _c } -// GetDataForId provides a mock function for the type MeasurementCommonInterface -func (_mock *MeasurementCommonInterface) GetDataForId(measurementId model.MeasurementIdType) (*model.MeasurementDataType, error) { - ret := _mock.Called(measurementId) +// GetDataForId provides a mock function with given fields: measurementId +func (_m *MeasurementCommonInterface) GetDataForId(measurementId model.MeasurementIdType) (*model.MeasurementDataType, error) { + ret := _m.Called(measurementId) if len(ret) == 0 { panic("no return value specified for GetDataForId") @@ -227,21 +193,23 @@ func (_mock *MeasurementCommonInterface) GetDataForId(measurementId model.Measur var r0 *model.MeasurementDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.MeasurementIdType) (*model.MeasurementDataType, error)); ok { - return returnFunc(measurementId) + if rf, ok := ret.Get(0).(func(model.MeasurementIdType) (*model.MeasurementDataType, error)); ok { + return rf(measurementId) } - if returnFunc, ok := ret.Get(0).(func(model.MeasurementIdType) *model.MeasurementDataType); ok { - r0 = returnFunc(measurementId) + if rf, ok := ret.Get(0).(func(model.MeasurementIdType) *model.MeasurementDataType); ok { + r0 = rf(measurementId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MeasurementDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.MeasurementIdType) error); ok { - r1 = returnFunc(measurementId) + + if rf, ok := ret.Get(1).(func(model.MeasurementIdType) error); ok { + r1 = rf(measurementId) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -258,30 +226,24 @@ func (_e *MeasurementCommonInterface_Expecter) GetDataForId(measurementId interf func (_c *MeasurementCommonInterface_GetDataForId_Call) Run(run func(measurementId model.MeasurementIdType)) *MeasurementCommonInterface_GetDataForId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.MeasurementIdType - if args[0] != nil { - arg0 = args[0].(model.MeasurementIdType) - } - run( - arg0, - ) + run(args[0].(model.MeasurementIdType)) }) return _c } -func (_c *MeasurementCommonInterface_GetDataForId_Call) Return(measurementDataType *model.MeasurementDataType, err error) *MeasurementCommonInterface_GetDataForId_Call { - _c.Call.Return(measurementDataType, err) +func (_c *MeasurementCommonInterface_GetDataForId_Call) Return(_a0 *model.MeasurementDataType, _a1 error) *MeasurementCommonInterface_GetDataForId_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MeasurementCommonInterface_GetDataForId_Call) RunAndReturn(run func(measurementId model.MeasurementIdType) (*model.MeasurementDataType, error)) *MeasurementCommonInterface_GetDataForId_Call { +func (_c *MeasurementCommonInterface_GetDataForId_Call) RunAndReturn(run func(model.MeasurementIdType) (*model.MeasurementDataType, error)) *MeasurementCommonInterface_GetDataForId_Call { _c.Call.Return(run) return _c } -// GetDescriptionForId provides a mock function for the type MeasurementCommonInterface -func (_mock *MeasurementCommonInterface) GetDescriptionForId(measurementId model.MeasurementIdType) (*model.MeasurementDescriptionDataType, error) { - ret := _mock.Called(measurementId) +// GetDescriptionForId provides a mock function with given fields: measurementId +func (_m *MeasurementCommonInterface) GetDescriptionForId(measurementId model.MeasurementIdType) (*model.MeasurementDescriptionDataType, error) { + ret := _m.Called(measurementId) if len(ret) == 0 { panic("no return value specified for GetDescriptionForId") @@ -289,21 +251,23 @@ func (_mock *MeasurementCommonInterface) GetDescriptionForId(measurementId model var r0 *model.MeasurementDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.MeasurementIdType) (*model.MeasurementDescriptionDataType, error)); ok { - return returnFunc(measurementId) + if rf, ok := ret.Get(0).(func(model.MeasurementIdType) (*model.MeasurementDescriptionDataType, error)); ok { + return rf(measurementId) } - if returnFunc, ok := ret.Get(0).(func(model.MeasurementIdType) *model.MeasurementDescriptionDataType); ok { - r0 = returnFunc(measurementId) + if rf, ok := ret.Get(0).(func(model.MeasurementIdType) *model.MeasurementDescriptionDataType); ok { + r0 = rf(measurementId) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MeasurementDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.MeasurementIdType) error); ok { - r1 = returnFunc(measurementId) + + if rf, ok := ret.Get(1).(func(model.MeasurementIdType) error); ok { + r1 = rf(measurementId) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -320,30 +284,24 @@ func (_e *MeasurementCommonInterface_Expecter) GetDescriptionForId(measurementId func (_c *MeasurementCommonInterface_GetDescriptionForId_Call) Run(run func(measurementId model.MeasurementIdType)) *MeasurementCommonInterface_GetDescriptionForId_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.MeasurementIdType - if args[0] != nil { - arg0 = args[0].(model.MeasurementIdType) - } - run( - arg0, - ) + run(args[0].(model.MeasurementIdType)) }) return _c } -func (_c *MeasurementCommonInterface_GetDescriptionForId_Call) Return(measurementDescriptionDataType *model.MeasurementDescriptionDataType, err error) *MeasurementCommonInterface_GetDescriptionForId_Call { - _c.Call.Return(measurementDescriptionDataType, err) +func (_c *MeasurementCommonInterface_GetDescriptionForId_Call) Return(_a0 *model.MeasurementDescriptionDataType, _a1 error) *MeasurementCommonInterface_GetDescriptionForId_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MeasurementCommonInterface_GetDescriptionForId_Call) RunAndReturn(run func(measurementId model.MeasurementIdType) (*model.MeasurementDescriptionDataType, error)) *MeasurementCommonInterface_GetDescriptionForId_Call { +func (_c *MeasurementCommonInterface_GetDescriptionForId_Call) RunAndReturn(run func(model.MeasurementIdType) (*model.MeasurementDescriptionDataType, error)) *MeasurementCommonInterface_GetDescriptionForId_Call { _c.Call.Return(run) return _c } -// GetDescriptionsForFilter provides a mock function for the type MeasurementCommonInterface -func (_mock *MeasurementCommonInterface) GetDescriptionsForFilter(filter model.MeasurementDescriptionDataType) ([]model.MeasurementDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetDescriptionsForFilter provides a mock function with given fields: filter +func (_m *MeasurementCommonInterface) GetDescriptionsForFilter(filter model.MeasurementDescriptionDataType) ([]model.MeasurementDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetDescriptionsForFilter") @@ -351,21 +309,23 @@ func (_mock *MeasurementCommonInterface) GetDescriptionsForFilter(filter model.M var r0 []model.MeasurementDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.MeasurementDescriptionDataType) ([]model.MeasurementDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.MeasurementDescriptionDataType) ([]model.MeasurementDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.MeasurementDescriptionDataType) []model.MeasurementDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.MeasurementDescriptionDataType) []model.MeasurementDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.MeasurementDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.MeasurementDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.MeasurementDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -382,23 +342,31 @@ func (_e *MeasurementCommonInterface_Expecter) GetDescriptionsForFilter(filter i func (_c *MeasurementCommonInterface_GetDescriptionsForFilter_Call) Run(run func(filter model.MeasurementDescriptionDataType)) *MeasurementCommonInterface_GetDescriptionsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.MeasurementDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.MeasurementDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.MeasurementDescriptionDataType)) }) return _c } -func (_c *MeasurementCommonInterface_GetDescriptionsForFilter_Call) Return(measurementDescriptionDataTypes []model.MeasurementDescriptionDataType, err error) *MeasurementCommonInterface_GetDescriptionsForFilter_Call { - _c.Call.Return(measurementDescriptionDataTypes, err) +func (_c *MeasurementCommonInterface_GetDescriptionsForFilter_Call) Return(_a0 []model.MeasurementDescriptionDataType, _a1 error) *MeasurementCommonInterface_GetDescriptionsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MeasurementCommonInterface_GetDescriptionsForFilter_Call) RunAndReturn(run func(filter model.MeasurementDescriptionDataType) ([]model.MeasurementDescriptionDataType, error)) *MeasurementCommonInterface_GetDescriptionsForFilter_Call { +func (_c *MeasurementCommonInterface_GetDescriptionsForFilter_Call) RunAndReturn(run func(model.MeasurementDescriptionDataType) ([]model.MeasurementDescriptionDataType, error)) *MeasurementCommonInterface_GetDescriptionsForFilter_Call { _c.Call.Return(run) return _c } + +// NewMeasurementCommonInterface creates a new instance of MeasurementCommonInterface. 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 NewMeasurementCommonInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MeasurementCommonInterface { + mock := &MeasurementCommonInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/MeasurementServerInterface.go b/mocks/MeasurementServerInterface.go index 81683c75..1518bc1b 100644 --- a/mocks/MeasurementServerInterface.go +++ b/mocks/MeasurementServerInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/eebus-go/api" - "github.com/enbility/spine-go/model" + api "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) - -// NewMeasurementServerInterface creates a new instance of MeasurementServerInterface. 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 NewMeasurementServerInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *MeasurementServerInterface { - mock := &MeasurementServerInterface{} - mock.Mock.Test(t) - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} + model "github.com/enbility/spine-go/model" +) // MeasurementServerInterface is an autogenerated mock type for the MeasurementServerInterface type type MeasurementServerInterface struct { @@ -37,22 +22,23 @@ func (_m *MeasurementServerInterface) EXPECT() *MeasurementServerInterface_Expec return &MeasurementServerInterface_Expecter{mock: &_m.Mock} } -// AddDescription provides a mock function for the type MeasurementServerInterface -func (_mock *MeasurementServerInterface) AddDescription(description model.MeasurementDescriptionDataType) *model.MeasurementIdType { - ret := _mock.Called(description) +// AddDescription provides a mock function with given fields: description +func (_m *MeasurementServerInterface) AddDescription(description model.MeasurementDescriptionDataType) *model.MeasurementIdType { + ret := _m.Called(description) if len(ret) == 0 { panic("no return value specified for AddDescription") } var r0 *model.MeasurementIdType - if returnFunc, ok := ret.Get(0).(func(model.MeasurementDescriptionDataType) *model.MeasurementIdType); ok { - r0 = returnFunc(description) + if rf, ok := ret.Get(0).(func(model.MeasurementDescriptionDataType) *model.MeasurementIdType); ok { + r0 = rf(description) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MeasurementIdType) } } + return r0 } @@ -69,41 +55,36 @@ func (_e *MeasurementServerInterface_Expecter) AddDescription(description interf func (_c *MeasurementServerInterface_AddDescription_Call) Run(run func(description model.MeasurementDescriptionDataType)) *MeasurementServerInterface_AddDescription_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.MeasurementDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.MeasurementDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.MeasurementDescriptionDataType)) }) return _c } -func (_c *MeasurementServerInterface_AddDescription_Call) Return(measurementIdType *model.MeasurementIdType) *MeasurementServerInterface_AddDescription_Call { - _c.Call.Return(measurementIdType) +func (_c *MeasurementServerInterface_AddDescription_Call) Return(_a0 *model.MeasurementIdType) *MeasurementServerInterface_AddDescription_Call { + _c.Call.Return(_a0) return _c } -func (_c *MeasurementServerInterface_AddDescription_Call) RunAndReturn(run func(description model.MeasurementDescriptionDataType) *model.MeasurementIdType) *MeasurementServerInterface_AddDescription_Call { +func (_c *MeasurementServerInterface_AddDescription_Call) RunAndReturn(run func(model.MeasurementDescriptionDataType) *model.MeasurementIdType) *MeasurementServerInterface_AddDescription_Call { _c.Call.Return(run) return _c } -// UpdateDataForFilters provides a mock function for the type MeasurementServerInterface -func (_mock *MeasurementServerInterface) UpdateDataForFilters(data []api.MeasurementDataForFilter, deleteSelector *model.MeasurementListDataSelectorsType, deleteElements *model.MeasurementDataElementsType) error { - ret := _mock.Called(data, deleteSelector, deleteElements) +// UpdateDataForFilters provides a mock function with given fields: data, deleteSelector, deleteElements +func (_m *MeasurementServerInterface) UpdateDataForFilters(data []api.MeasurementDataForFilter, deleteSelector *model.MeasurementListDataSelectorsType, deleteElements *model.MeasurementDataElementsType) error { + ret := _m.Called(data, deleteSelector, deleteElements) if len(ret) == 0 { panic("no return value specified for UpdateDataForFilters") } var r0 error - if returnFunc, ok := ret.Get(0).(func([]api.MeasurementDataForFilter, *model.MeasurementListDataSelectorsType, *model.MeasurementDataElementsType) error); ok { - r0 = returnFunc(data, deleteSelector, deleteElements) + if rf, ok := ret.Get(0).(func([]api.MeasurementDataForFilter, *model.MeasurementListDataSelectorsType, *model.MeasurementDataElementsType) error); ok { + r0 = rf(data, deleteSelector, deleteElements) } else { r0 = ret.Error(0) } + return r0 } @@ -122,51 +103,36 @@ func (_e *MeasurementServerInterface_Expecter) UpdateDataForFilters(data interfa func (_c *MeasurementServerInterface_UpdateDataForFilters_Call) Run(run func(data []api.MeasurementDataForFilter, deleteSelector *model.MeasurementListDataSelectorsType, deleteElements *model.MeasurementDataElementsType)) *MeasurementServerInterface_UpdateDataForFilters_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []api.MeasurementDataForFilter - if args[0] != nil { - arg0 = args[0].([]api.MeasurementDataForFilter) - } - var arg1 *model.MeasurementListDataSelectorsType - if args[1] != nil { - arg1 = args[1].(*model.MeasurementListDataSelectorsType) - } - var arg2 *model.MeasurementDataElementsType - if args[2] != nil { - arg2 = args[2].(*model.MeasurementDataElementsType) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].([]api.MeasurementDataForFilter), args[1].(*model.MeasurementListDataSelectorsType), args[2].(*model.MeasurementDataElementsType)) }) return _c } -func (_c *MeasurementServerInterface_UpdateDataForFilters_Call) Return(err error) *MeasurementServerInterface_UpdateDataForFilters_Call { - _c.Call.Return(err) +func (_c *MeasurementServerInterface_UpdateDataForFilters_Call) Return(_a0 error) *MeasurementServerInterface_UpdateDataForFilters_Call { + _c.Call.Return(_a0) return _c } -func (_c *MeasurementServerInterface_UpdateDataForFilters_Call) RunAndReturn(run func(data []api.MeasurementDataForFilter, deleteSelector *model.MeasurementListDataSelectorsType, deleteElements *model.MeasurementDataElementsType) error) *MeasurementServerInterface_UpdateDataForFilters_Call { +func (_c *MeasurementServerInterface_UpdateDataForFilters_Call) RunAndReturn(run func([]api.MeasurementDataForFilter, *model.MeasurementListDataSelectorsType, *model.MeasurementDataElementsType) error) *MeasurementServerInterface_UpdateDataForFilters_Call { _c.Call.Return(run) return _c } -// UpdateDataForIds provides a mock function for the type MeasurementServerInterface -func (_mock *MeasurementServerInterface) UpdateDataForIds(data []api.MeasurementDataForID) error { - ret := _mock.Called(data) +// UpdateDataForIds provides a mock function with given fields: data +func (_m *MeasurementServerInterface) UpdateDataForIds(data []api.MeasurementDataForID) error { + ret := _m.Called(data) if len(ret) == 0 { panic("no return value specified for UpdateDataForIds") } var r0 error - if returnFunc, ok := ret.Get(0).(func([]api.MeasurementDataForID) error); ok { - r0 = returnFunc(data) + if rf, ok := ret.Get(0).(func([]api.MeasurementDataForID) error); ok { + r0 = rf(data) } else { r0 = ret.Error(0) } + return r0 } @@ -183,23 +149,31 @@ func (_e *MeasurementServerInterface_Expecter) UpdateDataForIds(data interface{} func (_c *MeasurementServerInterface_UpdateDataForIds_Call) Run(run func(data []api.MeasurementDataForID)) *MeasurementServerInterface_UpdateDataForIds_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []api.MeasurementDataForID - if args[0] != nil { - arg0 = args[0].([]api.MeasurementDataForID) - } - run( - arg0, - ) + run(args[0].([]api.MeasurementDataForID)) }) return _c } -func (_c *MeasurementServerInterface_UpdateDataForIds_Call) Return(err error) *MeasurementServerInterface_UpdateDataForIds_Call { - _c.Call.Return(err) +func (_c *MeasurementServerInterface_UpdateDataForIds_Call) Return(_a0 error) *MeasurementServerInterface_UpdateDataForIds_Call { + _c.Call.Return(_a0) return _c } -func (_c *MeasurementServerInterface_UpdateDataForIds_Call) RunAndReturn(run func(data []api.MeasurementDataForID) error) *MeasurementServerInterface_UpdateDataForIds_Call { +func (_c *MeasurementServerInterface_UpdateDataForIds_Call) RunAndReturn(run func([]api.MeasurementDataForID) error) *MeasurementServerInterface_UpdateDataForIds_Call { _c.Call.Return(run) return _c } + +// NewMeasurementServerInterface creates a new instance of MeasurementServerInterface. 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 NewMeasurementServerInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MeasurementServerInterface { + mock := &MeasurementServerInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/ServiceInterface.go b/mocks/ServiceInterface.go index c728485e..1496cf28 100644 --- a/mocks/ServiceInterface.go +++ b/mocks/ServiceInterface.go @@ -1,30 +1,17 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/eebus-go/api" - api1 "github.com/enbility/ship-go/api" - "github.com/enbility/ship-go/logging" - api0 "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" -) + api "github.com/enbility/eebus-go/api" + logging "github.com/enbility/ship-go/logging" -// NewServiceInterface creates a new instance of ServiceInterface. 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 NewServiceInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *ServiceInterface { - mock := &ServiceInterface{} - mock.Mock.Test(t) + mock "github.com/stretchr/testify/mock" - t.Cleanup(func() { mock.AssertExpectations(t) }) + ship_goapi "github.com/enbility/ship-go/api" - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // ServiceInterface is an autogenerated mock type for the ServiceInterface type type ServiceInterface struct { @@ -39,10 +26,22 @@ func (_m *ServiceInterface) EXPECT() *ServiceInterface_Expecter { return &ServiceInterface_Expecter{mock: &_m.Mock} } -// AddUseCase provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) AddUseCase(useCase api.UseCaseInterface) { - _mock.Called(useCase) - return +// AddUseCase provides a mock function with given fields: useCase +func (_m *ServiceInterface) AddUseCase(useCase api.UseCaseInterface) error { + ret := _m.Called(useCase) + + if len(ret) == 0 { + panic("no return value specified for AddUseCase") + } + + var r0 error + if rf, ok := ret.Get(0).(func(api.UseCaseInterface) error); ok { + r0 = rf(useCase) + } else { + r0 = ret.Error(0) + } + + return r0 } // ServiceInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -58,31 +57,24 @@ func (_e *ServiceInterface_Expecter) AddUseCase(useCase interface{}) *ServiceInt func (_c *ServiceInterface_AddUseCase_Call) Run(run func(useCase api.UseCaseInterface)) *ServiceInterface_AddUseCase_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.UseCaseInterface - if args[0] != nil { - arg0 = args[0].(api.UseCaseInterface) - } - run( - arg0, - ) + run(args[0].(api.UseCaseInterface)) }) return _c } -func (_c *ServiceInterface_AddUseCase_Call) Return() *ServiceInterface_AddUseCase_Call { - _c.Call.Return() +func (_c *ServiceInterface_AddUseCase_Call) Return(_a0 error) *ServiceInterface_AddUseCase_Call { + _c.Call.Return(_a0) return _c } -func (_c *ServiceInterface_AddUseCase_Call) RunAndReturn(run func(useCase api.UseCaseInterface)) *ServiceInterface_AddUseCase_Call { - _c.Run(run) +func (_c *ServiceInterface_AddUseCase_Call) RunAndReturn(run func(api.UseCaseInterface) error) *ServiceInterface_AddUseCase_Call { + _c.Call.Return(run) return _c } -// CancelPairingWithSKI provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) CancelPairingWithSKI(ski string) { - _mock.Called(ski) - return +// CancelPairingWithSKI provides a mock function with given fields: ski +func (_m *ServiceInterface) CancelPairingWithSKI(ski string) { + _m.Called(ski) } // ServiceInterface_CancelPairingWithSKI_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CancelPairingWithSKI' @@ -98,13 +90,7 @@ func (_e *ServiceInterface_Expecter) CancelPairingWithSKI(ski interface{}) *Serv func (_c *ServiceInterface_CancelPairingWithSKI_Call) Run(run func(ski string)) *ServiceInterface_CancelPairingWithSKI_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 string - if args[0] != nil { - arg0 = args[0].(string) - } - run( - arg0, - ) + run(args[0].(string)) }) return _c } @@ -114,27 +100,28 @@ func (_c *ServiceInterface_CancelPairingWithSKI_Call) Return() *ServiceInterface return _c } -func (_c *ServiceInterface_CancelPairingWithSKI_Call) RunAndReturn(run func(ski string)) *ServiceInterface_CancelPairingWithSKI_Call { +func (_c *ServiceInterface_CancelPairingWithSKI_Call) RunAndReturn(run func(string)) *ServiceInterface_CancelPairingWithSKI_Call { _c.Run(run) return _c } -// Configuration provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) Configuration() *api.Configuration { - ret := _mock.Called() +// Configuration provides a mock function with no fields +func (_m *ServiceInterface) Configuration() *api.Configuration { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for Configuration") } var r0 *api.Configuration - if returnFunc, ok := ret.Get(0).(func() *api.Configuration); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *api.Configuration); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*api.Configuration) } } + return r0 } @@ -155,8 +142,8 @@ func (_c *ServiceInterface_Configuration_Call) Run(run func()) *ServiceInterface return _c } -func (_c *ServiceInterface_Configuration_Call) Return(configuration *api.Configuration) *ServiceInterface_Configuration_Call { - _c.Call.Return(configuration) +func (_c *ServiceInterface_Configuration_Call) Return(_a0 *api.Configuration) *ServiceInterface_Configuration_Call { + _c.Call.Return(_a0) return _c } @@ -165,10 +152,9 @@ func (_c *ServiceInterface_Configuration_Call) RunAndReturn(run func() *api.Conf return _c } -// DisconnectSKI provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) DisconnectSKI(ski string, reason string) { - _mock.Called(ski, reason) - return +// DisconnectSKI provides a mock function with given fields: ski, reason +func (_m *ServiceInterface) DisconnectSKI(ski string, reason string) { + _m.Called(ski, reason) } // ServiceInterface_DisconnectSKI_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisconnectSKI' @@ -185,18 +171,7 @@ func (_e *ServiceInterface_Expecter) DisconnectSKI(ski interface{}, reason inter func (_c *ServiceInterface_DisconnectSKI_Call) Run(run func(ski string, reason string)) *ServiceInterface_DisconnectSKI_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 string - if args[0] != nil { - arg0 = args[0].(string) - } - var arg1 string - if args[1] != nil { - arg1 = args[1].(string) - } - run( - arg0, - arg1, - ) + run(args[0].(string), args[1].(string)) }) return _c } @@ -206,25 +181,26 @@ func (_c *ServiceInterface_DisconnectSKI_Call) Return() *ServiceInterface_Discon return _c } -func (_c *ServiceInterface_DisconnectSKI_Call) RunAndReturn(run func(ski string, reason string)) *ServiceInterface_DisconnectSKI_Call { +func (_c *ServiceInterface_DisconnectSKI_Call) RunAndReturn(run func(string, string)) *ServiceInterface_DisconnectSKI_Call { _c.Run(run) return _c } -// IsAutoAcceptEnabled provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) IsAutoAcceptEnabled() bool { - ret := _mock.Called() +// IsAutoAcceptEnabled provides a mock function with no fields +func (_m *ServiceInterface) IsAutoAcceptEnabled() bool { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for IsAutoAcceptEnabled") } var r0 bool - if returnFunc, ok := ret.Get(0).(func() bool); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -245,8 +221,8 @@ func (_c *ServiceInterface_IsAutoAcceptEnabled_Call) Run(run func()) *ServiceInt return _c } -func (_c *ServiceInterface_IsAutoAcceptEnabled_Call) Return(b bool) *ServiceInterface_IsAutoAcceptEnabled_Call { - _c.Call.Return(b) +func (_c *ServiceInterface_IsAutoAcceptEnabled_Call) Return(_a0 bool) *ServiceInterface_IsAutoAcceptEnabled_Call { + _c.Call.Return(_a0) return _c } @@ -255,20 +231,21 @@ func (_c *ServiceInterface_IsAutoAcceptEnabled_Call) RunAndReturn(run func() boo return _c } -// IsRunning provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) IsRunning() bool { - ret := _mock.Called() +// IsRunning provides a mock function with no fields +func (_m *ServiceInterface) IsRunning() bool { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for IsRunning") } var r0 bool - if returnFunc, ok := ret.Get(0).(func() bool); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -289,8 +266,8 @@ func (_c *ServiceInterface_IsRunning_Call) Run(run func()) *ServiceInterface_IsR return _c } -func (_c *ServiceInterface_IsRunning_Call) Return(b bool) *ServiceInterface_IsRunning_Call { - _c.Call.Return(b) +func (_c *ServiceInterface_IsRunning_Call) Return(_a0 bool) *ServiceInterface_IsRunning_Call { + _c.Call.Return(_a0) return _c } @@ -299,22 +276,23 @@ func (_c *ServiceInterface_IsRunning_Call) RunAndReturn(run func() bool) *Servic return _c } -// LocalDevice provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) LocalDevice() api0.DeviceLocalInterface { - ret := _mock.Called() +// LocalDevice provides a mock function with no fields +func (_m *ServiceInterface) LocalDevice() spine_goapi.DeviceLocalInterface { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for LocalDevice") } - var r0 api0.DeviceLocalInterface - if returnFunc, ok := ret.Get(0).(func() api0.DeviceLocalInterface); ok { - r0 = returnFunc() + var r0 spine_goapi.DeviceLocalInterface + if rf, ok := ret.Get(0).(func() spine_goapi.DeviceLocalInterface); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(api0.DeviceLocalInterface) + r0 = ret.Get(0).(spine_goapi.DeviceLocalInterface) } } + return r0 } @@ -335,32 +313,33 @@ func (_c *ServiceInterface_LocalDevice_Call) Run(run func()) *ServiceInterface_L return _c } -func (_c *ServiceInterface_LocalDevice_Call) Return(deviceLocalInterface api0.DeviceLocalInterface) *ServiceInterface_LocalDevice_Call { - _c.Call.Return(deviceLocalInterface) +func (_c *ServiceInterface_LocalDevice_Call) Return(_a0 spine_goapi.DeviceLocalInterface) *ServiceInterface_LocalDevice_Call { + _c.Call.Return(_a0) return _c } -func (_c *ServiceInterface_LocalDevice_Call) RunAndReturn(run func() api0.DeviceLocalInterface) *ServiceInterface_LocalDevice_Call { +func (_c *ServiceInterface_LocalDevice_Call) RunAndReturn(run func() spine_goapi.DeviceLocalInterface) *ServiceInterface_LocalDevice_Call { _c.Call.Return(run) return _c } -// LocalService provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) LocalService() *api1.ServiceDetails { - ret := _mock.Called() +// LocalService provides a mock function with no fields +func (_m *ServiceInterface) LocalService() *ship_goapi.ServiceDetails { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for LocalService") } - var r0 *api1.ServiceDetails - if returnFunc, ok := ret.Get(0).(func() *api1.ServiceDetails); ok { - r0 = returnFunc() + var r0 *ship_goapi.ServiceDetails + if rf, ok := ret.Get(0).(func() *ship_goapi.ServiceDetails); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*api1.ServiceDetails) + r0 = ret.Get(0).(*ship_goapi.ServiceDetails) } } + return r0 } @@ -381,32 +360,33 @@ func (_c *ServiceInterface_LocalService_Call) Run(run func()) *ServiceInterface_ return _c } -func (_c *ServiceInterface_LocalService_Call) Return(serviceDetails *api1.ServiceDetails) *ServiceInterface_LocalService_Call { - _c.Call.Return(serviceDetails) +func (_c *ServiceInterface_LocalService_Call) Return(_a0 *ship_goapi.ServiceDetails) *ServiceInterface_LocalService_Call { + _c.Call.Return(_a0) return _c } -func (_c *ServiceInterface_LocalService_Call) RunAndReturn(run func() *api1.ServiceDetails) *ServiceInterface_LocalService_Call { +func (_c *ServiceInterface_LocalService_Call) RunAndReturn(run func() *ship_goapi.ServiceDetails) *ServiceInterface_LocalService_Call { _c.Call.Return(run) return _c } -// PairingDetailForSki provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) PairingDetailForSki(ski string) *api1.ConnectionStateDetail { - ret := _mock.Called(ski) +// PairingDetailForSki provides a mock function with given fields: ski +func (_m *ServiceInterface) PairingDetailForSki(ski string) *ship_goapi.ConnectionStateDetail { + ret := _m.Called(ski) if len(ret) == 0 { panic("no return value specified for PairingDetailForSki") } - var r0 *api1.ConnectionStateDetail - if returnFunc, ok := ret.Get(0).(func(string) *api1.ConnectionStateDetail); ok { - r0 = returnFunc(ski) + var r0 *ship_goapi.ConnectionStateDetail + if rf, ok := ret.Get(0).(func(string) *ship_goapi.ConnectionStateDetail); ok { + r0 = rf(ski) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*api1.ConnectionStateDetail) + r0 = ret.Get(0).(*ship_goapi.ConnectionStateDetail) } } + return r0 } @@ -423,41 +403,36 @@ func (_e *ServiceInterface_Expecter) PairingDetailForSki(ski interface{}) *Servi func (_c *ServiceInterface_PairingDetailForSki_Call) Run(run func(ski string)) *ServiceInterface_PairingDetailForSki_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 string - if args[0] != nil { - arg0 = args[0].(string) - } - run( - arg0, - ) + run(args[0].(string)) }) return _c } -func (_c *ServiceInterface_PairingDetailForSki_Call) Return(connectionStateDetail *api1.ConnectionStateDetail) *ServiceInterface_PairingDetailForSki_Call { - _c.Call.Return(connectionStateDetail) +func (_c *ServiceInterface_PairingDetailForSki_Call) Return(_a0 *ship_goapi.ConnectionStateDetail) *ServiceInterface_PairingDetailForSki_Call { + _c.Call.Return(_a0) return _c } -func (_c *ServiceInterface_PairingDetailForSki_Call) RunAndReturn(run func(ski string) *api1.ConnectionStateDetail) *ServiceInterface_PairingDetailForSki_Call { +func (_c *ServiceInterface_PairingDetailForSki_Call) RunAndReturn(run func(string) *ship_goapi.ConnectionStateDetail) *ServiceInterface_PairingDetailForSki_Call { _c.Call.Return(run) return _c } -// QRCodeText provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) QRCodeText() string { - ret := _mock.Called() +// QRCodeText provides a mock function with no fields +func (_m *ServiceInterface) QRCodeText() string { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for QRCodeText") } var r0 string - if returnFunc, ok := ret.Get(0).(func() string); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() } else { r0 = ret.Get(0).(string) } + return r0 } @@ -478,8 +453,8 @@ func (_c *ServiceInterface_QRCodeText_Call) Run(run func()) *ServiceInterface_QR return _c } -func (_c *ServiceInterface_QRCodeText_Call) Return(s string) *ServiceInterface_QRCodeText_Call { - _c.Call.Return(s) +func (_c *ServiceInterface_QRCodeText_Call) Return(_a0 string) *ServiceInterface_QRCodeText_Call { + _c.Call.Return(_a0) return _c } @@ -488,10 +463,9 @@ func (_c *ServiceInterface_QRCodeText_Call) RunAndReturn(run func() string) *Ser return _c } -// RegisterRemoteSKI provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) RegisterRemoteSKI(ski string, shipID string) { - _mock.Called(ski, shipID) - return +// RegisterRemoteSKI provides a mock function with given fields: ski, shipID +func (_m *ServiceInterface) RegisterRemoteSKI(ski string, shipID string) { + _m.Called(ski, shipID) } // ServiceInterface_RegisterRemoteSKI_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterRemoteSKI' @@ -508,18 +482,7 @@ func (_e *ServiceInterface_Expecter) RegisterRemoteSKI(ski interface{}, shipID i func (_c *ServiceInterface_RegisterRemoteSKI_Call) Run(run func(ski string, shipID string)) *ServiceInterface_RegisterRemoteSKI_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 string - if args[0] != nil { - arg0 = args[0].(string) - } - var arg1 string - if args[1] != nil { - arg1 = args[1].(string) - } - run( - arg0, - arg1, - ) + run(args[0].(string), args[1].(string)) }) return _c } @@ -529,27 +492,28 @@ func (_c *ServiceInterface_RegisterRemoteSKI_Call) Return() *ServiceInterface_Re return _c } -func (_c *ServiceInterface_RegisterRemoteSKI_Call) RunAndReturn(run func(ski string, shipID string)) *ServiceInterface_RegisterRemoteSKI_Call { +func (_c *ServiceInterface_RegisterRemoteSKI_Call) RunAndReturn(run func(string, string)) *ServiceInterface_RegisterRemoteSKI_Call { _c.Run(run) return _c } -// RemoteServiceForSKI provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) RemoteServiceForSKI(ski string) *api1.ServiceDetails { - ret := _mock.Called(ski) +// RemoteServiceForSKI provides a mock function with given fields: ski +func (_m *ServiceInterface) RemoteServiceForSKI(ski string) *ship_goapi.ServiceDetails { + ret := _m.Called(ski) if len(ret) == 0 { panic("no return value specified for RemoteServiceForSKI") } - var r0 *api1.ServiceDetails - if returnFunc, ok := ret.Get(0).(func(string) *api1.ServiceDetails); ok { - r0 = returnFunc(ski) + var r0 *ship_goapi.ServiceDetails + if rf, ok := ret.Get(0).(func(string) *ship_goapi.ServiceDetails); ok { + r0 = rf(ski) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*api1.ServiceDetails) + r0 = ret.Get(0).(*ship_goapi.ServiceDetails) } } + return r0 } @@ -566,31 +530,24 @@ func (_e *ServiceInterface_Expecter) RemoteServiceForSKI(ski interface{}) *Servi func (_c *ServiceInterface_RemoteServiceForSKI_Call) Run(run func(ski string)) *ServiceInterface_RemoteServiceForSKI_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 string - if args[0] != nil { - arg0 = args[0].(string) - } - run( - arg0, - ) + run(args[0].(string)) }) return _c } -func (_c *ServiceInterface_RemoteServiceForSKI_Call) Return(serviceDetails *api1.ServiceDetails) *ServiceInterface_RemoteServiceForSKI_Call { - _c.Call.Return(serviceDetails) +func (_c *ServiceInterface_RemoteServiceForSKI_Call) Return(_a0 *ship_goapi.ServiceDetails) *ServiceInterface_RemoteServiceForSKI_Call { + _c.Call.Return(_a0) return _c } -func (_c *ServiceInterface_RemoteServiceForSKI_Call) RunAndReturn(run func(ski string) *api1.ServiceDetails) *ServiceInterface_RemoteServiceForSKI_Call { +func (_c *ServiceInterface_RemoteServiceForSKI_Call) RunAndReturn(run func(string) *ship_goapi.ServiceDetails) *ServiceInterface_RemoteServiceForSKI_Call { _c.Call.Return(run) return _c } -// SetAutoAccept provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) SetAutoAccept(value bool) { - _mock.Called(value) - return +// SetAutoAccept provides a mock function with given fields: value +func (_m *ServiceInterface) SetAutoAccept(value bool) { + _m.Called(value) } // ServiceInterface_SetAutoAccept_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetAutoAccept' @@ -606,13 +563,7 @@ func (_e *ServiceInterface_Expecter) SetAutoAccept(value interface{}) *ServiceIn func (_c *ServiceInterface_SetAutoAccept_Call) Run(run func(value bool)) *ServiceInterface_SetAutoAccept_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -622,15 +573,14 @@ func (_c *ServiceInterface_SetAutoAccept_Call) Return() *ServiceInterface_SetAut return _c } -func (_c *ServiceInterface_SetAutoAccept_Call) RunAndReturn(run func(value bool)) *ServiceInterface_SetAutoAccept_Call { +func (_c *ServiceInterface_SetAutoAccept_Call) RunAndReturn(run func(bool)) *ServiceInterface_SetAutoAccept_Call { _c.Run(run) return _c } -// SetLogging provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) SetLogging(logger logging.LoggingInterface) { - _mock.Called(logger) - return +// SetLogging provides a mock function with given fields: logger +func (_m *ServiceInterface) SetLogging(logger logging.LoggingInterface) { + _m.Called(logger) } // ServiceInterface_SetLogging_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLogging' @@ -646,13 +596,7 @@ func (_e *ServiceInterface_Expecter) SetLogging(logger interface{}) *ServiceInte func (_c *ServiceInterface_SetLogging_Call) Run(run func(logger logging.LoggingInterface)) *ServiceInterface_SetLogging_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 logging.LoggingInterface - if args[0] != nil { - arg0 = args[0].(logging.LoggingInterface) - } - run( - arg0, - ) + run(args[0].(logging.LoggingInterface)) }) return _c } @@ -662,25 +606,26 @@ func (_c *ServiceInterface_SetLogging_Call) Return() *ServiceInterface_SetLoggin return _c } -func (_c *ServiceInterface_SetLogging_Call) RunAndReturn(run func(logger logging.LoggingInterface)) *ServiceInterface_SetLogging_Call { +func (_c *ServiceInterface_SetLogging_Call) RunAndReturn(run func(logging.LoggingInterface)) *ServiceInterface_SetLogging_Call { _c.Run(run) return _c } -// Setup provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) Setup() error { - ret := _mock.Called() +// Setup provides a mock function with no fields +func (_m *ServiceInterface) Setup() error { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for Setup") } var r0 error - if returnFunc, ok := ret.Get(0).(func() error); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() } else { r0 = ret.Error(0) } + return r0 } @@ -701,8 +646,8 @@ func (_c *ServiceInterface_Setup_Call) Run(run func()) *ServiceInterface_Setup_C return _c } -func (_c *ServiceInterface_Setup_Call) Return(err error) *ServiceInterface_Setup_Call { - _c.Call.Return(err) +func (_c *ServiceInterface_Setup_Call) Return(_a0 error) *ServiceInterface_Setup_Call { + _c.Call.Return(_a0) return _c } @@ -711,10 +656,9 @@ func (_c *ServiceInterface_Setup_Call) RunAndReturn(run func() error) *ServiceIn return _c } -// Shutdown provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) Shutdown() { - _mock.Called() - return +// Shutdown provides a mock function with no fields +func (_m *ServiceInterface) Shutdown() { + _m.Called() } // ServiceInterface_Shutdown_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Shutdown' @@ -744,10 +688,9 @@ func (_c *ServiceInterface_Shutdown_Call) RunAndReturn(run func()) *ServiceInter return _c } -// Start provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) Start() { - _mock.Called() - return +// Start provides a mock function with no fields +func (_m *ServiceInterface) Start() { + _m.Called() } // ServiceInterface_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' @@ -777,10 +720,9 @@ func (_c *ServiceInterface_Start_Call) RunAndReturn(run func()) *ServiceInterfac return _c } -// UnregisterRemoteSKI provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) UnregisterRemoteSKI(ski string) { - _mock.Called(ski) - return +// UnregisterRemoteSKI provides a mock function with given fields: ski +func (_m *ServiceInterface) UnregisterRemoteSKI(ski string) { + _m.Called(ski) } // ServiceInterface_UnregisterRemoteSKI_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnregisterRemoteSKI' @@ -796,13 +738,7 @@ func (_e *ServiceInterface_Expecter) UnregisterRemoteSKI(ski interface{}) *Servi func (_c *ServiceInterface_UnregisterRemoteSKI_Call) Run(run func(ski string)) *ServiceInterface_UnregisterRemoteSKI_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 string - if args[0] != nil { - arg0 = args[0].(string) - } - run( - arg0, - ) + run(args[0].(string)) }) return _c } @@ -812,15 +748,14 @@ func (_c *ServiceInterface_UnregisterRemoteSKI_Call) Return() *ServiceInterface_ return _c } -func (_c *ServiceInterface_UnregisterRemoteSKI_Call) RunAndReturn(run func(ski string)) *ServiceInterface_UnregisterRemoteSKI_Call { +func (_c *ServiceInterface_UnregisterRemoteSKI_Call) RunAndReturn(run func(string)) *ServiceInterface_UnregisterRemoteSKI_Call { _c.Run(run) return _c } -// UserIsAbleToApproveOrCancelPairingRequests provides a mock function for the type ServiceInterface -func (_mock *ServiceInterface) UserIsAbleToApproveOrCancelPairingRequests(allow bool) { - _mock.Called(allow) - return +// UserIsAbleToApproveOrCancelPairingRequests provides a mock function with given fields: allow +func (_m *ServiceInterface) UserIsAbleToApproveOrCancelPairingRequests(allow bool) { + _m.Called(allow) } // ServiceInterface_UserIsAbleToApproveOrCancelPairingRequests_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserIsAbleToApproveOrCancelPairingRequests' @@ -836,13 +771,7 @@ func (_e *ServiceInterface_Expecter) UserIsAbleToApproveOrCancelPairingRequests( func (_c *ServiceInterface_UserIsAbleToApproveOrCancelPairingRequests_Call) Run(run func(allow bool)) *ServiceInterface_UserIsAbleToApproveOrCancelPairingRequests_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -852,7 +781,21 @@ func (_c *ServiceInterface_UserIsAbleToApproveOrCancelPairingRequests_Call) Retu return _c } -func (_c *ServiceInterface_UserIsAbleToApproveOrCancelPairingRequests_Call) RunAndReturn(run func(allow bool)) *ServiceInterface_UserIsAbleToApproveOrCancelPairingRequests_Call { +func (_c *ServiceInterface_UserIsAbleToApproveOrCancelPairingRequests_Call) RunAndReturn(run func(bool)) *ServiceInterface_UserIsAbleToApproveOrCancelPairingRequests_Call { _c.Run(run) return _c } + +// NewServiceInterface creates a new instance of ServiceInterface. 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 NewServiceInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ServiceInterface { + mock := &ServiceInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/ServiceReaderInterface.go b/mocks/ServiceReaderInterface.go index 4a18e808..7328c747 100644 --- a/mocks/ServiceReaderInterface.go +++ b/mocks/ServiceReaderInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/eebus-go/api" - api0 "github.com/enbility/ship-go/api" + api "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) -// NewServiceReaderInterface creates a new instance of ServiceReaderInterface. 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 NewServiceReaderInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *ServiceReaderInterface { - mock := &ServiceReaderInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} + ship_goapi "github.com/enbility/ship-go/api" +) // ServiceReaderInterface is an autogenerated mock type for the ServiceReaderInterface type type ServiceReaderInterface struct { @@ -37,10 +22,9 @@ func (_m *ServiceReaderInterface) EXPECT() *ServiceReaderInterface_Expecter { return &ServiceReaderInterface_Expecter{mock: &_m.Mock} } -// RemoteSKIConnected provides a mock function for the type ServiceReaderInterface -func (_mock *ServiceReaderInterface) RemoteSKIConnected(service api.ServiceInterface, ski string) { - _mock.Called(service, ski) - return +// RemoteSKIConnected provides a mock function with given fields: service, ski +func (_m *ServiceReaderInterface) RemoteSKIConnected(service api.ServiceInterface, ski string) { + _m.Called(service, ski) } // ServiceReaderInterface_RemoteSKIConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoteSKIConnected' @@ -57,18 +41,7 @@ func (_e *ServiceReaderInterface_Expecter) RemoteSKIConnected(service interface{ func (_c *ServiceReaderInterface_RemoteSKIConnected_Call) Run(run func(service api.ServiceInterface, ski string)) *ServiceReaderInterface_RemoteSKIConnected_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.ServiceInterface - if args[0] != nil { - arg0 = args[0].(api.ServiceInterface) - } - var arg1 string - if args[1] != nil { - arg1 = args[1].(string) - } - run( - arg0, - arg1, - ) + run(args[0].(api.ServiceInterface), args[1].(string)) }) return _c } @@ -78,15 +51,14 @@ func (_c *ServiceReaderInterface_RemoteSKIConnected_Call) Return() *ServiceReade return _c } -func (_c *ServiceReaderInterface_RemoteSKIConnected_Call) RunAndReturn(run func(service api.ServiceInterface, ski string)) *ServiceReaderInterface_RemoteSKIConnected_Call { +func (_c *ServiceReaderInterface_RemoteSKIConnected_Call) RunAndReturn(run func(api.ServiceInterface, string)) *ServiceReaderInterface_RemoteSKIConnected_Call { _c.Run(run) return _c } -// RemoteSKIDisconnected provides a mock function for the type ServiceReaderInterface -func (_mock *ServiceReaderInterface) RemoteSKIDisconnected(service api.ServiceInterface, ski string) { - _mock.Called(service, ski) - return +// RemoteSKIDisconnected provides a mock function with given fields: service, ski +func (_m *ServiceReaderInterface) RemoteSKIDisconnected(service api.ServiceInterface, ski string) { + _m.Called(service, ski) } // ServiceReaderInterface_RemoteSKIDisconnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoteSKIDisconnected' @@ -103,18 +75,7 @@ func (_e *ServiceReaderInterface_Expecter) RemoteSKIDisconnected(service interfa func (_c *ServiceReaderInterface_RemoteSKIDisconnected_Call) Run(run func(service api.ServiceInterface, ski string)) *ServiceReaderInterface_RemoteSKIDisconnected_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.ServiceInterface - if args[0] != nil { - arg0 = args[0].(api.ServiceInterface) - } - var arg1 string - if args[1] != nil { - arg1 = args[1].(string) - } - run( - arg0, - arg1, - ) + run(args[0].(api.ServiceInterface), args[1].(string)) }) return _c } @@ -124,15 +85,14 @@ func (_c *ServiceReaderInterface_RemoteSKIDisconnected_Call) Return() *ServiceRe return _c } -func (_c *ServiceReaderInterface_RemoteSKIDisconnected_Call) RunAndReturn(run func(service api.ServiceInterface, ski string)) *ServiceReaderInterface_RemoteSKIDisconnected_Call { +func (_c *ServiceReaderInterface_RemoteSKIDisconnected_Call) RunAndReturn(run func(api.ServiceInterface, string)) *ServiceReaderInterface_RemoteSKIDisconnected_Call { _c.Run(run) return _c } -// ServicePairingDetailUpdate provides a mock function for the type ServiceReaderInterface -func (_mock *ServiceReaderInterface) ServicePairingDetailUpdate(ski string, detail *api0.ConnectionStateDetail) { - _mock.Called(ski, detail) - return +// ServicePairingDetailUpdate provides a mock function with given fields: ski, detail +func (_m *ServiceReaderInterface) ServicePairingDetailUpdate(ski string, detail *ship_goapi.ConnectionStateDetail) { + _m.Called(ski, detail) } // ServiceReaderInterface_ServicePairingDetailUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServicePairingDetailUpdate' @@ -142,25 +102,14 @@ type ServiceReaderInterface_ServicePairingDetailUpdate_Call struct { // ServicePairingDetailUpdate is a helper method to define mock.On call // - ski string -// - detail *api0.ConnectionStateDetail +// - detail *ship_goapi.ConnectionStateDetail func (_e *ServiceReaderInterface_Expecter) ServicePairingDetailUpdate(ski interface{}, detail interface{}) *ServiceReaderInterface_ServicePairingDetailUpdate_Call { return &ServiceReaderInterface_ServicePairingDetailUpdate_Call{Call: _e.mock.On("ServicePairingDetailUpdate", ski, detail)} } -func (_c *ServiceReaderInterface_ServicePairingDetailUpdate_Call) Run(run func(ski string, detail *api0.ConnectionStateDetail)) *ServiceReaderInterface_ServicePairingDetailUpdate_Call { +func (_c *ServiceReaderInterface_ServicePairingDetailUpdate_Call) Run(run func(ski string, detail *ship_goapi.ConnectionStateDetail)) *ServiceReaderInterface_ServicePairingDetailUpdate_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 string - if args[0] != nil { - arg0 = args[0].(string) - } - var arg1 *api0.ConnectionStateDetail - if args[1] != nil { - arg1 = args[1].(*api0.ConnectionStateDetail) - } - run( - arg0, - arg1, - ) + run(args[0].(string), args[1].(*ship_goapi.ConnectionStateDetail)) }) return _c } @@ -170,15 +119,14 @@ func (_c *ServiceReaderInterface_ServicePairingDetailUpdate_Call) Return() *Serv return _c } -func (_c *ServiceReaderInterface_ServicePairingDetailUpdate_Call) RunAndReturn(run func(ski string, detail *api0.ConnectionStateDetail)) *ServiceReaderInterface_ServicePairingDetailUpdate_Call { +func (_c *ServiceReaderInterface_ServicePairingDetailUpdate_Call) RunAndReturn(run func(string, *ship_goapi.ConnectionStateDetail)) *ServiceReaderInterface_ServicePairingDetailUpdate_Call { _c.Run(run) return _c } -// ServiceShipIDUpdate provides a mock function for the type ServiceReaderInterface -func (_mock *ServiceReaderInterface) ServiceShipIDUpdate(ski string, shipdID string) { - _mock.Called(ski, shipdID) - return +// ServiceShipIDUpdate provides a mock function with given fields: ski, shipdID +func (_m *ServiceReaderInterface) ServiceShipIDUpdate(ski string, shipdID string) { + _m.Called(ski, shipdID) } // ServiceReaderInterface_ServiceShipIDUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ServiceShipIDUpdate' @@ -195,18 +143,7 @@ func (_e *ServiceReaderInterface_Expecter) ServiceShipIDUpdate(ski interface{}, func (_c *ServiceReaderInterface_ServiceShipIDUpdate_Call) Run(run func(ski string, shipdID string)) *ServiceReaderInterface_ServiceShipIDUpdate_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 string - if args[0] != nil { - arg0 = args[0].(string) - } - var arg1 string - if args[1] != nil { - arg1 = args[1].(string) - } - run( - arg0, - arg1, - ) + run(args[0].(string), args[1].(string)) }) return _c } @@ -216,15 +153,14 @@ func (_c *ServiceReaderInterface_ServiceShipIDUpdate_Call) Return() *ServiceRead return _c } -func (_c *ServiceReaderInterface_ServiceShipIDUpdate_Call) RunAndReturn(run func(ski string, shipdID string)) *ServiceReaderInterface_ServiceShipIDUpdate_Call { +func (_c *ServiceReaderInterface_ServiceShipIDUpdate_Call) RunAndReturn(run func(string, string)) *ServiceReaderInterface_ServiceShipIDUpdate_Call { _c.Run(run) return _c } -// VisibleRemoteServicesUpdated provides a mock function for the type ServiceReaderInterface -func (_mock *ServiceReaderInterface) VisibleRemoteServicesUpdated(service api.ServiceInterface, entries []api0.RemoteService) { - _mock.Called(service, entries) - return +// VisibleRemoteServicesUpdated provides a mock function with given fields: service, entries +func (_m *ServiceReaderInterface) VisibleRemoteServicesUpdated(service api.ServiceInterface, entries []ship_goapi.RemoteService) { + _m.Called(service, entries) } // ServiceReaderInterface_VisibleRemoteServicesUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VisibleRemoteServicesUpdated' @@ -234,25 +170,14 @@ type ServiceReaderInterface_VisibleRemoteServicesUpdated_Call struct { // VisibleRemoteServicesUpdated is a helper method to define mock.On call // - service api.ServiceInterface -// - entries []api0.RemoteService +// - entries []ship_goapi.RemoteService func (_e *ServiceReaderInterface_Expecter) VisibleRemoteServicesUpdated(service interface{}, entries interface{}) *ServiceReaderInterface_VisibleRemoteServicesUpdated_Call { return &ServiceReaderInterface_VisibleRemoteServicesUpdated_Call{Call: _e.mock.On("VisibleRemoteServicesUpdated", service, entries)} } -func (_c *ServiceReaderInterface_VisibleRemoteServicesUpdated_Call) Run(run func(service api.ServiceInterface, entries []api0.RemoteService)) *ServiceReaderInterface_VisibleRemoteServicesUpdated_Call { +func (_c *ServiceReaderInterface_VisibleRemoteServicesUpdated_Call) Run(run func(service api.ServiceInterface, entries []ship_goapi.RemoteService)) *ServiceReaderInterface_VisibleRemoteServicesUpdated_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.ServiceInterface - if args[0] != nil { - arg0 = args[0].(api.ServiceInterface) - } - var arg1 []api0.RemoteService - if args[1] != nil { - arg1 = args[1].([]api0.RemoteService) - } - run( - arg0, - arg1, - ) + run(args[0].(api.ServiceInterface), args[1].([]ship_goapi.RemoteService)) }) return _c } @@ -262,7 +187,21 @@ func (_c *ServiceReaderInterface_VisibleRemoteServicesUpdated_Call) Return() *Se return _c } -func (_c *ServiceReaderInterface_VisibleRemoteServicesUpdated_Call) RunAndReturn(run func(service api.ServiceInterface, entries []api0.RemoteService)) *ServiceReaderInterface_VisibleRemoteServicesUpdated_Call { +func (_c *ServiceReaderInterface_VisibleRemoteServicesUpdated_Call) RunAndReturn(run func(api.ServiceInterface, []ship_goapi.RemoteService)) *ServiceReaderInterface_VisibleRemoteServicesUpdated_Call { _c.Run(run) return _c } + +// NewServiceReaderInterface creates a new instance of ServiceReaderInterface. 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 NewServiceReaderInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *ServiceReaderInterface { + mock := &ServiceReaderInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/SmartEnergyManagementPsClientInterface.go b/mocks/SmartEnergyManagementPsClientInterface.go index 743c9117..fa95fe36 100644 --- a/mocks/SmartEnergyManagementPsClientInterface.go +++ b/mocks/SmartEnergyManagementPsClientInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewSmartEnergyManagementPsClientInterface creates a new instance of SmartEnergyManagementPsClientInterface. 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 NewSmartEnergyManagementPsClientInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *SmartEnergyManagementPsClientInterface { - mock := &SmartEnergyManagementPsClientInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // SmartEnergyManagementPsClientInterface is an autogenerated mock type for the SmartEnergyManagementPsClientInterface type type SmartEnergyManagementPsClientInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *SmartEnergyManagementPsClientInterface) EXPECT() *SmartEnergyManagemen return &SmartEnergyManagementPsClientInterface_Expecter{mock: &_m.Mock} } -// RequestData provides a mock function for the type SmartEnergyManagementPsClientInterface -func (_mock *SmartEnergyManagementPsClientInterface) RequestData() (*model.MsgCounterType, error) { - ret := _mock.Called() +// RequestData provides a mock function with no fields +func (_m *SmartEnergyManagementPsClientInterface) RequestData() (*model.MsgCounterType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RequestData") @@ -46,21 +30,23 @@ func (_mock *SmartEnergyManagementPsClientInterface) RequestData() (*model.MsgCo var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.MsgCounterType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.MsgCounterType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.MsgCounterType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -81,8 +67,8 @@ func (_c *SmartEnergyManagementPsClientInterface_RequestData_Call) Run(run func( return _c } -func (_c *SmartEnergyManagementPsClientInterface_RequestData_Call) Return(msgCounterType *model.MsgCounterType, err error) *SmartEnergyManagementPsClientInterface_RequestData_Call { - _c.Call.Return(msgCounterType, err) +func (_c *SmartEnergyManagementPsClientInterface_RequestData_Call) Return(_a0 *model.MsgCounterType, _a1 error) *SmartEnergyManagementPsClientInterface_RequestData_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -91,9 +77,9 @@ func (_c *SmartEnergyManagementPsClientInterface_RequestData_Call) RunAndReturn( return _c } -// WriteData provides a mock function for the type SmartEnergyManagementPsClientInterface -func (_mock *SmartEnergyManagementPsClientInterface) WriteData(data *model.SmartEnergyManagementPsDataType) (*model.MsgCounterType, error) { - ret := _mock.Called(data) +// WriteData provides a mock function with given fields: data +func (_m *SmartEnergyManagementPsClientInterface) WriteData(data *model.SmartEnergyManagementPsDataType) (*model.MsgCounterType, error) { + ret := _m.Called(data) if len(ret) == 0 { panic("no return value specified for WriteData") @@ -101,21 +87,23 @@ func (_mock *SmartEnergyManagementPsClientInterface) WriteData(data *model.Smart var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.SmartEnergyManagementPsDataType) (*model.MsgCounterType, error)); ok { - return returnFunc(data) + if rf, ok := ret.Get(0).(func(*model.SmartEnergyManagementPsDataType) (*model.MsgCounterType, error)); ok { + return rf(data) } - if returnFunc, ok := ret.Get(0).(func(*model.SmartEnergyManagementPsDataType) *model.MsgCounterType); ok { - r0 = returnFunc(data) + if rf, ok := ret.Get(0).(func(*model.SmartEnergyManagementPsDataType) *model.MsgCounterType); ok { + r0 = rf(data) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.SmartEnergyManagementPsDataType) error); ok { - r1 = returnFunc(data) + + if rf, ok := ret.Get(1).(func(*model.SmartEnergyManagementPsDataType) error); ok { + r1 = rf(data) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -132,23 +120,31 @@ func (_e *SmartEnergyManagementPsClientInterface_Expecter) WriteData(data interf func (_c *SmartEnergyManagementPsClientInterface_WriteData_Call) Run(run func(data *model.SmartEnergyManagementPsDataType)) *SmartEnergyManagementPsClientInterface_WriteData_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.SmartEnergyManagementPsDataType - if args[0] != nil { - arg0 = args[0].(*model.SmartEnergyManagementPsDataType) - } - run( - arg0, - ) + run(args[0].(*model.SmartEnergyManagementPsDataType)) }) return _c } -func (_c *SmartEnergyManagementPsClientInterface_WriteData_Call) Return(msgCounterType *model.MsgCounterType, err error) *SmartEnergyManagementPsClientInterface_WriteData_Call { - _c.Call.Return(msgCounterType, err) +func (_c *SmartEnergyManagementPsClientInterface_WriteData_Call) Return(_a0 *model.MsgCounterType, _a1 error) *SmartEnergyManagementPsClientInterface_WriteData_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *SmartEnergyManagementPsClientInterface_WriteData_Call) RunAndReturn(run func(data *model.SmartEnergyManagementPsDataType) (*model.MsgCounterType, error)) *SmartEnergyManagementPsClientInterface_WriteData_Call { +func (_c *SmartEnergyManagementPsClientInterface_WriteData_Call) RunAndReturn(run func(*model.SmartEnergyManagementPsDataType) (*model.MsgCounterType, error)) *SmartEnergyManagementPsClientInterface_WriteData_Call { _c.Call.Return(run) return _c } + +// NewSmartEnergyManagementPsClientInterface creates a new instance of SmartEnergyManagementPsClientInterface. 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 NewSmartEnergyManagementPsClientInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *SmartEnergyManagementPsClientInterface { + mock := &SmartEnergyManagementPsClientInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/SmartEnergyManagementPsCommonInterface.go b/mocks/SmartEnergyManagementPsCommonInterface.go index 9ad01737..6ffe4e1b 100644 --- a/mocks/SmartEnergyManagementPsCommonInterface.go +++ b/mocks/SmartEnergyManagementPsCommonInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewSmartEnergyManagementPsCommonInterface creates a new instance of SmartEnergyManagementPsCommonInterface. 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 NewSmartEnergyManagementPsCommonInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *SmartEnergyManagementPsCommonInterface { - mock := &SmartEnergyManagementPsCommonInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // SmartEnergyManagementPsCommonInterface is an autogenerated mock type for the SmartEnergyManagementPsCommonInterface type type SmartEnergyManagementPsCommonInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *SmartEnergyManagementPsCommonInterface) EXPECT() *SmartEnergyManagemen return &SmartEnergyManagementPsCommonInterface_Expecter{mock: &_m.Mock} } -// GetData provides a mock function for the type SmartEnergyManagementPsCommonInterface -func (_mock *SmartEnergyManagementPsCommonInterface) GetData() (*model.SmartEnergyManagementPsDataType, error) { - ret := _mock.Called() +// GetData provides a mock function with no fields +func (_m *SmartEnergyManagementPsCommonInterface) GetData() (*model.SmartEnergyManagementPsDataType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetData") @@ -46,21 +30,23 @@ func (_mock *SmartEnergyManagementPsCommonInterface) GetData() (*model.SmartEner var r0 *model.SmartEnergyManagementPsDataType var r1 error - if returnFunc, ok := ret.Get(0).(func() (*model.SmartEnergyManagementPsDataType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (*model.SmartEnergyManagementPsDataType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() *model.SmartEnergyManagementPsDataType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() *model.SmartEnergyManagementPsDataType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.SmartEnergyManagementPsDataType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -81,8 +67,8 @@ func (_c *SmartEnergyManagementPsCommonInterface_GetData_Call) Run(run func()) * return _c } -func (_c *SmartEnergyManagementPsCommonInterface_GetData_Call) Return(smartEnergyManagementPsDataType *model.SmartEnergyManagementPsDataType, err error) *SmartEnergyManagementPsCommonInterface_GetData_Call { - _c.Call.Return(smartEnergyManagementPsDataType, err) +func (_c *SmartEnergyManagementPsCommonInterface_GetData_Call) Return(_a0 *model.SmartEnergyManagementPsDataType, _a1 error) *SmartEnergyManagementPsCommonInterface_GetData_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -90,3 +76,17 @@ func (_c *SmartEnergyManagementPsCommonInterface_GetData_Call) RunAndReturn(run _c.Call.Return(run) return _c } + +// NewSmartEnergyManagementPsCommonInterface creates a new instance of SmartEnergyManagementPsCommonInterface. 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 NewSmartEnergyManagementPsCommonInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *SmartEnergyManagementPsCommonInterface { + mock := &SmartEnergyManagementPsCommonInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/SmartEnergyManagementPsServerInterface.go b/mocks/SmartEnergyManagementPsServerInterface.go index 0bee8257..b7c3a323 100644 --- a/mocks/SmartEnergyManagementPsServerInterface.go +++ b/mocks/SmartEnergyManagementPsServerInterface.go @@ -1,12 +1,21 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks -import ( - mock "github.com/stretchr/testify/mock" -) +import mock "github.com/stretchr/testify/mock" + +// SmartEnergyManagementPsServerInterface is an autogenerated mock type for the SmartEnergyManagementPsServerInterface type +type SmartEnergyManagementPsServerInterface struct { + mock.Mock +} + +type SmartEnergyManagementPsServerInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *SmartEnergyManagementPsServerInterface) EXPECT() *SmartEnergyManagementPsServerInterface_Expecter { + return &SmartEnergyManagementPsServerInterface_Expecter{mock: &_m.Mock} +} // NewSmartEnergyManagementPsServerInterface creates a new instance of SmartEnergyManagementPsServerInterface. 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. @@ -21,16 +30,3 @@ func NewSmartEnergyManagementPsServerInterface(t interface { return mock } - -// SmartEnergyManagementPsServerInterface is an autogenerated mock type for the SmartEnergyManagementPsServerInterface type -type SmartEnergyManagementPsServerInterface struct { - mock.Mock -} - -type SmartEnergyManagementPsServerInterface_Expecter struct { - mock *mock.Mock -} - -func (_m *SmartEnergyManagementPsServerInterface) EXPECT() *SmartEnergyManagementPsServerInterface_Expecter { - return &SmartEnergyManagementPsServerInterface_Expecter{mock: &_m.Mock} -} diff --git a/mocks/TimeSeriesClientInterface.go b/mocks/TimeSeriesClientInterface.go index 46dc1d37..782be79b 100644 --- a/mocks/TimeSeriesClientInterface.go +++ b/mocks/TimeSeriesClientInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewTimeSeriesClientInterface creates a new instance of TimeSeriesClientInterface. 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 NewTimeSeriesClientInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *TimeSeriesClientInterface { - mock := &TimeSeriesClientInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // TimeSeriesClientInterface is an autogenerated mock type for the TimeSeriesClientInterface type type TimeSeriesClientInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *TimeSeriesClientInterface) EXPECT() *TimeSeriesClientInterface_Expecte return &TimeSeriesClientInterface_Expecter{mock: &_m.Mock} } -// RequestConstraints provides a mock function for the type TimeSeriesClientInterface -func (_mock *TimeSeriesClientInterface) RequestConstraints(selector *model.TimeSeriesConstraintsListDataSelectorsType, elements *model.TimeSeriesConstraintsDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestConstraints provides a mock function with given fields: selector, elements +func (_m *TimeSeriesClientInterface) RequestConstraints(selector *model.TimeSeriesConstraintsListDataSelectorsType, elements *model.TimeSeriesConstraintsDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestConstraints") @@ -46,21 +30,23 @@ func (_mock *TimeSeriesClientInterface) RequestConstraints(selector *model.TimeS var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.TimeSeriesConstraintsListDataSelectorsType, *model.TimeSeriesConstraintsDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.TimeSeriesConstraintsListDataSelectorsType, *model.TimeSeriesConstraintsDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.TimeSeriesConstraintsListDataSelectorsType, *model.TimeSeriesConstraintsDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.TimeSeriesConstraintsListDataSelectorsType, *model.TimeSeriesConstraintsDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.TimeSeriesConstraintsListDataSelectorsType, *model.TimeSeriesConstraintsDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.TimeSeriesConstraintsListDataSelectorsType, *model.TimeSeriesConstraintsDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -78,35 +64,24 @@ func (_e *TimeSeriesClientInterface_Expecter) RequestConstraints(selector interf func (_c *TimeSeriesClientInterface_RequestConstraints_Call) Run(run func(selector *model.TimeSeriesConstraintsListDataSelectorsType, elements *model.TimeSeriesConstraintsDataElementsType)) *TimeSeriesClientInterface_RequestConstraints_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.TimeSeriesConstraintsListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.TimeSeriesConstraintsListDataSelectorsType) - } - var arg1 *model.TimeSeriesConstraintsDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.TimeSeriesConstraintsDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.TimeSeriesConstraintsListDataSelectorsType), args[1].(*model.TimeSeriesConstraintsDataElementsType)) }) return _c } -func (_c *TimeSeriesClientInterface_RequestConstraints_Call) Return(msgCounterType *model.MsgCounterType, err error) *TimeSeriesClientInterface_RequestConstraints_Call { - _c.Call.Return(msgCounterType, err) +func (_c *TimeSeriesClientInterface_RequestConstraints_Call) Return(_a0 *model.MsgCounterType, _a1 error) *TimeSeriesClientInterface_RequestConstraints_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *TimeSeriesClientInterface_RequestConstraints_Call) RunAndReturn(run func(selector *model.TimeSeriesConstraintsListDataSelectorsType, elements *model.TimeSeriesConstraintsDataElementsType) (*model.MsgCounterType, error)) *TimeSeriesClientInterface_RequestConstraints_Call { +func (_c *TimeSeriesClientInterface_RequestConstraints_Call) RunAndReturn(run func(*model.TimeSeriesConstraintsListDataSelectorsType, *model.TimeSeriesConstraintsDataElementsType) (*model.MsgCounterType, error)) *TimeSeriesClientInterface_RequestConstraints_Call { _c.Call.Return(run) return _c } -// RequestData provides a mock function for the type TimeSeriesClientInterface -func (_mock *TimeSeriesClientInterface) RequestData(selector *model.TimeSeriesListDataSelectorsType, elements *model.TimeSeriesDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestData provides a mock function with given fields: selector, elements +func (_m *TimeSeriesClientInterface) RequestData(selector *model.TimeSeriesListDataSelectorsType, elements *model.TimeSeriesDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestData") @@ -114,21 +89,23 @@ func (_mock *TimeSeriesClientInterface) RequestData(selector *model.TimeSeriesLi var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.TimeSeriesListDataSelectorsType, *model.TimeSeriesDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.TimeSeriesListDataSelectorsType, *model.TimeSeriesDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.TimeSeriesListDataSelectorsType, *model.TimeSeriesDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.TimeSeriesListDataSelectorsType, *model.TimeSeriesDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.TimeSeriesListDataSelectorsType, *model.TimeSeriesDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.TimeSeriesListDataSelectorsType, *model.TimeSeriesDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -146,35 +123,24 @@ func (_e *TimeSeriesClientInterface_Expecter) RequestData(selector interface{}, func (_c *TimeSeriesClientInterface_RequestData_Call) Run(run func(selector *model.TimeSeriesListDataSelectorsType, elements *model.TimeSeriesDataElementsType)) *TimeSeriesClientInterface_RequestData_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.TimeSeriesListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.TimeSeriesListDataSelectorsType) - } - var arg1 *model.TimeSeriesDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.TimeSeriesDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.TimeSeriesListDataSelectorsType), args[1].(*model.TimeSeriesDataElementsType)) }) return _c } -func (_c *TimeSeriesClientInterface_RequestData_Call) Return(msgCounterType *model.MsgCounterType, err error) *TimeSeriesClientInterface_RequestData_Call { - _c.Call.Return(msgCounterType, err) +func (_c *TimeSeriesClientInterface_RequestData_Call) Return(_a0 *model.MsgCounterType, _a1 error) *TimeSeriesClientInterface_RequestData_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *TimeSeriesClientInterface_RequestData_Call) RunAndReturn(run func(selector *model.TimeSeriesListDataSelectorsType, elements *model.TimeSeriesDataElementsType) (*model.MsgCounterType, error)) *TimeSeriesClientInterface_RequestData_Call { +func (_c *TimeSeriesClientInterface_RequestData_Call) RunAndReturn(run func(*model.TimeSeriesListDataSelectorsType, *model.TimeSeriesDataElementsType) (*model.MsgCounterType, error)) *TimeSeriesClientInterface_RequestData_Call { _c.Call.Return(run) return _c } -// RequestDescriptions provides a mock function for the type TimeSeriesClientInterface -func (_mock *TimeSeriesClientInterface) RequestDescriptions(selector *model.TimeSeriesDescriptionListDataSelectorsType, elements *model.TimeSeriesDescriptionDataElementsType) (*model.MsgCounterType, error) { - ret := _mock.Called(selector, elements) +// RequestDescriptions provides a mock function with given fields: selector, elements +func (_m *TimeSeriesClientInterface) RequestDescriptions(selector *model.TimeSeriesDescriptionListDataSelectorsType, elements *model.TimeSeriesDescriptionDataElementsType) (*model.MsgCounterType, error) { + ret := _m.Called(selector, elements) if len(ret) == 0 { panic("no return value specified for RequestDescriptions") @@ -182,21 +148,23 @@ func (_mock *TimeSeriesClientInterface) RequestDescriptions(selector *model.Time var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(*model.TimeSeriesDescriptionListDataSelectorsType, *model.TimeSeriesDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { - return returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.TimeSeriesDescriptionListDataSelectorsType, *model.TimeSeriesDescriptionDataElementsType) (*model.MsgCounterType, error)); ok { + return rf(selector, elements) } - if returnFunc, ok := ret.Get(0).(func(*model.TimeSeriesDescriptionListDataSelectorsType, *model.TimeSeriesDescriptionDataElementsType) *model.MsgCounterType); ok { - r0 = returnFunc(selector, elements) + if rf, ok := ret.Get(0).(func(*model.TimeSeriesDescriptionListDataSelectorsType, *model.TimeSeriesDescriptionDataElementsType) *model.MsgCounterType); ok { + r0 = rf(selector, elements) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(*model.TimeSeriesDescriptionListDataSelectorsType, *model.TimeSeriesDescriptionDataElementsType) error); ok { - r1 = returnFunc(selector, elements) + + if rf, ok := ret.Get(1).(func(*model.TimeSeriesDescriptionListDataSelectorsType, *model.TimeSeriesDescriptionDataElementsType) error); ok { + r1 = rf(selector, elements) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -214,35 +182,24 @@ func (_e *TimeSeriesClientInterface_Expecter) RequestDescriptions(selector inter func (_c *TimeSeriesClientInterface_RequestDescriptions_Call) Run(run func(selector *model.TimeSeriesDescriptionListDataSelectorsType, elements *model.TimeSeriesDescriptionDataElementsType)) *TimeSeriesClientInterface_RequestDescriptions_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 *model.TimeSeriesDescriptionListDataSelectorsType - if args[0] != nil { - arg0 = args[0].(*model.TimeSeriesDescriptionListDataSelectorsType) - } - var arg1 *model.TimeSeriesDescriptionDataElementsType - if args[1] != nil { - arg1 = args[1].(*model.TimeSeriesDescriptionDataElementsType) - } - run( - arg0, - arg1, - ) + run(args[0].(*model.TimeSeriesDescriptionListDataSelectorsType), args[1].(*model.TimeSeriesDescriptionDataElementsType)) }) return _c } -func (_c *TimeSeriesClientInterface_RequestDescriptions_Call) Return(msgCounterType *model.MsgCounterType, err error) *TimeSeriesClientInterface_RequestDescriptions_Call { - _c.Call.Return(msgCounterType, err) +func (_c *TimeSeriesClientInterface_RequestDescriptions_Call) Return(_a0 *model.MsgCounterType, _a1 error) *TimeSeriesClientInterface_RequestDescriptions_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *TimeSeriesClientInterface_RequestDescriptions_Call) RunAndReturn(run func(selector *model.TimeSeriesDescriptionListDataSelectorsType, elements *model.TimeSeriesDescriptionDataElementsType) (*model.MsgCounterType, error)) *TimeSeriesClientInterface_RequestDescriptions_Call { +func (_c *TimeSeriesClientInterface_RequestDescriptions_Call) RunAndReturn(run func(*model.TimeSeriesDescriptionListDataSelectorsType, *model.TimeSeriesDescriptionDataElementsType) (*model.MsgCounterType, error)) *TimeSeriesClientInterface_RequestDescriptions_Call { _c.Call.Return(run) return _c } -// WriteData provides a mock function for the type TimeSeriesClientInterface -func (_mock *TimeSeriesClientInterface) WriteData(data []model.TimeSeriesDataType) (*model.MsgCounterType, error) { - ret := _mock.Called(data) +// WriteData provides a mock function with given fields: data +func (_m *TimeSeriesClientInterface) WriteData(data []model.TimeSeriesDataType) (*model.MsgCounterType, error) { + ret := _m.Called(data) if len(ret) == 0 { panic("no return value specified for WriteData") @@ -250,21 +207,23 @@ func (_mock *TimeSeriesClientInterface) WriteData(data []model.TimeSeriesDataTyp var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func([]model.TimeSeriesDataType) (*model.MsgCounterType, error)); ok { - return returnFunc(data) + if rf, ok := ret.Get(0).(func([]model.TimeSeriesDataType) (*model.MsgCounterType, error)); ok { + return rf(data) } - if returnFunc, ok := ret.Get(0).(func([]model.TimeSeriesDataType) *model.MsgCounterType); ok { - r0 = returnFunc(data) + if rf, ok := ret.Get(0).(func([]model.TimeSeriesDataType) *model.MsgCounterType); ok { + r0 = rf(data) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func([]model.TimeSeriesDataType) error); ok { - r1 = returnFunc(data) + + if rf, ok := ret.Get(1).(func([]model.TimeSeriesDataType) error); ok { + r1 = rf(data) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -281,23 +240,31 @@ func (_e *TimeSeriesClientInterface_Expecter) WriteData(data interface{}) *TimeS func (_c *TimeSeriesClientInterface_WriteData_Call) Run(run func(data []model.TimeSeriesDataType)) *TimeSeriesClientInterface_WriteData_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 []model.TimeSeriesDataType - if args[0] != nil { - arg0 = args[0].([]model.TimeSeriesDataType) - } - run( - arg0, - ) + run(args[0].([]model.TimeSeriesDataType)) }) return _c } -func (_c *TimeSeriesClientInterface_WriteData_Call) Return(msgCounterType *model.MsgCounterType, err error) *TimeSeriesClientInterface_WriteData_Call { - _c.Call.Return(msgCounterType, err) +func (_c *TimeSeriesClientInterface_WriteData_Call) Return(_a0 *model.MsgCounterType, _a1 error) *TimeSeriesClientInterface_WriteData_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *TimeSeriesClientInterface_WriteData_Call) RunAndReturn(run func(data []model.TimeSeriesDataType) (*model.MsgCounterType, error)) *TimeSeriesClientInterface_WriteData_Call { +func (_c *TimeSeriesClientInterface_WriteData_Call) RunAndReturn(run func([]model.TimeSeriesDataType) (*model.MsgCounterType, error)) *TimeSeriesClientInterface_WriteData_Call { _c.Call.Return(run) return _c } + +// NewTimeSeriesClientInterface creates a new instance of TimeSeriesClientInterface. 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 NewTimeSeriesClientInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *TimeSeriesClientInterface { + mock := &TimeSeriesClientInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/TimeSeriesCommonInterface.go b/mocks/TimeSeriesCommonInterface.go index e816686e..11a84d43 100644 --- a/mocks/TimeSeriesCommonInterface.go +++ b/mocks/TimeSeriesCommonInterface.go @@ -1,28 +1,12 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "github.com/enbility/spine-go/model" + model "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" ) -// NewTimeSeriesCommonInterface creates a new instance of TimeSeriesCommonInterface. 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 NewTimeSeriesCommonInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *TimeSeriesCommonInterface { - mock := &TimeSeriesCommonInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} - // TimeSeriesCommonInterface is an autogenerated mock type for the TimeSeriesCommonInterface type type TimeSeriesCommonInterface struct { mock.Mock @@ -36,9 +20,9 @@ func (_m *TimeSeriesCommonInterface) EXPECT() *TimeSeriesCommonInterface_Expecte return &TimeSeriesCommonInterface_Expecter{mock: &_m.Mock} } -// GetConstraints provides a mock function for the type TimeSeriesCommonInterface -func (_mock *TimeSeriesCommonInterface) GetConstraints() ([]model.TimeSeriesConstraintsDataType, error) { - ret := _mock.Called() +// GetConstraints provides a mock function with no fields +func (_m *TimeSeriesCommonInterface) GetConstraints() ([]model.TimeSeriesConstraintsDataType, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetConstraints") @@ -46,21 +30,23 @@ func (_mock *TimeSeriesCommonInterface) GetConstraints() ([]model.TimeSeriesCons var r0 []model.TimeSeriesConstraintsDataType var r1 error - if returnFunc, ok := ret.Get(0).(func() ([]model.TimeSeriesConstraintsDataType, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() ([]model.TimeSeriesConstraintsDataType, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() []model.TimeSeriesConstraintsDataType); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() []model.TimeSeriesConstraintsDataType); ok { + r0 = rf() } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.TimeSeriesConstraintsDataType) } } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -81,8 +67,8 @@ func (_c *TimeSeriesCommonInterface_GetConstraints_Call) Run(run func()) *TimeSe return _c } -func (_c *TimeSeriesCommonInterface_GetConstraints_Call) Return(timeSeriesConstraintsDataTypes []model.TimeSeriesConstraintsDataType, err error) *TimeSeriesCommonInterface_GetConstraints_Call { - _c.Call.Return(timeSeriesConstraintsDataTypes, err) +func (_c *TimeSeriesCommonInterface_GetConstraints_Call) Return(_a0 []model.TimeSeriesConstraintsDataType, _a1 error) *TimeSeriesCommonInterface_GetConstraints_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -91,9 +77,9 @@ func (_c *TimeSeriesCommonInterface_GetConstraints_Call) RunAndReturn(run func() return _c } -// GetDataForFilter provides a mock function for the type TimeSeriesCommonInterface -func (_mock *TimeSeriesCommonInterface) GetDataForFilter(filter model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDataType, error) { - ret := _mock.Called(filter) +// GetDataForFilter provides a mock function with given fields: filter +func (_m *TimeSeriesCommonInterface) GetDataForFilter(filter model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetDataForFilter") @@ -101,21 +87,23 @@ func (_mock *TimeSeriesCommonInterface) GetDataForFilter(filter model.TimeSeries var r0 []model.TimeSeriesDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.TimeSeriesDescriptionDataType) []model.TimeSeriesDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.TimeSeriesDescriptionDataType) []model.TimeSeriesDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.TimeSeriesDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.TimeSeriesDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.TimeSeriesDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -132,30 +120,24 @@ func (_e *TimeSeriesCommonInterface_Expecter) GetDataForFilter(filter interface{ func (_c *TimeSeriesCommonInterface_GetDataForFilter_Call) Run(run func(filter model.TimeSeriesDescriptionDataType)) *TimeSeriesCommonInterface_GetDataForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.TimeSeriesDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.TimeSeriesDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.TimeSeriesDescriptionDataType)) }) return _c } -func (_c *TimeSeriesCommonInterface_GetDataForFilter_Call) Return(timeSeriesDataTypes []model.TimeSeriesDataType, err error) *TimeSeriesCommonInterface_GetDataForFilter_Call { - _c.Call.Return(timeSeriesDataTypes, err) +func (_c *TimeSeriesCommonInterface_GetDataForFilter_Call) Return(_a0 []model.TimeSeriesDataType, _a1 error) *TimeSeriesCommonInterface_GetDataForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *TimeSeriesCommonInterface_GetDataForFilter_Call) RunAndReturn(run func(filter model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDataType, error)) *TimeSeriesCommonInterface_GetDataForFilter_Call { +func (_c *TimeSeriesCommonInterface_GetDataForFilter_Call) RunAndReturn(run func(model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDataType, error)) *TimeSeriesCommonInterface_GetDataForFilter_Call { _c.Call.Return(run) return _c } -// GetDescriptionsForFilter provides a mock function for the type TimeSeriesCommonInterface -func (_mock *TimeSeriesCommonInterface) GetDescriptionsForFilter(filter model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDescriptionDataType, error) { - ret := _mock.Called(filter) +// GetDescriptionsForFilter provides a mock function with given fields: filter +func (_m *TimeSeriesCommonInterface) GetDescriptionsForFilter(filter model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDescriptionDataType, error) { + ret := _m.Called(filter) if len(ret) == 0 { panic("no return value specified for GetDescriptionsForFilter") @@ -163,21 +145,23 @@ func (_mock *TimeSeriesCommonInterface) GetDescriptionsForFilter(filter model.Ti var r0 []model.TimeSeriesDescriptionDataType var r1 error - if returnFunc, ok := ret.Get(0).(func(model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDescriptionDataType, error)); ok { - return returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDescriptionDataType, error)); ok { + return rf(filter) } - if returnFunc, ok := ret.Get(0).(func(model.TimeSeriesDescriptionDataType) []model.TimeSeriesDescriptionDataType); ok { - r0 = returnFunc(filter) + if rf, ok := ret.Get(0).(func(model.TimeSeriesDescriptionDataType) []model.TimeSeriesDescriptionDataType); ok { + r0 = rf(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]model.TimeSeriesDescriptionDataType) } } - if returnFunc, ok := ret.Get(1).(func(model.TimeSeriesDescriptionDataType) error); ok { - r1 = returnFunc(filter) + + if rf, ok := ret.Get(1).(func(model.TimeSeriesDescriptionDataType) error); ok { + r1 = rf(filter) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -194,23 +178,31 @@ func (_e *TimeSeriesCommonInterface_Expecter) GetDescriptionsForFilter(filter in func (_c *TimeSeriesCommonInterface_GetDescriptionsForFilter_Call) Run(run func(filter model.TimeSeriesDescriptionDataType)) *TimeSeriesCommonInterface_GetDescriptionsForFilter_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.TimeSeriesDescriptionDataType - if args[0] != nil { - arg0 = args[0].(model.TimeSeriesDescriptionDataType) - } - run( - arg0, - ) + run(args[0].(model.TimeSeriesDescriptionDataType)) }) return _c } -func (_c *TimeSeriesCommonInterface_GetDescriptionsForFilter_Call) Return(timeSeriesDescriptionDataTypes []model.TimeSeriesDescriptionDataType, err error) *TimeSeriesCommonInterface_GetDescriptionsForFilter_Call { - _c.Call.Return(timeSeriesDescriptionDataTypes, err) +func (_c *TimeSeriesCommonInterface_GetDescriptionsForFilter_Call) Return(_a0 []model.TimeSeriesDescriptionDataType, _a1 error) *TimeSeriesCommonInterface_GetDescriptionsForFilter_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *TimeSeriesCommonInterface_GetDescriptionsForFilter_Call) RunAndReturn(run func(filter model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDescriptionDataType, error)) *TimeSeriesCommonInterface_GetDescriptionsForFilter_Call { +func (_c *TimeSeriesCommonInterface_GetDescriptionsForFilter_Call) RunAndReturn(run func(model.TimeSeriesDescriptionDataType) ([]model.TimeSeriesDescriptionDataType, error)) *TimeSeriesCommonInterface_GetDescriptionsForFilter_Call { _c.Call.Return(run) return _c } + +// NewTimeSeriesCommonInterface creates a new instance of TimeSeriesCommonInterface. 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 NewTimeSeriesCommonInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *TimeSeriesCommonInterface { + mock := &TimeSeriesCommonInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/TimeSeriesServerInterface.go b/mocks/TimeSeriesServerInterface.go index 78248483..13623fff 100644 --- a/mocks/TimeSeriesServerInterface.go +++ b/mocks/TimeSeriesServerInterface.go @@ -1,12 +1,21 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks -import ( - mock "github.com/stretchr/testify/mock" -) +import mock "github.com/stretchr/testify/mock" + +// TimeSeriesServerInterface is an autogenerated mock type for the TimeSeriesServerInterface type +type TimeSeriesServerInterface struct { + mock.Mock +} + +type TimeSeriesServerInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *TimeSeriesServerInterface) EXPECT() *TimeSeriesServerInterface_Expecter { + return &TimeSeriesServerInterface_Expecter{mock: &_m.Mock} +} // NewTimeSeriesServerInterface creates a new instance of TimeSeriesServerInterface. 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. @@ -21,16 +30,3 @@ func NewTimeSeriesServerInterface(t interface { return mock } - -// TimeSeriesServerInterface is an autogenerated mock type for the TimeSeriesServerInterface type -type TimeSeriesServerInterface struct { - mock.Mock -} - -type TimeSeriesServerInterface_Expecter struct { - mock *mock.Mock -} - -func (_m *TimeSeriesServerInterface) EXPECT() *TimeSeriesServerInterface_Expecter { - return &TimeSeriesServerInterface_Expecter{mock: &_m.Mock} -} diff --git a/mocks/UseCaseBaseInterface.go b/mocks/UseCaseBaseInterface.go index e454ded4..bc669948 100644 --- a/mocks/UseCaseBaseInterface.go +++ b/mocks/UseCaseBaseInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api0 "github.com/enbility/eebus-go/api" - "github.com/enbility/spine-go/api" + api "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) - -// NewUseCaseBaseInterface creates a new instance of UseCaseBaseInterface. 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 NewUseCaseBaseInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *UseCaseBaseInterface { - mock := &UseCaseBaseInterface{} - mock.Mock.Test(t) - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // UseCaseBaseInterface is an autogenerated mock type for the UseCaseBaseInterface type type UseCaseBaseInterface struct { @@ -37,10 +22,9 @@ func (_m *UseCaseBaseInterface) EXPECT() *UseCaseBaseInterface_Expecter { return &UseCaseBaseInterface_Expecter{mock: &_m.Mock} } -// AddUseCase provides a mock function for the type UseCaseBaseInterface -func (_mock *UseCaseBaseInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *UseCaseBaseInterface) AddUseCase() { + _m.Called() } // UseCaseBaseInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -70,22 +54,23 @@ func (_c *UseCaseBaseInterface_AddUseCase_Call) RunAndReturn(run func()) *UseCas return _c } -// AvailableScenariosForEntity provides a mock function for the type UseCaseBaseInterface -func (_mock *UseCaseBaseInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *UseCaseBaseInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -95,48 +80,43 @@ type UseCaseBaseInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *UseCaseBaseInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *UseCaseBaseInterface_AvailableScenariosForEntity_Call { return &UseCaseBaseInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *UseCaseBaseInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *UseCaseBaseInterface_AvailableScenariosForEntity_Call { +func (_c *UseCaseBaseInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *UseCaseBaseInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *UseCaseBaseInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *UseCaseBaseInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *UseCaseBaseInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *UseCaseBaseInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *UseCaseBaseInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *UseCaseBaseInterface_AvailableScenariosForEntity_Call { +func (_c *UseCaseBaseInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *UseCaseBaseInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type UseCaseBaseInterface -func (_mock *UseCaseBaseInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *UseCaseBaseInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -146,48 +126,43 @@ type UseCaseBaseInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *UseCaseBaseInterface_Expecter) IsCompatibleEntityType(entity interface{}) *UseCaseBaseInterface_IsCompatibleEntityType_Call { return &UseCaseBaseInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *UseCaseBaseInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *UseCaseBaseInterface_IsCompatibleEntityType_Call { +func (_c *UseCaseBaseInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *UseCaseBaseInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *UseCaseBaseInterface_IsCompatibleEntityType_Call) Return(b bool) *UseCaseBaseInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *UseCaseBaseInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *UseCaseBaseInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *UseCaseBaseInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *UseCaseBaseInterface_IsCompatibleEntityType_Call { +func (_c *UseCaseBaseInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *UseCaseBaseInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type UseCaseBaseInterface -func (_mock *UseCaseBaseInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *UseCaseBaseInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -197,56 +172,46 @@ type UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *UseCaseBaseInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call { return &UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call { +func (_c *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call { +func (_c *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *UseCaseBaseInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type UseCaseBaseInterface -func (_mock *UseCaseBaseInterface) RemoteEntitiesScenarios() []api0.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *UseCaseBaseInterface) RemoteEntitiesScenarios() []api.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api0.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api0.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []api.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []api.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.RemoteEntityScenarios) + r0 = ret.Get(0).([]api.RemoteEntityScenarios) } } + return r0 } @@ -267,20 +232,19 @@ func (_c *UseCaseBaseInterface_RemoteEntitiesScenarios_Call) Run(run func()) *Us return _c } -func (_c *UseCaseBaseInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api0.RemoteEntityScenarios) *UseCaseBaseInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *UseCaseBaseInterface_RemoteEntitiesScenarios_Call) Return(_a0 []api.RemoteEntityScenarios) *UseCaseBaseInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *UseCaseBaseInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api0.RemoteEntityScenarios) *UseCaseBaseInterface_RemoteEntitiesScenarios_Call { +func (_c *UseCaseBaseInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api.RemoteEntityScenarios) *UseCaseBaseInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type UseCaseBaseInterface -func (_mock *UseCaseBaseInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *UseCaseBaseInterface) RemoveUseCase() { + _m.Called() } // UseCaseBaseInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -310,10 +274,9 @@ func (_c *UseCaseBaseInterface_RemoveUseCase_Call) RunAndReturn(run func()) *Use return _c } -// UpdateUseCaseAvailability provides a mock function for the type UseCaseBaseInterface -func (_mock *UseCaseBaseInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *UseCaseBaseInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // UseCaseBaseInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -329,13 +292,7 @@ func (_e *UseCaseBaseInterface_Expecter) UpdateUseCaseAvailability(available int func (_c *UseCaseBaseInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *UseCaseBaseInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -345,7 +302,21 @@ func (_c *UseCaseBaseInterface_UpdateUseCaseAvailability_Call) Return() *UseCase return _c } -func (_c *UseCaseBaseInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *UseCaseBaseInterface_UpdateUseCaseAvailability_Call { +func (_c *UseCaseBaseInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *UseCaseBaseInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } + +// NewUseCaseBaseInterface creates a new instance of UseCaseBaseInterface. 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 NewUseCaseBaseInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *UseCaseBaseInterface { + mock := &UseCaseBaseInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/UseCaseInterface.go b/mocks/UseCaseInterface.go index 31081cf3..3f52ca9f 100644 --- a/mocks/UseCaseInterface.go +++ b/mocks/UseCaseInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api0 "github.com/enbility/eebus-go/api" - "github.com/enbility/spine-go/api" + api "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) -// NewUseCaseInterface creates a new instance of UseCaseInterface. 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 NewUseCaseInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *UseCaseInterface { - mock := &UseCaseInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // UseCaseInterface is an autogenerated mock type for the UseCaseInterface type type UseCaseInterface struct { @@ -37,10 +22,22 @@ func (_m *UseCaseInterface) EXPECT() *UseCaseInterface_Expecter { return &UseCaseInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type UseCaseInterface -func (_mock *UseCaseInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *UseCaseInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // UseCaseInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -60,20 +57,19 @@ func (_c *UseCaseInterface_AddFeatures_Call) Run(run func()) *UseCaseInterface_A return _c } -func (_c *UseCaseInterface_AddFeatures_Call) Return() *UseCaseInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *UseCaseInterface_AddFeatures_Call) Return(_a0 error) *UseCaseInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *UseCaseInterface_AddFeatures_Call) RunAndReturn(run func()) *UseCaseInterface_AddFeatures_Call { - _c.Run(run) +func (_c *UseCaseInterface_AddFeatures_Call) RunAndReturn(run func() error) *UseCaseInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type UseCaseInterface -func (_mock *UseCaseInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *UseCaseInterface) AddUseCase() { + _m.Called() } // UseCaseInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -103,22 +99,23 @@ func (_c *UseCaseInterface_AddUseCase_Call) RunAndReturn(run func()) *UseCaseInt return _c } -// AvailableScenariosForEntity provides a mock function for the type UseCaseInterface -func (_mock *UseCaseInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *UseCaseInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -128,48 +125,43 @@ type UseCaseInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *UseCaseInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *UseCaseInterface_AvailableScenariosForEntity_Call { return &UseCaseInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *UseCaseInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *UseCaseInterface_AvailableScenariosForEntity_Call { +func (_c *UseCaseInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *UseCaseInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *UseCaseInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *UseCaseInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *UseCaseInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *UseCaseInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *UseCaseInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *UseCaseInterface_AvailableScenariosForEntity_Call { +func (_c *UseCaseInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *UseCaseInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type UseCaseInterface -func (_mock *UseCaseInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *UseCaseInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -179,48 +171,43 @@ type UseCaseInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *UseCaseInterface_Expecter) IsCompatibleEntityType(entity interface{}) *UseCaseInterface_IsCompatibleEntityType_Call { return &UseCaseInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *UseCaseInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *UseCaseInterface_IsCompatibleEntityType_Call { +func (_c *UseCaseInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *UseCaseInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *UseCaseInterface_IsCompatibleEntityType_Call) Return(b bool) *UseCaseInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *UseCaseInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *UseCaseInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *UseCaseInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *UseCaseInterface_IsCompatibleEntityType_Call { +func (_c *UseCaseInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *UseCaseInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type UseCaseInterface -func (_mock *UseCaseInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *UseCaseInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -230,56 +217,46 @@ type UseCaseInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *UseCaseInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *UseCaseInterface_IsScenarioAvailableAtEntity_Call { return &UseCaseInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *UseCaseInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *UseCaseInterface_IsScenarioAvailableAtEntity_Call { +func (_c *UseCaseInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *UseCaseInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *UseCaseInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *UseCaseInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *UseCaseInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *UseCaseInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *UseCaseInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *UseCaseInterface_IsScenarioAvailableAtEntity_Call { +func (_c *UseCaseInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *UseCaseInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type UseCaseInterface -func (_mock *UseCaseInterface) RemoteEntitiesScenarios() []api0.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *UseCaseInterface) RemoteEntitiesScenarios() []api.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api0.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api0.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []api.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []api.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.RemoteEntityScenarios) + r0 = ret.Get(0).([]api.RemoteEntityScenarios) } } + return r0 } @@ -300,20 +277,19 @@ func (_c *UseCaseInterface_RemoteEntitiesScenarios_Call) Run(run func()) *UseCas return _c } -func (_c *UseCaseInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api0.RemoteEntityScenarios) *UseCaseInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *UseCaseInterface_RemoteEntitiesScenarios_Call) Return(_a0 []api.RemoteEntityScenarios) *UseCaseInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *UseCaseInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api0.RemoteEntityScenarios) *UseCaseInterface_RemoteEntitiesScenarios_Call { +func (_c *UseCaseInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api.RemoteEntityScenarios) *UseCaseInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type UseCaseInterface -func (_mock *UseCaseInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *UseCaseInterface) RemoveUseCase() { + _m.Called() } // UseCaseInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -343,10 +319,9 @@ func (_c *UseCaseInterface_RemoveUseCase_Call) RunAndReturn(run func()) *UseCase return _c } -// UpdateUseCaseAvailability provides a mock function for the type UseCaseInterface -func (_mock *UseCaseInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *UseCaseInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // UseCaseInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -362,13 +337,7 @@ func (_e *UseCaseInterface_Expecter) UpdateUseCaseAvailability(available interfa func (_c *UseCaseInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *UseCaseInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -378,7 +347,21 @@ func (_c *UseCaseInterface_UpdateUseCaseAvailability_Call) Return() *UseCaseInte return _c } -func (_c *UseCaseInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *UseCaseInterface_UpdateUseCaseAvailability_Call { +func (_c *UseCaseInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *UseCaseInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } + +// NewUseCaseInterface creates a new instance of UseCaseInterface. 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 NewUseCaseInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *UseCaseInterface { + mock := &UseCaseInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/service/service.go b/service/service.go index 070a9d3b..349b9263 100644 --- a/service/service.go +++ b/service/service.go @@ -193,11 +193,22 @@ func (s *Service) IsRunning() bool { } // add a use case to the service -func (s *Service) AddUseCase(useCase api.UseCaseInterface) { +// +// returns an error when adding features to the entity fails +// +// errors should not occur during normal usage of eebus-go, and should +// generally be considered fatal implementation errors +// +// see usecase.AddFeatures() for more information +func (s *Service) AddUseCase(useCase api.UseCaseInterface) error { s.usecases = append(s.usecases, useCase) - useCase.AddFeatures() + if err := useCase.AddFeatures(); err != nil { + return err + } useCase.AddUseCase() + + return nil } func (s *Service) Configuration() *api.Configuration { diff --git a/service/service_test.go b/service/service_test.go index 2b661599..1b38cfb4 100644 --- a/service/service_test.go +++ b/service/service_test.go @@ -63,12 +63,20 @@ func (s *ServiceSuite) BeforeTest(suiteName, testName string) { func (s *ServiceSuite) Test_AddUseCase() { ucMock := mocks.NewUseCaseInterface(s.T()) - ucMock.EXPECT().AddFeatures().Return().Once() + ucMock.EXPECT().AddFeatures().Return(nil).Once() ucMock.EXPECT().AddUseCase().Return().Once() s.sut.AddUseCase(ucMock) } +func (s *ServiceSuite) Test_AddUseCase_Error() { + ucMock := mocks.NewUseCaseInterface(s.T()) + ucMock.EXPECT().AddFeatures().Return(assert.AnError).Once() + + err := s.sut.AddUseCase(ucMock) + assert.Equal(s.T(), assert.AnError, err) +} + func (s *ServiceSuite) Test_EEBUSHandler() { testSki := "test" diff --git a/usecases/README.md b/usecases/README.md index 47a977b1..88166c85 100644 --- a/usecases/README.md +++ b/usecases/README.md @@ -34,3 +34,8 @@ Actors: Use Cases: - `mpc`: Monitoring of Power Consumption - `mgcp`: Monitoring of Grid Connection Point + +- `mu`: Monitored Unit + + Use Cases: + - `mpc`: Monitoring of Power Consumption diff --git a/usecases/api/api.go b/usecases/api/api.go index 898b38b1..4bbeb772 100644 --- a/usecases/api/api.go +++ b/usecases/api/api.go @@ -1,7 +1,34 @@ package api -import "github.com/enbility/spine-go/model" +import ( + "github.com/enbility/eebus-go/api" + "github.com/enbility/spine-go/model" +) //go:generate mockery var PhaseNameMapping = []model.ElectricalConnectionPhaseNameType{model.ElectricalConnectionPhaseNameTypeA, model.ElectricalConnectionPhaseNameTypeB, model.ElectricalConnectionPhaseNameTypeC} + +// used to enable batch data updates for certain usecases +// +// a usecase that wants to provide batch update capabilities using this interface should +// +// 1. provide methods that return a type implementing this interface +// 2. provide an Update method that accepts a list of this interface +// +// The Update method can then iterate over the provided UpdateData, ensure all +// data points are supported, and then create a batched spine update request +type UpdateData interface { + Supported() bool + NotSupportedError() error +} + +// used to enable batch data updates for MeaserumentData +// +// usecases can use this interface to provide batch update capabilities by +// implementing a method that takes a list of this interface and passes a list +// of MeasurementData to Measurement.UpdateDataForIds +type UpdateMeasurementData interface { + UpdateData + MeasurementData() api.MeasurementDataForID +} diff --git a/usecases/api/mu_mpc.go b/usecases/api/mu_mpc.go new file mode 100644 index 00000000..26baa548 --- /dev/null +++ b/usecases/api/mu_mpc.go @@ -0,0 +1,201 @@ +package api + +import ( + "time" + + "github.com/enbility/eebus-go/api" + "github.com/enbility/spine-go/model" +) + +// Actor: Monitoring Unit +// UseCase: Monitoring of Power Consumption +type MuMPCInterface interface { + api.UseCaseInterface + // ------------------------- Getters ------------------------- // + + // Scenario 1 + + // get the momentary active power consumption or production + // + // possible errors: + // - ErrMissingData if the id is not available + // - and others + Power() (float64, error) + + // get the momentary active power consumption or production per phase + // + // possible errors: + // - ErrMissingData if the id is not available + // - and others + PowerPerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error) + + // Scenario 2 + + // get the total feed in energy + // + // - negative values are used for production + // + // possible errors: + // - ErrMissingData if the id is not available + // - and others + EnergyProduced() (float64, error) + + // get the total feed in energy + // + // - negative values are used for production + // + // possible errors: + // - ErrMissingData if the id is not available + // - and others + EnergyConsumed() (float64, error) + + // Scenario 3 + + // get the momentary phase specific current consumption or production + // + // - positive values are used for consumption + // - negative values are used for production + // + // possible errors: + // - ErrMissingData if the id is not available + // - and others + CurrentPerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error) + + // Scenario 4 + + // get the phase specific voltage details + // + // possible errors: + // - ErrMissingData if the id is not available + // - and others + VoltagePerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error) + + // Scenario 5 + + // get frequency + // + // possible errors: + // - ErrMissingData if the id is not available + // - and others + Frequency() (float64, error) + + // ------------------------- Setters ------------------------- // + + // use Update to update the measurement data + // use it like this: + // + // mpc.Update( + // mpc.UpdateDataPowerTotal(1000, nil, nil), + // mpc.UpdateDataPowerPhaseA(500, nil, nil), + // ... + // ) + // + // possible errors: + // - ErrMissingData if the id is not available + // - and others + Update(data ...UpdateMeasurementData) error + + // Scenario 1 + + // use UpdateDataPowerTotal in Update to set the momentary active power consumption or production + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataPowerTotal(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // use UpdateDataPowerPhaseA in Update to set the momentary active power consumption or production per phase + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataPowerPhaseA(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // use UpdateDataPowerPhaseB in Update to set the momentary active power consumption or production per phase + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataPowerPhaseB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // use UpdateDataPowerPhaseC in Update to set the momentary active power consumption or production per phase + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataPowerPhaseC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // Scenario 2 + + // use UpdateDataEnergyConsumed in Update to set the total feed in energy + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + // The evaluationStart and End are optional and can be nil (both must be set to be used) + UpdateDataEnergyConsumed( + value float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, + evaluationStart *time.Time, + evaluationEnd *time.Time, + ) UpdateMeasurementData + + // use UpdateDataEnergyProduced in Update to set the total feed in energy + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + // The evaluationStart and End are optional and can be nil (both must be set to be used) + UpdateDataEnergyProduced( + value float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, + evaluationStart *time.Time, + evaluationEnd *time.Time, + ) UpdateMeasurementData + + // Scenario 3 + + // use UpdateDataCurrentPhaseA in Update to set the momentary phase specific current consumption or production + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataCurrentPhaseA(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // use UpdateDataCurrentPhaseB in Update to set the momentary phase specific current consumption or production + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataCurrentPhaseB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // use UpdateDataCurrentPhaseC in Update to set the momentary phase specific current consumption or production + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataCurrentPhaseC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // Scenario 4 + + // use UpdateDataVoltagePhaseA in Update to set the phase specific voltage details + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataVoltagePhaseA(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // use UpdateDataVoltagePhaseB in Update to set the phase specific voltage details + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataVoltagePhaseB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // use UpdateDataVoltagePhaseC in Update to set the phase specific voltage details + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataVoltagePhaseC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // use UpdateDataVoltagePhaseAToB in Update to set the phase specific voltage details + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataVoltagePhaseAToB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // use UpdateDataVoltagePhaseBToC in Update to set the phase specific voltage details + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataVoltagePhaseBToC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // use UpdateDataVoltagePhaseAToC in Update to set the phase specific voltage details + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataVoltagePhaseAToC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData + + // Scenario 5 + + // use AcFrequency in Update to set the frequency + // The timestamp is optional and can be nil + // The valueState shall be set if it differs from the normal valueState otherwise it can be nil + UpdateDataFrequency(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) UpdateMeasurementData +} diff --git a/usecases/cem/cevc/testhelper_test.go b/usecases/cem/cevc/testhelper_test.go index a6c17238..9f0524e5 100644 --- a/usecases/cem/cevc/testhelper_test.go +++ b/usecases/cem/cevc/testhelper_test.go @@ -75,7 +75,7 @@ func (s *CemCEVCSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewCEVC(localEntity, s.Event) - s.sut.AddFeatures() + _ = s.sut.AddFeatures() s.sut.AddUseCase() var entities []spineapi.EntityRemoteInterface diff --git a/usecases/cem/cevc/usecase.go b/usecases/cem/cevc/usecase.go index 56c61c81..016339ea 100644 --- a/usecases/cem/cevc/usecase.go +++ b/usecases/cem/cevc/usecase.go @@ -1,6 +1,7 @@ package cevc import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" "github.com/enbility/eebus-go/usecases/usecase" @@ -70,6 +71,7 @@ func NewCEVC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventC UseCaseSupportUpdate, validActorTypes, validEntityTypes, + false, ) uc := &CEVC{ @@ -81,7 +83,7 @@ func NewCEVC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventC return uc } -func (e *CEVC) AddFeatures() { +func (e *CEVC) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeDeviceConfiguration, @@ -90,11 +92,15 @@ func (e *CEVC) AddFeatures() { model.FeatureTypeTypeElectricalConnection, } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("failed to add feature: " + string(feature)) + } } // server features f := e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) f.AddFunctionType(model.FunctionTypeDeviceDiagnosisStateData, true, false) f.AddFunctionType(model.FunctionTypeDeviceDiagnosisHeartbeatData, true, false) + + return nil } diff --git a/usecases/cem/evcc/usecase.go b/usecases/cem/evcc/usecase.go index 1612522f..c3847bb3 100644 --- a/usecases/cem/evcc/usecase.go +++ b/usecases/cem/evcc/usecase.go @@ -1,6 +1,7 @@ package evcc import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" "github.com/enbility/eebus-go/usecases/usecase" @@ -83,6 +84,7 @@ func NewEVCC( UseCaseSupportUpdate, validActorTypes, validEntityTypes, + false, ) uc := &EVCC{ @@ -95,7 +97,7 @@ func NewEVCC( return uc } -func (e *EVCC) AddFeatures() { +func (e *EVCC) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeDeviceConfiguration, @@ -106,6 +108,11 @@ func (e *EVCC) AddFeatures() { } for _, feature := range clientFeatures { f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f == nil { + return errors.New("could not add feature: " + string(feature)) + } f.AddResultCallback(e.HandleResponse) } + + return nil } diff --git a/usecases/cem/evcem/testhelper_test.go b/usecases/cem/evcem/testhelper_test.go index 85da2303..54c74be5 100644 --- a/usecases/cem/evcem/testhelper_test.go +++ b/usecases/cem/evcem/testhelper_test.go @@ -70,7 +70,7 @@ func (s *CemEVCEMSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewEVCEM(s.service, localEntity, s.Event) - s.sut.AddFeatures() + _ = s.sut.AddFeatures() s.sut.AddUseCase() var entities []spineapi.EntityRemoteInterface diff --git a/usecases/cem/evcem/usecase.go b/usecases/cem/evcem/usecase.go index 42491c4a..b0242741 100644 --- a/usecases/cem/evcem/usecase.go +++ b/usecases/cem/evcem/usecase.go @@ -1,6 +1,7 @@ package evcem import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" usecase "github.com/enbility/eebus-go/usecases/usecase" @@ -69,7 +70,9 @@ func NewEVCEM( eventCB, UseCaseSupportUpdate, validActorTypes, - validEntityTypes) + validEntityTypes, + false, + ) uc := &EVCEM{ UseCaseBase: usecase, @@ -81,13 +84,17 @@ func NewEVCEM( return uc } -func (e *EVCEM) AddFeatures() { +func (e *EVCEM) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeElectricalConnection, model.FeatureTypeTypeMeasurement, } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("failed to add feature: " + string(feature)) + } } + + return nil } diff --git a/usecases/cem/evsecc/testhelper_test.go b/usecases/cem/evsecc/testhelper_test.go index d8738822..2e6da7d4 100644 --- a/usecases/cem/evsecc/testhelper_test.go +++ b/usecases/cem/evsecc/testhelper_test.go @@ -73,7 +73,7 @@ func (s *CemEVSECCSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewEVSECC(localEntity, s.Event) - s.sut.AddFeatures() + _ = s.sut.AddFeatures() s.sut.AddUseCase() var entities []spineapi.EntityRemoteInterface diff --git a/usecases/cem/evsecc/usecase.go b/usecases/cem/evsecc/usecase.go index d96ee92b..786e70a5 100644 --- a/usecases/cem/evsecc/usecase.go +++ b/usecases/cem/evsecc/usecase.go @@ -1,6 +1,7 @@ package evsecc import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" "github.com/enbility/eebus-go/usecases/usecase" @@ -51,7 +52,9 @@ func NewEVSECC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEven eventCB, UseCaseSupportUpdate, validActorTypes, - validEntityTypes) + validEntityTypes, + false, + ) uc := &EVSECC{ UseCaseBase: usecase, @@ -62,7 +65,7 @@ func NewEVSECC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEven return uc } -func (e *EVSECC) AddFeatures() { +func (e *EVSECC) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeDeviceClassification, @@ -70,6 +73,10 @@ func (e *EVSECC) AddFeatures() { } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("could not add feature: " + string(feature)) + } } + + return nil } diff --git a/usecases/cem/evsoc/testhelper_test.go b/usecases/cem/evsoc/testhelper_test.go index 1cea9b00..1c13aaf6 100644 --- a/usecases/cem/evsoc/testhelper_test.go +++ b/usecases/cem/evsoc/testhelper_test.go @@ -73,7 +73,7 @@ func (s *CemEVSOCSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewEVSOC(localEntity, s.Event) - s.sut.AddFeatures() + _ = s.sut.AddFeatures() s.sut.AddUseCase() var entities []spineapi.EntityRemoteInterface diff --git a/usecases/cem/evsoc/usecase.go b/usecases/cem/evsoc/usecase.go index 32df9b0c..3136661e 100644 --- a/usecases/cem/evsoc/usecase.go +++ b/usecases/cem/evsoc/usecase.go @@ -1,6 +1,7 @@ package evsoc import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" usecase "github.com/enbility/eebus-go/usecases/usecase" @@ -47,6 +48,7 @@ func NewEVSOC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEvent UseCaseSupportUpdate, validActorTypes, validEntityTypes, + false, ) uc := &EVSOC{ @@ -58,15 +60,19 @@ func NewEVSOC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEvent return uc } -func (e *EVSOC) AddFeatures() { +func (e *EVSOC) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeElectricalConnection, model.FeatureTypeTypeMeasurement, } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("could not add feature: " + string(feature)) + } } + + return nil } func (e *EVSOC) UpdateUseCaseAvailability(available bool) { diff --git a/usecases/cem/opev/testhelper_test.go b/usecases/cem/opev/testhelper_test.go index 55308a53..1722ffb2 100644 --- a/usecases/cem/opev/testhelper_test.go +++ b/usecases/cem/opev/testhelper_test.go @@ -73,7 +73,7 @@ func (s *CemOPEVSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewOPEV(localEntity, s.Event) - s.sut.AddFeatures() + _ = s.sut.AddFeatures() s.sut.AddUseCase() var clientFeatures = []model.FeatureTypeType{ diff --git a/usecases/cem/opev/usecase.go b/usecases/cem/opev/usecase.go index 40937b25..ac9f8654 100644 --- a/usecases/cem/opev/usecase.go +++ b/usecases/cem/opev/usecase.go @@ -1,6 +1,7 @@ package opev import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" "github.com/enbility/eebus-go/usecases/usecase" @@ -58,6 +59,7 @@ func NewOPEV(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventC UseCaseSupportUpdate, validActorTypes, validEntityTypes, + false, ) uc := &OPEV{ @@ -69,18 +71,25 @@ func NewOPEV(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventC return uc } -func (e *OPEV) AddFeatures() { +func (e *OPEV) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeLoadControl, model.FeatureTypeTypeElectricalConnection, } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("could not add feature: " + string(feature)) + } } // server features f := e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) + if f == nil { + return errors.New("could not add feature: " + string(model.FeatureTypeTypeDeviceDiagnosis)) + } f.AddFunctionType(model.FunctionTypeDeviceDiagnosisStateData, true, false) f.AddFunctionType(model.FunctionTypeDeviceDiagnosisHeartbeatData, true, false) + + return nil } diff --git a/usecases/cem/oscev/testhelper_test.go b/usecases/cem/oscev/testhelper_test.go index 741ffb91..1dc73af7 100644 --- a/usecases/cem/oscev/testhelper_test.go +++ b/usecases/cem/oscev/testhelper_test.go @@ -72,7 +72,7 @@ func (s *CemOSCEVSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewOSCEV(localEntity, s.Event) - s.sut.AddFeatures() + _ = s.sut.AddFeatures() s.sut.AddUseCase() var clientFeatures = []model.FeatureTypeType{ diff --git a/usecases/cem/oscev/usecase.go b/usecases/cem/oscev/usecase.go index 75fc3e2a..98e1b2ba 100644 --- a/usecases/cem/oscev/usecase.go +++ b/usecases/cem/oscev/usecase.go @@ -1,6 +1,7 @@ package oscev import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" "github.com/enbility/eebus-go/usecases/usecase" @@ -58,6 +59,7 @@ func NewOSCEV(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEvent UseCaseSupportUpdate, validActorTypes, validEntityTypes, + false, ) uc := &OSCEV{ @@ -69,18 +71,26 @@ func NewOSCEV(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEvent return uc } -func (e *OSCEV) AddFeatures() { +func (e *OSCEV) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeLoadControl, model.FeatureTypeTypeElectricalConnection, } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("could not add feature: " + string(feature)) + } } // server features f := e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) + if f == nil { + return errors.New("could not add feature: " + string(model.FeatureTypeTypeDeviceDiagnosis)) + } + f.AddFunctionType(model.FunctionTypeDeviceDiagnosisStateData, true, false) f.AddFunctionType(model.FunctionTypeDeviceDiagnosisHeartbeatData, true, false) + + return nil } diff --git a/usecases/cem/vabd/testhelper_test.go b/usecases/cem/vabd/testhelper_test.go index 056a8713..4e8e133c 100644 --- a/usecases/cem/vabd/testhelper_test.go +++ b/usecases/cem/vabd/testhelper_test.go @@ -73,7 +73,7 @@ func (s *CemVABDSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewVABD(localEntity, s.Event) - s.sut.AddFeatures() + _ = s.sut.AddFeatures() s.sut.AddUseCase() s.remoteDevice, s.batteryEntity = setupDevices(s.service, s.T()) diff --git a/usecases/cem/vabd/usecase.go b/usecases/cem/vabd/usecase.go index c28ed5d3..46a04c34 100644 --- a/usecases/cem/vabd/usecase.go +++ b/usecases/cem/vabd/usecase.go @@ -1,6 +1,7 @@ package vabd import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" "github.com/enbility/eebus-go/usecases/usecase" @@ -72,6 +73,7 @@ func NewVABD(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventC UseCaseSupportUpdate, validActorTypes, validEntityTypes, + false, ) uc := &VABD{ @@ -83,7 +85,7 @@ func NewVABD(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventC return uc } -func (e *VABD) AddFeatures() { +func (e *VABD) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeDeviceConfiguration, @@ -91,6 +93,10 @@ func (e *VABD) AddFeatures() { model.FeatureTypeTypeMeasurement, } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("could not add feature: " + string(feature)) + } } + + return nil } diff --git a/usecases/cem/vapd/testhelper_test.go b/usecases/cem/vapd/testhelper_test.go index 21ae36cd..ae21c6d8 100644 --- a/usecases/cem/vapd/testhelper_test.go +++ b/usecases/cem/vapd/testhelper_test.go @@ -73,7 +73,7 @@ func (s *CemVAPDSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewVAPD(localEntity, s.Event) - s.sut.AddFeatures() + _ = s.sut.AddFeatures() s.sut.AddUseCase() s.remoteDevice, s.pvEntity = setupDevices(s.service, s.T()) diff --git a/usecases/cem/vapd/usecase.go b/usecases/cem/vapd/usecase.go index 50578d1b..48a3c19a 100644 --- a/usecases/cem/vapd/usecase.go +++ b/usecases/cem/vapd/usecase.go @@ -1,6 +1,7 @@ package vapd import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" "github.com/enbility/eebus-go/usecases/usecase" @@ -63,6 +64,7 @@ func NewVAPD(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventC UseCaseSupportUpdate, validActorTypes, validEntityTypes, + false, ) uc := &VAPD{ @@ -74,7 +76,7 @@ func NewVAPD(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventC return uc } -func (e *VAPD) AddFeatures() { +func (e *VAPD) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeDeviceConfiguration, @@ -82,6 +84,10 @@ func (e *VAPD) AddFeatures() { model.FeatureTypeTypeMeasurement, } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("could not add feature: " + string(feature)) + } } + + return nil } diff --git a/usecases/cs/lpc/testhelper_test.go b/usecases/cs/lpc/testhelper_test.go index 839828b6..737804ee 100644 --- a/usecases/cs/lpc/testhelper_test.go +++ b/usecases/cs/lpc/testhelper_test.go @@ -16,6 +16,7 @@ import ( "github.com/enbility/spine-go/model" "github.com/enbility/spine-go/spine" "github.com/enbility/spine-go/util" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" ) @@ -76,7 +77,7 @@ func (s *CsLPCSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewLPC(localEntity, s.Event) - s.sut.AddFeatures() + assert.Nil(s.T(), s.sut.AddFeatures()) s.sut.AddUseCase() s.loadControlFeature = localEntity.FeatureOfTypeAndRole(model.FeatureTypeTypeLoadControl, model.RoleTypeServer) diff --git a/usecases/cs/lpc/usecase.go b/usecases/cs/lpc/usecase.go index 5b6d3608..2d40e2db 100644 --- a/usecases/cs/lpc/usecase.go +++ b/usecases/cs/lpc/usecase.go @@ -1,6 +1,7 @@ package lpc import ( + "errors" "sync" "github.com/enbility/eebus-go/api" @@ -71,6 +72,7 @@ func NewLPC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCa UseCaseSupportUpdate, validActorTypes, validEntityTypes, + false, ) uc := &LPC{ @@ -172,15 +174,23 @@ func (e *LPC) loadControlWriteCB(msg *spineapi.Message) { go e.approveOrDenyConsumptionLimit(msg, true, "") } -func (e *LPC) AddFeatures() { +func (e *LPC) AddFeatures() error { // client features - _ = e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeClient); f == nil { + return errors.New("feature not found: DeviceDiagnosis") + } // server features f := e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeLoadControl, model.RoleTypeServer) + if f == nil { + return errors.New("feature not found: LoadControl") + } + f.AddFunctionType(model.FunctionTypeLoadControlLimitDescriptionListData, true, false) f.AddFunctionType(model.FunctionTypeLoadControlLimitListData, true, true) - _ = f.AddWriteApprovalCallback(e.loadControlWriteCB) + if err := f.AddWriteApprovalCallback(e.loadControlWriteCB); err != nil { + return err + } newLimitDesc := model.LoadControlLimitDescriptionDataType{ LimitType: util.Ptr(model.LoadControlLimitTypeTypeSignDependentAbsValueLimit), @@ -190,75 +200,88 @@ func (e *LPC) AddFeatures() { Unit: util.Ptr(model.UnitOfMeasurementTypeW), ScopeType: util.Ptr(model.ScopeTypeTypeActivePowerLimit), } - if lc, err := server.NewLoadControl(e.LocalEntity); err == nil { - limitId := lc.AddLimitDescription(newLimitDesc) - - newLimiData := []api.LoadControlLimitDataForID{ - { - Data: model.LoadControlLimitDataType{ - Value: model.NewScaledNumberType(0), - IsLimitChangeable: util.Ptr(true), - IsLimitActive: util.Ptr(false), - }, - Id: *limitId, + + lc, err := server.NewLoadControl(e.LocalEntity) + if err != nil { + return err + } + + limitId := lc.AddLimitDescription(newLimitDesc) + + newLimiData := []api.LoadControlLimitDataForID{ + { + Data: model.LoadControlLimitDataType{ + Value: model.NewScaledNumberType(0), + IsLimitChangeable: util.Ptr(true), + IsLimitActive: util.Ptr(false), }, - } - _ = lc.UpdateLimitDataForIds(newLimiData) + Id: *limitId, + }, + } + if err := lc.UpdateLimitDataForIds(newLimiData); err != nil { + return err } f = e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceConfiguration, model.RoleTypeServer) f.AddFunctionType(model.FunctionTypeDeviceConfigurationKeyValueDescriptionListData, true, false) f.AddFunctionType(model.FunctionTypeDeviceConfigurationKeyValueListData, true, true) - if dcs, err := server.NewDeviceConfiguration(e.LocalEntity); err == nil { - dcs.AddKeyValueDescription( - model.DeviceConfigurationKeyValueDescriptionDataType{ - KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeConsumptionActivePowerLimit), - ValueType: util.Ptr(model.DeviceConfigurationKeyValueTypeTypeScaledNumber), - Unit: util.Ptr(model.UnitOfMeasurementTypeW), - }, - ) + dcs, err := server.NewDeviceConfiguration(e.LocalEntity) + if err != nil { + return err + } - // only add if it doesn't exist yet - filter := model.DeviceConfigurationKeyValueDescriptionDataType{ - KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), - } - if data, err := dcs.GetKeyValueDescriptionsForFilter(filter); err == nil && len(data) == 0 { - dcs.AddKeyValueDescription( - model.DeviceConfigurationKeyValueDescriptionDataType{ - KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), - ValueType: util.Ptr(model.DeviceConfigurationKeyValueTypeTypeDuration), - }, - ) - } + dcs.AddKeyValueDescription( + model.DeviceConfigurationKeyValueDescriptionDataType{ + KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeConsumptionActivePowerLimit), + ValueType: util.Ptr(model.DeviceConfigurationKeyValueTypeTypeScaledNumber), + Unit: util.Ptr(model.UnitOfMeasurementTypeW), + }, + ) - value := &model.DeviceConfigurationKeyValueValueType{ - ScaledNumber: model.NewScaledNumberType(0), - } - _ = dcs.UpdateKeyValueDataForFilter( - model.DeviceConfigurationKeyValueDataType{ - Value: value, - IsValueChangeable: util.Ptr(true), - }, - nil, + // only add if it doesn't exist yet + filter := model.DeviceConfigurationKeyValueDescriptionDataType{ + KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), + } + if data, err := dcs.GetKeyValueDescriptionsForFilter(filter); err == nil && len(data) == 0 { + dcs.AddKeyValueDescription( model.DeviceConfigurationKeyValueDescriptionDataType{ - KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeConsumptionActivePowerLimit), + KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), + ValueType: util.Ptr(model.DeviceConfigurationKeyValueTypeTypeDuration), }, ) + } - value = &model.DeviceConfigurationKeyValueValueType{ - Duration: model.NewDurationType(0), - } - _ = dcs.UpdateKeyValueDataForFilter( - model.DeviceConfigurationKeyValueDataType{ - Value: value, - IsValueChangeable: util.Ptr(true), - }, - nil, - model.DeviceConfigurationKeyValueDescriptionDataType{ - KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), - }, - ) + value := &model.DeviceConfigurationKeyValueValueType{ + ScaledNumber: model.NewScaledNumberType(0), + } + if err := dcs.UpdateKeyValueDataForFilter( + model.DeviceConfigurationKeyValueDataType{ + Value: value, + IsValueChangeable: util.Ptr(true), + }, + nil, + model.DeviceConfigurationKeyValueDescriptionDataType{ + KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeConsumptionActivePowerLimit), + }, + ); err != nil { + return err + } + + value = &model.DeviceConfigurationKeyValueValueType{ + Duration: model.NewDurationType(0), + } + if err := dcs.UpdateKeyValueDataForFilter( + model.DeviceConfigurationKeyValueDataType{ + Value: value, + IsValueChangeable: util.Ptr(true), + }, + nil, + model.DeviceConfigurationKeyValueDescriptionDataType{ + KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), + }, + ); err != nil { + return err } f = e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) @@ -267,16 +290,23 @@ func (e *LPC) AddFeatures() { f = e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer) f.AddFunctionType(model.FunctionTypeElectricalConnectionCharacteristicListData, true, false) - if ec, err := server.NewElectricalConnection(e.LocalEntity); err == nil { - // ElectricalConnectionId and ParameterId should be identical to the ones used - // in a MPC Server role implementation, which is not done here (yet) - newCharData := model.ElectricalConnectionCharacteristicDataType{ - ElectricalConnectionId: util.Ptr(model.ElectricalConnectionIdType(0)), - ParameterId: util.Ptr(model.ElectricalConnectionParameterIdType(0)), - CharacteristicContext: util.Ptr(model.ElectricalConnectionCharacteristicContextTypeEntity), - CharacteristicType: util.Ptr(e.characteristicType()), - Unit: util.Ptr(model.UnitOfMeasurementTypeW), - } - _, _ = ec.AddCharacteristic(newCharData) + ec, err := server.NewElectricalConnection(e.LocalEntity) + if err != nil { + return err + } + + // ElectricalConnectionId and ParameterId should be identical to the ones used + // in an MPC Server role implementation, which is not done here (yet) + newCharData := model.ElectricalConnectionCharacteristicDataType{ + ElectricalConnectionId: util.Ptr(model.ElectricalConnectionIdType(0)), + ParameterId: util.Ptr(model.ElectricalConnectionParameterIdType(0)), + CharacteristicContext: util.Ptr(model.ElectricalConnectionCharacteristicContextTypeEntity), + CharacteristicType: util.Ptr(e.characteristicType()), + Unit: util.Ptr(model.UnitOfMeasurementTypeW), + } + if _, err := ec.AddCharacteristic(newCharData); err != nil { + return err } + + return nil } diff --git a/usecases/cs/lpp/testhelper_test.go b/usecases/cs/lpp/testhelper_test.go index c1ae590f..8c8ce4f4 100644 --- a/usecases/cs/lpp/testhelper_test.go +++ b/usecases/cs/lpp/testhelper_test.go @@ -16,6 +16,7 @@ import ( "github.com/enbility/spine-go/model" "github.com/enbility/spine-go/spine" "github.com/enbility/spine-go/util" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" ) @@ -76,7 +77,7 @@ func (s *CsLPPSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewLPP(localEntity, s.Event) - s.sut.AddFeatures() + assert.Nil(s.T(), s.sut.AddFeatures()) s.sut.AddUseCase() s.loadControlFeature = localEntity.FeatureOfTypeAndRole(model.FeatureTypeTypeLoadControl, model.RoleTypeServer) diff --git a/usecases/cs/lpp/usecase.go b/usecases/cs/lpp/usecase.go index 8b859f98..9aeafe45 100644 --- a/usecases/cs/lpp/usecase.go +++ b/usecases/cs/lpp/usecase.go @@ -1,6 +1,7 @@ package lpp import ( + "errors" "sync" "github.com/enbility/eebus-go/api" @@ -70,6 +71,7 @@ func NewLPP(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCa UseCaseSupportUpdate, validActorTypes, validEntityTypes, + false, ) uc := &LPP{ @@ -172,15 +174,36 @@ func (e *LPP) loadControlWriteCB(msg *spineapi.Message) { go e.approveOrDenyProductionLimit(msg, true, "") } -func (e *LPP) AddFeatures() { +func (e *LPP) AddFeatures() error { // client features - _ = e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeClient); f == nil { + return errors.New("could not add feature: " + string(model.FeatureTypeTypeDeviceDiagnosis)) + } // server features f := e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeLoadControl, model.RoleTypeServer) + if f == nil { + return errors.New("could not add feature: " + string(model.FeatureTypeTypeLoadControl)) + } f.AddFunctionType(model.FunctionTypeLoadControlLimitDescriptionListData, true, false) f.AddFunctionType(model.FunctionTypeLoadControlLimitListData, true, true) - _ = f.AddWriteApprovalCallback(e.loadControlWriteCB) + + f = e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceConfiguration, model.RoleTypeServer) + if f == nil { + return errors.New("could not add feature: " + string(model.FeatureTypeTypeDeviceConfiguration)) + } + f.AddFunctionType(model.FunctionTypeDeviceConfigurationKeyValueDescriptionListData, true, false) + f.AddFunctionType(model.FunctionTypeDeviceConfigurationKeyValueListData, true, true) + + if err := f.AddWriteApprovalCallback(e.loadControlWriteCB); err != nil { + return err + } + + f = e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) + f.AddFunctionType(model.FunctionTypeDeviceDiagnosisHeartbeatData, true, false) + + f = e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer) + f.AddFunctionType(model.FunctionTypeElectricalConnectionCharacteristicListData, true, false) newLimitDesc := model.LoadControlLimitDescriptionDataType{ LimitType: util.Ptr(model.LoadControlLimitTypeTypeSignDependentAbsValueLimit), @@ -190,93 +213,102 @@ func (e *LPP) AddFeatures() { Unit: util.Ptr(model.UnitOfMeasurementTypeW), ScopeType: util.Ptr(model.ScopeTypeTypeActivePowerLimit), } - if lc, err := server.NewLoadControl(e.LocalEntity); err == nil { - limitId := lc.AddLimitDescription(newLimitDesc) - - newLimiData := []api.LoadControlLimitDataForID{ - { - Data: model.LoadControlLimitDataType{ - Value: model.NewScaledNumberType(0), - IsLimitChangeable: util.Ptr(true), - IsLimitActive: util.Ptr(false), - }, - Id: *limitId, - }, - } - _ = lc.UpdateLimitDataForIds(newLimiData) + lc, err := server.NewLoadControl(e.LocalEntity) + if err != nil { + return err } + limitId := lc.AddLimitDescription(newLimitDesc) - f = e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceConfiguration, model.RoleTypeServer) - f.AddFunctionType(model.FunctionTypeDeviceConfigurationKeyValueDescriptionListData, true, false) - f.AddFunctionType(model.FunctionTypeDeviceConfigurationKeyValueListData, true, true) - - if dcs, err := server.NewDeviceConfiguration(e.LocalEntity); err == nil { - dcs.AddKeyValueDescription( - model.DeviceConfigurationKeyValueDescriptionDataType{ - KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeProductionActivePowerLimit), - ValueType: util.Ptr(model.DeviceConfigurationKeyValueTypeTypeScaledNumber), - Unit: util.Ptr(model.UnitOfMeasurementTypeW), + newLimiData := []api.LoadControlLimitDataForID{ + { + Data: model.LoadControlLimitDataType{ + Value: model.NewScaledNumberType(0), + IsLimitChangeable: util.Ptr(true), + IsLimitActive: util.Ptr(false), }, - ) + Id: *limitId, + }, + } + if err = lc.UpdateLimitDataForIds(newLimiData); err != nil { + return err + } - // only add if it doesn't exist yet - filter := model.DeviceConfigurationKeyValueDescriptionDataType{ - KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), - } - if data, err := dcs.GetKeyValueDescriptionsForFilter(filter); err == nil && len(data) == 0 { - dcs.AddKeyValueDescription( - model.DeviceConfigurationKeyValueDescriptionDataType{ - KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), - ValueType: util.Ptr(model.DeviceConfigurationKeyValueTypeTypeDuration), - }, - ) - } + dcs, err := server.NewDeviceConfiguration(e.LocalEntity) + if err != nil { + return err + } - value := &model.DeviceConfigurationKeyValueValueType{ - ScaledNumber: model.NewScaledNumberType(0), - } - _ = dcs.UpdateKeyValueDataForFilter( - model.DeviceConfigurationKeyValueDataType{ - Value: value, - IsValueChangeable: util.Ptr(true), - }, - nil, - model.DeviceConfigurationKeyValueDescriptionDataType{ - KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeProductionActivePowerLimit), - }, - ) + dcs.AddKeyValueDescription( + model.DeviceConfigurationKeyValueDescriptionDataType{ + KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeProductionActivePowerLimit), + ValueType: util.Ptr(model.DeviceConfigurationKeyValueTypeTypeScaledNumber), + Unit: util.Ptr(model.UnitOfMeasurementTypeW), + }, + ) - value = &model.DeviceConfigurationKeyValueValueType{ - Duration: model.NewDurationType(0), - } - _ = dcs.UpdateKeyValueDataForFilter( - model.DeviceConfigurationKeyValueDataType{ - Value: value, - IsValueChangeable: util.Ptr(true), - }, - nil, + // only add if it doesn't exist yet + filter := model.DeviceConfigurationKeyValueDescriptionDataType{ + KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), + } + if data, err := dcs.GetKeyValueDescriptionsForFilter(filter); err == nil && len(data) == 0 { + dcs.AddKeyValueDescription( model.DeviceConfigurationKeyValueDescriptionDataType{ - KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), + KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), + ValueType: util.Ptr(model.DeviceConfigurationKeyValueTypeTypeDuration), }, ) } - f = e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) - f.AddFunctionType(model.FunctionTypeDeviceDiagnosisHeartbeatData, true, false) + value := &model.DeviceConfigurationKeyValueValueType{ + ScaledNumber: model.NewScaledNumberType(0), + } + if err := dcs.UpdateKeyValueDataForFilter( + model.DeviceConfigurationKeyValueDataType{ + Value: value, + IsValueChangeable: util.Ptr(true), + }, + nil, + model.DeviceConfigurationKeyValueDescriptionDataType{ + KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeProductionActivePowerLimit), + }, + ); err != nil { + return err + } - f = e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer) - f.AddFunctionType(model.FunctionTypeElectricalConnectionCharacteristicListData, true, false) + value = &model.DeviceConfigurationKeyValueValueType{ + Duration: model.NewDurationType(0), + } + if err := dcs.UpdateKeyValueDataForFilter( + model.DeviceConfigurationKeyValueDataType{ + Value: value, + IsValueChangeable: util.Ptr(true), + }, + nil, + model.DeviceConfigurationKeyValueDescriptionDataType{ + KeyName: util.Ptr(model.DeviceConfigurationKeyNameTypeFailsafeDurationMinimum), + }, + ); err != nil { + return err + } - if ec, err := server.NewElectricalConnection(e.LocalEntity); err == nil { - // ElectricalConnectionId and ParameterId should be identical to the ones used - // in a MPC Server role implementation, which is not done here (yet) - newCharData := model.ElectricalConnectionCharacteristicDataType{ - ElectricalConnectionId: util.Ptr(model.ElectricalConnectionIdType(0)), - ParameterId: util.Ptr(model.ElectricalConnectionParameterIdType(0)), - CharacteristicContext: util.Ptr(model.ElectricalConnectionCharacteristicContextTypeEntity), - CharacteristicType: util.Ptr(e.characteristicType()), - Unit: util.Ptr(model.UnitOfMeasurementTypeW), - } - _, _ = ec.AddCharacteristic(newCharData) + ec, err := server.NewElectricalConnection(e.LocalEntity) + if err != nil { + return err } + + // ElectricalConnectionId and ParameterId should be identical to the ones used + // in an MPC Server role implementation, which is not done here (yet) + newCharData := model.ElectricalConnectionCharacteristicDataType{ + ElectricalConnectionId: util.Ptr(model.ElectricalConnectionIdType(0)), + ParameterId: util.Ptr(model.ElectricalConnectionParameterIdType(0)), + CharacteristicContext: util.Ptr(model.ElectricalConnectionCharacteristicContextTypeEntity), + CharacteristicType: util.Ptr(e.characteristicType()), + Unit: util.Ptr(model.UnitOfMeasurementTypeW), + } + _, err1 := ec.AddCharacteristic(newCharData) + if err1 != nil { + return err1 + } + + return nil } diff --git a/usecases/eg/lpc/usecase.go b/usecases/eg/lpc/usecase.go index 84c3c5d3..70a5514e 100644 --- a/usecases/eg/lpc/usecase.go +++ b/usecases/eg/lpc/usecase.go @@ -1,6 +1,7 @@ package lpc import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" usecase "github.com/enbility/eebus-go/usecases/usecase" @@ -66,6 +67,7 @@ func NewLPC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCa UseCaseSupportUpdate, validActorTypes, validEntityTypes, + false, ) uc := &LPC{ @@ -77,7 +79,7 @@ func NewLPC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCa return uc } -func (e *LPC) AddFeatures() { +func (e *LPC) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeDeviceDiagnosis, @@ -86,10 +88,17 @@ func (e *LPC) AddFeatures() { model.FeatureTypeTypeElectricalConnection, } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("could not add feature: " + string(feature)) + } } // server features f := e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) + if f == nil { + return errors.New("could not add feature: " + string(model.FeatureTypeTypeDeviceDiagnosis)) + } f.AddFunctionType(model.FunctionTypeDeviceDiagnosisHeartbeatData, true, false) + + return nil } diff --git a/usecases/eg/lpp/testhelper_test.go b/usecases/eg/lpp/testhelper_test.go index 2d3b1285..e486c91c 100644 --- a/usecases/eg/lpp/testhelper_test.go +++ b/usecases/eg/lpp/testhelper_test.go @@ -73,7 +73,7 @@ func (s *EgLPPSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewLPP(localEntity, s.Event) - s.sut.AddFeatures() + _ = s.sut.AddFeatures() s.sut.AddUseCase() s.remoteDevice, s.monitoredEntity = setupDevices(s.service, s.T()) diff --git a/usecases/eg/lpp/usecase.go b/usecases/eg/lpp/usecase.go index c68a5b74..b2245ea8 100644 --- a/usecases/eg/lpp/usecase.go +++ b/usecases/eg/lpp/usecase.go @@ -1,6 +1,7 @@ package lpp import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" "github.com/enbility/eebus-go/usecases/usecase" @@ -63,7 +64,9 @@ func NewLPP(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCa eventCB, UseCaseSupportUpdate, validActorTypes, - validEntityTypes) + validEntityTypes, + false, + ) uc := &LPP{ UseCaseBase: usecase, @@ -74,7 +77,7 @@ func NewLPP(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCa return uc } -func (e *LPP) AddFeatures() { +func (e *LPP) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeDeviceDiagnosis, @@ -83,12 +86,19 @@ func (e *LPP) AddFeatures() { model.FeatureTypeTypeElectricalConnection, } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("could not add feature: " + string(feature)) + } } // server features f := e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeDeviceDiagnosis, model.RoleTypeServer) + if f == nil { + return errors.New("could not add feature: " + string(model.FeatureTypeTypeDeviceDiagnosis)) + } f.AddFunctionType(model.FunctionTypeDeviceDiagnosisHeartbeatData, true, false) + + return nil } func (e *LPP) UpdateUseCaseAvailability(available bool) { diff --git a/usecases/ma/mgcp/testhelper_test.go b/usecases/ma/mgcp/testhelper_test.go index 878a3d62..bce44b2e 100644 --- a/usecases/ma/mgcp/testhelper_test.go +++ b/usecases/ma/mgcp/testhelper_test.go @@ -73,7 +73,7 @@ func (s *GcpMGCPSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewMGCP(localEntity, s.Event) - s.sut.AddFeatures() + _ = s.sut.AddFeatures() s.sut.AddUseCase() s.remoteDevice, s.smgwEntity = setupDevices(s.service, s.T()) diff --git a/usecases/ma/mgcp/usecase.go b/usecases/ma/mgcp/usecase.go index 6f6988d2..b3791392 100644 --- a/usecases/ma/mgcp/usecase.go +++ b/usecases/ma/mgcp/usecase.go @@ -1,6 +1,7 @@ package mgcp import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" usecase "github.com/enbility/eebus-go/usecases/usecase" @@ -93,7 +94,9 @@ func NewMGCP(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventC eventCB, UseCaseSupportUpdate, validActorTypes, - validEntityTypes) + validEntityTypes, + false, + ) uc := &MGCP{ UseCaseBase: usecase, @@ -104,7 +107,7 @@ func NewMGCP(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventC return uc } -func (e *MGCP) AddFeatures() { +func (e *MGCP) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeDeviceConfiguration, @@ -112,6 +115,10 @@ func (e *MGCP) AddFeatures() { model.FeatureTypeTypeMeasurement, } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("could not add feature: " + string(feature)) + } } + + return nil } diff --git a/usecases/ma/mpc/testhelper_test.go b/usecases/ma/mpc/testhelper_test.go index 272947d8..7f4f5d0e 100644 --- a/usecases/ma/mpc/testhelper_test.go +++ b/usecases/ma/mpc/testhelper_test.go @@ -73,7 +73,7 @@ func (s *MaMPCSuite) BeforeTest(suiteName, testName string) { localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeCEM) s.sut = NewMPC(localEntity, s.Event) - s.sut.AddFeatures() + _ = s.sut.AddFeatures() s.sut.AddUseCase() s.remoteDevice, s.monitoredEntity = setupDevices(s.service, s.T()) diff --git a/usecases/ma/mpc/usecase.go b/usecases/ma/mpc/usecase.go index 8e23395b..69560d3e 100644 --- a/usecases/ma/mpc/usecase.go +++ b/usecases/ma/mpc/usecase.go @@ -1,6 +1,7 @@ package mpc import ( + "errors" "github.com/enbility/eebus-go/api" ucapi "github.com/enbility/eebus-go/usecases/api" usecase "github.com/enbility/eebus-go/usecases/usecase" @@ -85,7 +86,9 @@ func NewMPC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCa eventCB, UseCaseSupportUpdate, validActorTypes, - validEntityTypes) + validEntityTypes, + false, + ) uc := &MPC{ UseCaseBase: usecase, @@ -96,13 +99,17 @@ func NewMPC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCa return uc } -func (e *MPC) AddFeatures() { +func (e *MPC) AddFeatures() error { // client features var clientFeatures = []model.FeatureTypeType{ model.FeatureTypeTypeElectricalConnection, model.FeatureTypeTypeMeasurement, } for _, feature := range clientFeatures { - _ = e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient) + if f := e.LocalEntity.GetOrAddFeature(feature, model.RoleTypeClient); f == nil { + return errors.New("failed to add feature: " + string(feature)) + } } + + return nil } diff --git a/usecases/mocks/CemCEVCInterface.go b/usecases/mocks/CemCEVCInterface.go index bb8393ba..33ecd02f 100644 --- a/usecases/mocks/CemCEVCInterface.go +++ b/usecases/mocks/CemCEVCInterface.go @@ -1,29 +1,15 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api1 "github.com/enbility/eebus-go/api" - api0 "github.com/enbility/eebus-go/usecases/api" - "github.com/enbility/spine-go/api" - mock "github.com/stretchr/testify/mock" -) - -// NewCemCEVCInterface creates a new instance of CemCEVCInterface. 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 NewCemCEVCInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *CemCEVCInterface { - mock := &CemCEVCInterface{} - mock.Mock.Test(t) + eebus_goapi "github.com/enbility/eebus-go/api" + api "github.com/enbility/eebus-go/usecases/api" - t.Cleanup(func() { mock.AssertExpectations(t) }) + mock "github.com/stretchr/testify/mock" - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // CemCEVCInterface is an autogenerated mock type for the CemCEVCInterface type type CemCEVCInterface struct { @@ -38,10 +24,22 @@ func (_m *CemCEVCInterface) EXPECT() *CemCEVCInterface_Expecter { return &CemCEVCInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *CemCEVCInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // CemCEVCInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -61,20 +59,19 @@ func (_c *CemCEVCInterface_AddFeatures_Call) Run(run func()) *CemCEVCInterface_A return _c } -func (_c *CemCEVCInterface_AddFeatures_Call) Return() *CemCEVCInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *CemCEVCInterface_AddFeatures_Call) Return(_a0 error) *CemCEVCInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemCEVCInterface_AddFeatures_Call) RunAndReturn(run func()) *CemCEVCInterface_AddFeatures_Call { - _c.Run(run) +func (_c *CemCEVCInterface_AddFeatures_Call) RunAndReturn(run func() error) *CemCEVCInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *CemCEVCInterface) AddUseCase() { + _m.Called() } // CemCEVCInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -104,22 +101,23 @@ func (_c *CemCEVCInterface_AddUseCase_Call) RunAndReturn(run func()) *CemCEVCInt return _c } -// AvailableScenariosForEntity provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *CemCEVCInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -129,57 +127,53 @@ type CemCEVCInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemCEVCInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *CemCEVCInterface_AvailableScenariosForEntity_Call { return &CemCEVCInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *CemCEVCInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *CemCEVCInterface_AvailableScenariosForEntity_Call { +func (_c *CemCEVCInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemCEVCInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemCEVCInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *CemCEVCInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *CemCEVCInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *CemCEVCInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemCEVCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *CemCEVCInterface_AvailableScenariosForEntity_Call { +func (_c *CemCEVCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *CemCEVCInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// ChargePlan provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) ChargePlan(entity api.EntityRemoteInterface) (api0.ChargePlan, error) { - ret := _mock.Called(entity) +// ChargePlan provides a mock function with given fields: entity +func (_m *CemCEVCInterface) ChargePlan(entity spine_goapi.EntityRemoteInterface) (api.ChargePlan, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for ChargePlan") } - var r0 api0.ChargePlan + var r0 api.ChargePlan var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (api0.ChargePlan, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (api.ChargePlan, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) api0.ChargePlan); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) api.ChargePlan); ok { + r0 = rf(entity) } else { - r0 = ret.Get(0).(api0.ChargePlan) + r0 = ret.Get(0).(api.ChargePlan) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -189,59 +183,55 @@ type CemCEVCInterface_ChargePlan_Call struct { } // ChargePlan is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemCEVCInterface_Expecter) ChargePlan(entity interface{}) *CemCEVCInterface_ChargePlan_Call { return &CemCEVCInterface_ChargePlan_Call{Call: _e.mock.On("ChargePlan", entity)} } -func (_c *CemCEVCInterface_ChargePlan_Call) Run(run func(entity api.EntityRemoteInterface)) *CemCEVCInterface_ChargePlan_Call { +func (_c *CemCEVCInterface_ChargePlan_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemCEVCInterface_ChargePlan_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemCEVCInterface_ChargePlan_Call) Return(chargePlan api0.ChargePlan, err error) *CemCEVCInterface_ChargePlan_Call { - _c.Call.Return(chargePlan, err) +func (_c *CemCEVCInterface_ChargePlan_Call) Return(_a0 api.ChargePlan, _a1 error) *CemCEVCInterface_ChargePlan_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemCEVCInterface_ChargePlan_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (api0.ChargePlan, error)) *CemCEVCInterface_ChargePlan_Call { +func (_c *CemCEVCInterface_ChargePlan_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (api.ChargePlan, error)) *CemCEVCInterface_ChargePlan_Call { _c.Call.Return(run) return _c } -// ChargePlanConstraints provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) ChargePlanConstraints(entity api.EntityRemoteInterface) ([]api0.DurationSlotValue, error) { - ret := _mock.Called(entity) +// ChargePlanConstraints provides a mock function with given fields: entity +func (_m *CemCEVCInterface) ChargePlanConstraints(entity spine_goapi.EntityRemoteInterface) ([]api.DurationSlotValue, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for ChargePlanConstraints") } - var r0 []api0.DurationSlotValue + var r0 []api.DurationSlotValue var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]api0.DurationSlotValue, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]api.DurationSlotValue, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []api0.DurationSlotValue); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []api.DurationSlotValue); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.DurationSlotValue) + r0 = ret.Get(0).([]api.DurationSlotValue) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -251,48 +241,43 @@ type CemCEVCInterface_ChargePlanConstraints_Call struct { } // ChargePlanConstraints is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemCEVCInterface_Expecter) ChargePlanConstraints(entity interface{}) *CemCEVCInterface_ChargePlanConstraints_Call { return &CemCEVCInterface_ChargePlanConstraints_Call{Call: _e.mock.On("ChargePlanConstraints", entity)} } -func (_c *CemCEVCInterface_ChargePlanConstraints_Call) Run(run func(entity api.EntityRemoteInterface)) *CemCEVCInterface_ChargePlanConstraints_Call { +func (_c *CemCEVCInterface_ChargePlanConstraints_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemCEVCInterface_ChargePlanConstraints_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemCEVCInterface_ChargePlanConstraints_Call) Return(durationSlotValues []api0.DurationSlotValue, err error) *CemCEVCInterface_ChargePlanConstraints_Call { - _c.Call.Return(durationSlotValues, err) +func (_c *CemCEVCInterface_ChargePlanConstraints_Call) Return(_a0 []api.DurationSlotValue, _a1 error) *CemCEVCInterface_ChargePlanConstraints_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemCEVCInterface_ChargePlanConstraints_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]api0.DurationSlotValue, error)) *CemCEVCInterface_ChargePlanConstraints_Call { +func (_c *CemCEVCInterface_ChargePlanConstraints_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]api.DurationSlotValue, error)) *CemCEVCInterface_ChargePlanConstraints_Call { _c.Call.Return(run) return _c } -// ChargeStrategy provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) ChargeStrategy(remoteEntity api.EntityRemoteInterface) api0.EVChargeStrategyType { - ret := _mock.Called(remoteEntity) +// ChargeStrategy provides a mock function with given fields: remoteEntity +func (_m *CemCEVCInterface) ChargeStrategy(remoteEntity spine_goapi.EntityRemoteInterface) api.EVChargeStrategyType { + ret := _m.Called(remoteEntity) if len(ret) == 0 { panic("no return value specified for ChargeStrategy") } - var r0 api0.EVChargeStrategyType - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) api0.EVChargeStrategyType); ok { - r0 = returnFunc(remoteEntity) + var r0 api.EVChargeStrategyType + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) api.EVChargeStrategyType); ok { + r0 = rf(remoteEntity) } else { - r0 = ret.Get(0).(api0.EVChargeStrategyType) + r0 = ret.Get(0).(api.EVChargeStrategyType) } + return r0 } @@ -302,57 +287,53 @@ type CemCEVCInterface_ChargeStrategy_Call struct { } // ChargeStrategy is a helper method to define mock.On call -// - remoteEntity api.EntityRemoteInterface +// - remoteEntity spine_goapi.EntityRemoteInterface func (_e *CemCEVCInterface_Expecter) ChargeStrategy(remoteEntity interface{}) *CemCEVCInterface_ChargeStrategy_Call { return &CemCEVCInterface_ChargeStrategy_Call{Call: _e.mock.On("ChargeStrategy", remoteEntity)} } -func (_c *CemCEVCInterface_ChargeStrategy_Call) Run(run func(remoteEntity api.EntityRemoteInterface)) *CemCEVCInterface_ChargeStrategy_Call { +func (_c *CemCEVCInterface_ChargeStrategy_Call) Run(run func(remoteEntity spine_goapi.EntityRemoteInterface)) *CemCEVCInterface_ChargeStrategy_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemCEVCInterface_ChargeStrategy_Call) Return(eVChargeStrategyType api0.EVChargeStrategyType) *CemCEVCInterface_ChargeStrategy_Call { - _c.Call.Return(eVChargeStrategyType) +func (_c *CemCEVCInterface_ChargeStrategy_Call) Return(_a0 api.EVChargeStrategyType) *CemCEVCInterface_ChargeStrategy_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemCEVCInterface_ChargeStrategy_Call) RunAndReturn(run func(remoteEntity api.EntityRemoteInterface) api0.EVChargeStrategyType) *CemCEVCInterface_ChargeStrategy_Call { +func (_c *CemCEVCInterface_ChargeStrategy_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) api.EVChargeStrategyType) *CemCEVCInterface_ChargeStrategy_Call { _c.Call.Return(run) return _c } -// EnergyDemand provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) EnergyDemand(remoteEntity api.EntityRemoteInterface) (api0.Demand, error) { - ret := _mock.Called(remoteEntity) +// EnergyDemand provides a mock function with given fields: remoteEntity +func (_m *CemCEVCInterface) EnergyDemand(remoteEntity spine_goapi.EntityRemoteInterface) (api.Demand, error) { + ret := _m.Called(remoteEntity) if len(ret) == 0 { panic("no return value specified for EnergyDemand") } - var r0 api0.Demand + var r0 api.Demand var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (api0.Demand, error)); ok { - return returnFunc(remoteEntity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (api.Demand, error)); ok { + return rf(remoteEntity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) api0.Demand); ok { - r0 = returnFunc(remoteEntity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) api.Demand); ok { + r0 = rf(remoteEntity) } else { - r0 = ret.Get(0).(api0.Demand) + r0 = ret.Get(0).(api.Demand) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(remoteEntity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(remoteEntity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -362,57 +343,53 @@ type CemCEVCInterface_EnergyDemand_Call struct { } // EnergyDemand is a helper method to define mock.On call -// - remoteEntity api.EntityRemoteInterface +// - remoteEntity spine_goapi.EntityRemoteInterface func (_e *CemCEVCInterface_Expecter) EnergyDemand(remoteEntity interface{}) *CemCEVCInterface_EnergyDemand_Call { return &CemCEVCInterface_EnergyDemand_Call{Call: _e.mock.On("EnergyDemand", remoteEntity)} } -func (_c *CemCEVCInterface_EnergyDemand_Call) Run(run func(remoteEntity api.EntityRemoteInterface)) *CemCEVCInterface_EnergyDemand_Call { +func (_c *CemCEVCInterface_EnergyDemand_Call) Run(run func(remoteEntity spine_goapi.EntityRemoteInterface)) *CemCEVCInterface_EnergyDemand_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemCEVCInterface_EnergyDemand_Call) Return(demand api0.Demand, err error) *CemCEVCInterface_EnergyDemand_Call { - _c.Call.Return(demand, err) +func (_c *CemCEVCInterface_EnergyDemand_Call) Return(_a0 api.Demand, _a1 error) *CemCEVCInterface_EnergyDemand_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemCEVCInterface_EnergyDemand_Call) RunAndReturn(run func(remoteEntity api.EntityRemoteInterface) (api0.Demand, error)) *CemCEVCInterface_EnergyDemand_Call { +func (_c *CemCEVCInterface_EnergyDemand_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (api.Demand, error)) *CemCEVCInterface_EnergyDemand_Call { _c.Call.Return(run) return _c } -// IncentiveConstraints provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) IncentiveConstraints(entity api.EntityRemoteInterface) (api0.IncentiveSlotConstraints, error) { - ret := _mock.Called(entity) +// IncentiveConstraints provides a mock function with given fields: entity +func (_m *CemCEVCInterface) IncentiveConstraints(entity spine_goapi.EntityRemoteInterface) (api.IncentiveSlotConstraints, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IncentiveConstraints") } - var r0 api0.IncentiveSlotConstraints + var r0 api.IncentiveSlotConstraints var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (api0.IncentiveSlotConstraints, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (api.IncentiveSlotConstraints, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) api0.IncentiveSlotConstraints); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) api.IncentiveSlotConstraints); ok { + r0 = rf(entity) } else { - r0 = ret.Get(0).(api0.IncentiveSlotConstraints) + r0 = ret.Get(0).(api.IncentiveSlotConstraints) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -422,48 +399,43 @@ type CemCEVCInterface_IncentiveConstraints_Call struct { } // IncentiveConstraints is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemCEVCInterface_Expecter) IncentiveConstraints(entity interface{}) *CemCEVCInterface_IncentiveConstraints_Call { return &CemCEVCInterface_IncentiveConstraints_Call{Call: _e.mock.On("IncentiveConstraints", entity)} } -func (_c *CemCEVCInterface_IncentiveConstraints_Call) Run(run func(entity api.EntityRemoteInterface)) *CemCEVCInterface_IncentiveConstraints_Call { +func (_c *CemCEVCInterface_IncentiveConstraints_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemCEVCInterface_IncentiveConstraints_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemCEVCInterface_IncentiveConstraints_Call) Return(incentiveSlotConstraints api0.IncentiveSlotConstraints, err error) *CemCEVCInterface_IncentiveConstraints_Call { - _c.Call.Return(incentiveSlotConstraints, err) +func (_c *CemCEVCInterface_IncentiveConstraints_Call) Return(_a0 api.IncentiveSlotConstraints, _a1 error) *CemCEVCInterface_IncentiveConstraints_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemCEVCInterface_IncentiveConstraints_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (api0.IncentiveSlotConstraints, error)) *CemCEVCInterface_IncentiveConstraints_Call { +func (_c *CemCEVCInterface_IncentiveConstraints_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (api.IncentiveSlotConstraints, error)) *CemCEVCInterface_IncentiveConstraints_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *CemCEVCInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -473,48 +445,43 @@ type CemCEVCInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemCEVCInterface_Expecter) IsCompatibleEntityType(entity interface{}) *CemCEVCInterface_IsCompatibleEntityType_Call { return &CemCEVCInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *CemCEVCInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *CemCEVCInterface_IsCompatibleEntityType_Call { +func (_c *CemCEVCInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemCEVCInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemCEVCInterface_IsCompatibleEntityType_Call) Return(b bool) *CemCEVCInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *CemCEVCInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *CemCEVCInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemCEVCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CemCEVCInterface_IsCompatibleEntityType_Call { +func (_c *CemCEVCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CemCEVCInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *CemCEVCInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -524,56 +491,46 @@ type CemCEVCInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *CemCEVCInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *CemCEVCInterface_IsScenarioAvailableAtEntity_Call { return &CemCEVCInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *CemCEVCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *CemCEVCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemCEVCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *CemCEVCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *CemCEVCInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *CemCEVCInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *CemCEVCInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *CemCEVCInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemCEVCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *CemCEVCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemCEVCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *CemCEVCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) RemoteEntitiesScenarios() []api1.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *CemCEVCInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api1.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api1.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api1.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -594,20 +551,19 @@ func (_c *CemCEVCInterface_RemoteEntitiesScenarios_Call) Run(run func()) *CemCEV return _c } -func (_c *CemCEVCInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api1.RemoteEntityScenarios) *CemCEVCInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *CemCEVCInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *CemCEVCInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemCEVCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api1.RemoteEntityScenarios) *CemCEVCInterface_RemoteEntitiesScenarios_Call { +func (_c *CemCEVCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *CemCEVCInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *CemCEVCInterface) RemoveUseCase() { + _m.Called() } // CemCEVCInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -637,20 +593,21 @@ func (_c *CemCEVCInterface_RemoveUseCase_Call) RunAndReturn(run func()) *CemCEVC return _c } -// SetOperatingState provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) SetOperatingState(failureState bool) error { - ret := _mock.Called(failureState) +// SetOperatingState provides a mock function with given fields: failureState +func (_m *CemCEVCInterface) SetOperatingState(failureState bool) error { + ret := _m.Called(failureState) if len(ret) == 0 { panic("no return value specified for SetOperatingState") } var r0 error - if returnFunc, ok := ret.Get(0).(func(bool) error); ok { - r0 = returnFunc(failureState) + if rf, ok := ret.Get(0).(func(bool) error); ok { + r0 = rf(failureState) } else { r0 = ret.Error(0) } + return r0 } @@ -667,31 +624,24 @@ func (_e *CemCEVCInterface_Expecter) SetOperatingState(failureState interface{}) func (_c *CemCEVCInterface_SetOperatingState_Call) Run(run func(failureState bool)) *CemCEVCInterface_SetOperatingState_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } -func (_c *CemCEVCInterface_SetOperatingState_Call) Return(err error) *CemCEVCInterface_SetOperatingState_Call { - _c.Call.Return(err) +func (_c *CemCEVCInterface_SetOperatingState_Call) Return(_a0 error) *CemCEVCInterface_SetOperatingState_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemCEVCInterface_SetOperatingState_Call) RunAndReturn(run func(failureState bool) error) *CemCEVCInterface_SetOperatingState_Call { +func (_c *CemCEVCInterface_SetOperatingState_Call) RunAndReturn(run func(bool) error) *CemCEVCInterface_SetOperatingState_Call { _c.Call.Return(run) return _c } -// StartHeartbeat provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) StartHeartbeat() { - _mock.Called() - return +// StartHeartbeat provides a mock function with no fields +func (_m *CemCEVCInterface) StartHeartbeat() { + _m.Called() } // CemCEVCInterface_StartHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartHeartbeat' @@ -721,10 +671,9 @@ func (_c *CemCEVCInterface_StartHeartbeat_Call) RunAndReturn(run func()) *CemCEV return _c } -// StopHeartbeat provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) StopHeartbeat() { - _mock.Called() - return +// StopHeartbeat provides a mock function with no fields +func (_m *CemCEVCInterface) StopHeartbeat() { + _m.Called() } // CemCEVCInterface_StopHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopHeartbeat' @@ -754,29 +703,31 @@ func (_c *CemCEVCInterface_StopHeartbeat_Call) RunAndReturn(run func()) *CemCEVC return _c } -// TimeSlotConstraints provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) TimeSlotConstraints(entity api.EntityRemoteInterface) (api0.TimeSlotConstraints, error) { - ret := _mock.Called(entity) +// TimeSlotConstraints provides a mock function with given fields: entity +func (_m *CemCEVCInterface) TimeSlotConstraints(entity spine_goapi.EntityRemoteInterface) (api.TimeSlotConstraints, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for TimeSlotConstraints") } - var r0 api0.TimeSlotConstraints + var r0 api.TimeSlotConstraints var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (api0.TimeSlotConstraints, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (api.TimeSlotConstraints, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) api0.TimeSlotConstraints); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) api.TimeSlotConstraints); ok { + r0 = rf(entity) } else { - r0 = ret.Get(0).(api0.TimeSlotConstraints) + r0 = ret.Get(0).(api.TimeSlotConstraints) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -786,38 +737,31 @@ type CemCEVCInterface_TimeSlotConstraints_Call struct { } // TimeSlotConstraints is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemCEVCInterface_Expecter) TimeSlotConstraints(entity interface{}) *CemCEVCInterface_TimeSlotConstraints_Call { return &CemCEVCInterface_TimeSlotConstraints_Call{Call: _e.mock.On("TimeSlotConstraints", entity)} } -func (_c *CemCEVCInterface_TimeSlotConstraints_Call) Run(run func(entity api.EntityRemoteInterface)) *CemCEVCInterface_TimeSlotConstraints_Call { +func (_c *CemCEVCInterface_TimeSlotConstraints_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemCEVCInterface_TimeSlotConstraints_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemCEVCInterface_TimeSlotConstraints_Call) Return(timeSlotConstraints api0.TimeSlotConstraints, err error) *CemCEVCInterface_TimeSlotConstraints_Call { - _c.Call.Return(timeSlotConstraints, err) +func (_c *CemCEVCInterface_TimeSlotConstraints_Call) Return(_a0 api.TimeSlotConstraints, _a1 error) *CemCEVCInterface_TimeSlotConstraints_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemCEVCInterface_TimeSlotConstraints_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (api0.TimeSlotConstraints, error)) *CemCEVCInterface_TimeSlotConstraints_Call { +func (_c *CemCEVCInterface_TimeSlotConstraints_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (api.TimeSlotConstraints, error)) *CemCEVCInterface_TimeSlotConstraints_Call { _c.Call.Return(run) return _c } -// UpdateUseCaseAvailability provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *CemCEVCInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // CemCEVCInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -833,13 +777,7 @@ func (_e *CemCEVCInterface_Expecter) UpdateUseCaseAvailability(available interfa func (_c *CemCEVCInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *CemCEVCInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -849,25 +787,26 @@ func (_c *CemCEVCInterface_UpdateUseCaseAvailability_Call) Return() *CemCEVCInte return _c } -func (_c *CemCEVCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *CemCEVCInterface_UpdateUseCaseAvailability_Call { +func (_c *CemCEVCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *CemCEVCInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } -// WriteIncentiveTableDescriptions provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) WriteIncentiveTableDescriptions(entity api.EntityRemoteInterface, data []api0.IncentiveTariffDescription) error { - ret := _mock.Called(entity, data) +// WriteIncentiveTableDescriptions provides a mock function with given fields: entity, data +func (_m *CemCEVCInterface) WriteIncentiveTableDescriptions(entity spine_goapi.EntityRemoteInterface, data []api.IncentiveTariffDescription) error { + ret := _m.Called(entity, data) if len(ret) == 0 { panic("no return value specified for WriteIncentiveTableDescriptions") } var r0 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, []api0.IncentiveTariffDescription) error); ok { - r0 = returnFunc(entity, data) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, []api.IncentiveTariffDescription) error); ok { + r0 = rf(entity, data) } else { r0 = ret.Error(0) } + return r0 } @@ -877,54 +816,44 @@ type CemCEVCInterface_WriteIncentiveTableDescriptions_Call struct { } // WriteIncentiveTableDescriptions is a helper method to define mock.On call -// - entity api.EntityRemoteInterface -// - data []api0.IncentiveTariffDescription +// - entity spine_goapi.EntityRemoteInterface +// - data []api.IncentiveTariffDescription func (_e *CemCEVCInterface_Expecter) WriteIncentiveTableDescriptions(entity interface{}, data interface{}) *CemCEVCInterface_WriteIncentiveTableDescriptions_Call { return &CemCEVCInterface_WriteIncentiveTableDescriptions_Call{Call: _e.mock.On("WriteIncentiveTableDescriptions", entity, data)} } -func (_c *CemCEVCInterface_WriteIncentiveTableDescriptions_Call) Run(run func(entity api.EntityRemoteInterface, data []api0.IncentiveTariffDescription)) *CemCEVCInterface_WriteIncentiveTableDescriptions_Call { +func (_c *CemCEVCInterface_WriteIncentiveTableDescriptions_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, data []api.IncentiveTariffDescription)) *CemCEVCInterface_WriteIncentiveTableDescriptions_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 []api0.IncentiveTariffDescription - if args[1] != nil { - arg1 = args[1].([]api0.IncentiveTariffDescription) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].([]api.IncentiveTariffDescription)) }) return _c } -func (_c *CemCEVCInterface_WriteIncentiveTableDescriptions_Call) Return(err error) *CemCEVCInterface_WriteIncentiveTableDescriptions_Call { - _c.Call.Return(err) +func (_c *CemCEVCInterface_WriteIncentiveTableDescriptions_Call) Return(_a0 error) *CemCEVCInterface_WriteIncentiveTableDescriptions_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemCEVCInterface_WriteIncentiveTableDescriptions_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, data []api0.IncentiveTariffDescription) error) *CemCEVCInterface_WriteIncentiveTableDescriptions_Call { +func (_c *CemCEVCInterface_WriteIncentiveTableDescriptions_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, []api.IncentiveTariffDescription) error) *CemCEVCInterface_WriteIncentiveTableDescriptions_Call { _c.Call.Return(run) return _c } -// WriteIncentives provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) WriteIncentives(entity api.EntityRemoteInterface, data []api0.DurationSlotValue) error { - ret := _mock.Called(entity, data) +// WriteIncentives provides a mock function with given fields: entity, data +func (_m *CemCEVCInterface) WriteIncentives(entity spine_goapi.EntityRemoteInterface, data []api.DurationSlotValue) error { + ret := _m.Called(entity, data) if len(ret) == 0 { panic("no return value specified for WriteIncentives") } var r0 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, []api0.DurationSlotValue) error); ok { - r0 = returnFunc(entity, data) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, []api.DurationSlotValue) error); ok { + r0 = rf(entity, data) } else { r0 = ret.Error(0) } + return r0 } @@ -934,54 +863,44 @@ type CemCEVCInterface_WriteIncentives_Call struct { } // WriteIncentives is a helper method to define mock.On call -// - entity api.EntityRemoteInterface -// - data []api0.DurationSlotValue +// - entity spine_goapi.EntityRemoteInterface +// - data []api.DurationSlotValue func (_e *CemCEVCInterface_Expecter) WriteIncentives(entity interface{}, data interface{}) *CemCEVCInterface_WriteIncentives_Call { return &CemCEVCInterface_WriteIncentives_Call{Call: _e.mock.On("WriteIncentives", entity, data)} } -func (_c *CemCEVCInterface_WriteIncentives_Call) Run(run func(entity api.EntityRemoteInterface, data []api0.DurationSlotValue)) *CemCEVCInterface_WriteIncentives_Call { +func (_c *CemCEVCInterface_WriteIncentives_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, data []api.DurationSlotValue)) *CemCEVCInterface_WriteIncentives_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 []api0.DurationSlotValue - if args[1] != nil { - arg1 = args[1].([]api0.DurationSlotValue) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].([]api.DurationSlotValue)) }) return _c } -func (_c *CemCEVCInterface_WriteIncentives_Call) Return(err error) *CemCEVCInterface_WriteIncentives_Call { - _c.Call.Return(err) +func (_c *CemCEVCInterface_WriteIncentives_Call) Return(_a0 error) *CemCEVCInterface_WriteIncentives_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemCEVCInterface_WriteIncentives_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, data []api0.DurationSlotValue) error) *CemCEVCInterface_WriteIncentives_Call { +func (_c *CemCEVCInterface_WriteIncentives_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, []api.DurationSlotValue) error) *CemCEVCInterface_WriteIncentives_Call { _c.Call.Return(run) return _c } -// WritePowerLimits provides a mock function for the type CemCEVCInterface -func (_mock *CemCEVCInterface) WritePowerLimits(entity api.EntityRemoteInterface, data []api0.DurationSlotValue) error { - ret := _mock.Called(entity, data) +// WritePowerLimits provides a mock function with given fields: entity, data +func (_m *CemCEVCInterface) WritePowerLimits(entity spine_goapi.EntityRemoteInterface, data []api.DurationSlotValue) error { + ret := _m.Called(entity, data) if len(ret) == 0 { panic("no return value specified for WritePowerLimits") } var r0 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, []api0.DurationSlotValue) error); ok { - r0 = returnFunc(entity, data) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, []api.DurationSlotValue) error); ok { + r0 = rf(entity, data) } else { r0 = ret.Error(0) } + return r0 } @@ -991,36 +910,39 @@ type CemCEVCInterface_WritePowerLimits_Call struct { } // WritePowerLimits is a helper method to define mock.On call -// - entity api.EntityRemoteInterface -// - data []api0.DurationSlotValue +// - entity spine_goapi.EntityRemoteInterface +// - data []api.DurationSlotValue func (_e *CemCEVCInterface_Expecter) WritePowerLimits(entity interface{}, data interface{}) *CemCEVCInterface_WritePowerLimits_Call { return &CemCEVCInterface_WritePowerLimits_Call{Call: _e.mock.On("WritePowerLimits", entity, data)} } -func (_c *CemCEVCInterface_WritePowerLimits_Call) Run(run func(entity api.EntityRemoteInterface, data []api0.DurationSlotValue)) *CemCEVCInterface_WritePowerLimits_Call { +func (_c *CemCEVCInterface_WritePowerLimits_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, data []api.DurationSlotValue)) *CemCEVCInterface_WritePowerLimits_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 []api0.DurationSlotValue - if args[1] != nil { - arg1 = args[1].([]api0.DurationSlotValue) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].([]api.DurationSlotValue)) }) return _c } -func (_c *CemCEVCInterface_WritePowerLimits_Call) Return(err error) *CemCEVCInterface_WritePowerLimits_Call { - _c.Call.Return(err) +func (_c *CemCEVCInterface_WritePowerLimits_Call) Return(_a0 error) *CemCEVCInterface_WritePowerLimits_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemCEVCInterface_WritePowerLimits_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, data []api0.DurationSlotValue) error) *CemCEVCInterface_WritePowerLimits_Call { +func (_c *CemCEVCInterface_WritePowerLimits_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, []api.DurationSlotValue) error) *CemCEVCInterface_WritePowerLimits_Call { _c.Call.Return(run) return _c } + +// NewCemCEVCInterface creates a new instance of CemCEVCInterface. 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 NewCemCEVCInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CemCEVCInterface { + mock := &CemCEVCInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/CemEVCCInterface.go b/usecases/mocks/CemEVCCInterface.go index 5b474d2a..e0c845c0 100644 --- a/usecases/mocks/CemEVCCInterface.go +++ b/usecases/mocks/CemEVCCInterface.go @@ -1,30 +1,17 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api1 "github.com/enbility/eebus-go/api" - api0 "github.com/enbility/eebus-go/usecases/api" - "github.com/enbility/spine-go/api" - "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" -) + eebus_goapi "github.com/enbility/eebus-go/api" + api "github.com/enbility/eebus-go/usecases/api" -// NewCemEVCCInterface creates a new instance of CemEVCCInterface. 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 NewCemEVCCInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *CemEVCCInterface { - mock := &CemEVCCInterface{} - mock.Mock.Test(t) + mock "github.com/stretchr/testify/mock" - t.Cleanup(func() { mock.AssertExpectations(t) }) + model "github.com/enbility/spine-go/model" - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // CemEVCCInterface is an autogenerated mock type for the CemEVCCInterface type type CemEVCCInterface struct { @@ -39,10 +26,22 @@ func (_m *CemEVCCInterface) EXPECT() *CemEVCCInterface_Expecter { return &CemEVCCInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *CemEVCCInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // CemEVCCInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -62,20 +61,19 @@ func (_c *CemEVCCInterface_AddFeatures_Call) Run(run func()) *CemEVCCInterface_A return _c } -func (_c *CemEVCCInterface_AddFeatures_Call) Return() *CemEVCCInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *CemEVCCInterface_AddFeatures_Call) Return(_a0 error) *CemEVCCInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVCCInterface_AddFeatures_Call) RunAndReturn(run func()) *CemEVCCInterface_AddFeatures_Call { - _c.Run(run) +func (_c *CemEVCCInterface_AddFeatures_Call) RunAndReturn(run func() error) *CemEVCCInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *CemEVCCInterface) AddUseCase() { + _m.Called() } // CemEVCCInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -105,9 +103,9 @@ func (_c *CemEVCCInterface_AddUseCase_Call) RunAndReturn(run func()) *CemEVCCInt return _c } -// AsymmetricChargingSupport provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) AsymmetricChargingSupport(entity api.EntityRemoteInterface) (bool, error) { - ret := _mock.Called(entity) +// AsymmetricChargingSupport provides a mock function with given fields: entity +func (_m *CemEVCCInterface) AsymmetricChargingSupport(entity spine_goapi.EntityRemoteInterface) (bool, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AsymmetricChargingSupport") @@ -115,19 +113,21 @@ func (_mock *CemEVCCInterface) AsymmetricChargingSupport(entity api.EntityRemote var r0 bool var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (bool, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (bool, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -137,50 +137,45 @@ type CemEVCCInterface_AsymmetricChargingSupport_Call struct { } // AsymmetricChargingSupport is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCCInterface_Expecter) AsymmetricChargingSupport(entity interface{}) *CemEVCCInterface_AsymmetricChargingSupport_Call { return &CemEVCCInterface_AsymmetricChargingSupport_Call{Call: _e.mock.On("AsymmetricChargingSupport", entity)} } -func (_c *CemEVCCInterface_AsymmetricChargingSupport_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCCInterface_AsymmetricChargingSupport_Call { +func (_c *CemEVCCInterface_AsymmetricChargingSupport_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCCInterface_AsymmetricChargingSupport_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCCInterface_AsymmetricChargingSupport_Call) Return(b bool, err error) *CemEVCCInterface_AsymmetricChargingSupport_Call { - _c.Call.Return(b, err) +func (_c *CemEVCCInterface_AsymmetricChargingSupport_Call) Return(_a0 bool, _a1 error) *CemEVCCInterface_AsymmetricChargingSupport_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVCCInterface_AsymmetricChargingSupport_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (bool, error)) *CemEVCCInterface_AsymmetricChargingSupport_Call { +func (_c *CemEVCCInterface_AsymmetricChargingSupport_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (bool, error)) *CemEVCCInterface_AsymmetricChargingSupport_Call { _c.Call.Return(run) return _c } -// AvailableScenariosForEntity provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *CemEVCCInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -190,57 +185,53 @@ type CemEVCCInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCCInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *CemEVCCInterface_AvailableScenariosForEntity_Call { return &CemEVCCInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *CemEVCCInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCCInterface_AvailableScenariosForEntity_Call { +func (_c *CemEVCCInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCCInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCCInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *CemEVCCInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *CemEVCCInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *CemEVCCInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVCCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *CemEVCCInterface_AvailableScenariosForEntity_Call { +func (_c *CemEVCCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *CemEVCCInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// ChargeState provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) ChargeState(entity api.EntityRemoteInterface) (api0.EVChargeStateType, error) { - ret := _mock.Called(entity) +// ChargeState provides a mock function with given fields: entity +func (_m *CemEVCCInterface) ChargeState(entity spine_goapi.EntityRemoteInterface) (api.EVChargeStateType, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for ChargeState") } - var r0 api0.EVChargeStateType + var r0 api.EVChargeStateType var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (api0.EVChargeStateType, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (api.EVChargeStateType, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) api0.EVChargeStateType); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) api.EVChargeStateType); ok { + r0 = rf(entity) } else { - r0 = ret.Get(0).(api0.EVChargeStateType) + r0 = ret.Get(0).(api.EVChargeStateType) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -250,37 +241,31 @@ type CemEVCCInterface_ChargeState_Call struct { } // ChargeState is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCCInterface_Expecter) ChargeState(entity interface{}) *CemEVCCInterface_ChargeState_Call { return &CemEVCCInterface_ChargeState_Call{Call: _e.mock.On("ChargeState", entity)} } -func (_c *CemEVCCInterface_ChargeState_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCCInterface_ChargeState_Call { +func (_c *CemEVCCInterface_ChargeState_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCCInterface_ChargeState_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCCInterface_ChargeState_Call) Return(eVChargeStateType api0.EVChargeStateType, err error) *CemEVCCInterface_ChargeState_Call { - _c.Call.Return(eVChargeStateType, err) +func (_c *CemEVCCInterface_ChargeState_Call) Return(_a0 api.EVChargeStateType, _a1 error) *CemEVCCInterface_ChargeState_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVCCInterface_ChargeState_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (api0.EVChargeStateType, error)) *CemEVCCInterface_ChargeState_Call { +func (_c *CemEVCCInterface_ChargeState_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (api.EVChargeStateType, error)) *CemEVCCInterface_ChargeState_Call { _c.Call.Return(run) return _c } -// ChargingPowerLimits provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) ChargingPowerLimits(entity api.EntityRemoteInterface) (float64, float64, float64, error) { - ret := _mock.Called(entity) +// ChargingPowerLimits provides a mock function with given fields: entity +func (_m *CemEVCCInterface) ChargingPowerLimits(entity spine_goapi.EntityRemoteInterface) (float64, float64, float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for ChargingPowerLimits") @@ -290,29 +275,33 @@ func (_mock *CemEVCCInterface) ChargingPowerLimits(entity api.EntityRemoteInterf var r1 float64 var r2 float64 var r3 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, float64, float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, float64, float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) float64); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r1 = rf(entity) } else { r1 = ret.Get(1).(float64) } - if returnFunc, ok := ret.Get(2).(func(api.EntityRemoteInterface) float64); ok { - r2 = returnFunc(entity) + + if rf, ok := ret.Get(2).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r2 = rf(entity) } else { r2 = ret.Get(2).(float64) } - if returnFunc, ok := ret.Get(3).(func(api.EntityRemoteInterface) error); ok { - r3 = returnFunc(entity) + + if rf, ok := ret.Get(3).(func(spine_goapi.EntityRemoteInterface) error); ok { + r3 = rf(entity) } else { r3 = ret.Error(3) } + return r0, r1, r2, r3 } @@ -322,37 +311,31 @@ type CemEVCCInterface_ChargingPowerLimits_Call struct { } // ChargingPowerLimits is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCCInterface_Expecter) ChargingPowerLimits(entity interface{}) *CemEVCCInterface_ChargingPowerLimits_Call { return &CemEVCCInterface_ChargingPowerLimits_Call{Call: _e.mock.On("ChargingPowerLimits", entity)} } -func (_c *CemEVCCInterface_ChargingPowerLimits_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCCInterface_ChargingPowerLimits_Call { +func (_c *CemEVCCInterface_ChargingPowerLimits_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCCInterface_ChargingPowerLimits_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCCInterface_ChargingPowerLimits_Call) Return(f float64, f1 float64, f2 float64, err error) *CemEVCCInterface_ChargingPowerLimits_Call { - _c.Call.Return(f, f1, f2, err) +func (_c *CemEVCCInterface_ChargingPowerLimits_Call) Return(_a0 float64, _a1 float64, _a2 float64, _a3 error) *CemEVCCInterface_ChargingPowerLimits_Call { + _c.Call.Return(_a0, _a1, _a2, _a3) return _c } -func (_c *CemEVCCInterface_ChargingPowerLimits_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, float64, float64, error)) *CemEVCCInterface_ChargingPowerLimits_Call { +func (_c *CemEVCCInterface_ChargingPowerLimits_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, float64, float64, error)) *CemEVCCInterface_ChargingPowerLimits_Call { _c.Call.Return(run) return _c } -// CommunicationStandard provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) CommunicationStandard(entity api.EntityRemoteInterface) (model.DeviceConfigurationKeyValueStringType, error) { - ret := _mock.Called(entity) +// CommunicationStandard provides a mock function with given fields: entity +func (_m *CemEVCCInterface) CommunicationStandard(entity spine_goapi.EntityRemoteInterface) (model.DeviceConfigurationKeyValueStringType, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for CommunicationStandard") @@ -360,19 +343,21 @@ func (_mock *CemEVCCInterface) CommunicationStandard(entity api.EntityRemoteInte var r0 model.DeviceConfigurationKeyValueStringType var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (model.DeviceConfigurationKeyValueStringType, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (model.DeviceConfigurationKeyValueStringType, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) model.DeviceConfigurationKeyValueStringType); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) model.DeviceConfigurationKeyValueStringType); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(model.DeviceConfigurationKeyValueStringType) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -382,48 +367,43 @@ type CemEVCCInterface_CommunicationStandard_Call struct { } // CommunicationStandard is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCCInterface_Expecter) CommunicationStandard(entity interface{}) *CemEVCCInterface_CommunicationStandard_Call { return &CemEVCCInterface_CommunicationStandard_Call{Call: _e.mock.On("CommunicationStandard", entity)} } -func (_c *CemEVCCInterface_CommunicationStandard_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCCInterface_CommunicationStandard_Call { +func (_c *CemEVCCInterface_CommunicationStandard_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCCInterface_CommunicationStandard_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCCInterface_CommunicationStandard_Call) Return(deviceConfigurationKeyValueStringType model.DeviceConfigurationKeyValueStringType, err error) *CemEVCCInterface_CommunicationStandard_Call { - _c.Call.Return(deviceConfigurationKeyValueStringType, err) +func (_c *CemEVCCInterface_CommunicationStandard_Call) Return(_a0 model.DeviceConfigurationKeyValueStringType, _a1 error) *CemEVCCInterface_CommunicationStandard_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVCCInterface_CommunicationStandard_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (model.DeviceConfigurationKeyValueStringType, error)) *CemEVCCInterface_CommunicationStandard_Call { +func (_c *CemEVCCInterface_CommunicationStandard_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (model.DeviceConfigurationKeyValueStringType, error)) *CemEVCCInterface_CommunicationStandard_Call { _c.Call.Return(run) return _c } -// EVConnected provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) EVConnected(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// EVConnected provides a mock function with given fields: entity +func (_m *CemEVCCInterface) EVConnected(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for EVConnected") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -433,59 +413,55 @@ type CemEVCCInterface_EVConnected_Call struct { } // EVConnected is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCCInterface_Expecter) EVConnected(entity interface{}) *CemEVCCInterface_EVConnected_Call { return &CemEVCCInterface_EVConnected_Call{Call: _e.mock.On("EVConnected", entity)} } -func (_c *CemEVCCInterface_EVConnected_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCCInterface_EVConnected_Call { +func (_c *CemEVCCInterface_EVConnected_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCCInterface_EVConnected_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCCInterface_EVConnected_Call) Return(b bool) *CemEVCCInterface_EVConnected_Call { - _c.Call.Return(b) +func (_c *CemEVCCInterface_EVConnected_Call) Return(_a0 bool) *CemEVCCInterface_EVConnected_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVCCInterface_EVConnected_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CemEVCCInterface_EVConnected_Call { +func (_c *CemEVCCInterface_EVConnected_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CemEVCCInterface_EVConnected_Call { _c.Call.Return(run) return _c } -// Identifications provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) Identifications(entity api.EntityRemoteInterface) ([]api0.IdentificationItem, error) { - ret := _mock.Called(entity) +// Identifications provides a mock function with given fields: entity +func (_m *CemEVCCInterface) Identifications(entity spine_goapi.EntityRemoteInterface) ([]api.IdentificationItem, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for Identifications") } - var r0 []api0.IdentificationItem + var r0 []api.IdentificationItem var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]api0.IdentificationItem, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]api.IdentificationItem, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []api0.IdentificationItem); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []api.IdentificationItem); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.IdentificationItem) + r0 = ret.Get(0).([]api.IdentificationItem) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -495,48 +471,43 @@ type CemEVCCInterface_Identifications_Call struct { } // Identifications is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCCInterface_Expecter) Identifications(entity interface{}) *CemEVCCInterface_Identifications_Call { return &CemEVCCInterface_Identifications_Call{Call: _e.mock.On("Identifications", entity)} } -func (_c *CemEVCCInterface_Identifications_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCCInterface_Identifications_Call { +func (_c *CemEVCCInterface_Identifications_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCCInterface_Identifications_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCCInterface_Identifications_Call) Return(identificationItems []api0.IdentificationItem, err error) *CemEVCCInterface_Identifications_Call { - _c.Call.Return(identificationItems, err) +func (_c *CemEVCCInterface_Identifications_Call) Return(_a0 []api.IdentificationItem, _a1 error) *CemEVCCInterface_Identifications_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVCCInterface_Identifications_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]api0.IdentificationItem, error)) *CemEVCCInterface_Identifications_Call { +func (_c *CemEVCCInterface_Identifications_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]api.IdentificationItem, error)) *CemEVCCInterface_Identifications_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *CemEVCCInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -546,37 +517,31 @@ type CemEVCCInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCCInterface_Expecter) IsCompatibleEntityType(entity interface{}) *CemEVCCInterface_IsCompatibleEntityType_Call { return &CemEVCCInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *CemEVCCInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCCInterface_IsCompatibleEntityType_Call { +func (_c *CemEVCCInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCCInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCCInterface_IsCompatibleEntityType_Call) Return(b bool) *CemEVCCInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *CemEVCCInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *CemEVCCInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVCCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CemEVCCInterface_IsCompatibleEntityType_Call { +func (_c *CemEVCCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CemEVCCInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsInSleepMode provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) IsInSleepMode(entity api.EntityRemoteInterface) (bool, error) { - ret := _mock.Called(entity) +// IsInSleepMode provides a mock function with given fields: entity +func (_m *CemEVCCInterface) IsInSleepMode(entity spine_goapi.EntityRemoteInterface) (bool, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsInSleepMode") @@ -584,19 +549,21 @@ func (_mock *CemEVCCInterface) IsInSleepMode(entity api.EntityRemoteInterface) ( var r0 bool var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (bool, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (bool, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -606,48 +573,43 @@ type CemEVCCInterface_IsInSleepMode_Call struct { } // IsInSleepMode is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCCInterface_Expecter) IsInSleepMode(entity interface{}) *CemEVCCInterface_IsInSleepMode_Call { return &CemEVCCInterface_IsInSleepMode_Call{Call: _e.mock.On("IsInSleepMode", entity)} } -func (_c *CemEVCCInterface_IsInSleepMode_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCCInterface_IsInSleepMode_Call { +func (_c *CemEVCCInterface_IsInSleepMode_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCCInterface_IsInSleepMode_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCCInterface_IsInSleepMode_Call) Return(b bool, err error) *CemEVCCInterface_IsInSleepMode_Call { - _c.Call.Return(b, err) +func (_c *CemEVCCInterface_IsInSleepMode_Call) Return(_a0 bool, _a1 error) *CemEVCCInterface_IsInSleepMode_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVCCInterface_IsInSleepMode_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (bool, error)) *CemEVCCInterface_IsInSleepMode_Call { +func (_c *CemEVCCInterface_IsInSleepMode_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (bool, error)) *CemEVCCInterface_IsInSleepMode_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *CemEVCCInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -657,63 +619,54 @@ type CemEVCCInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *CemEVCCInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *CemEVCCInterface_IsScenarioAvailableAtEntity_Call { return &CemEVCCInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *CemEVCCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *CemEVCCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemEVCCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *CemEVCCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *CemEVCCInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *CemEVCCInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *CemEVCCInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *CemEVCCInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVCCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *CemEVCCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemEVCCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *CemEVCCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// ManufacturerData provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) ManufacturerData(entity api.EntityRemoteInterface) (api0.ManufacturerData, error) { - ret := _mock.Called(entity) +// ManufacturerData provides a mock function with given fields: entity +func (_m *CemEVCCInterface) ManufacturerData(entity spine_goapi.EntityRemoteInterface) (api.ManufacturerData, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for ManufacturerData") } - var r0 api0.ManufacturerData + var r0 api.ManufacturerData var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (api0.ManufacturerData, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (api.ManufacturerData, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) api0.ManufacturerData); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) api.ManufacturerData); ok { + r0 = rf(entity) } else { - r0 = ret.Get(0).(api0.ManufacturerData) + r0 = ret.Get(0).(api.ManufacturerData) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -723,50 +676,45 @@ type CemEVCCInterface_ManufacturerData_Call struct { } // ManufacturerData is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCCInterface_Expecter) ManufacturerData(entity interface{}) *CemEVCCInterface_ManufacturerData_Call { return &CemEVCCInterface_ManufacturerData_Call{Call: _e.mock.On("ManufacturerData", entity)} } -func (_c *CemEVCCInterface_ManufacturerData_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCCInterface_ManufacturerData_Call { +func (_c *CemEVCCInterface_ManufacturerData_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCCInterface_ManufacturerData_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCCInterface_ManufacturerData_Call) Return(manufacturerData api0.ManufacturerData, err error) *CemEVCCInterface_ManufacturerData_Call { - _c.Call.Return(manufacturerData, err) +func (_c *CemEVCCInterface_ManufacturerData_Call) Return(_a0 api.ManufacturerData, _a1 error) *CemEVCCInterface_ManufacturerData_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVCCInterface_ManufacturerData_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (api0.ManufacturerData, error)) *CemEVCCInterface_ManufacturerData_Call { +func (_c *CemEVCCInterface_ManufacturerData_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (api.ManufacturerData, error)) *CemEVCCInterface_ManufacturerData_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) RemoteEntitiesScenarios() []api1.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *CemEVCCInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api1.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api1.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api1.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -787,20 +735,19 @@ func (_c *CemEVCCInterface_RemoteEntitiesScenarios_Call) Run(run func()) *CemEVC return _c } -func (_c *CemEVCCInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api1.RemoteEntityScenarios) *CemEVCCInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *CemEVCCInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *CemEVCCInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVCCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api1.RemoteEntityScenarios) *CemEVCCInterface_RemoteEntitiesScenarios_Call { +func (_c *CemEVCCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *CemEVCCInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *CemEVCCInterface) RemoveUseCase() { + _m.Called() } // CemEVCCInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -830,10 +777,9 @@ func (_c *CemEVCCInterface_RemoveUseCase_Call) RunAndReturn(run func()) *CemEVCC return _c } -// UpdateUseCaseAvailability provides a mock function for the type CemEVCCInterface -func (_mock *CemEVCCInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *CemEVCCInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // CemEVCCInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -849,13 +795,7 @@ func (_e *CemEVCCInterface_Expecter) UpdateUseCaseAvailability(available interfa func (_c *CemEVCCInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *CemEVCCInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -865,7 +805,21 @@ func (_c *CemEVCCInterface_UpdateUseCaseAvailability_Call) Return() *CemEVCCInte return _c } -func (_c *CemEVCCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *CemEVCCInterface_UpdateUseCaseAvailability_Call { +func (_c *CemEVCCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *CemEVCCInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } + +// NewCemEVCCInterface creates a new instance of CemEVCCInterface. 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 NewCemEVCCInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CemEVCCInterface { + mock := &CemEVCCInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/CemEVCEMInterface.go b/usecases/mocks/CemEVCEMInterface.go index 02310eed..4876a7f3 100644 --- a/usecases/mocks/CemEVCEMInterface.go +++ b/usecases/mocks/CemEVCEMInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api0 "github.com/enbility/eebus-go/api" - "github.com/enbility/spine-go/api" + eebus_goapi "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) - -// NewCemEVCEMInterface creates a new instance of CemEVCEMInterface. 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 NewCemEVCEMInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *CemEVCEMInterface { - mock := &CemEVCEMInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // CemEVCEMInterface is an autogenerated mock type for the CemEVCEMInterface type type CemEVCEMInterface struct { @@ -37,10 +22,22 @@ func (_m *CemEVCEMInterface) EXPECT() *CemEVCEMInterface_Expecter { return &CemEVCEMInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *CemEVCEMInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // CemEVCEMInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -60,20 +57,19 @@ func (_c *CemEVCEMInterface_AddFeatures_Call) Run(run func()) *CemEVCEMInterface return _c } -func (_c *CemEVCEMInterface_AddFeatures_Call) Return() *CemEVCEMInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *CemEVCEMInterface_AddFeatures_Call) Return(_a0 error) *CemEVCEMInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVCEMInterface_AddFeatures_Call) RunAndReturn(run func()) *CemEVCEMInterface_AddFeatures_Call { - _c.Run(run) +func (_c *CemEVCEMInterface_AddFeatures_Call) RunAndReturn(run func() error) *CemEVCEMInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *CemEVCEMInterface) AddUseCase() { + _m.Called() } // CemEVCEMInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -103,22 +99,23 @@ func (_c *CemEVCEMInterface_AddUseCase_Call) RunAndReturn(run func()) *CemEVCEMI return _c } -// AvailableScenariosForEntity provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *CemEVCEMInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -128,37 +125,31 @@ type CemEVCEMInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCEMInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *CemEVCEMInterface_AvailableScenariosForEntity_Call { return &CemEVCEMInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *CemEVCEMInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCEMInterface_AvailableScenariosForEntity_Call { +func (_c *CemEVCEMInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCEMInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCEMInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *CemEVCEMInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *CemEVCEMInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *CemEVCEMInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVCEMInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *CemEVCEMInterface_AvailableScenariosForEntity_Call { +func (_c *CemEVCEMInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *CemEVCEMInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// CurrentPerPhase provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) CurrentPerPhase(entity api.EntityRemoteInterface) ([]float64, error) { - ret := _mock.Called(entity) +// CurrentPerPhase provides a mock function with given fields: entity +func (_m *CemEVCEMInterface) CurrentPerPhase(entity spine_goapi.EntityRemoteInterface) ([]float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for CurrentPerPhase") @@ -166,21 +157,23 @@ func (_mock *CemEVCEMInterface) CurrentPerPhase(entity api.EntityRemoteInterface var r0 []float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]float64) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -190,37 +183,31 @@ type CemEVCEMInterface_CurrentPerPhase_Call struct { } // CurrentPerPhase is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCEMInterface_Expecter) CurrentPerPhase(entity interface{}) *CemEVCEMInterface_CurrentPerPhase_Call { return &CemEVCEMInterface_CurrentPerPhase_Call{Call: _e.mock.On("CurrentPerPhase", entity)} } -func (_c *CemEVCEMInterface_CurrentPerPhase_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCEMInterface_CurrentPerPhase_Call { +func (_c *CemEVCEMInterface_CurrentPerPhase_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCEMInterface_CurrentPerPhase_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCEMInterface_CurrentPerPhase_Call) Return(float64s []float64, err error) *CemEVCEMInterface_CurrentPerPhase_Call { - _c.Call.Return(float64s, err) +func (_c *CemEVCEMInterface_CurrentPerPhase_Call) Return(_a0 []float64, _a1 error) *CemEVCEMInterface_CurrentPerPhase_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVCEMInterface_CurrentPerPhase_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]float64, error)) *CemEVCEMInterface_CurrentPerPhase_Call { +func (_c *CemEVCEMInterface_CurrentPerPhase_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]float64, error)) *CemEVCEMInterface_CurrentPerPhase_Call { _c.Call.Return(run) return _c } -// EnergyCharged provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) EnergyCharged(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// EnergyCharged provides a mock function with given fields: entity +func (_m *CemEVCEMInterface) EnergyCharged(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for EnergyCharged") @@ -228,19 +215,21 @@ func (_mock *CemEVCEMInterface) EnergyCharged(entity api.EntityRemoteInterface) var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -250,48 +239,43 @@ type CemEVCEMInterface_EnergyCharged_Call struct { } // EnergyCharged is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCEMInterface_Expecter) EnergyCharged(entity interface{}) *CemEVCEMInterface_EnergyCharged_Call { return &CemEVCEMInterface_EnergyCharged_Call{Call: _e.mock.On("EnergyCharged", entity)} } -func (_c *CemEVCEMInterface_EnergyCharged_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCEMInterface_EnergyCharged_Call { +func (_c *CemEVCEMInterface_EnergyCharged_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCEMInterface_EnergyCharged_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCEMInterface_EnergyCharged_Call) Return(f float64, err error) *CemEVCEMInterface_EnergyCharged_Call { - _c.Call.Return(f, err) +func (_c *CemEVCEMInterface_EnergyCharged_Call) Return(_a0 float64, _a1 error) *CemEVCEMInterface_EnergyCharged_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVCEMInterface_EnergyCharged_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *CemEVCEMInterface_EnergyCharged_Call { +func (_c *CemEVCEMInterface_EnergyCharged_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *CemEVCEMInterface_EnergyCharged_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *CemEVCEMInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -301,48 +285,43 @@ type CemEVCEMInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCEMInterface_Expecter) IsCompatibleEntityType(entity interface{}) *CemEVCEMInterface_IsCompatibleEntityType_Call { return &CemEVCEMInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *CemEVCEMInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCEMInterface_IsCompatibleEntityType_Call { +func (_c *CemEVCEMInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCEMInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCEMInterface_IsCompatibleEntityType_Call) Return(b bool) *CemEVCEMInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *CemEVCEMInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *CemEVCEMInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVCEMInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CemEVCEMInterface_IsCompatibleEntityType_Call { +func (_c *CemEVCEMInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CemEVCEMInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *CemEVCEMInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -352,43 +331,32 @@ type CemEVCEMInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *CemEVCEMInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call { return &CemEVCEMInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *CemEVCEMInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// PhasesConnected provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) PhasesConnected(entity api.EntityRemoteInterface) (uint, error) { - ret := _mock.Called(entity) +// PhasesConnected provides a mock function with given fields: entity +func (_m *CemEVCEMInterface) PhasesConnected(entity spine_goapi.EntityRemoteInterface) (uint, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for PhasesConnected") @@ -396,19 +364,21 @@ func (_mock *CemEVCEMInterface) PhasesConnected(entity api.EntityRemoteInterface var r0 uint var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (uint, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (uint, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) uint); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(uint) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -418,37 +388,31 @@ type CemEVCEMInterface_PhasesConnected_Call struct { } // PhasesConnected is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCEMInterface_Expecter) PhasesConnected(entity interface{}) *CemEVCEMInterface_PhasesConnected_Call { return &CemEVCEMInterface_PhasesConnected_Call{Call: _e.mock.On("PhasesConnected", entity)} } -func (_c *CemEVCEMInterface_PhasesConnected_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCEMInterface_PhasesConnected_Call { +func (_c *CemEVCEMInterface_PhasesConnected_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCEMInterface_PhasesConnected_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCEMInterface_PhasesConnected_Call) Return(v uint, err error) *CemEVCEMInterface_PhasesConnected_Call { - _c.Call.Return(v, err) +func (_c *CemEVCEMInterface_PhasesConnected_Call) Return(_a0 uint, _a1 error) *CemEVCEMInterface_PhasesConnected_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVCEMInterface_PhasesConnected_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (uint, error)) *CemEVCEMInterface_PhasesConnected_Call { +func (_c *CemEVCEMInterface_PhasesConnected_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (uint, error)) *CemEVCEMInterface_PhasesConnected_Call { _c.Call.Return(run) return _c } -// PowerPerPhase provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) PowerPerPhase(entity api.EntityRemoteInterface) ([]float64, error) { - ret := _mock.Called(entity) +// PowerPerPhase provides a mock function with given fields: entity +func (_m *CemEVCEMInterface) PowerPerPhase(entity spine_goapi.EntityRemoteInterface) ([]float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for PowerPerPhase") @@ -456,21 +420,23 @@ func (_mock *CemEVCEMInterface) PowerPerPhase(entity api.EntityRemoteInterface) var r0 []float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]float64) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -480,50 +446,45 @@ type CemEVCEMInterface_PowerPerPhase_Call struct { } // PowerPerPhase is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVCEMInterface_Expecter) PowerPerPhase(entity interface{}) *CemEVCEMInterface_PowerPerPhase_Call { return &CemEVCEMInterface_PowerPerPhase_Call{Call: _e.mock.On("PowerPerPhase", entity)} } -func (_c *CemEVCEMInterface_PowerPerPhase_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVCEMInterface_PowerPerPhase_Call { +func (_c *CemEVCEMInterface_PowerPerPhase_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVCEMInterface_PowerPerPhase_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVCEMInterface_PowerPerPhase_Call) Return(float64s []float64, err error) *CemEVCEMInterface_PowerPerPhase_Call { - _c.Call.Return(float64s, err) +func (_c *CemEVCEMInterface_PowerPerPhase_Call) Return(_a0 []float64, _a1 error) *CemEVCEMInterface_PowerPerPhase_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVCEMInterface_PowerPerPhase_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]float64, error)) *CemEVCEMInterface_PowerPerPhase_Call { +func (_c *CemEVCEMInterface_PowerPerPhase_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]float64, error)) *CemEVCEMInterface_PowerPerPhase_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) RemoteEntitiesScenarios() []api0.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *CemEVCEMInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api0.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api0.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -544,20 +505,19 @@ func (_c *CemEVCEMInterface_RemoteEntitiesScenarios_Call) Run(run func()) *CemEV return _c } -func (_c *CemEVCEMInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api0.RemoteEntityScenarios) *CemEVCEMInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *CemEVCEMInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *CemEVCEMInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVCEMInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api0.RemoteEntityScenarios) *CemEVCEMInterface_RemoteEntitiesScenarios_Call { +func (_c *CemEVCEMInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *CemEVCEMInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *CemEVCEMInterface) RemoveUseCase() { + _m.Called() } // CemEVCEMInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -587,10 +547,9 @@ func (_c *CemEVCEMInterface_RemoveUseCase_Call) RunAndReturn(run func()) *CemEVC return _c } -// UpdateUseCaseAvailability provides a mock function for the type CemEVCEMInterface -func (_mock *CemEVCEMInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *CemEVCEMInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // CemEVCEMInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -606,13 +565,7 @@ func (_e *CemEVCEMInterface_Expecter) UpdateUseCaseAvailability(available interf func (_c *CemEVCEMInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *CemEVCEMInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -622,7 +575,21 @@ func (_c *CemEVCEMInterface_UpdateUseCaseAvailability_Call) Return() *CemEVCEMIn return _c } -func (_c *CemEVCEMInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *CemEVCEMInterface_UpdateUseCaseAvailability_Call { +func (_c *CemEVCEMInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *CemEVCEMInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } + +// NewCemEVCEMInterface creates a new instance of CemEVCEMInterface. 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 NewCemEVCEMInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CemEVCEMInterface { + mock := &CemEVCEMInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/CemEVSECCInterface.go b/usecases/mocks/CemEVSECCInterface.go index 1c2c018c..64d2391e 100644 --- a/usecases/mocks/CemEVSECCInterface.go +++ b/usecases/mocks/CemEVSECCInterface.go @@ -1,30 +1,17 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api1 "github.com/enbility/eebus-go/api" - api0 "github.com/enbility/eebus-go/usecases/api" - "github.com/enbility/spine-go/api" - "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" -) + eebus_goapi "github.com/enbility/eebus-go/api" + api "github.com/enbility/eebus-go/usecases/api" -// NewCemEVSECCInterface creates a new instance of CemEVSECCInterface. 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 NewCemEVSECCInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *CemEVSECCInterface { - mock := &CemEVSECCInterface{} - mock.Mock.Test(t) + mock "github.com/stretchr/testify/mock" - t.Cleanup(func() { mock.AssertExpectations(t) }) + model "github.com/enbility/spine-go/model" - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // CemEVSECCInterface is an autogenerated mock type for the CemEVSECCInterface type type CemEVSECCInterface struct { @@ -39,10 +26,22 @@ func (_m *CemEVSECCInterface) EXPECT() *CemEVSECCInterface_Expecter { return &CemEVSECCInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type CemEVSECCInterface -func (_mock *CemEVSECCInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *CemEVSECCInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // CemEVSECCInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -62,20 +61,19 @@ func (_c *CemEVSECCInterface_AddFeatures_Call) Run(run func()) *CemEVSECCInterfa return _c } -func (_c *CemEVSECCInterface_AddFeatures_Call) Return() *CemEVSECCInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *CemEVSECCInterface_AddFeatures_Call) Return(_a0 error) *CemEVSECCInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVSECCInterface_AddFeatures_Call) RunAndReturn(run func()) *CemEVSECCInterface_AddFeatures_Call { - _c.Run(run) +func (_c *CemEVSECCInterface_AddFeatures_Call) RunAndReturn(run func() error) *CemEVSECCInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type CemEVSECCInterface -func (_mock *CemEVSECCInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *CemEVSECCInterface) AddUseCase() { + _m.Called() } // CemEVSECCInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -105,22 +103,23 @@ func (_c *CemEVSECCInterface_AddUseCase_Call) RunAndReturn(run func()) *CemEVSEC return _c } -// AvailableScenariosForEntity provides a mock function for the type CemEVSECCInterface -func (_mock *CemEVSECCInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *CemEVSECCInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -130,48 +129,43 @@ type CemEVSECCInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVSECCInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *CemEVSECCInterface_AvailableScenariosForEntity_Call { return &CemEVSECCInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *CemEVSECCInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVSECCInterface_AvailableScenariosForEntity_Call { +func (_c *CemEVSECCInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVSECCInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVSECCInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *CemEVSECCInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *CemEVSECCInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *CemEVSECCInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVSECCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *CemEVSECCInterface_AvailableScenariosForEntity_Call { +func (_c *CemEVSECCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *CemEVSECCInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type CemEVSECCInterface -func (_mock *CemEVSECCInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *CemEVSECCInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -181,48 +175,43 @@ type CemEVSECCInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVSECCInterface_Expecter) IsCompatibleEntityType(entity interface{}) *CemEVSECCInterface_IsCompatibleEntityType_Call { return &CemEVSECCInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *CemEVSECCInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVSECCInterface_IsCompatibleEntityType_Call { +func (_c *CemEVSECCInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVSECCInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVSECCInterface_IsCompatibleEntityType_Call) Return(b bool) *CemEVSECCInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *CemEVSECCInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *CemEVSECCInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVSECCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CemEVSECCInterface_IsCompatibleEntityType_Call { +func (_c *CemEVSECCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CemEVSECCInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type CemEVSECCInterface -func (_mock *CemEVSECCInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *CemEVSECCInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -232,63 +221,54 @@ type CemEVSECCInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *CemEVSECCInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call { return &CemEVSECCInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *CemEVSECCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// ManufacturerData provides a mock function for the type CemEVSECCInterface -func (_mock *CemEVSECCInterface) ManufacturerData(entity api.EntityRemoteInterface) (api0.ManufacturerData, error) { - ret := _mock.Called(entity) +// ManufacturerData provides a mock function with given fields: entity +func (_m *CemEVSECCInterface) ManufacturerData(entity spine_goapi.EntityRemoteInterface) (api.ManufacturerData, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for ManufacturerData") } - var r0 api0.ManufacturerData + var r0 api.ManufacturerData var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (api0.ManufacturerData, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (api.ManufacturerData, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) api0.ManufacturerData); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) api.ManufacturerData); ok { + r0 = rf(entity) } else { - r0 = ret.Get(0).(api0.ManufacturerData) + r0 = ret.Get(0).(api.ManufacturerData) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -298,37 +278,31 @@ type CemEVSECCInterface_ManufacturerData_Call struct { } // ManufacturerData is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVSECCInterface_Expecter) ManufacturerData(entity interface{}) *CemEVSECCInterface_ManufacturerData_Call { return &CemEVSECCInterface_ManufacturerData_Call{Call: _e.mock.On("ManufacturerData", entity)} } -func (_c *CemEVSECCInterface_ManufacturerData_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVSECCInterface_ManufacturerData_Call { +func (_c *CemEVSECCInterface_ManufacturerData_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVSECCInterface_ManufacturerData_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVSECCInterface_ManufacturerData_Call) Return(manufacturerData api0.ManufacturerData, err error) *CemEVSECCInterface_ManufacturerData_Call { - _c.Call.Return(manufacturerData, err) +func (_c *CemEVSECCInterface_ManufacturerData_Call) Return(_a0 api.ManufacturerData, _a1 error) *CemEVSECCInterface_ManufacturerData_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVSECCInterface_ManufacturerData_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (api0.ManufacturerData, error)) *CemEVSECCInterface_ManufacturerData_Call { +func (_c *CemEVSECCInterface_ManufacturerData_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (api.ManufacturerData, error)) *CemEVSECCInterface_ManufacturerData_Call { _c.Call.Return(run) return _c } -// OperatingState provides a mock function for the type CemEVSECCInterface -func (_mock *CemEVSECCInterface) OperatingState(entity api.EntityRemoteInterface) (model.DeviceDiagnosisOperatingStateType, string, error) { - ret := _mock.Called(entity) +// OperatingState provides a mock function with given fields: entity +func (_m *CemEVSECCInterface) OperatingState(entity spine_goapi.EntityRemoteInterface) (model.DeviceDiagnosisOperatingStateType, string, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for OperatingState") @@ -337,24 +311,27 @@ func (_mock *CemEVSECCInterface) OperatingState(entity api.EntityRemoteInterface var r0 model.DeviceDiagnosisOperatingStateType var r1 string var r2 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (model.DeviceDiagnosisOperatingStateType, string, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (model.DeviceDiagnosisOperatingStateType, string, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) model.DeviceDiagnosisOperatingStateType); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) model.DeviceDiagnosisOperatingStateType); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(model.DeviceDiagnosisOperatingStateType) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) string); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) string); ok { + r1 = rf(entity) } else { r1 = ret.Get(1).(string) } - if returnFunc, ok := ret.Get(2).(func(api.EntityRemoteInterface) error); ok { - r2 = returnFunc(entity) + + if rf, ok := ret.Get(2).(func(spine_goapi.EntityRemoteInterface) error); ok { + r2 = rf(entity) } else { r2 = ret.Error(2) } + return r0, r1, r2 } @@ -364,50 +341,45 @@ type CemEVSECCInterface_OperatingState_Call struct { } // OperatingState is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVSECCInterface_Expecter) OperatingState(entity interface{}) *CemEVSECCInterface_OperatingState_Call { return &CemEVSECCInterface_OperatingState_Call{Call: _e.mock.On("OperatingState", entity)} } -func (_c *CemEVSECCInterface_OperatingState_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVSECCInterface_OperatingState_Call { +func (_c *CemEVSECCInterface_OperatingState_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVSECCInterface_OperatingState_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVSECCInterface_OperatingState_Call) Return(deviceDiagnosisOperatingStateType model.DeviceDiagnosisOperatingStateType, s string, err error) *CemEVSECCInterface_OperatingState_Call { - _c.Call.Return(deviceDiagnosisOperatingStateType, s, err) +func (_c *CemEVSECCInterface_OperatingState_Call) Return(_a0 model.DeviceDiagnosisOperatingStateType, _a1 string, _a2 error) *CemEVSECCInterface_OperatingState_Call { + _c.Call.Return(_a0, _a1, _a2) return _c } -func (_c *CemEVSECCInterface_OperatingState_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (model.DeviceDiagnosisOperatingStateType, string, error)) *CemEVSECCInterface_OperatingState_Call { +func (_c *CemEVSECCInterface_OperatingState_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (model.DeviceDiagnosisOperatingStateType, string, error)) *CemEVSECCInterface_OperatingState_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type CemEVSECCInterface -func (_mock *CemEVSECCInterface) RemoteEntitiesScenarios() []api1.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *CemEVSECCInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api1.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api1.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api1.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -428,20 +400,19 @@ func (_c *CemEVSECCInterface_RemoteEntitiesScenarios_Call) Run(run func()) *CemE return _c } -func (_c *CemEVSECCInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api1.RemoteEntityScenarios) *CemEVSECCInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *CemEVSECCInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *CemEVSECCInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVSECCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api1.RemoteEntityScenarios) *CemEVSECCInterface_RemoteEntitiesScenarios_Call { +func (_c *CemEVSECCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *CemEVSECCInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type CemEVSECCInterface -func (_mock *CemEVSECCInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *CemEVSECCInterface) RemoveUseCase() { + _m.Called() } // CemEVSECCInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -471,10 +442,9 @@ func (_c *CemEVSECCInterface_RemoveUseCase_Call) RunAndReturn(run func()) *CemEV return _c } -// UpdateUseCaseAvailability provides a mock function for the type CemEVSECCInterface -func (_mock *CemEVSECCInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *CemEVSECCInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // CemEVSECCInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -490,13 +460,7 @@ func (_e *CemEVSECCInterface_Expecter) UpdateUseCaseAvailability(available inter func (_c *CemEVSECCInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *CemEVSECCInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -506,7 +470,21 @@ func (_c *CemEVSECCInterface_UpdateUseCaseAvailability_Call) Return() *CemEVSECC return _c } -func (_c *CemEVSECCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *CemEVSECCInterface_UpdateUseCaseAvailability_Call { +func (_c *CemEVSECCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *CemEVSECCInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } + +// NewCemEVSECCInterface creates a new instance of CemEVSECCInterface. 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 NewCemEVSECCInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CemEVSECCInterface { + mock := &CemEVSECCInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/CemEVSOCInterface.go b/usecases/mocks/CemEVSOCInterface.go index 862e8563..2f53810e 100644 --- a/usecases/mocks/CemEVSOCInterface.go +++ b/usecases/mocks/CemEVSOCInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api0 "github.com/enbility/eebus-go/api" - "github.com/enbility/spine-go/api" + eebus_goapi "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) -// NewCemEVSOCInterface creates a new instance of CemEVSOCInterface. 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 NewCemEVSOCInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *CemEVSOCInterface { - mock := &CemEVSOCInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // CemEVSOCInterface is an autogenerated mock type for the CemEVSOCInterface type type CemEVSOCInterface struct { @@ -37,10 +22,22 @@ func (_m *CemEVSOCInterface) EXPECT() *CemEVSOCInterface_Expecter { return &CemEVSOCInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type CemEVSOCInterface -func (_mock *CemEVSOCInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *CemEVSOCInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // CemEVSOCInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -60,20 +57,19 @@ func (_c *CemEVSOCInterface_AddFeatures_Call) Run(run func()) *CemEVSOCInterface return _c } -func (_c *CemEVSOCInterface_AddFeatures_Call) Return() *CemEVSOCInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *CemEVSOCInterface_AddFeatures_Call) Return(_a0 error) *CemEVSOCInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVSOCInterface_AddFeatures_Call) RunAndReturn(run func()) *CemEVSOCInterface_AddFeatures_Call { - _c.Run(run) +func (_c *CemEVSOCInterface_AddFeatures_Call) RunAndReturn(run func() error) *CemEVSOCInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type CemEVSOCInterface -func (_mock *CemEVSOCInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *CemEVSOCInterface) AddUseCase() { + _m.Called() } // CemEVSOCInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -103,22 +99,23 @@ func (_c *CemEVSOCInterface_AddUseCase_Call) RunAndReturn(run func()) *CemEVSOCI return _c } -// AvailableScenariosForEntity provides a mock function for the type CemEVSOCInterface -func (_mock *CemEVSOCInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *CemEVSOCInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -128,48 +125,43 @@ type CemEVSOCInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVSOCInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *CemEVSOCInterface_AvailableScenariosForEntity_Call { return &CemEVSOCInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *CemEVSOCInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVSOCInterface_AvailableScenariosForEntity_Call { +func (_c *CemEVSOCInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVSOCInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVSOCInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *CemEVSOCInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *CemEVSOCInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *CemEVSOCInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVSOCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *CemEVSOCInterface_AvailableScenariosForEntity_Call { +func (_c *CemEVSOCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *CemEVSOCInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type CemEVSOCInterface -func (_mock *CemEVSOCInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *CemEVSOCInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -179,48 +171,43 @@ type CemEVSOCInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVSOCInterface_Expecter) IsCompatibleEntityType(entity interface{}) *CemEVSOCInterface_IsCompatibleEntityType_Call { return &CemEVSOCInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *CemEVSOCInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVSOCInterface_IsCompatibleEntityType_Call { +func (_c *CemEVSOCInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVSOCInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVSOCInterface_IsCompatibleEntityType_Call) Return(b bool) *CemEVSOCInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *CemEVSOCInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *CemEVSOCInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVSOCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CemEVSOCInterface_IsCompatibleEntityType_Call { +func (_c *CemEVSOCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CemEVSOCInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type CemEVSOCInterface -func (_mock *CemEVSOCInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *CemEVSOCInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -230,56 +217,46 @@ type CemEVSOCInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *CemEVSOCInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call { return &CemEVSOCInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *CemEVSOCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type CemEVSOCInterface -func (_mock *CemEVSOCInterface) RemoteEntitiesScenarios() []api0.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *CemEVSOCInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api0.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api0.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -300,20 +277,19 @@ func (_c *CemEVSOCInterface_RemoteEntitiesScenarios_Call) Run(run func()) *CemEV return _c } -func (_c *CemEVSOCInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api0.RemoteEntityScenarios) *CemEVSOCInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *CemEVSOCInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *CemEVSOCInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemEVSOCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api0.RemoteEntityScenarios) *CemEVSOCInterface_RemoteEntitiesScenarios_Call { +func (_c *CemEVSOCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *CemEVSOCInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type CemEVSOCInterface -func (_mock *CemEVSOCInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *CemEVSOCInterface) RemoveUseCase() { + _m.Called() } // CemEVSOCInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -343,9 +319,9 @@ func (_c *CemEVSOCInterface_RemoveUseCase_Call) RunAndReturn(run func()) *CemEVS return _c } -// StateOfCharge provides a mock function for the type CemEVSOCInterface -func (_mock *CemEVSOCInterface) StateOfCharge(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// StateOfCharge provides a mock function with given fields: entity +func (_m *CemEVSOCInterface) StateOfCharge(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for StateOfCharge") @@ -353,19 +329,21 @@ func (_mock *CemEVSOCInterface) StateOfCharge(entity api.EntityRemoteInterface) var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -375,38 +353,31 @@ type CemEVSOCInterface_StateOfCharge_Call struct { } // StateOfCharge is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemEVSOCInterface_Expecter) StateOfCharge(entity interface{}) *CemEVSOCInterface_StateOfCharge_Call { return &CemEVSOCInterface_StateOfCharge_Call{Call: _e.mock.On("StateOfCharge", entity)} } -func (_c *CemEVSOCInterface_StateOfCharge_Call) Run(run func(entity api.EntityRemoteInterface)) *CemEVSOCInterface_StateOfCharge_Call { +func (_c *CemEVSOCInterface_StateOfCharge_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemEVSOCInterface_StateOfCharge_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemEVSOCInterface_StateOfCharge_Call) Return(f float64, err error) *CemEVSOCInterface_StateOfCharge_Call { - _c.Call.Return(f, err) +func (_c *CemEVSOCInterface_StateOfCharge_Call) Return(_a0 float64, _a1 error) *CemEVSOCInterface_StateOfCharge_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemEVSOCInterface_StateOfCharge_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *CemEVSOCInterface_StateOfCharge_Call { +func (_c *CemEVSOCInterface_StateOfCharge_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *CemEVSOCInterface_StateOfCharge_Call { _c.Call.Return(run) return _c } -// UpdateUseCaseAvailability provides a mock function for the type CemEVSOCInterface -func (_mock *CemEVSOCInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *CemEVSOCInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // CemEVSOCInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -422,13 +393,7 @@ func (_e *CemEVSOCInterface_Expecter) UpdateUseCaseAvailability(available interf func (_c *CemEVSOCInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *CemEVSOCInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -438,7 +403,21 @@ func (_c *CemEVSOCInterface_UpdateUseCaseAvailability_Call) Return() *CemEVSOCIn return _c } -func (_c *CemEVSOCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *CemEVSOCInterface_UpdateUseCaseAvailability_Call { +func (_c *CemEVSOCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *CemEVSOCInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } + +// NewCemEVSOCInterface creates a new instance of CemEVSOCInterface. 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 NewCemEVSOCInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CemEVSOCInterface { + mock := &CemEVSOCInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/CemOPEVInterface.go b/usecases/mocks/CemOPEVInterface.go index 70eb72b3..2040fb32 100644 --- a/usecases/mocks/CemOPEVInterface.go +++ b/usecases/mocks/CemOPEVInterface.go @@ -1,30 +1,17 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api1 "github.com/enbility/eebus-go/api" - api0 "github.com/enbility/eebus-go/usecases/api" - "github.com/enbility/spine-go/api" - "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" -) + eebus_goapi "github.com/enbility/eebus-go/api" + api "github.com/enbility/eebus-go/usecases/api" -// NewCemOPEVInterface creates a new instance of CemOPEVInterface. 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 NewCemOPEVInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *CemOPEVInterface { - mock := &CemOPEVInterface{} - mock.Mock.Test(t) + mock "github.com/stretchr/testify/mock" - t.Cleanup(func() { mock.AssertExpectations(t) }) + model "github.com/enbility/spine-go/model" - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // CemOPEVInterface is an autogenerated mock type for the CemOPEVInterface type type CemOPEVInterface struct { @@ -39,10 +26,22 @@ func (_m *CemOPEVInterface) EXPECT() *CemOPEVInterface_Expecter { return &CemOPEVInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *CemOPEVInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // CemOPEVInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -62,20 +61,19 @@ func (_c *CemOPEVInterface_AddFeatures_Call) Run(run func()) *CemOPEVInterface_A return _c } -func (_c *CemOPEVInterface_AddFeatures_Call) Return() *CemOPEVInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *CemOPEVInterface_AddFeatures_Call) Return(_a0 error) *CemOPEVInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOPEVInterface_AddFeatures_Call) RunAndReturn(run func()) *CemOPEVInterface_AddFeatures_Call { - _c.Run(run) +func (_c *CemOPEVInterface_AddFeatures_Call) RunAndReturn(run func() error) *CemOPEVInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *CemOPEVInterface) AddUseCase() { + _m.Called() } // CemOPEVInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -105,22 +103,23 @@ func (_c *CemOPEVInterface_AddUseCase_Call) RunAndReturn(run func()) *CemOPEVInt return _c } -// AvailableScenariosForEntity provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *CemOPEVInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -130,37 +129,31 @@ type CemOPEVInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemOPEVInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *CemOPEVInterface_AvailableScenariosForEntity_Call { return &CemOPEVInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *CemOPEVInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *CemOPEVInterface_AvailableScenariosForEntity_Call { +func (_c *CemOPEVInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemOPEVInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemOPEVInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *CemOPEVInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *CemOPEVInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *CemOPEVInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOPEVInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *CemOPEVInterface_AvailableScenariosForEntity_Call { +func (_c *CemOPEVInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *CemOPEVInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// CurrentLimits provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) CurrentLimits(entity api.EntityRemoteInterface) ([]float64, []float64, []float64, error) { - ret := _mock.Called(entity) +// CurrentLimits provides a mock function with given fields: entity +func (_m *CemOPEVInterface) CurrentLimits(entity spine_goapi.EntityRemoteInterface) ([]float64, []float64, []float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for CurrentLimits") @@ -170,35 +163,39 @@ func (_mock *CemOPEVInterface) CurrentLimits(entity api.EntityRemoteInterface) ( var r1 []float64 var r2 []float64 var r3 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]float64, []float64, []float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]float64, []float64, []float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]float64) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) []float64); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r1 = rf(entity) } else { if ret.Get(1) != nil { r1 = ret.Get(1).([]float64) } } - if returnFunc, ok := ret.Get(2).(func(api.EntityRemoteInterface) []float64); ok { - r2 = returnFunc(entity) + + if rf, ok := ret.Get(2).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r2 = rf(entity) } else { if ret.Get(2) != nil { r2 = ret.Get(2).([]float64) } } - if returnFunc, ok := ret.Get(3).(func(api.EntityRemoteInterface) error); ok { - r3 = returnFunc(entity) + + if rf, ok := ret.Get(3).(func(spine_goapi.EntityRemoteInterface) error); ok { + r3 = rf(entity) } else { r3 = ret.Error(3) } + return r0, r1, r2, r3 } @@ -208,48 +205,43 @@ type CemOPEVInterface_CurrentLimits_Call struct { } // CurrentLimits is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemOPEVInterface_Expecter) CurrentLimits(entity interface{}) *CemOPEVInterface_CurrentLimits_Call { return &CemOPEVInterface_CurrentLimits_Call{Call: _e.mock.On("CurrentLimits", entity)} } -func (_c *CemOPEVInterface_CurrentLimits_Call) Run(run func(entity api.EntityRemoteInterface)) *CemOPEVInterface_CurrentLimits_Call { +func (_c *CemOPEVInterface_CurrentLimits_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemOPEVInterface_CurrentLimits_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemOPEVInterface_CurrentLimits_Call) Return(float64s []float64, float64s1 []float64, float64s2 []float64, err error) *CemOPEVInterface_CurrentLimits_Call { - _c.Call.Return(float64s, float64s1, float64s2, err) +func (_c *CemOPEVInterface_CurrentLimits_Call) Return(_a0 []float64, _a1 []float64, _a2 []float64, _a3 error) *CemOPEVInterface_CurrentLimits_Call { + _c.Call.Return(_a0, _a1, _a2, _a3) return _c } -func (_c *CemOPEVInterface_CurrentLimits_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]float64, []float64, []float64, error)) *CemOPEVInterface_CurrentLimits_Call { +func (_c *CemOPEVInterface_CurrentLimits_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]float64, []float64, []float64, error)) *CemOPEVInterface_CurrentLimits_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *CemOPEVInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -259,48 +251,43 @@ type CemOPEVInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemOPEVInterface_Expecter) IsCompatibleEntityType(entity interface{}) *CemOPEVInterface_IsCompatibleEntityType_Call { return &CemOPEVInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *CemOPEVInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *CemOPEVInterface_IsCompatibleEntityType_Call { +func (_c *CemOPEVInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemOPEVInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemOPEVInterface_IsCompatibleEntityType_Call) Return(b bool) *CemOPEVInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *CemOPEVInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *CemOPEVInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOPEVInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CemOPEVInterface_IsCompatibleEntityType_Call { +func (_c *CemOPEVInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CemOPEVInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *CemOPEVInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -310,65 +297,56 @@ type CemOPEVInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *CemOPEVInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *CemOPEVInterface_IsScenarioAvailableAtEntity_Call { return &CemOPEVInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *CemOPEVInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *CemOPEVInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemOPEVInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *CemOPEVInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *CemOPEVInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *CemOPEVInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *CemOPEVInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *CemOPEVInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOPEVInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *CemOPEVInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemOPEVInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *CemOPEVInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// LoadControlLimits provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) LoadControlLimits(entity api.EntityRemoteInterface) ([]api0.LoadLimitsPhase, error) { - ret := _mock.Called(entity) +// LoadControlLimits provides a mock function with given fields: entity +func (_m *CemOPEVInterface) LoadControlLimits(entity spine_goapi.EntityRemoteInterface) ([]api.LoadLimitsPhase, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for LoadControlLimits") } - var r0 []api0.LoadLimitsPhase + var r0 []api.LoadLimitsPhase var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]api0.LoadLimitsPhase, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]api.LoadLimitsPhase, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []api0.LoadLimitsPhase); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []api.LoadLimitsPhase); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.LoadLimitsPhase) + r0 = ret.Get(0).([]api.LoadLimitsPhase) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -378,50 +356,45 @@ type CemOPEVInterface_LoadControlLimits_Call struct { } // LoadControlLimits is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemOPEVInterface_Expecter) LoadControlLimits(entity interface{}) *CemOPEVInterface_LoadControlLimits_Call { return &CemOPEVInterface_LoadControlLimits_Call{Call: _e.mock.On("LoadControlLimits", entity)} } -func (_c *CemOPEVInterface_LoadControlLimits_Call) Run(run func(entity api.EntityRemoteInterface)) *CemOPEVInterface_LoadControlLimits_Call { +func (_c *CemOPEVInterface_LoadControlLimits_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemOPEVInterface_LoadControlLimits_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemOPEVInterface_LoadControlLimits_Call) Return(limits []api0.LoadLimitsPhase, resultErr error) *CemOPEVInterface_LoadControlLimits_Call { +func (_c *CemOPEVInterface_LoadControlLimits_Call) Return(limits []api.LoadLimitsPhase, resultErr error) *CemOPEVInterface_LoadControlLimits_Call { _c.Call.Return(limits, resultErr) return _c } -func (_c *CemOPEVInterface_LoadControlLimits_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]api0.LoadLimitsPhase, error)) *CemOPEVInterface_LoadControlLimits_Call { +func (_c *CemOPEVInterface_LoadControlLimits_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]api.LoadLimitsPhase, error)) *CemOPEVInterface_LoadControlLimits_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) RemoteEntitiesScenarios() []api1.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *CemOPEVInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api1.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api1.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api1.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -442,20 +415,19 @@ func (_c *CemOPEVInterface_RemoteEntitiesScenarios_Call) Run(run func()) *CemOPE return _c } -func (_c *CemOPEVInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api1.RemoteEntityScenarios) *CemOPEVInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *CemOPEVInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *CemOPEVInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOPEVInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api1.RemoteEntityScenarios) *CemOPEVInterface_RemoteEntitiesScenarios_Call { +func (_c *CemOPEVInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *CemOPEVInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *CemOPEVInterface) RemoveUseCase() { + _m.Called() } // CemOPEVInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -485,20 +457,21 @@ func (_c *CemOPEVInterface_RemoveUseCase_Call) RunAndReturn(run func()) *CemOPEV return _c } -// SetOperatingState provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) SetOperatingState(failureState bool) error { - ret := _mock.Called(failureState) +// SetOperatingState provides a mock function with given fields: failureState +func (_m *CemOPEVInterface) SetOperatingState(failureState bool) error { + ret := _m.Called(failureState) if len(ret) == 0 { panic("no return value specified for SetOperatingState") } var r0 error - if returnFunc, ok := ret.Get(0).(func(bool) error); ok { - r0 = returnFunc(failureState) + if rf, ok := ret.Get(0).(func(bool) error); ok { + r0 = rf(failureState) } else { r0 = ret.Error(0) } + return r0 } @@ -515,31 +488,24 @@ func (_e *CemOPEVInterface_Expecter) SetOperatingState(failureState interface{}) func (_c *CemOPEVInterface_SetOperatingState_Call) Run(run func(failureState bool)) *CemOPEVInterface_SetOperatingState_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } -func (_c *CemOPEVInterface_SetOperatingState_Call) Return(err error) *CemOPEVInterface_SetOperatingState_Call { - _c.Call.Return(err) +func (_c *CemOPEVInterface_SetOperatingState_Call) Return(_a0 error) *CemOPEVInterface_SetOperatingState_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOPEVInterface_SetOperatingState_Call) RunAndReturn(run func(failureState bool) error) *CemOPEVInterface_SetOperatingState_Call { +func (_c *CemOPEVInterface_SetOperatingState_Call) RunAndReturn(run func(bool) error) *CemOPEVInterface_SetOperatingState_Call { _c.Call.Return(run) return _c } -// StartHeartbeat provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) StartHeartbeat() { - _mock.Called() - return +// StartHeartbeat provides a mock function with no fields +func (_m *CemOPEVInterface) StartHeartbeat() { + _m.Called() } // CemOPEVInterface_StartHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartHeartbeat' @@ -569,10 +535,9 @@ func (_c *CemOPEVInterface_StartHeartbeat_Call) RunAndReturn(run func()) *CemOPE return _c } -// StopHeartbeat provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) StopHeartbeat() { - _mock.Called() - return +// StopHeartbeat provides a mock function with no fields +func (_m *CemOPEVInterface) StopHeartbeat() { + _m.Called() } // CemOPEVInterface_StopHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopHeartbeat' @@ -602,10 +567,9 @@ func (_c *CemOPEVInterface_StopHeartbeat_Call) RunAndReturn(run func()) *CemOPEV return _c } -// UpdateUseCaseAvailability provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *CemOPEVInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // CemOPEVInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -621,13 +585,7 @@ func (_e *CemOPEVInterface_Expecter) UpdateUseCaseAvailability(available interfa func (_c *CemOPEVInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *CemOPEVInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -637,14 +595,14 @@ func (_c *CemOPEVInterface_UpdateUseCaseAvailability_Call) Return() *CemOPEVInte return _c } -func (_c *CemOPEVInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *CemOPEVInterface_UpdateUseCaseAvailability_Call { +func (_c *CemOPEVInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *CemOPEVInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } -// WriteLoadControlLimits provides a mock function for the type CemOPEVInterface -func (_mock *CemOPEVInterface) WriteLoadControlLimits(entity api.EntityRemoteInterface, limits []api0.LoadLimitsPhase, resultCB func(result model.ResultDataType)) (*model.MsgCounterType, error) { - ret := _mock.Called(entity, limits, resultCB) +// WriteLoadControlLimits provides a mock function with given fields: entity, limits, resultCB +func (_m *CemOPEVInterface) WriteLoadControlLimits(entity spine_goapi.EntityRemoteInterface, limits []api.LoadLimitsPhase, resultCB func(model.ResultDataType)) (*model.MsgCounterType, error) { + ret := _m.Called(entity, limits, resultCB) if len(ret) == 0 { panic("no return value specified for WriteLoadControlLimits") @@ -652,21 +610,23 @@ func (_mock *CemOPEVInterface) WriteLoadControlLimits(entity api.EntityRemoteInt var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, []api0.LoadLimitsPhase, func(result model.ResultDataType)) (*model.MsgCounterType, error)); ok { - return returnFunc(entity, limits, resultCB) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, []api.LoadLimitsPhase, func(model.ResultDataType)) (*model.MsgCounterType, error)); ok { + return rf(entity, limits, resultCB) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, []api0.LoadLimitsPhase, func(result model.ResultDataType)) *model.MsgCounterType); ok { - r0 = returnFunc(entity, limits, resultCB) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, []api.LoadLimitsPhase, func(model.ResultDataType)) *model.MsgCounterType); ok { + r0 = rf(entity, limits, resultCB) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface, []api0.LoadLimitsPhase, func(result model.ResultDataType)) error); ok { - r1 = returnFunc(entity, limits, resultCB) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface, []api.LoadLimitsPhase, func(model.ResultDataType)) error); ok { + r1 = rf(entity, limits, resultCB) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -676,42 +636,40 @@ type CemOPEVInterface_WriteLoadControlLimits_Call struct { } // WriteLoadControlLimits is a helper method to define mock.On call -// - entity api.EntityRemoteInterface -// - limits []api0.LoadLimitsPhase -// - resultCB func(result model.ResultDataType) +// - entity spine_goapi.EntityRemoteInterface +// - limits []api.LoadLimitsPhase +// - resultCB func(model.ResultDataType) func (_e *CemOPEVInterface_Expecter) WriteLoadControlLimits(entity interface{}, limits interface{}, resultCB interface{}) *CemOPEVInterface_WriteLoadControlLimits_Call { return &CemOPEVInterface_WriteLoadControlLimits_Call{Call: _e.mock.On("WriteLoadControlLimits", entity, limits, resultCB)} } -func (_c *CemOPEVInterface_WriteLoadControlLimits_Call) Run(run func(entity api.EntityRemoteInterface, limits []api0.LoadLimitsPhase, resultCB func(result model.ResultDataType))) *CemOPEVInterface_WriteLoadControlLimits_Call { +func (_c *CemOPEVInterface_WriteLoadControlLimits_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, limits []api.LoadLimitsPhase, resultCB func(model.ResultDataType))) *CemOPEVInterface_WriteLoadControlLimits_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 []api0.LoadLimitsPhase - if args[1] != nil { - arg1 = args[1].([]api0.LoadLimitsPhase) - } - var arg2 func(result model.ResultDataType) - if args[2] != nil { - arg2 = args[2].(func(result model.ResultDataType)) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].([]api.LoadLimitsPhase), args[2].(func(model.ResultDataType))) }) return _c } -func (_c *CemOPEVInterface_WriteLoadControlLimits_Call) Return(msgCounterType *model.MsgCounterType, err error) *CemOPEVInterface_WriteLoadControlLimits_Call { - _c.Call.Return(msgCounterType, err) +func (_c *CemOPEVInterface_WriteLoadControlLimits_Call) Return(_a0 *model.MsgCounterType, _a1 error) *CemOPEVInterface_WriteLoadControlLimits_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemOPEVInterface_WriteLoadControlLimits_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, limits []api0.LoadLimitsPhase, resultCB func(result model.ResultDataType)) (*model.MsgCounterType, error)) *CemOPEVInterface_WriteLoadControlLimits_Call { +func (_c *CemOPEVInterface_WriteLoadControlLimits_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, []api.LoadLimitsPhase, func(model.ResultDataType)) (*model.MsgCounterType, error)) *CemOPEVInterface_WriteLoadControlLimits_Call { _c.Call.Return(run) return _c } + +// NewCemOPEVInterface creates a new instance of CemOPEVInterface. 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 NewCemOPEVInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CemOPEVInterface { + mock := &CemOPEVInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/CemOSCEVInterface.go b/usecases/mocks/CemOSCEVInterface.go index 0f11ef40..9e8ab8a1 100644 --- a/usecases/mocks/CemOSCEVInterface.go +++ b/usecases/mocks/CemOSCEVInterface.go @@ -1,30 +1,17 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api1 "github.com/enbility/eebus-go/api" - api0 "github.com/enbility/eebus-go/usecases/api" - "github.com/enbility/spine-go/api" - "github.com/enbility/spine-go/model" - mock "github.com/stretchr/testify/mock" -) + eebus_goapi "github.com/enbility/eebus-go/api" + api "github.com/enbility/eebus-go/usecases/api" -// NewCemOSCEVInterface creates a new instance of CemOSCEVInterface. 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 NewCemOSCEVInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *CemOSCEVInterface { - mock := &CemOSCEVInterface{} - mock.Mock.Test(t) + mock "github.com/stretchr/testify/mock" - t.Cleanup(func() { mock.AssertExpectations(t) }) + model "github.com/enbility/spine-go/model" - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // CemOSCEVInterface is an autogenerated mock type for the CemOSCEVInterface type type CemOSCEVInterface struct { @@ -39,10 +26,22 @@ func (_m *CemOSCEVInterface) EXPECT() *CemOSCEVInterface_Expecter { return &CemOSCEVInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *CemOSCEVInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // CemOSCEVInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -62,20 +61,19 @@ func (_c *CemOSCEVInterface_AddFeatures_Call) Run(run func()) *CemOSCEVInterface return _c } -func (_c *CemOSCEVInterface_AddFeatures_Call) Return() *CemOSCEVInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *CemOSCEVInterface_AddFeatures_Call) Return(_a0 error) *CemOSCEVInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOSCEVInterface_AddFeatures_Call) RunAndReturn(run func()) *CemOSCEVInterface_AddFeatures_Call { - _c.Run(run) +func (_c *CemOSCEVInterface_AddFeatures_Call) RunAndReturn(run func() error) *CemOSCEVInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *CemOSCEVInterface) AddUseCase() { + _m.Called() } // CemOSCEVInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -105,22 +103,23 @@ func (_c *CemOSCEVInterface_AddUseCase_Call) RunAndReturn(run func()) *CemOSCEVI return _c } -// AvailableScenariosForEntity provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *CemOSCEVInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -130,37 +129,31 @@ type CemOSCEVInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemOSCEVInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *CemOSCEVInterface_AvailableScenariosForEntity_Call { return &CemOSCEVInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *CemOSCEVInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *CemOSCEVInterface_AvailableScenariosForEntity_Call { +func (_c *CemOSCEVInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemOSCEVInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemOSCEVInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *CemOSCEVInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *CemOSCEVInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *CemOSCEVInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOSCEVInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *CemOSCEVInterface_AvailableScenariosForEntity_Call { +func (_c *CemOSCEVInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *CemOSCEVInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// CurrentLimits provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) CurrentLimits(entity api.EntityRemoteInterface) ([]float64, []float64, []float64, error) { - ret := _mock.Called(entity) +// CurrentLimits provides a mock function with given fields: entity +func (_m *CemOSCEVInterface) CurrentLimits(entity spine_goapi.EntityRemoteInterface) ([]float64, []float64, []float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for CurrentLimits") @@ -170,35 +163,39 @@ func (_mock *CemOSCEVInterface) CurrentLimits(entity api.EntityRemoteInterface) var r1 []float64 var r2 []float64 var r3 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]float64, []float64, []float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]float64, []float64, []float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]float64) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) []float64); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r1 = rf(entity) } else { if ret.Get(1) != nil { r1 = ret.Get(1).([]float64) } } - if returnFunc, ok := ret.Get(2).(func(api.EntityRemoteInterface) []float64); ok { - r2 = returnFunc(entity) + + if rf, ok := ret.Get(2).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r2 = rf(entity) } else { if ret.Get(2) != nil { r2 = ret.Get(2).([]float64) } } - if returnFunc, ok := ret.Get(3).(func(api.EntityRemoteInterface) error); ok { - r3 = returnFunc(entity) + + if rf, ok := ret.Get(3).(func(spine_goapi.EntityRemoteInterface) error); ok { + r3 = rf(entity) } else { r3 = ret.Error(3) } + return r0, r1, r2, r3 } @@ -208,48 +205,43 @@ type CemOSCEVInterface_CurrentLimits_Call struct { } // CurrentLimits is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemOSCEVInterface_Expecter) CurrentLimits(entity interface{}) *CemOSCEVInterface_CurrentLimits_Call { return &CemOSCEVInterface_CurrentLimits_Call{Call: _e.mock.On("CurrentLimits", entity)} } -func (_c *CemOSCEVInterface_CurrentLimits_Call) Run(run func(entity api.EntityRemoteInterface)) *CemOSCEVInterface_CurrentLimits_Call { +func (_c *CemOSCEVInterface_CurrentLimits_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemOSCEVInterface_CurrentLimits_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemOSCEVInterface_CurrentLimits_Call) Return(float64s []float64, float64s1 []float64, float64s2 []float64, err error) *CemOSCEVInterface_CurrentLimits_Call { - _c.Call.Return(float64s, float64s1, float64s2, err) +func (_c *CemOSCEVInterface_CurrentLimits_Call) Return(_a0 []float64, _a1 []float64, _a2 []float64, _a3 error) *CemOSCEVInterface_CurrentLimits_Call { + _c.Call.Return(_a0, _a1, _a2, _a3) return _c } -func (_c *CemOSCEVInterface_CurrentLimits_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]float64, []float64, []float64, error)) *CemOSCEVInterface_CurrentLimits_Call { +func (_c *CemOSCEVInterface_CurrentLimits_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]float64, []float64, []float64, error)) *CemOSCEVInterface_CurrentLimits_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *CemOSCEVInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -259,48 +251,43 @@ type CemOSCEVInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemOSCEVInterface_Expecter) IsCompatibleEntityType(entity interface{}) *CemOSCEVInterface_IsCompatibleEntityType_Call { return &CemOSCEVInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *CemOSCEVInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *CemOSCEVInterface_IsCompatibleEntityType_Call { +func (_c *CemOSCEVInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemOSCEVInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemOSCEVInterface_IsCompatibleEntityType_Call) Return(b bool) *CemOSCEVInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *CemOSCEVInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *CemOSCEVInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOSCEVInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CemOSCEVInterface_IsCompatibleEntityType_Call { +func (_c *CemOSCEVInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CemOSCEVInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *CemOSCEVInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -310,65 +297,56 @@ type CemOSCEVInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *CemOSCEVInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call { return &CemOSCEVInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *CemOSCEVInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// LoadControlLimits provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) LoadControlLimits(entity api.EntityRemoteInterface) ([]api0.LoadLimitsPhase, error) { - ret := _mock.Called(entity) +// LoadControlLimits provides a mock function with given fields: entity +func (_m *CemOSCEVInterface) LoadControlLimits(entity spine_goapi.EntityRemoteInterface) ([]api.LoadLimitsPhase, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for LoadControlLimits") } - var r0 []api0.LoadLimitsPhase + var r0 []api.LoadLimitsPhase var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]api0.LoadLimitsPhase, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]api.LoadLimitsPhase, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []api0.LoadLimitsPhase); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []api.LoadLimitsPhase); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.LoadLimitsPhase) + r0 = ret.Get(0).([]api.LoadLimitsPhase) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -378,50 +356,45 @@ type CemOSCEVInterface_LoadControlLimits_Call struct { } // LoadControlLimits is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemOSCEVInterface_Expecter) LoadControlLimits(entity interface{}) *CemOSCEVInterface_LoadControlLimits_Call { return &CemOSCEVInterface_LoadControlLimits_Call{Call: _e.mock.On("LoadControlLimits", entity)} } -func (_c *CemOSCEVInterface_LoadControlLimits_Call) Run(run func(entity api.EntityRemoteInterface)) *CemOSCEVInterface_LoadControlLimits_Call { +func (_c *CemOSCEVInterface_LoadControlLimits_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemOSCEVInterface_LoadControlLimits_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemOSCEVInterface_LoadControlLimits_Call) Return(limits []api0.LoadLimitsPhase, resultErr error) *CemOSCEVInterface_LoadControlLimits_Call { +func (_c *CemOSCEVInterface_LoadControlLimits_Call) Return(limits []api.LoadLimitsPhase, resultErr error) *CemOSCEVInterface_LoadControlLimits_Call { _c.Call.Return(limits, resultErr) return _c } -func (_c *CemOSCEVInterface_LoadControlLimits_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]api0.LoadLimitsPhase, error)) *CemOSCEVInterface_LoadControlLimits_Call { +func (_c *CemOSCEVInterface_LoadControlLimits_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]api.LoadLimitsPhase, error)) *CemOSCEVInterface_LoadControlLimits_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) RemoteEntitiesScenarios() []api1.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *CemOSCEVInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api1.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api1.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api1.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -442,20 +415,19 @@ func (_c *CemOSCEVInterface_RemoteEntitiesScenarios_Call) Run(run func()) *CemOS return _c } -func (_c *CemOSCEVInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api1.RemoteEntityScenarios) *CemOSCEVInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *CemOSCEVInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *CemOSCEVInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOSCEVInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api1.RemoteEntityScenarios) *CemOSCEVInterface_RemoteEntitiesScenarios_Call { +func (_c *CemOSCEVInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *CemOSCEVInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *CemOSCEVInterface) RemoveUseCase() { + _m.Called() } // CemOSCEVInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -485,20 +457,21 @@ func (_c *CemOSCEVInterface_RemoveUseCase_Call) RunAndReturn(run func()) *CemOSC return _c } -// SetOperatingState provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) SetOperatingState(failureState bool) error { - ret := _mock.Called(failureState) +// SetOperatingState provides a mock function with given fields: failureState +func (_m *CemOSCEVInterface) SetOperatingState(failureState bool) error { + ret := _m.Called(failureState) if len(ret) == 0 { panic("no return value specified for SetOperatingState") } var r0 error - if returnFunc, ok := ret.Get(0).(func(bool) error); ok { - r0 = returnFunc(failureState) + if rf, ok := ret.Get(0).(func(bool) error); ok { + r0 = rf(failureState) } else { r0 = ret.Error(0) } + return r0 } @@ -515,31 +488,24 @@ func (_e *CemOSCEVInterface_Expecter) SetOperatingState(failureState interface{} func (_c *CemOSCEVInterface_SetOperatingState_Call) Run(run func(failureState bool)) *CemOSCEVInterface_SetOperatingState_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } -func (_c *CemOSCEVInterface_SetOperatingState_Call) Return(err error) *CemOSCEVInterface_SetOperatingState_Call { - _c.Call.Return(err) +func (_c *CemOSCEVInterface_SetOperatingState_Call) Return(_a0 error) *CemOSCEVInterface_SetOperatingState_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemOSCEVInterface_SetOperatingState_Call) RunAndReturn(run func(failureState bool) error) *CemOSCEVInterface_SetOperatingState_Call { +func (_c *CemOSCEVInterface_SetOperatingState_Call) RunAndReturn(run func(bool) error) *CemOSCEVInterface_SetOperatingState_Call { _c.Call.Return(run) return _c } -// StartHeartbeat provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) StartHeartbeat() { - _mock.Called() - return +// StartHeartbeat provides a mock function with no fields +func (_m *CemOSCEVInterface) StartHeartbeat() { + _m.Called() } // CemOSCEVInterface_StartHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartHeartbeat' @@ -569,10 +535,9 @@ func (_c *CemOSCEVInterface_StartHeartbeat_Call) RunAndReturn(run func()) *CemOS return _c } -// StopHeartbeat provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) StopHeartbeat() { - _mock.Called() - return +// StopHeartbeat provides a mock function with no fields +func (_m *CemOSCEVInterface) StopHeartbeat() { + _m.Called() } // CemOSCEVInterface_StopHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopHeartbeat' @@ -602,10 +567,9 @@ func (_c *CemOSCEVInterface_StopHeartbeat_Call) RunAndReturn(run func()) *CemOSC return _c } -// UpdateUseCaseAvailability provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *CemOSCEVInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // CemOSCEVInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -621,13 +585,7 @@ func (_e *CemOSCEVInterface_Expecter) UpdateUseCaseAvailability(available interf func (_c *CemOSCEVInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *CemOSCEVInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -637,14 +595,14 @@ func (_c *CemOSCEVInterface_UpdateUseCaseAvailability_Call) Return() *CemOSCEVIn return _c } -func (_c *CemOSCEVInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *CemOSCEVInterface_UpdateUseCaseAvailability_Call { +func (_c *CemOSCEVInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *CemOSCEVInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } -// WriteLoadControlLimits provides a mock function for the type CemOSCEVInterface -func (_mock *CemOSCEVInterface) WriteLoadControlLimits(entity api.EntityRemoteInterface, limits []api0.LoadLimitsPhase, resultCB func(result model.ResultDataType)) (*model.MsgCounterType, error) { - ret := _mock.Called(entity, limits, resultCB) +// WriteLoadControlLimits provides a mock function with given fields: entity, limits, resultCB +func (_m *CemOSCEVInterface) WriteLoadControlLimits(entity spine_goapi.EntityRemoteInterface, limits []api.LoadLimitsPhase, resultCB func(model.ResultDataType)) (*model.MsgCounterType, error) { + ret := _m.Called(entity, limits, resultCB) if len(ret) == 0 { panic("no return value specified for WriteLoadControlLimits") @@ -652,21 +610,23 @@ func (_mock *CemOSCEVInterface) WriteLoadControlLimits(entity api.EntityRemoteIn var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, []api0.LoadLimitsPhase, func(result model.ResultDataType)) (*model.MsgCounterType, error)); ok { - return returnFunc(entity, limits, resultCB) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, []api.LoadLimitsPhase, func(model.ResultDataType)) (*model.MsgCounterType, error)); ok { + return rf(entity, limits, resultCB) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, []api0.LoadLimitsPhase, func(result model.ResultDataType)) *model.MsgCounterType); ok { - r0 = returnFunc(entity, limits, resultCB) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, []api.LoadLimitsPhase, func(model.ResultDataType)) *model.MsgCounterType); ok { + r0 = rf(entity, limits, resultCB) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface, []api0.LoadLimitsPhase, func(result model.ResultDataType)) error); ok { - r1 = returnFunc(entity, limits, resultCB) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface, []api.LoadLimitsPhase, func(model.ResultDataType)) error); ok { + r1 = rf(entity, limits, resultCB) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -676,42 +636,40 @@ type CemOSCEVInterface_WriteLoadControlLimits_Call struct { } // WriteLoadControlLimits is a helper method to define mock.On call -// - entity api.EntityRemoteInterface -// - limits []api0.LoadLimitsPhase -// - resultCB func(result model.ResultDataType) +// - entity spine_goapi.EntityRemoteInterface +// - limits []api.LoadLimitsPhase +// - resultCB func(model.ResultDataType) func (_e *CemOSCEVInterface_Expecter) WriteLoadControlLimits(entity interface{}, limits interface{}, resultCB interface{}) *CemOSCEVInterface_WriteLoadControlLimits_Call { return &CemOSCEVInterface_WriteLoadControlLimits_Call{Call: _e.mock.On("WriteLoadControlLimits", entity, limits, resultCB)} } -func (_c *CemOSCEVInterface_WriteLoadControlLimits_Call) Run(run func(entity api.EntityRemoteInterface, limits []api0.LoadLimitsPhase, resultCB func(result model.ResultDataType))) *CemOSCEVInterface_WriteLoadControlLimits_Call { +func (_c *CemOSCEVInterface_WriteLoadControlLimits_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, limits []api.LoadLimitsPhase, resultCB func(model.ResultDataType))) *CemOSCEVInterface_WriteLoadControlLimits_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 []api0.LoadLimitsPhase - if args[1] != nil { - arg1 = args[1].([]api0.LoadLimitsPhase) - } - var arg2 func(result model.ResultDataType) - if args[2] != nil { - arg2 = args[2].(func(result model.ResultDataType)) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].([]api.LoadLimitsPhase), args[2].(func(model.ResultDataType))) }) return _c } -func (_c *CemOSCEVInterface_WriteLoadControlLimits_Call) Return(msgCounterType *model.MsgCounterType, err error) *CemOSCEVInterface_WriteLoadControlLimits_Call { - _c.Call.Return(msgCounterType, err) +func (_c *CemOSCEVInterface_WriteLoadControlLimits_Call) Return(_a0 *model.MsgCounterType, _a1 error) *CemOSCEVInterface_WriteLoadControlLimits_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemOSCEVInterface_WriteLoadControlLimits_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, limits []api0.LoadLimitsPhase, resultCB func(result model.ResultDataType)) (*model.MsgCounterType, error)) *CemOSCEVInterface_WriteLoadControlLimits_Call { +func (_c *CemOSCEVInterface_WriteLoadControlLimits_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, []api.LoadLimitsPhase, func(model.ResultDataType)) (*model.MsgCounterType, error)) *CemOSCEVInterface_WriteLoadControlLimits_Call { _c.Call.Return(run) return _c } + +// NewCemOSCEVInterface creates a new instance of CemOSCEVInterface. 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 NewCemOSCEVInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CemOSCEVInterface { + mock := &CemOSCEVInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/CemVABDInterface.go b/usecases/mocks/CemVABDInterface.go index 00360d58..5f55973c 100644 --- a/usecases/mocks/CemVABDInterface.go +++ b/usecases/mocks/CemVABDInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api0 "github.com/enbility/eebus-go/api" - "github.com/enbility/spine-go/api" + eebus_goapi "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) - -// NewCemVABDInterface creates a new instance of CemVABDInterface. 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 NewCemVABDInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *CemVABDInterface { - mock := &CemVABDInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // CemVABDInterface is an autogenerated mock type for the CemVABDInterface type type CemVABDInterface struct { @@ -37,10 +22,22 @@ func (_m *CemVABDInterface) EXPECT() *CemVABDInterface_Expecter { return &CemVABDInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *CemVABDInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // CemVABDInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -60,20 +57,19 @@ func (_c *CemVABDInterface_AddFeatures_Call) Run(run func()) *CemVABDInterface_A return _c } -func (_c *CemVABDInterface_AddFeatures_Call) Return() *CemVABDInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *CemVABDInterface_AddFeatures_Call) Return(_a0 error) *CemVABDInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemVABDInterface_AddFeatures_Call) RunAndReturn(run func()) *CemVABDInterface_AddFeatures_Call { - _c.Run(run) +func (_c *CemVABDInterface_AddFeatures_Call) RunAndReturn(run func() error) *CemVABDInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *CemVABDInterface) AddUseCase() { + _m.Called() } // CemVABDInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -103,22 +99,23 @@ func (_c *CemVABDInterface_AddUseCase_Call) RunAndReturn(run func()) *CemVABDInt return _c } -// AvailableScenariosForEntity provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *CemVABDInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -128,37 +125,31 @@ type CemVABDInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemVABDInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *CemVABDInterface_AvailableScenariosForEntity_Call { return &CemVABDInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *CemVABDInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *CemVABDInterface_AvailableScenariosForEntity_Call { +func (_c *CemVABDInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemVABDInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemVABDInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *CemVABDInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *CemVABDInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *CemVABDInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemVABDInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *CemVABDInterface_AvailableScenariosForEntity_Call { +func (_c *CemVABDInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *CemVABDInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// EnergyCharged provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) EnergyCharged(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// EnergyCharged provides a mock function with given fields: entity +func (_m *CemVABDInterface) EnergyCharged(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for EnergyCharged") @@ -166,19 +157,21 @@ func (_mock *CemVABDInterface) EnergyCharged(entity api.EntityRemoteInterface) ( var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -188,37 +181,31 @@ type CemVABDInterface_EnergyCharged_Call struct { } // EnergyCharged is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemVABDInterface_Expecter) EnergyCharged(entity interface{}) *CemVABDInterface_EnergyCharged_Call { return &CemVABDInterface_EnergyCharged_Call{Call: _e.mock.On("EnergyCharged", entity)} } -func (_c *CemVABDInterface_EnergyCharged_Call) Run(run func(entity api.EntityRemoteInterface)) *CemVABDInterface_EnergyCharged_Call { +func (_c *CemVABDInterface_EnergyCharged_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemVABDInterface_EnergyCharged_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemVABDInterface_EnergyCharged_Call) Return(f float64, err error) *CemVABDInterface_EnergyCharged_Call { - _c.Call.Return(f, err) +func (_c *CemVABDInterface_EnergyCharged_Call) Return(_a0 float64, _a1 error) *CemVABDInterface_EnergyCharged_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemVABDInterface_EnergyCharged_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *CemVABDInterface_EnergyCharged_Call { +func (_c *CemVABDInterface_EnergyCharged_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *CemVABDInterface_EnergyCharged_Call { _c.Call.Return(run) return _c } -// EnergyDischarged provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) EnergyDischarged(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// EnergyDischarged provides a mock function with given fields: entity +func (_m *CemVABDInterface) EnergyDischarged(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for EnergyDischarged") @@ -226,19 +213,21 @@ func (_mock *CemVABDInterface) EnergyDischarged(entity api.EntityRemoteInterface var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -248,48 +237,43 @@ type CemVABDInterface_EnergyDischarged_Call struct { } // EnergyDischarged is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemVABDInterface_Expecter) EnergyDischarged(entity interface{}) *CemVABDInterface_EnergyDischarged_Call { return &CemVABDInterface_EnergyDischarged_Call{Call: _e.mock.On("EnergyDischarged", entity)} } -func (_c *CemVABDInterface_EnergyDischarged_Call) Run(run func(entity api.EntityRemoteInterface)) *CemVABDInterface_EnergyDischarged_Call { +func (_c *CemVABDInterface_EnergyDischarged_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemVABDInterface_EnergyDischarged_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemVABDInterface_EnergyDischarged_Call) Return(f float64, err error) *CemVABDInterface_EnergyDischarged_Call { - _c.Call.Return(f, err) +func (_c *CemVABDInterface_EnergyDischarged_Call) Return(_a0 float64, _a1 error) *CemVABDInterface_EnergyDischarged_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemVABDInterface_EnergyDischarged_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *CemVABDInterface_EnergyDischarged_Call { +func (_c *CemVABDInterface_EnergyDischarged_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *CemVABDInterface_EnergyDischarged_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *CemVABDInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -299,48 +283,43 @@ type CemVABDInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemVABDInterface_Expecter) IsCompatibleEntityType(entity interface{}) *CemVABDInterface_IsCompatibleEntityType_Call { return &CemVABDInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *CemVABDInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *CemVABDInterface_IsCompatibleEntityType_Call { +func (_c *CemVABDInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemVABDInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemVABDInterface_IsCompatibleEntityType_Call) Return(b bool) *CemVABDInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *CemVABDInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *CemVABDInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemVABDInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CemVABDInterface_IsCompatibleEntityType_Call { +func (_c *CemVABDInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CemVABDInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *CemVABDInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -350,43 +329,32 @@ type CemVABDInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *CemVABDInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *CemVABDInterface_IsScenarioAvailableAtEntity_Call { return &CemVABDInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *CemVABDInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *CemVABDInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemVABDInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *CemVABDInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *CemVABDInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *CemVABDInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *CemVABDInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *CemVABDInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemVABDInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *CemVABDInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemVABDInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *CemVABDInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// Power provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) Power(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// Power provides a mock function with given fields: entity +func (_m *CemVABDInterface) Power(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for Power") @@ -394,19 +362,21 @@ func (_mock *CemVABDInterface) Power(entity api.EntityRemoteInterface) (float64, var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -416,50 +386,45 @@ type CemVABDInterface_Power_Call struct { } // Power is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemVABDInterface_Expecter) Power(entity interface{}) *CemVABDInterface_Power_Call { return &CemVABDInterface_Power_Call{Call: _e.mock.On("Power", entity)} } -func (_c *CemVABDInterface_Power_Call) Run(run func(entity api.EntityRemoteInterface)) *CemVABDInterface_Power_Call { +func (_c *CemVABDInterface_Power_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemVABDInterface_Power_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemVABDInterface_Power_Call) Return(f float64, err error) *CemVABDInterface_Power_Call { - _c.Call.Return(f, err) +func (_c *CemVABDInterface_Power_Call) Return(_a0 float64, _a1 error) *CemVABDInterface_Power_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemVABDInterface_Power_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *CemVABDInterface_Power_Call { +func (_c *CemVABDInterface_Power_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *CemVABDInterface_Power_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) RemoteEntitiesScenarios() []api0.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *CemVABDInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api0.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api0.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -480,20 +445,19 @@ func (_c *CemVABDInterface_RemoteEntitiesScenarios_Call) Run(run func()) *CemVAB return _c } -func (_c *CemVABDInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api0.RemoteEntityScenarios) *CemVABDInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *CemVABDInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *CemVABDInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemVABDInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api0.RemoteEntityScenarios) *CemVABDInterface_RemoteEntitiesScenarios_Call { +func (_c *CemVABDInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *CemVABDInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *CemVABDInterface) RemoveUseCase() { + _m.Called() } // CemVABDInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -523,9 +487,9 @@ func (_c *CemVABDInterface_RemoveUseCase_Call) RunAndReturn(run func()) *CemVABD return _c } -// StateOfCharge provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) StateOfCharge(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// StateOfCharge provides a mock function with given fields: entity +func (_m *CemVABDInterface) StateOfCharge(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for StateOfCharge") @@ -533,19 +497,21 @@ func (_mock *CemVABDInterface) StateOfCharge(entity api.EntityRemoteInterface) ( var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -555,38 +521,31 @@ type CemVABDInterface_StateOfCharge_Call struct { } // StateOfCharge is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemVABDInterface_Expecter) StateOfCharge(entity interface{}) *CemVABDInterface_StateOfCharge_Call { return &CemVABDInterface_StateOfCharge_Call{Call: _e.mock.On("StateOfCharge", entity)} } -func (_c *CemVABDInterface_StateOfCharge_Call) Run(run func(entity api.EntityRemoteInterface)) *CemVABDInterface_StateOfCharge_Call { +func (_c *CemVABDInterface_StateOfCharge_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemVABDInterface_StateOfCharge_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemVABDInterface_StateOfCharge_Call) Return(f float64, err error) *CemVABDInterface_StateOfCharge_Call { - _c.Call.Return(f, err) +func (_c *CemVABDInterface_StateOfCharge_Call) Return(_a0 float64, _a1 error) *CemVABDInterface_StateOfCharge_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemVABDInterface_StateOfCharge_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *CemVABDInterface_StateOfCharge_Call { +func (_c *CemVABDInterface_StateOfCharge_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *CemVABDInterface_StateOfCharge_Call { _c.Call.Return(run) return _c } -// UpdateUseCaseAvailability provides a mock function for the type CemVABDInterface -func (_mock *CemVABDInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *CemVABDInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // CemVABDInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -602,13 +561,7 @@ func (_e *CemVABDInterface_Expecter) UpdateUseCaseAvailability(available interfa func (_c *CemVABDInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *CemVABDInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -618,7 +571,21 @@ func (_c *CemVABDInterface_UpdateUseCaseAvailability_Call) Return() *CemVABDInte return _c } -func (_c *CemVABDInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *CemVABDInterface_UpdateUseCaseAvailability_Call { +func (_c *CemVABDInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *CemVABDInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } + +// NewCemVABDInterface creates a new instance of CemVABDInterface. 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 NewCemVABDInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CemVABDInterface { + mock := &CemVABDInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/CemVAPDInterface.go b/usecases/mocks/CemVAPDInterface.go index b751d207..2bac0b59 100644 --- a/usecases/mocks/CemVAPDInterface.go +++ b/usecases/mocks/CemVAPDInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api0 "github.com/enbility/eebus-go/api" - "github.com/enbility/spine-go/api" + eebus_goapi "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) -// NewCemVAPDInterface creates a new instance of CemVAPDInterface. 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 NewCemVAPDInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *CemVAPDInterface { - mock := &CemVAPDInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // CemVAPDInterface is an autogenerated mock type for the CemVAPDInterface type type CemVAPDInterface struct { @@ -37,10 +22,22 @@ func (_m *CemVAPDInterface) EXPECT() *CemVAPDInterface_Expecter { return &CemVAPDInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type CemVAPDInterface -func (_mock *CemVAPDInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *CemVAPDInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // CemVAPDInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -60,20 +57,19 @@ func (_c *CemVAPDInterface_AddFeatures_Call) Run(run func()) *CemVAPDInterface_A return _c } -func (_c *CemVAPDInterface_AddFeatures_Call) Return() *CemVAPDInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *CemVAPDInterface_AddFeatures_Call) Return(_a0 error) *CemVAPDInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemVAPDInterface_AddFeatures_Call) RunAndReturn(run func()) *CemVAPDInterface_AddFeatures_Call { - _c.Run(run) +func (_c *CemVAPDInterface_AddFeatures_Call) RunAndReturn(run func() error) *CemVAPDInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type CemVAPDInterface -func (_mock *CemVAPDInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *CemVAPDInterface) AddUseCase() { + _m.Called() } // CemVAPDInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -103,22 +99,23 @@ func (_c *CemVAPDInterface_AddUseCase_Call) RunAndReturn(run func()) *CemVAPDInt return _c } -// AvailableScenariosForEntity provides a mock function for the type CemVAPDInterface -func (_mock *CemVAPDInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *CemVAPDInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -128,48 +125,43 @@ type CemVAPDInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemVAPDInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *CemVAPDInterface_AvailableScenariosForEntity_Call { return &CemVAPDInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *CemVAPDInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *CemVAPDInterface_AvailableScenariosForEntity_Call { +func (_c *CemVAPDInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemVAPDInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemVAPDInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *CemVAPDInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *CemVAPDInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *CemVAPDInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemVAPDInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *CemVAPDInterface_AvailableScenariosForEntity_Call { +func (_c *CemVAPDInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *CemVAPDInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type CemVAPDInterface -func (_mock *CemVAPDInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *CemVAPDInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -179,48 +171,43 @@ type CemVAPDInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemVAPDInterface_Expecter) IsCompatibleEntityType(entity interface{}) *CemVAPDInterface_IsCompatibleEntityType_Call { return &CemVAPDInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *CemVAPDInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *CemVAPDInterface_IsCompatibleEntityType_Call { +func (_c *CemVAPDInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemVAPDInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemVAPDInterface_IsCompatibleEntityType_Call) Return(b bool) *CemVAPDInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *CemVAPDInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *CemVAPDInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemVAPDInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CemVAPDInterface_IsCompatibleEntityType_Call { +func (_c *CemVAPDInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CemVAPDInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type CemVAPDInterface -func (_mock *CemVAPDInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *CemVAPDInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -230,43 +217,32 @@ type CemVAPDInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *CemVAPDInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *CemVAPDInterface_IsScenarioAvailableAtEntity_Call { return &CemVAPDInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *CemVAPDInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *CemVAPDInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemVAPDInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *CemVAPDInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *CemVAPDInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *CemVAPDInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *CemVAPDInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *CemVAPDInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemVAPDInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *CemVAPDInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CemVAPDInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *CemVAPDInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// PVYieldTotal provides a mock function for the type CemVAPDInterface -func (_mock *CemVAPDInterface) PVYieldTotal(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// PVYieldTotal provides a mock function with given fields: entity +func (_m *CemVAPDInterface) PVYieldTotal(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for PVYieldTotal") @@ -274,19 +250,21 @@ func (_mock *CemVAPDInterface) PVYieldTotal(entity api.EntityRemoteInterface) (f var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -296,37 +274,31 @@ type CemVAPDInterface_PVYieldTotal_Call struct { } // PVYieldTotal is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemVAPDInterface_Expecter) PVYieldTotal(entity interface{}) *CemVAPDInterface_PVYieldTotal_Call { return &CemVAPDInterface_PVYieldTotal_Call{Call: _e.mock.On("PVYieldTotal", entity)} } -func (_c *CemVAPDInterface_PVYieldTotal_Call) Run(run func(entity api.EntityRemoteInterface)) *CemVAPDInterface_PVYieldTotal_Call { +func (_c *CemVAPDInterface_PVYieldTotal_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemVAPDInterface_PVYieldTotal_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemVAPDInterface_PVYieldTotal_Call) Return(f float64, err error) *CemVAPDInterface_PVYieldTotal_Call { - _c.Call.Return(f, err) +func (_c *CemVAPDInterface_PVYieldTotal_Call) Return(_a0 float64, _a1 error) *CemVAPDInterface_PVYieldTotal_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemVAPDInterface_PVYieldTotal_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *CemVAPDInterface_PVYieldTotal_Call { +func (_c *CemVAPDInterface_PVYieldTotal_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *CemVAPDInterface_PVYieldTotal_Call { _c.Call.Return(run) return _c } -// Power provides a mock function for the type CemVAPDInterface -func (_mock *CemVAPDInterface) Power(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// Power provides a mock function with given fields: entity +func (_m *CemVAPDInterface) Power(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for Power") @@ -334,19 +306,21 @@ func (_mock *CemVAPDInterface) Power(entity api.EntityRemoteInterface) (float64, var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -356,37 +330,31 @@ type CemVAPDInterface_Power_Call struct { } // Power is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemVAPDInterface_Expecter) Power(entity interface{}) *CemVAPDInterface_Power_Call { return &CemVAPDInterface_Power_Call{Call: _e.mock.On("Power", entity)} } -func (_c *CemVAPDInterface_Power_Call) Run(run func(entity api.EntityRemoteInterface)) *CemVAPDInterface_Power_Call { +func (_c *CemVAPDInterface_Power_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemVAPDInterface_Power_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemVAPDInterface_Power_Call) Return(f float64, err error) *CemVAPDInterface_Power_Call { - _c.Call.Return(f, err) +func (_c *CemVAPDInterface_Power_Call) Return(_a0 float64, _a1 error) *CemVAPDInterface_Power_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemVAPDInterface_Power_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *CemVAPDInterface_Power_Call { +func (_c *CemVAPDInterface_Power_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *CemVAPDInterface_Power_Call { _c.Call.Return(run) return _c } -// PowerNominalPeak provides a mock function for the type CemVAPDInterface -func (_mock *CemVAPDInterface) PowerNominalPeak(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// PowerNominalPeak provides a mock function with given fields: entity +func (_m *CemVAPDInterface) PowerNominalPeak(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for PowerNominalPeak") @@ -394,19 +362,21 @@ func (_mock *CemVAPDInterface) PowerNominalPeak(entity api.EntityRemoteInterface var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -416,50 +386,45 @@ type CemVAPDInterface_PowerNominalPeak_Call struct { } // PowerNominalPeak is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CemVAPDInterface_Expecter) PowerNominalPeak(entity interface{}) *CemVAPDInterface_PowerNominalPeak_Call { return &CemVAPDInterface_PowerNominalPeak_Call{Call: _e.mock.On("PowerNominalPeak", entity)} } -func (_c *CemVAPDInterface_PowerNominalPeak_Call) Run(run func(entity api.EntityRemoteInterface)) *CemVAPDInterface_PowerNominalPeak_Call { +func (_c *CemVAPDInterface_PowerNominalPeak_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CemVAPDInterface_PowerNominalPeak_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CemVAPDInterface_PowerNominalPeak_Call) Return(f float64, err error) *CemVAPDInterface_PowerNominalPeak_Call { - _c.Call.Return(f, err) +func (_c *CemVAPDInterface_PowerNominalPeak_Call) Return(_a0 float64, _a1 error) *CemVAPDInterface_PowerNominalPeak_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CemVAPDInterface_PowerNominalPeak_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *CemVAPDInterface_PowerNominalPeak_Call { +func (_c *CemVAPDInterface_PowerNominalPeak_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *CemVAPDInterface_PowerNominalPeak_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type CemVAPDInterface -func (_mock *CemVAPDInterface) RemoteEntitiesScenarios() []api0.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *CemVAPDInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api0.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api0.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -480,20 +445,19 @@ func (_c *CemVAPDInterface_RemoteEntitiesScenarios_Call) Run(run func()) *CemVAP return _c } -func (_c *CemVAPDInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api0.RemoteEntityScenarios) *CemVAPDInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *CemVAPDInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *CemVAPDInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *CemVAPDInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api0.RemoteEntityScenarios) *CemVAPDInterface_RemoteEntitiesScenarios_Call { +func (_c *CemVAPDInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *CemVAPDInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type CemVAPDInterface -func (_mock *CemVAPDInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *CemVAPDInterface) RemoveUseCase() { + _m.Called() } // CemVAPDInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -523,10 +487,9 @@ func (_c *CemVAPDInterface_RemoveUseCase_Call) RunAndReturn(run func()) *CemVAPD return _c } -// UpdateUseCaseAvailability provides a mock function for the type CemVAPDInterface -func (_mock *CemVAPDInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *CemVAPDInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // CemVAPDInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -542,13 +505,7 @@ func (_e *CemVAPDInterface_Expecter) UpdateUseCaseAvailability(available interfa func (_c *CemVAPDInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *CemVAPDInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -558,7 +515,21 @@ func (_c *CemVAPDInterface_UpdateUseCaseAvailability_Call) Return() *CemVAPDInte return _c } -func (_c *CemVAPDInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *CemVAPDInterface_UpdateUseCaseAvailability_Call { +func (_c *CemVAPDInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *CemVAPDInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } + +// NewCemVAPDInterface creates a new instance of CemVAPDInterface. 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 NewCemVAPDInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CemVAPDInterface { + mock := &CemVAPDInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/CsLPCInterface.go b/usecases/mocks/CsLPCInterface.go index fcbbde21..0da91277 100644 --- a/usecases/mocks/CsLPCInterface.go +++ b/usecases/mocks/CsLPCInterface.go @@ -1,32 +1,19 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "time" + eebus_goapi "github.com/enbility/eebus-go/api" + api "github.com/enbility/eebus-go/usecases/api" - api1 "github.com/enbility/eebus-go/api" - api0 "github.com/enbility/eebus-go/usecases/api" - "github.com/enbility/spine-go/api" - "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" -) -// NewCsLPCInterface creates a new instance of CsLPCInterface. 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 NewCsLPCInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *CsLPCInterface { - mock := &CsLPCInterface{} - mock.Mock.Test(t) + model "github.com/enbility/spine-go/model" - t.Cleanup(func() { mock.AssertExpectations(t) }) + spine_goapi "github.com/enbility/spine-go/api" - return mock -} + time "time" +) // CsLPCInterface is an autogenerated mock type for the CsLPCInterface type type CsLPCInterface struct { @@ -41,10 +28,22 @@ func (_m *CsLPCInterface) EXPECT() *CsLPCInterface_Expecter { return &CsLPCInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *CsLPCInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // CsLPCInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -64,20 +63,19 @@ func (_c *CsLPCInterface_AddFeatures_Call) Run(run func()) *CsLPCInterface_AddFe return _c } -func (_c *CsLPCInterface_AddFeatures_Call) Return() *CsLPCInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *CsLPCInterface_AddFeatures_Call) Return(_a0 error) *CsLPCInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPCInterface_AddFeatures_Call) RunAndReturn(run func()) *CsLPCInterface_AddFeatures_Call { - _c.Run(run) +func (_c *CsLPCInterface_AddFeatures_Call) RunAndReturn(run func() error) *CsLPCInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *CsLPCInterface) AddUseCase() { + _m.Called() } // CsLPCInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -107,10 +105,9 @@ func (_c *CsLPCInterface_AddUseCase_Call) RunAndReturn(run func()) *CsLPCInterfa return _c } -// ApproveOrDenyConsumptionLimit provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) ApproveOrDenyConsumptionLimit(msgCounter model.MsgCounterType, approve bool, reason string) { - _mock.Called(msgCounter, approve, reason) - return +// ApproveOrDenyConsumptionLimit provides a mock function with given fields: msgCounter, approve, reason +func (_m *CsLPCInterface) ApproveOrDenyConsumptionLimit(msgCounter model.MsgCounterType, approve bool, reason string) { + _m.Called(msgCounter, approve, reason) } // CsLPCInterface_ApproveOrDenyConsumptionLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApproveOrDenyConsumptionLimit' @@ -128,23 +125,7 @@ func (_e *CsLPCInterface_Expecter) ApproveOrDenyConsumptionLimit(msgCounter inte func (_c *CsLPCInterface_ApproveOrDenyConsumptionLimit_Call) Run(run func(msgCounter model.MsgCounterType, approve bool, reason string)) *CsLPCInterface_ApproveOrDenyConsumptionLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.MsgCounterType - if args[0] != nil { - arg0 = args[0].(model.MsgCounterType) - } - var arg1 bool - if args[1] != nil { - arg1 = args[1].(bool) - } - var arg2 string - if args[2] != nil { - arg2 = args[2].(string) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].(model.MsgCounterType), args[1].(bool), args[2].(string)) }) return _c } @@ -154,27 +135,28 @@ func (_c *CsLPCInterface_ApproveOrDenyConsumptionLimit_Call) Return() *CsLPCInte return _c } -func (_c *CsLPCInterface_ApproveOrDenyConsumptionLimit_Call) RunAndReturn(run func(msgCounter model.MsgCounterType, approve bool, reason string)) *CsLPCInterface_ApproveOrDenyConsumptionLimit_Call { +func (_c *CsLPCInterface_ApproveOrDenyConsumptionLimit_Call) RunAndReturn(run func(model.MsgCounterType, bool, string)) *CsLPCInterface_ApproveOrDenyConsumptionLimit_Call { _c.Run(run) return _c } -// AvailableScenariosForEntity provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *CsLPCInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -184,57 +166,53 @@ type CsLPCInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CsLPCInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *CsLPCInterface_AvailableScenariosForEntity_Call { return &CsLPCInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *CsLPCInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *CsLPCInterface_AvailableScenariosForEntity_Call { +func (_c *CsLPCInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CsLPCInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CsLPCInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *CsLPCInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *CsLPCInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *CsLPCInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *CsLPCInterface_AvailableScenariosForEntity_Call { +func (_c *CsLPCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *CsLPCInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// ConsumptionLimit provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) ConsumptionLimit() (api0.LoadLimit, error) { - ret := _mock.Called() +// ConsumptionLimit provides a mock function with no fields +func (_m *CsLPCInterface) ConsumptionLimit() (api.LoadLimit, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for ConsumptionLimit") } - var r0 api0.LoadLimit + var r0 api.LoadLimit var r1 error - if returnFunc, ok := ret.Get(0).(func() (api0.LoadLimit, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (api.LoadLimit, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() api0.LoadLimit); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() api.LoadLimit); ok { + r0 = rf() } else { - r0 = ret.Get(0).(api0.LoadLimit) + r0 = ret.Get(0).(api.LoadLimit) } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -255,19 +233,19 @@ func (_c *CsLPCInterface_ConsumptionLimit_Call) Run(run func()) *CsLPCInterface_ return _c } -func (_c *CsLPCInterface_ConsumptionLimit_Call) Return(loadLimit api0.LoadLimit, err error) *CsLPCInterface_ConsumptionLimit_Call { - _c.Call.Return(loadLimit, err) +func (_c *CsLPCInterface_ConsumptionLimit_Call) Return(_a0 api.LoadLimit, _a1 error) *CsLPCInterface_ConsumptionLimit_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CsLPCInterface_ConsumptionLimit_Call) RunAndReturn(run func() (api0.LoadLimit, error)) *CsLPCInterface_ConsumptionLimit_Call { +func (_c *CsLPCInterface_ConsumptionLimit_Call) RunAndReturn(run func() (api.LoadLimit, error)) *CsLPCInterface_ConsumptionLimit_Call { _c.Call.Return(run) return _c } -// ConsumptionNominalMax provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) ConsumptionNominalMax() (float64, error) { - ret := _mock.Called() +// ConsumptionNominalMax provides a mock function with no fields +func (_m *CsLPCInterface) ConsumptionNominalMax() (float64, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for ConsumptionNominalMax") @@ -275,19 +253,21 @@ func (_mock *CsLPCInterface) ConsumptionNominalMax() (float64, error) { var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func() (float64, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (float64, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() float64); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() float64); ok { + r0 = rf() } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -308,8 +288,8 @@ func (_c *CsLPCInterface_ConsumptionNominalMax_Call) Run(run func()) *CsLPCInter return _c } -func (_c *CsLPCInterface_ConsumptionNominalMax_Call) Return(f float64, err error) *CsLPCInterface_ConsumptionNominalMax_Call { - _c.Call.Return(f, err) +func (_c *CsLPCInterface_ConsumptionNominalMax_Call) Return(_a0 float64, _a1 error) *CsLPCInterface_ConsumptionNominalMax_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -318,9 +298,9 @@ func (_c *CsLPCInterface_ConsumptionNominalMax_Call) RunAndReturn(run func() (fl return _c } -// FailsafeConsumptionActivePowerLimit provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) FailsafeConsumptionActivePowerLimit() (float64, bool, error) { - ret := _mock.Called() +// FailsafeConsumptionActivePowerLimit provides a mock function with no fields +func (_m *CsLPCInterface) FailsafeConsumptionActivePowerLimit() (float64, bool, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for FailsafeConsumptionActivePowerLimit") @@ -329,24 +309,27 @@ func (_mock *CsLPCInterface) FailsafeConsumptionActivePowerLimit() (float64, boo var r0 float64 var r1 bool var r2 error - if returnFunc, ok := ret.Get(0).(func() (float64, bool, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (float64, bool, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() float64); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() float64); ok { + r0 = rf() } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func() bool); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() bool); ok { + r1 = rf() } else { r1 = ret.Get(1).(bool) } - if returnFunc, ok := ret.Get(2).(func() error); ok { - r2 = returnFunc() + + if rf, ok := ret.Get(2).(func() error); ok { + r2 = rf() } else { r2 = ret.Error(2) } + return r0, r1, r2 } @@ -377,9 +360,9 @@ func (_c *CsLPCInterface_FailsafeConsumptionActivePowerLimit_Call) RunAndReturn( return _c } -// FailsafeDurationMinimum provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) FailsafeDurationMinimum() (time.Duration, bool, error) { - ret := _mock.Called() +// FailsafeDurationMinimum provides a mock function with no fields +func (_m *CsLPCInterface) FailsafeDurationMinimum() (time.Duration, bool, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for FailsafeDurationMinimum") @@ -388,24 +371,27 @@ func (_mock *CsLPCInterface) FailsafeDurationMinimum() (time.Duration, bool, err var r0 time.Duration var r1 bool var r2 error - if returnFunc, ok := ret.Get(0).(func() (time.Duration, bool, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (time.Duration, bool, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() time.Duration); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() } else { r0 = ret.Get(0).(time.Duration) } - if returnFunc, ok := ret.Get(1).(func() bool); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() bool); ok { + r1 = rf() } else { r1 = ret.Get(1).(bool) } - if returnFunc, ok := ret.Get(2).(func() error); ok { - r2 = returnFunc() + + if rf, ok := ret.Get(2).(func() error); ok { + r2 = rf() } else { r2 = ret.Error(2) } + return r0, r1, r2 } @@ -436,20 +422,21 @@ func (_c *CsLPCInterface_FailsafeDurationMinimum_Call) RunAndReturn(run func() ( return _c } -// IsCompatibleEntityType provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *CsLPCInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -459,48 +446,43 @@ type CsLPCInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CsLPCInterface_Expecter) IsCompatibleEntityType(entity interface{}) *CsLPCInterface_IsCompatibleEntityType_Call { return &CsLPCInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *CsLPCInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *CsLPCInterface_IsCompatibleEntityType_Call { +func (_c *CsLPCInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CsLPCInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CsLPCInterface_IsCompatibleEntityType_Call) Return(b bool) *CsLPCInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *CsLPCInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *CsLPCInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CsLPCInterface_IsCompatibleEntityType_Call { +func (_c *CsLPCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CsLPCInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsHeartbeatWithinDuration provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) IsHeartbeatWithinDuration() bool { - ret := _mock.Called() +// IsHeartbeatWithinDuration provides a mock function with no fields +func (_m *CsLPCInterface) IsHeartbeatWithinDuration() bool { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for IsHeartbeatWithinDuration") } var r0 bool - if returnFunc, ok := ret.Get(0).(func() bool); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -521,8 +503,8 @@ func (_c *CsLPCInterface_IsHeartbeatWithinDuration_Call) Run(run func()) *CsLPCI return _c } -func (_c *CsLPCInterface_IsHeartbeatWithinDuration_Call) Return(b bool) *CsLPCInterface_IsHeartbeatWithinDuration_Call { - _c.Call.Return(b) +func (_c *CsLPCInterface_IsHeartbeatWithinDuration_Call) Return(_a0 bool) *CsLPCInterface_IsHeartbeatWithinDuration_Call { + _c.Call.Return(_a0) return _c } @@ -531,20 +513,21 @@ func (_c *CsLPCInterface_IsHeartbeatWithinDuration_Call) RunAndReturn(run func() return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *CsLPCInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -554,56 +537,46 @@ type CsLPCInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *CsLPCInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *CsLPCInterface_IsScenarioAvailableAtEntity_Call { return &CsLPCInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *CsLPCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *CsLPCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CsLPCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *CsLPCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *CsLPCInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *CsLPCInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *CsLPCInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *CsLPCInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *CsLPCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CsLPCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *CsLPCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// PendingConsumptionLimits provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) PendingConsumptionLimits() map[model.MsgCounterType]api0.LoadLimit { - ret := _mock.Called() +// PendingConsumptionLimits provides a mock function with no fields +func (_m *CsLPCInterface) PendingConsumptionLimits() map[model.MsgCounterType]api.LoadLimit { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for PendingConsumptionLimits") } - var r0 map[model.MsgCounterType]api0.LoadLimit - if returnFunc, ok := ret.Get(0).(func() map[model.MsgCounterType]api0.LoadLimit); ok { - r0 = returnFunc() + var r0 map[model.MsgCounterType]api.LoadLimit + if rf, ok := ret.Get(0).(func() map[model.MsgCounterType]api.LoadLimit); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(map[model.MsgCounterType]api0.LoadLimit) + r0 = ret.Get(0).(map[model.MsgCounterType]api.LoadLimit) } } + return r0 } @@ -624,32 +597,33 @@ func (_c *CsLPCInterface_PendingConsumptionLimits_Call) Run(run func()) *CsLPCIn return _c } -func (_c *CsLPCInterface_PendingConsumptionLimits_Call) Return(msgCounterTypeToLoadLimit map[model.MsgCounterType]api0.LoadLimit) *CsLPCInterface_PendingConsumptionLimits_Call { - _c.Call.Return(msgCounterTypeToLoadLimit) +func (_c *CsLPCInterface_PendingConsumptionLimits_Call) Return(_a0 map[model.MsgCounterType]api.LoadLimit) *CsLPCInterface_PendingConsumptionLimits_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPCInterface_PendingConsumptionLimits_Call) RunAndReturn(run func() map[model.MsgCounterType]api0.LoadLimit) *CsLPCInterface_PendingConsumptionLimits_Call { +func (_c *CsLPCInterface_PendingConsumptionLimits_Call) RunAndReturn(run func() map[model.MsgCounterType]api.LoadLimit) *CsLPCInterface_PendingConsumptionLimits_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) RemoteEntitiesScenarios() []api1.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *CsLPCInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api1.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api1.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api1.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -670,20 +644,19 @@ func (_c *CsLPCInterface_RemoteEntitiesScenarios_Call) Run(run func()) *CsLPCInt return _c } -func (_c *CsLPCInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api1.RemoteEntityScenarios) *CsLPCInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *CsLPCInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *CsLPCInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api1.RemoteEntityScenarios) *CsLPCInterface_RemoteEntitiesScenarios_Call { +func (_c *CsLPCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *CsLPCInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *CsLPCInterface) RemoveUseCase() { + _m.Called() } // CsLPCInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -713,20 +686,21 @@ func (_c *CsLPCInterface_RemoveUseCase_Call) RunAndReturn(run func()) *CsLPCInte return _c } -// SetConsumptionLimit provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) SetConsumptionLimit(limit api0.LoadLimit) error { - ret := _mock.Called(limit) +// SetConsumptionLimit provides a mock function with given fields: limit +func (_m *CsLPCInterface) SetConsumptionLimit(limit api.LoadLimit) error { + ret := _m.Called(limit) if len(ret) == 0 { panic("no return value specified for SetConsumptionLimit") } var r0 error - if returnFunc, ok := ret.Get(0).(func(api0.LoadLimit) error); ok { - r0 = returnFunc(limit) + if rf, ok := ret.Get(0).(func(api.LoadLimit) error); ok { + r0 = rf(limit) } else { r0 = ret.Error(0) } + return r0 } @@ -736,20 +710,14 @@ type CsLPCInterface_SetConsumptionLimit_Call struct { } // SetConsumptionLimit is a helper method to define mock.On call -// - limit api0.LoadLimit +// - limit api.LoadLimit func (_e *CsLPCInterface_Expecter) SetConsumptionLimit(limit interface{}) *CsLPCInterface_SetConsumptionLimit_Call { return &CsLPCInterface_SetConsumptionLimit_Call{Call: _e.mock.On("SetConsumptionLimit", limit)} } -func (_c *CsLPCInterface_SetConsumptionLimit_Call) Run(run func(limit api0.LoadLimit)) *CsLPCInterface_SetConsumptionLimit_Call { +func (_c *CsLPCInterface_SetConsumptionLimit_Call) Run(run func(limit api.LoadLimit)) *CsLPCInterface_SetConsumptionLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api0.LoadLimit - if args[0] != nil { - arg0 = args[0].(api0.LoadLimit) - } - run( - arg0, - ) + run(args[0].(api.LoadLimit)) }) return _c } @@ -759,25 +727,26 @@ func (_c *CsLPCInterface_SetConsumptionLimit_Call) Return(resultErr error) *CsLP return _c } -func (_c *CsLPCInterface_SetConsumptionLimit_Call) RunAndReturn(run func(limit api0.LoadLimit) error) *CsLPCInterface_SetConsumptionLimit_Call { +func (_c *CsLPCInterface_SetConsumptionLimit_Call) RunAndReturn(run func(api.LoadLimit) error) *CsLPCInterface_SetConsumptionLimit_Call { _c.Call.Return(run) return _c } -// SetConsumptionNominalMax provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) SetConsumptionNominalMax(value float64) error { - ret := _mock.Called(value) +// SetConsumptionNominalMax provides a mock function with given fields: value +func (_m *CsLPCInterface) SetConsumptionNominalMax(value float64) error { + ret := _m.Called(value) if len(ret) == 0 { panic("no return value specified for SetConsumptionNominalMax") } var r0 error - if returnFunc, ok := ret.Get(0).(func(float64) error); ok { - r0 = returnFunc(value) + if rf, ok := ret.Get(0).(func(float64) error); ok { + r0 = rf(value) } else { r0 = ret.Error(0) } + return r0 } @@ -794,13 +763,7 @@ func (_e *CsLPCInterface_Expecter) SetConsumptionNominalMax(value interface{}) * func (_c *CsLPCInterface_SetConsumptionNominalMax_Call) Run(run func(value float64)) *CsLPCInterface_SetConsumptionNominalMax_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 float64 - if args[0] != nil { - arg0 = args[0].(float64) - } - run( - arg0, - ) + run(args[0].(float64)) }) return _c } @@ -810,25 +773,26 @@ func (_c *CsLPCInterface_SetConsumptionNominalMax_Call) Return(resultErr error) return _c } -func (_c *CsLPCInterface_SetConsumptionNominalMax_Call) RunAndReturn(run func(value float64) error) *CsLPCInterface_SetConsumptionNominalMax_Call { +func (_c *CsLPCInterface_SetConsumptionNominalMax_Call) RunAndReturn(run func(float64) error) *CsLPCInterface_SetConsumptionNominalMax_Call { _c.Call.Return(run) return _c } -// SetFailsafeConsumptionActivePowerLimit provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) SetFailsafeConsumptionActivePowerLimit(value float64, changeable bool) error { - ret := _mock.Called(value, changeable) +// SetFailsafeConsumptionActivePowerLimit provides a mock function with given fields: value, changeable +func (_m *CsLPCInterface) SetFailsafeConsumptionActivePowerLimit(value float64, changeable bool) error { + ret := _m.Called(value, changeable) if len(ret) == 0 { panic("no return value specified for SetFailsafeConsumptionActivePowerLimit") } var r0 error - if returnFunc, ok := ret.Get(0).(func(float64, bool) error); ok { - r0 = returnFunc(value, changeable) + if rf, ok := ret.Get(0).(func(float64, bool) error); ok { + r0 = rf(value, changeable) } else { r0 = ret.Error(0) } + return r0 } @@ -846,18 +810,7 @@ func (_e *CsLPCInterface_Expecter) SetFailsafeConsumptionActivePowerLimit(value func (_c *CsLPCInterface_SetFailsafeConsumptionActivePowerLimit_Call) Run(run func(value float64, changeable bool)) *CsLPCInterface_SetFailsafeConsumptionActivePowerLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 float64 - if args[0] != nil { - arg0 = args[0].(float64) - } - var arg1 bool - if args[1] != nil { - arg1 = args[1].(bool) - } - run( - arg0, - arg1, - ) + run(args[0].(float64), args[1].(bool)) }) return _c } @@ -867,25 +820,26 @@ func (_c *CsLPCInterface_SetFailsafeConsumptionActivePowerLimit_Call) Return(res return _c } -func (_c *CsLPCInterface_SetFailsafeConsumptionActivePowerLimit_Call) RunAndReturn(run func(value float64, changeable bool) error) *CsLPCInterface_SetFailsafeConsumptionActivePowerLimit_Call { +func (_c *CsLPCInterface_SetFailsafeConsumptionActivePowerLimit_Call) RunAndReturn(run func(float64, bool) error) *CsLPCInterface_SetFailsafeConsumptionActivePowerLimit_Call { _c.Call.Return(run) return _c } -// SetFailsafeDurationMinimum provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) SetFailsafeDurationMinimum(duration time.Duration, changeable bool) error { - ret := _mock.Called(duration, changeable) +// SetFailsafeDurationMinimum provides a mock function with given fields: duration, changeable +func (_m *CsLPCInterface) SetFailsafeDurationMinimum(duration time.Duration, changeable bool) error { + ret := _m.Called(duration, changeable) if len(ret) == 0 { panic("no return value specified for SetFailsafeDurationMinimum") } var r0 error - if returnFunc, ok := ret.Get(0).(func(time.Duration, bool) error); ok { - r0 = returnFunc(duration, changeable) + if rf, ok := ret.Get(0).(func(time.Duration, bool) error); ok { + r0 = rf(duration, changeable) } else { r0 = ret.Error(0) } + return r0 } @@ -903,18 +857,7 @@ func (_e *CsLPCInterface_Expecter) SetFailsafeDurationMinimum(duration interface func (_c *CsLPCInterface_SetFailsafeDurationMinimum_Call) Run(run func(duration time.Duration, changeable bool)) *CsLPCInterface_SetFailsafeDurationMinimum_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 time.Duration - if args[0] != nil { - arg0 = args[0].(time.Duration) - } - var arg1 bool - if args[1] != nil { - arg1 = args[1].(bool) - } - run( - arg0, - arg1, - ) + run(args[0].(time.Duration), args[1].(bool)) }) return _c } @@ -924,15 +867,14 @@ func (_c *CsLPCInterface_SetFailsafeDurationMinimum_Call) Return(resultErr error return _c } -func (_c *CsLPCInterface_SetFailsafeDurationMinimum_Call) RunAndReturn(run func(duration time.Duration, changeable bool) error) *CsLPCInterface_SetFailsafeDurationMinimum_Call { +func (_c *CsLPCInterface_SetFailsafeDurationMinimum_Call) RunAndReturn(run func(time.Duration, bool) error) *CsLPCInterface_SetFailsafeDurationMinimum_Call { _c.Call.Return(run) return _c } -// StartHeartbeat provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) StartHeartbeat() { - _mock.Called() - return +// StartHeartbeat provides a mock function with no fields +func (_m *CsLPCInterface) StartHeartbeat() { + _m.Called() } // CsLPCInterface_StartHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartHeartbeat' @@ -962,10 +904,9 @@ func (_c *CsLPCInterface_StartHeartbeat_Call) RunAndReturn(run func()) *CsLPCInt return _c } -// StopHeartbeat provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) StopHeartbeat() { - _mock.Called() - return +// StopHeartbeat provides a mock function with no fields +func (_m *CsLPCInterface) StopHeartbeat() { + _m.Called() } // CsLPCInterface_StopHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopHeartbeat' @@ -995,10 +936,9 @@ func (_c *CsLPCInterface_StopHeartbeat_Call) RunAndReturn(run func()) *CsLPCInte return _c } -// UpdateUseCaseAvailability provides a mock function for the type CsLPCInterface -func (_mock *CsLPCInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *CsLPCInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // CsLPCInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -1014,13 +954,7 @@ func (_e *CsLPCInterface_Expecter) UpdateUseCaseAvailability(available interface func (_c *CsLPCInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *CsLPCInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -1030,7 +964,21 @@ func (_c *CsLPCInterface_UpdateUseCaseAvailability_Call) Return() *CsLPCInterfac return _c } -func (_c *CsLPCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *CsLPCInterface_UpdateUseCaseAvailability_Call { +func (_c *CsLPCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *CsLPCInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } + +// NewCsLPCInterface creates a new instance of CsLPCInterface. 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 NewCsLPCInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CsLPCInterface { + mock := &CsLPCInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/CsLPPInterface.go b/usecases/mocks/CsLPPInterface.go index 3d6d6ed8..ebb81b1b 100644 --- a/usecases/mocks/CsLPPInterface.go +++ b/usecases/mocks/CsLPPInterface.go @@ -1,32 +1,19 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "time" + eebus_goapi "github.com/enbility/eebus-go/api" + api "github.com/enbility/eebus-go/usecases/api" - api1 "github.com/enbility/eebus-go/api" - api0 "github.com/enbility/eebus-go/usecases/api" - "github.com/enbility/spine-go/api" - "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" -) -// NewCsLPPInterface creates a new instance of CsLPPInterface. 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 NewCsLPPInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *CsLPPInterface { - mock := &CsLPPInterface{} - mock.Mock.Test(t) + model "github.com/enbility/spine-go/model" - t.Cleanup(func() { mock.AssertExpectations(t) }) + spine_goapi "github.com/enbility/spine-go/api" - return mock -} + time "time" +) // CsLPPInterface is an autogenerated mock type for the CsLPPInterface type type CsLPPInterface struct { @@ -41,10 +28,22 @@ func (_m *CsLPPInterface) EXPECT() *CsLPPInterface_Expecter { return &CsLPPInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *CsLPPInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // CsLPPInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -64,20 +63,19 @@ func (_c *CsLPPInterface_AddFeatures_Call) Run(run func()) *CsLPPInterface_AddFe return _c } -func (_c *CsLPPInterface_AddFeatures_Call) Return() *CsLPPInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *CsLPPInterface_AddFeatures_Call) Return(_a0 error) *CsLPPInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPPInterface_AddFeatures_Call) RunAndReturn(run func()) *CsLPPInterface_AddFeatures_Call { - _c.Run(run) +func (_c *CsLPPInterface_AddFeatures_Call) RunAndReturn(run func() error) *CsLPPInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *CsLPPInterface) AddUseCase() { + _m.Called() } // CsLPPInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -107,10 +105,9 @@ func (_c *CsLPPInterface_AddUseCase_Call) RunAndReturn(run func()) *CsLPPInterfa return _c } -// ApproveOrDenyProductionLimit provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) ApproveOrDenyProductionLimit(msgCounter model.MsgCounterType, approve bool, reason string) { - _mock.Called(msgCounter, approve, reason) - return +// ApproveOrDenyProductionLimit provides a mock function with given fields: msgCounter, approve, reason +func (_m *CsLPPInterface) ApproveOrDenyProductionLimit(msgCounter model.MsgCounterType, approve bool, reason string) { + _m.Called(msgCounter, approve, reason) } // CsLPPInterface_ApproveOrDenyProductionLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApproveOrDenyProductionLimit' @@ -128,23 +125,7 @@ func (_e *CsLPPInterface_Expecter) ApproveOrDenyProductionLimit(msgCounter inter func (_c *CsLPPInterface_ApproveOrDenyProductionLimit_Call) Run(run func(msgCounter model.MsgCounterType, approve bool, reason string)) *CsLPPInterface_ApproveOrDenyProductionLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 model.MsgCounterType - if args[0] != nil { - arg0 = args[0].(model.MsgCounterType) - } - var arg1 bool - if args[1] != nil { - arg1 = args[1].(bool) - } - var arg2 string - if args[2] != nil { - arg2 = args[2].(string) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].(model.MsgCounterType), args[1].(bool), args[2].(string)) }) return _c } @@ -154,27 +135,28 @@ func (_c *CsLPPInterface_ApproveOrDenyProductionLimit_Call) Return() *CsLPPInter return _c } -func (_c *CsLPPInterface_ApproveOrDenyProductionLimit_Call) RunAndReturn(run func(msgCounter model.MsgCounterType, approve bool, reason string)) *CsLPPInterface_ApproveOrDenyProductionLimit_Call { +func (_c *CsLPPInterface_ApproveOrDenyProductionLimit_Call) RunAndReturn(run func(model.MsgCounterType, bool, string)) *CsLPPInterface_ApproveOrDenyProductionLimit_Call { _c.Run(run) return _c } -// AvailableScenariosForEntity provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *CsLPPInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -184,37 +166,31 @@ type CsLPPInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CsLPPInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *CsLPPInterface_AvailableScenariosForEntity_Call { return &CsLPPInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *CsLPPInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *CsLPPInterface_AvailableScenariosForEntity_Call { +func (_c *CsLPPInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CsLPPInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CsLPPInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *CsLPPInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *CsLPPInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *CsLPPInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPPInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *CsLPPInterface_AvailableScenariosForEntity_Call { +func (_c *CsLPPInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *CsLPPInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// FailsafeDurationMinimum provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) FailsafeDurationMinimum() (time.Duration, bool, error) { - ret := _mock.Called() +// FailsafeDurationMinimum provides a mock function with no fields +func (_m *CsLPPInterface) FailsafeDurationMinimum() (time.Duration, bool, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for FailsafeDurationMinimum") @@ -223,24 +199,27 @@ func (_mock *CsLPPInterface) FailsafeDurationMinimum() (time.Duration, bool, err var r0 time.Duration var r1 bool var r2 error - if returnFunc, ok := ret.Get(0).(func() (time.Duration, bool, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (time.Duration, bool, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() time.Duration); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() time.Duration); ok { + r0 = rf() } else { r0 = ret.Get(0).(time.Duration) } - if returnFunc, ok := ret.Get(1).(func() bool); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() bool); ok { + r1 = rf() } else { r1 = ret.Get(1).(bool) } - if returnFunc, ok := ret.Get(2).(func() error); ok { - r2 = returnFunc() + + if rf, ok := ret.Get(2).(func() error); ok { + r2 = rf() } else { r2 = ret.Error(2) } + return r0, r1, r2 } @@ -271,9 +250,9 @@ func (_c *CsLPPInterface_FailsafeDurationMinimum_Call) RunAndReturn(run func() ( return _c } -// FailsafeProductionActivePowerLimit provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) FailsafeProductionActivePowerLimit() (float64, bool, error) { - ret := _mock.Called() +// FailsafeProductionActivePowerLimit provides a mock function with no fields +func (_m *CsLPPInterface) FailsafeProductionActivePowerLimit() (float64, bool, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for FailsafeProductionActivePowerLimit") @@ -282,24 +261,27 @@ func (_mock *CsLPPInterface) FailsafeProductionActivePowerLimit() (float64, bool var r0 float64 var r1 bool var r2 error - if returnFunc, ok := ret.Get(0).(func() (float64, bool, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (float64, bool, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() float64); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() float64); ok { + r0 = rf() } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func() bool); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() bool); ok { + r1 = rf() } else { r1 = ret.Get(1).(bool) } - if returnFunc, ok := ret.Get(2).(func() error); ok { - r2 = returnFunc() + + if rf, ok := ret.Get(2).(func() error); ok { + r2 = rf() } else { r2 = ret.Error(2) } + return r0, r1, r2 } @@ -330,20 +312,21 @@ func (_c *CsLPPInterface_FailsafeProductionActivePowerLimit_Call) RunAndReturn(r return _c } -// IsCompatibleEntityType provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *CsLPPInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -353,48 +336,43 @@ type CsLPPInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *CsLPPInterface_Expecter) IsCompatibleEntityType(entity interface{}) *CsLPPInterface_IsCompatibleEntityType_Call { return &CsLPPInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *CsLPPInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *CsLPPInterface_IsCompatibleEntityType_Call { +func (_c *CsLPPInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *CsLPPInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *CsLPPInterface_IsCompatibleEntityType_Call) Return(b bool) *CsLPPInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *CsLPPInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *CsLPPInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPPInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *CsLPPInterface_IsCompatibleEntityType_Call { +func (_c *CsLPPInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *CsLPPInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsHeartbeatWithinDuration provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) IsHeartbeatWithinDuration() bool { - ret := _mock.Called() +// IsHeartbeatWithinDuration provides a mock function with no fields +func (_m *CsLPPInterface) IsHeartbeatWithinDuration() bool { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for IsHeartbeatWithinDuration") } var r0 bool - if returnFunc, ok := ret.Get(0).(func() bool); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -415,8 +393,8 @@ func (_c *CsLPPInterface_IsHeartbeatWithinDuration_Call) Run(run func()) *CsLPPI return _c } -func (_c *CsLPPInterface_IsHeartbeatWithinDuration_Call) Return(b bool) *CsLPPInterface_IsHeartbeatWithinDuration_Call { - _c.Call.Return(b) +func (_c *CsLPPInterface_IsHeartbeatWithinDuration_Call) Return(_a0 bool) *CsLPPInterface_IsHeartbeatWithinDuration_Call { + _c.Call.Return(_a0) return _c } @@ -425,20 +403,21 @@ func (_c *CsLPPInterface_IsHeartbeatWithinDuration_Call) RunAndReturn(run func() return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *CsLPPInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -448,56 +427,46 @@ type CsLPPInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *CsLPPInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *CsLPPInterface_IsScenarioAvailableAtEntity_Call { return &CsLPPInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *CsLPPInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *CsLPPInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CsLPPInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *CsLPPInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *CsLPPInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *CsLPPInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *CsLPPInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *CsLPPInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPPInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *CsLPPInterface_IsScenarioAvailableAtEntity_Call { +func (_c *CsLPPInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *CsLPPInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// PendingProductionLimits provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) PendingProductionLimits() map[model.MsgCounterType]api0.LoadLimit { - ret := _mock.Called() +// PendingProductionLimits provides a mock function with no fields +func (_m *CsLPPInterface) PendingProductionLimits() map[model.MsgCounterType]api.LoadLimit { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for PendingProductionLimits") } - var r0 map[model.MsgCounterType]api0.LoadLimit - if returnFunc, ok := ret.Get(0).(func() map[model.MsgCounterType]api0.LoadLimit); ok { - r0 = returnFunc() + var r0 map[model.MsgCounterType]api.LoadLimit + if rf, ok := ret.Get(0).(func() map[model.MsgCounterType]api.LoadLimit); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(map[model.MsgCounterType]api0.LoadLimit) + r0 = ret.Get(0).(map[model.MsgCounterType]api.LoadLimit) } } + return r0 } @@ -518,39 +487,41 @@ func (_c *CsLPPInterface_PendingProductionLimits_Call) Run(run func()) *CsLPPInt return _c } -func (_c *CsLPPInterface_PendingProductionLimits_Call) Return(msgCounterTypeToLoadLimit map[model.MsgCounterType]api0.LoadLimit) *CsLPPInterface_PendingProductionLimits_Call { - _c.Call.Return(msgCounterTypeToLoadLimit) +func (_c *CsLPPInterface_PendingProductionLimits_Call) Return(_a0 map[model.MsgCounterType]api.LoadLimit) *CsLPPInterface_PendingProductionLimits_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPPInterface_PendingProductionLimits_Call) RunAndReturn(run func() map[model.MsgCounterType]api0.LoadLimit) *CsLPPInterface_PendingProductionLimits_Call { +func (_c *CsLPPInterface_PendingProductionLimits_Call) RunAndReturn(run func() map[model.MsgCounterType]api.LoadLimit) *CsLPPInterface_PendingProductionLimits_Call { _c.Call.Return(run) return _c } -// ProductionLimit provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) ProductionLimit() (api0.LoadLimit, error) { - ret := _mock.Called() +// ProductionLimit provides a mock function with no fields +func (_m *CsLPPInterface) ProductionLimit() (api.LoadLimit, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for ProductionLimit") } - var r0 api0.LoadLimit + var r0 api.LoadLimit var r1 error - if returnFunc, ok := ret.Get(0).(func() (api0.LoadLimit, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (api.LoadLimit, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() api0.LoadLimit); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() api.LoadLimit); ok { + r0 = rf() } else { - r0 = ret.Get(0).(api0.LoadLimit) + r0 = ret.Get(0).(api.LoadLimit) } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -571,19 +542,19 @@ func (_c *CsLPPInterface_ProductionLimit_Call) Run(run func()) *CsLPPInterface_P return _c } -func (_c *CsLPPInterface_ProductionLimit_Call) Return(loadLimit api0.LoadLimit, err error) *CsLPPInterface_ProductionLimit_Call { - _c.Call.Return(loadLimit, err) +func (_c *CsLPPInterface_ProductionLimit_Call) Return(_a0 api.LoadLimit, _a1 error) *CsLPPInterface_ProductionLimit_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *CsLPPInterface_ProductionLimit_Call) RunAndReturn(run func() (api0.LoadLimit, error)) *CsLPPInterface_ProductionLimit_Call { +func (_c *CsLPPInterface_ProductionLimit_Call) RunAndReturn(run func() (api.LoadLimit, error)) *CsLPPInterface_ProductionLimit_Call { _c.Call.Return(run) return _c } -// ProductionNominalMax provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) ProductionNominalMax() (float64, error) { - ret := _mock.Called() +// ProductionNominalMax provides a mock function with no fields +func (_m *CsLPPInterface) ProductionNominalMax() (float64, error) { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for ProductionNominalMax") @@ -591,19 +562,21 @@ func (_mock *CsLPPInterface) ProductionNominalMax() (float64, error) { var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func() (float64, error)); ok { - return returnFunc() + if rf, ok := ret.Get(0).(func() (float64, error)); ok { + return rf() } - if returnFunc, ok := ret.Get(0).(func() float64); ok { - r0 = returnFunc() + if rf, ok := ret.Get(0).(func() float64); ok { + r0 = rf() } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func() error); ok { - r1 = returnFunc() + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } + return r0, r1 } @@ -624,8 +597,8 @@ func (_c *CsLPPInterface_ProductionNominalMax_Call) Run(run func()) *CsLPPInterf return _c } -func (_c *CsLPPInterface_ProductionNominalMax_Call) Return(f float64, err error) *CsLPPInterface_ProductionNominalMax_Call { - _c.Call.Return(f, err) +func (_c *CsLPPInterface_ProductionNominalMax_Call) Return(_a0 float64, _a1 error) *CsLPPInterface_ProductionNominalMax_Call { + _c.Call.Return(_a0, _a1) return _c } @@ -634,22 +607,23 @@ func (_c *CsLPPInterface_ProductionNominalMax_Call) RunAndReturn(run func() (flo return _c } -// RemoteEntitiesScenarios provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) RemoteEntitiesScenarios() []api1.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *CsLPPInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api1.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api1.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api1.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -670,20 +644,19 @@ func (_c *CsLPPInterface_RemoteEntitiesScenarios_Call) Run(run func()) *CsLPPInt return _c } -func (_c *CsLPPInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api1.RemoteEntityScenarios) *CsLPPInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *CsLPPInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *CsLPPInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *CsLPPInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api1.RemoteEntityScenarios) *CsLPPInterface_RemoteEntitiesScenarios_Call { +func (_c *CsLPPInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *CsLPPInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *CsLPPInterface) RemoveUseCase() { + _m.Called() } // CsLPPInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -713,20 +686,21 @@ func (_c *CsLPPInterface_RemoveUseCase_Call) RunAndReturn(run func()) *CsLPPInte return _c } -// SetFailsafeDurationMinimum provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) SetFailsafeDurationMinimum(duration time.Duration, changeable bool) error { - ret := _mock.Called(duration, changeable) +// SetFailsafeDurationMinimum provides a mock function with given fields: duration, changeable +func (_m *CsLPPInterface) SetFailsafeDurationMinimum(duration time.Duration, changeable bool) error { + ret := _m.Called(duration, changeable) if len(ret) == 0 { panic("no return value specified for SetFailsafeDurationMinimum") } var r0 error - if returnFunc, ok := ret.Get(0).(func(time.Duration, bool) error); ok { - r0 = returnFunc(duration, changeable) + if rf, ok := ret.Get(0).(func(time.Duration, bool) error); ok { + r0 = rf(duration, changeable) } else { r0 = ret.Error(0) } + return r0 } @@ -744,18 +718,7 @@ func (_e *CsLPPInterface_Expecter) SetFailsafeDurationMinimum(duration interface func (_c *CsLPPInterface_SetFailsafeDurationMinimum_Call) Run(run func(duration time.Duration, changeable bool)) *CsLPPInterface_SetFailsafeDurationMinimum_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 time.Duration - if args[0] != nil { - arg0 = args[0].(time.Duration) - } - var arg1 bool - if args[1] != nil { - arg1 = args[1].(bool) - } - run( - arg0, - arg1, - ) + run(args[0].(time.Duration), args[1].(bool)) }) return _c } @@ -765,25 +728,26 @@ func (_c *CsLPPInterface_SetFailsafeDurationMinimum_Call) Return(resultErr error return _c } -func (_c *CsLPPInterface_SetFailsafeDurationMinimum_Call) RunAndReturn(run func(duration time.Duration, changeable bool) error) *CsLPPInterface_SetFailsafeDurationMinimum_Call { +func (_c *CsLPPInterface_SetFailsafeDurationMinimum_Call) RunAndReturn(run func(time.Duration, bool) error) *CsLPPInterface_SetFailsafeDurationMinimum_Call { _c.Call.Return(run) return _c } -// SetFailsafeProductionActivePowerLimit provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) SetFailsafeProductionActivePowerLimit(value float64, changeable bool) error { - ret := _mock.Called(value, changeable) +// SetFailsafeProductionActivePowerLimit provides a mock function with given fields: value, changeable +func (_m *CsLPPInterface) SetFailsafeProductionActivePowerLimit(value float64, changeable bool) error { + ret := _m.Called(value, changeable) if len(ret) == 0 { panic("no return value specified for SetFailsafeProductionActivePowerLimit") } var r0 error - if returnFunc, ok := ret.Get(0).(func(float64, bool) error); ok { - r0 = returnFunc(value, changeable) + if rf, ok := ret.Get(0).(func(float64, bool) error); ok { + r0 = rf(value, changeable) } else { r0 = ret.Error(0) } + return r0 } @@ -801,18 +765,7 @@ func (_e *CsLPPInterface_Expecter) SetFailsafeProductionActivePowerLimit(value i func (_c *CsLPPInterface_SetFailsafeProductionActivePowerLimit_Call) Run(run func(value float64, changeable bool)) *CsLPPInterface_SetFailsafeProductionActivePowerLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 float64 - if args[0] != nil { - arg0 = args[0].(float64) - } - var arg1 bool - if args[1] != nil { - arg1 = args[1].(bool) - } - run( - arg0, - arg1, - ) + run(args[0].(float64), args[1].(bool)) }) return _c } @@ -822,25 +775,26 @@ func (_c *CsLPPInterface_SetFailsafeProductionActivePowerLimit_Call) Return(resu return _c } -func (_c *CsLPPInterface_SetFailsafeProductionActivePowerLimit_Call) RunAndReturn(run func(value float64, changeable bool) error) *CsLPPInterface_SetFailsafeProductionActivePowerLimit_Call { +func (_c *CsLPPInterface_SetFailsafeProductionActivePowerLimit_Call) RunAndReturn(run func(float64, bool) error) *CsLPPInterface_SetFailsafeProductionActivePowerLimit_Call { _c.Call.Return(run) return _c } -// SetProductionLimit provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) SetProductionLimit(limit api0.LoadLimit) error { - ret := _mock.Called(limit) +// SetProductionLimit provides a mock function with given fields: limit +func (_m *CsLPPInterface) SetProductionLimit(limit api.LoadLimit) error { + ret := _m.Called(limit) if len(ret) == 0 { panic("no return value specified for SetProductionLimit") } var r0 error - if returnFunc, ok := ret.Get(0).(func(api0.LoadLimit) error); ok { - r0 = returnFunc(limit) + if rf, ok := ret.Get(0).(func(api.LoadLimit) error); ok { + r0 = rf(limit) } else { r0 = ret.Error(0) } + return r0 } @@ -850,20 +804,14 @@ type CsLPPInterface_SetProductionLimit_Call struct { } // SetProductionLimit is a helper method to define mock.On call -// - limit api0.LoadLimit +// - limit api.LoadLimit func (_e *CsLPPInterface_Expecter) SetProductionLimit(limit interface{}) *CsLPPInterface_SetProductionLimit_Call { return &CsLPPInterface_SetProductionLimit_Call{Call: _e.mock.On("SetProductionLimit", limit)} } -func (_c *CsLPPInterface_SetProductionLimit_Call) Run(run func(limit api0.LoadLimit)) *CsLPPInterface_SetProductionLimit_Call { +func (_c *CsLPPInterface_SetProductionLimit_Call) Run(run func(limit api.LoadLimit)) *CsLPPInterface_SetProductionLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api0.LoadLimit - if args[0] != nil { - arg0 = args[0].(api0.LoadLimit) - } - run( - arg0, - ) + run(args[0].(api.LoadLimit)) }) return _c } @@ -873,25 +821,26 @@ func (_c *CsLPPInterface_SetProductionLimit_Call) Return(resultErr error) *CsLPP return _c } -func (_c *CsLPPInterface_SetProductionLimit_Call) RunAndReturn(run func(limit api0.LoadLimit) error) *CsLPPInterface_SetProductionLimit_Call { +func (_c *CsLPPInterface_SetProductionLimit_Call) RunAndReturn(run func(api.LoadLimit) error) *CsLPPInterface_SetProductionLimit_Call { _c.Call.Return(run) return _c } -// SetProductionNominalMax provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) SetProductionNominalMax(value float64) error { - ret := _mock.Called(value) +// SetProductionNominalMax provides a mock function with given fields: value +func (_m *CsLPPInterface) SetProductionNominalMax(value float64) error { + ret := _m.Called(value) if len(ret) == 0 { panic("no return value specified for SetProductionNominalMax") } var r0 error - if returnFunc, ok := ret.Get(0).(func(float64) error); ok { - r0 = returnFunc(value) + if rf, ok := ret.Get(0).(func(float64) error); ok { + r0 = rf(value) } else { r0 = ret.Error(0) } + return r0 } @@ -908,13 +857,7 @@ func (_e *CsLPPInterface_Expecter) SetProductionNominalMax(value interface{}) *C func (_c *CsLPPInterface_SetProductionNominalMax_Call) Run(run func(value float64)) *CsLPPInterface_SetProductionNominalMax_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 float64 - if args[0] != nil { - arg0 = args[0].(float64) - } - run( - arg0, - ) + run(args[0].(float64)) }) return _c } @@ -924,15 +867,14 @@ func (_c *CsLPPInterface_SetProductionNominalMax_Call) Return(resultErr error) * return _c } -func (_c *CsLPPInterface_SetProductionNominalMax_Call) RunAndReturn(run func(value float64) error) *CsLPPInterface_SetProductionNominalMax_Call { +func (_c *CsLPPInterface_SetProductionNominalMax_Call) RunAndReturn(run func(float64) error) *CsLPPInterface_SetProductionNominalMax_Call { _c.Call.Return(run) return _c } -// StartHeartbeat provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) StartHeartbeat() { - _mock.Called() - return +// StartHeartbeat provides a mock function with no fields +func (_m *CsLPPInterface) StartHeartbeat() { + _m.Called() } // CsLPPInterface_StartHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartHeartbeat' @@ -962,10 +904,9 @@ func (_c *CsLPPInterface_StartHeartbeat_Call) RunAndReturn(run func()) *CsLPPInt return _c } -// StopHeartbeat provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) StopHeartbeat() { - _mock.Called() - return +// StopHeartbeat provides a mock function with no fields +func (_m *CsLPPInterface) StopHeartbeat() { + _m.Called() } // CsLPPInterface_StopHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopHeartbeat' @@ -995,10 +936,9 @@ func (_c *CsLPPInterface_StopHeartbeat_Call) RunAndReturn(run func()) *CsLPPInte return _c } -// UpdateUseCaseAvailability provides a mock function for the type CsLPPInterface -func (_mock *CsLPPInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *CsLPPInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // CsLPPInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -1014,13 +954,7 @@ func (_e *CsLPPInterface_Expecter) UpdateUseCaseAvailability(available interface func (_c *CsLPPInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *CsLPPInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -1030,7 +964,21 @@ func (_c *CsLPPInterface_UpdateUseCaseAvailability_Call) Return() *CsLPPInterfac return _c } -func (_c *CsLPPInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *CsLPPInterface_UpdateUseCaseAvailability_Call { +func (_c *CsLPPInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *CsLPPInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } + +// NewCsLPPInterface creates a new instance of CsLPPInterface. 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 NewCsLPPInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *CsLPPInterface { + mock := &CsLPPInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/EgLPCInterface.go b/usecases/mocks/EgLPCInterface.go index aba2463b..3633f240 100644 --- a/usecases/mocks/EgLPCInterface.go +++ b/usecases/mocks/EgLPCInterface.go @@ -1,32 +1,19 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "time" + eebus_goapi "github.com/enbility/eebus-go/api" + api "github.com/enbility/eebus-go/usecases/api" - api1 "github.com/enbility/eebus-go/api" - api0 "github.com/enbility/eebus-go/usecases/api" - "github.com/enbility/spine-go/api" - "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" -) -// NewEgLPCInterface creates a new instance of EgLPCInterface. 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 NewEgLPCInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *EgLPCInterface { - mock := &EgLPCInterface{} - mock.Mock.Test(t) + model "github.com/enbility/spine-go/model" - t.Cleanup(func() { mock.AssertExpectations(t) }) + spine_goapi "github.com/enbility/spine-go/api" - return mock -} + time "time" +) // EgLPCInterface is an autogenerated mock type for the EgLPCInterface type type EgLPCInterface struct { @@ -41,10 +28,22 @@ func (_m *EgLPCInterface) EXPECT() *EgLPCInterface_Expecter { return &EgLPCInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *EgLPCInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // EgLPCInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -64,20 +63,19 @@ func (_c *EgLPCInterface_AddFeatures_Call) Run(run func()) *EgLPCInterface_AddFe return _c } -func (_c *EgLPCInterface_AddFeatures_Call) Return() *EgLPCInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *EgLPCInterface_AddFeatures_Call) Return(_a0 error) *EgLPCInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPCInterface_AddFeatures_Call) RunAndReturn(run func()) *EgLPCInterface_AddFeatures_Call { - _c.Run(run) +func (_c *EgLPCInterface_AddFeatures_Call) RunAndReturn(run func() error) *EgLPCInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *EgLPCInterface) AddUseCase() { + _m.Called() } // EgLPCInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -107,22 +105,23 @@ func (_c *EgLPCInterface_AddUseCase_Call) RunAndReturn(run func()) *EgLPCInterfa return _c } -// AvailableScenariosForEntity provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *EgLPCInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -132,57 +131,53 @@ type EgLPCInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPCInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *EgLPCInterface_AvailableScenariosForEntity_Call { return &EgLPCInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *EgLPCInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPCInterface_AvailableScenariosForEntity_Call { +func (_c *EgLPCInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPCInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPCInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *EgLPCInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *EgLPCInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *EgLPCInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *EgLPCInterface_AvailableScenariosForEntity_Call { +func (_c *EgLPCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *EgLPCInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// ConsumptionLimit provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) ConsumptionLimit(entity api.EntityRemoteInterface) (api0.LoadLimit, error) { - ret := _mock.Called(entity) +// ConsumptionLimit provides a mock function with given fields: entity +func (_m *EgLPCInterface) ConsumptionLimit(entity spine_goapi.EntityRemoteInterface) (api.LoadLimit, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for ConsumptionLimit") } - var r0 api0.LoadLimit + var r0 api.LoadLimit var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (api0.LoadLimit, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (api.LoadLimit, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) api0.LoadLimit); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) api.LoadLimit); ok { + r0 = rf(entity) } else { - r0 = ret.Get(0).(api0.LoadLimit) + r0 = ret.Get(0).(api.LoadLimit) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -192,37 +187,31 @@ type EgLPCInterface_ConsumptionLimit_Call struct { } // ConsumptionLimit is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPCInterface_Expecter) ConsumptionLimit(entity interface{}) *EgLPCInterface_ConsumptionLimit_Call { return &EgLPCInterface_ConsumptionLimit_Call{Call: _e.mock.On("ConsumptionLimit", entity)} } -func (_c *EgLPCInterface_ConsumptionLimit_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPCInterface_ConsumptionLimit_Call { +func (_c *EgLPCInterface_ConsumptionLimit_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPCInterface_ConsumptionLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPCInterface_ConsumptionLimit_Call) Return(limit api0.LoadLimit, resultErr error) *EgLPCInterface_ConsumptionLimit_Call { +func (_c *EgLPCInterface_ConsumptionLimit_Call) Return(limit api.LoadLimit, resultErr error) *EgLPCInterface_ConsumptionLimit_Call { _c.Call.Return(limit, resultErr) return _c } -func (_c *EgLPCInterface_ConsumptionLimit_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (api0.LoadLimit, error)) *EgLPCInterface_ConsumptionLimit_Call { +func (_c *EgLPCInterface_ConsumptionLimit_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (api.LoadLimit, error)) *EgLPCInterface_ConsumptionLimit_Call { _c.Call.Return(run) return _c } -// ConsumptionNominalMax provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) ConsumptionNominalMax(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// ConsumptionNominalMax provides a mock function with given fields: entity +func (_m *EgLPCInterface) ConsumptionNominalMax(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for ConsumptionNominalMax") @@ -230,19 +219,21 @@ func (_mock *EgLPCInterface) ConsumptionNominalMax(entity api.EntityRemoteInterf var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -252,37 +243,31 @@ type EgLPCInterface_ConsumptionNominalMax_Call struct { } // ConsumptionNominalMax is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPCInterface_Expecter) ConsumptionNominalMax(entity interface{}) *EgLPCInterface_ConsumptionNominalMax_Call { return &EgLPCInterface_ConsumptionNominalMax_Call{Call: _e.mock.On("ConsumptionNominalMax", entity)} } -func (_c *EgLPCInterface_ConsumptionNominalMax_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPCInterface_ConsumptionNominalMax_Call { +func (_c *EgLPCInterface_ConsumptionNominalMax_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPCInterface_ConsumptionNominalMax_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPCInterface_ConsumptionNominalMax_Call) Return(f float64, err error) *EgLPCInterface_ConsumptionNominalMax_Call { - _c.Call.Return(f, err) +func (_c *EgLPCInterface_ConsumptionNominalMax_Call) Return(_a0 float64, _a1 error) *EgLPCInterface_ConsumptionNominalMax_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPCInterface_ConsumptionNominalMax_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *EgLPCInterface_ConsumptionNominalMax_Call { +func (_c *EgLPCInterface_ConsumptionNominalMax_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *EgLPCInterface_ConsumptionNominalMax_Call { _c.Call.Return(run) return _c } -// FailsafeConsumptionActivePowerLimit provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) FailsafeConsumptionActivePowerLimit(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// FailsafeConsumptionActivePowerLimit provides a mock function with given fields: entity +func (_m *EgLPCInterface) FailsafeConsumptionActivePowerLimit(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for FailsafeConsumptionActivePowerLimit") @@ -290,19 +275,21 @@ func (_mock *EgLPCInterface) FailsafeConsumptionActivePowerLimit(entity api.Enti var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -312,37 +299,31 @@ type EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call struct { } // FailsafeConsumptionActivePowerLimit is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPCInterface_Expecter) FailsafeConsumptionActivePowerLimit(entity interface{}) *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call { return &EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call{Call: _e.mock.On("FailsafeConsumptionActivePowerLimit", entity)} } -func (_c *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call { +func (_c *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call) Return(f float64, err error) *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call { - _c.Call.Return(f, err) +func (_c *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call) Return(_a0 float64, _a1 error) *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call { +func (_c *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *EgLPCInterface_FailsafeConsumptionActivePowerLimit_Call { _c.Call.Return(run) return _c } -// FailsafeDurationMinimum provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) FailsafeDurationMinimum(entity api.EntityRemoteInterface) (time.Duration, error) { - ret := _mock.Called(entity) +// FailsafeDurationMinimum provides a mock function with given fields: entity +func (_m *EgLPCInterface) FailsafeDurationMinimum(entity spine_goapi.EntityRemoteInterface) (time.Duration, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for FailsafeDurationMinimum") @@ -350,19 +331,21 @@ func (_mock *EgLPCInterface) FailsafeDurationMinimum(entity api.EntityRemoteInte var r0 time.Duration var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (time.Duration, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (time.Duration, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) time.Duration); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) time.Duration); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(time.Duration) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -372,48 +355,43 @@ type EgLPCInterface_FailsafeDurationMinimum_Call struct { } // FailsafeDurationMinimum is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPCInterface_Expecter) FailsafeDurationMinimum(entity interface{}) *EgLPCInterface_FailsafeDurationMinimum_Call { return &EgLPCInterface_FailsafeDurationMinimum_Call{Call: _e.mock.On("FailsafeDurationMinimum", entity)} } -func (_c *EgLPCInterface_FailsafeDurationMinimum_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPCInterface_FailsafeDurationMinimum_Call { +func (_c *EgLPCInterface_FailsafeDurationMinimum_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPCInterface_FailsafeDurationMinimum_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPCInterface_FailsafeDurationMinimum_Call) Return(duration time.Duration, err error) *EgLPCInterface_FailsafeDurationMinimum_Call { - _c.Call.Return(duration, err) +func (_c *EgLPCInterface_FailsafeDurationMinimum_Call) Return(_a0 time.Duration, _a1 error) *EgLPCInterface_FailsafeDurationMinimum_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPCInterface_FailsafeDurationMinimum_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (time.Duration, error)) *EgLPCInterface_FailsafeDurationMinimum_Call { +func (_c *EgLPCInterface_FailsafeDurationMinimum_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (time.Duration, error)) *EgLPCInterface_FailsafeDurationMinimum_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *EgLPCInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -423,48 +401,43 @@ type EgLPCInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPCInterface_Expecter) IsCompatibleEntityType(entity interface{}) *EgLPCInterface_IsCompatibleEntityType_Call { return &EgLPCInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *EgLPCInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPCInterface_IsCompatibleEntityType_Call { +func (_c *EgLPCInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPCInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPCInterface_IsCompatibleEntityType_Call) Return(b bool) *EgLPCInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *EgLPCInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *EgLPCInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *EgLPCInterface_IsCompatibleEntityType_Call { +func (_c *EgLPCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *EgLPCInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsHeartbeatWithinDuration provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) IsHeartbeatWithinDuration(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsHeartbeatWithinDuration provides a mock function with given fields: entity +func (_m *EgLPCInterface) IsHeartbeatWithinDuration(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsHeartbeatWithinDuration") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -474,48 +447,43 @@ type EgLPCInterface_IsHeartbeatWithinDuration_Call struct { } // IsHeartbeatWithinDuration is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPCInterface_Expecter) IsHeartbeatWithinDuration(entity interface{}) *EgLPCInterface_IsHeartbeatWithinDuration_Call { return &EgLPCInterface_IsHeartbeatWithinDuration_Call{Call: _e.mock.On("IsHeartbeatWithinDuration", entity)} } -func (_c *EgLPCInterface_IsHeartbeatWithinDuration_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPCInterface_IsHeartbeatWithinDuration_Call { +func (_c *EgLPCInterface_IsHeartbeatWithinDuration_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPCInterface_IsHeartbeatWithinDuration_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPCInterface_IsHeartbeatWithinDuration_Call) Return(b bool) *EgLPCInterface_IsHeartbeatWithinDuration_Call { - _c.Call.Return(b) +func (_c *EgLPCInterface_IsHeartbeatWithinDuration_Call) Return(_a0 bool) *EgLPCInterface_IsHeartbeatWithinDuration_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPCInterface_IsHeartbeatWithinDuration_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *EgLPCInterface_IsHeartbeatWithinDuration_Call { +func (_c *EgLPCInterface_IsHeartbeatWithinDuration_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *EgLPCInterface_IsHeartbeatWithinDuration_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *EgLPCInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -525,56 +493,46 @@ type EgLPCInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *EgLPCInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *EgLPCInterface_IsScenarioAvailableAtEntity_Call { return &EgLPCInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *EgLPCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *EgLPCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *EgLPCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *EgLPCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *EgLPCInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *EgLPCInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *EgLPCInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *EgLPCInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *EgLPCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *EgLPCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *EgLPCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) RemoteEntitiesScenarios() []api1.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *EgLPCInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api1.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api1.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api1.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -595,20 +553,19 @@ func (_c *EgLPCInterface_RemoteEntitiesScenarios_Call) Run(run func()) *EgLPCInt return _c } -func (_c *EgLPCInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api1.RemoteEntityScenarios) *EgLPCInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *EgLPCInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *EgLPCInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api1.RemoteEntityScenarios) *EgLPCInterface_RemoteEntitiesScenarios_Call { +func (_c *EgLPCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *EgLPCInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *EgLPCInterface) RemoveUseCase() { + _m.Called() } // EgLPCInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -638,10 +595,9 @@ func (_c *EgLPCInterface_RemoveUseCase_Call) RunAndReturn(run func()) *EgLPCInte return _c } -// StartHeartbeat provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) StartHeartbeat() { - _mock.Called() - return +// StartHeartbeat provides a mock function with no fields +func (_m *EgLPCInterface) StartHeartbeat() { + _m.Called() } // EgLPCInterface_StartHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartHeartbeat' @@ -671,10 +627,9 @@ func (_c *EgLPCInterface_StartHeartbeat_Call) RunAndReturn(run func()) *EgLPCInt return _c } -// StopHeartbeat provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) StopHeartbeat() { - _mock.Called() - return +// StopHeartbeat provides a mock function with no fields +func (_m *EgLPCInterface) StopHeartbeat() { + _m.Called() } // EgLPCInterface_StopHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopHeartbeat' @@ -704,10 +659,9 @@ func (_c *EgLPCInterface_StopHeartbeat_Call) RunAndReturn(run func()) *EgLPCInte return _c } -// UpdateUseCaseAvailability provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *EgLPCInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // EgLPCInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -723,13 +677,7 @@ func (_e *EgLPCInterface_Expecter) UpdateUseCaseAvailability(available interface func (_c *EgLPCInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *EgLPCInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -739,14 +687,14 @@ func (_c *EgLPCInterface_UpdateUseCaseAvailability_Call) Return() *EgLPCInterfac return _c } -func (_c *EgLPCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *EgLPCInterface_UpdateUseCaseAvailability_Call { +func (_c *EgLPCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *EgLPCInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } -// WriteConsumptionLimit provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) WriteConsumptionLimit(entity api.EntityRemoteInterface, limit api0.LoadLimit, resultCB func(result model.ResultDataType)) (*model.MsgCounterType, error) { - ret := _mock.Called(entity, limit, resultCB) +// WriteConsumptionLimit provides a mock function with given fields: entity, limit, resultCB +func (_m *EgLPCInterface) WriteConsumptionLimit(entity spine_goapi.EntityRemoteInterface, limit api.LoadLimit, resultCB func(model.ResultDataType)) (*model.MsgCounterType, error) { + ret := _m.Called(entity, limit, resultCB) if len(ret) == 0 { panic("no return value specified for WriteConsumptionLimit") @@ -754,21 +702,23 @@ func (_mock *EgLPCInterface) WriteConsumptionLimit(entity api.EntityRemoteInterf var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, api0.LoadLimit, func(result model.ResultDataType)) (*model.MsgCounterType, error)); ok { - return returnFunc(entity, limit, resultCB) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, api.LoadLimit, func(model.ResultDataType)) (*model.MsgCounterType, error)); ok { + return rf(entity, limit, resultCB) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, api0.LoadLimit, func(result model.ResultDataType)) *model.MsgCounterType); ok { - r0 = returnFunc(entity, limit, resultCB) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, api.LoadLimit, func(model.ResultDataType)) *model.MsgCounterType); ok { + r0 = rf(entity, limit, resultCB) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface, api0.LoadLimit, func(result model.ResultDataType)) error); ok { - r1 = returnFunc(entity, limit, resultCB) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface, api.LoadLimit, func(model.ResultDataType)) error); ok { + r1 = rf(entity, limit, resultCB) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -778,49 +728,33 @@ type EgLPCInterface_WriteConsumptionLimit_Call struct { } // WriteConsumptionLimit is a helper method to define mock.On call -// - entity api.EntityRemoteInterface -// - limit api0.LoadLimit -// - resultCB func(result model.ResultDataType) +// - entity spine_goapi.EntityRemoteInterface +// - limit api.LoadLimit +// - resultCB func(model.ResultDataType) func (_e *EgLPCInterface_Expecter) WriteConsumptionLimit(entity interface{}, limit interface{}, resultCB interface{}) *EgLPCInterface_WriteConsumptionLimit_Call { return &EgLPCInterface_WriteConsumptionLimit_Call{Call: _e.mock.On("WriteConsumptionLimit", entity, limit, resultCB)} } -func (_c *EgLPCInterface_WriteConsumptionLimit_Call) Run(run func(entity api.EntityRemoteInterface, limit api0.LoadLimit, resultCB func(result model.ResultDataType))) *EgLPCInterface_WriteConsumptionLimit_Call { +func (_c *EgLPCInterface_WriteConsumptionLimit_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, limit api.LoadLimit, resultCB func(model.ResultDataType))) *EgLPCInterface_WriteConsumptionLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 api0.LoadLimit - if args[1] != nil { - arg1 = args[1].(api0.LoadLimit) - } - var arg2 func(result model.ResultDataType) - if args[2] != nil { - arg2 = args[2].(func(result model.ResultDataType)) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(api.LoadLimit), args[2].(func(model.ResultDataType))) }) return _c } -func (_c *EgLPCInterface_WriteConsumptionLimit_Call) Return(msgCounterType *model.MsgCounterType, err error) *EgLPCInterface_WriteConsumptionLimit_Call { - _c.Call.Return(msgCounterType, err) +func (_c *EgLPCInterface_WriteConsumptionLimit_Call) Return(_a0 *model.MsgCounterType, _a1 error) *EgLPCInterface_WriteConsumptionLimit_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPCInterface_WriteConsumptionLimit_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, limit api0.LoadLimit, resultCB func(result model.ResultDataType)) (*model.MsgCounterType, error)) *EgLPCInterface_WriteConsumptionLimit_Call { +func (_c *EgLPCInterface_WriteConsumptionLimit_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, api.LoadLimit, func(model.ResultDataType)) (*model.MsgCounterType, error)) *EgLPCInterface_WriteConsumptionLimit_Call { _c.Call.Return(run) return _c } -// WriteFailsafeConsumptionActivePowerLimit provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) WriteFailsafeConsumptionActivePowerLimit(entity api.EntityRemoteInterface, value float64) (*model.MsgCounterType, error) { - ret := _mock.Called(entity, value) +// WriteFailsafeConsumptionActivePowerLimit provides a mock function with given fields: entity, value +func (_m *EgLPCInterface) WriteFailsafeConsumptionActivePowerLimit(entity spine_goapi.EntityRemoteInterface, value float64) (*model.MsgCounterType, error) { + ret := _m.Called(entity, value) if len(ret) == 0 { panic("no return value specified for WriteFailsafeConsumptionActivePowerLimit") @@ -828,21 +762,23 @@ func (_mock *EgLPCInterface) WriteFailsafeConsumptionActivePowerLimit(entity api var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, float64) (*model.MsgCounterType, error)); ok { - return returnFunc(entity, value) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, float64) (*model.MsgCounterType, error)); ok { + return rf(entity, value) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, float64) *model.MsgCounterType); ok { - r0 = returnFunc(entity, value) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, float64) *model.MsgCounterType); ok { + r0 = rf(entity, value) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface, float64) error); ok { - r1 = returnFunc(entity, value) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface, float64) error); ok { + r1 = rf(entity, value) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -852,43 +788,32 @@ type EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call struct { } // WriteFailsafeConsumptionActivePowerLimit is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - value float64 func (_e *EgLPCInterface_Expecter) WriteFailsafeConsumptionActivePowerLimit(entity interface{}, value interface{}) *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call { return &EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call{Call: _e.mock.On("WriteFailsafeConsumptionActivePowerLimit", entity, value)} } -func (_c *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call) Run(run func(entity api.EntityRemoteInterface, value float64)) *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call { +func (_c *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, value float64)) *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 float64 - if args[1] != nil { - arg1 = args[1].(float64) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(float64)) }) return _c } -func (_c *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call) Return(msgCounterType *model.MsgCounterType, err error) *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call { - _c.Call.Return(msgCounterType, err) +func (_c *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call) Return(_a0 *model.MsgCounterType, _a1 error) *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, value float64) (*model.MsgCounterType, error)) *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call { +func (_c *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, float64) (*model.MsgCounterType, error)) *EgLPCInterface_WriteFailsafeConsumptionActivePowerLimit_Call { _c.Call.Return(run) return _c } -// WriteFailsafeDurationMinimum provides a mock function for the type EgLPCInterface -func (_mock *EgLPCInterface) WriteFailsafeDurationMinimum(entity api.EntityRemoteInterface, duration time.Duration) (*model.MsgCounterType, error) { - ret := _mock.Called(entity, duration) +// WriteFailsafeDurationMinimum provides a mock function with given fields: entity, duration +func (_m *EgLPCInterface) WriteFailsafeDurationMinimum(entity spine_goapi.EntityRemoteInterface, duration time.Duration) (*model.MsgCounterType, error) { + ret := _m.Called(entity, duration) if len(ret) == 0 { panic("no return value specified for WriteFailsafeDurationMinimum") @@ -896,21 +821,23 @@ func (_mock *EgLPCInterface) WriteFailsafeDurationMinimum(entity api.EntityRemot var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, time.Duration) (*model.MsgCounterType, error)); ok { - return returnFunc(entity, duration) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, time.Duration) (*model.MsgCounterType, error)); ok { + return rf(entity, duration) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, time.Duration) *model.MsgCounterType); ok { - r0 = returnFunc(entity, duration) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, time.Duration) *model.MsgCounterType); ok { + r0 = rf(entity, duration) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface, time.Duration) error); ok { - r1 = returnFunc(entity, duration) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface, time.Duration) error); ok { + r1 = rf(entity, duration) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -920,36 +847,39 @@ type EgLPCInterface_WriteFailsafeDurationMinimum_Call struct { } // WriteFailsafeDurationMinimum is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - duration time.Duration func (_e *EgLPCInterface_Expecter) WriteFailsafeDurationMinimum(entity interface{}, duration interface{}) *EgLPCInterface_WriteFailsafeDurationMinimum_Call { return &EgLPCInterface_WriteFailsafeDurationMinimum_Call{Call: _e.mock.On("WriteFailsafeDurationMinimum", entity, duration)} } -func (_c *EgLPCInterface_WriteFailsafeDurationMinimum_Call) Run(run func(entity api.EntityRemoteInterface, duration time.Duration)) *EgLPCInterface_WriteFailsafeDurationMinimum_Call { +func (_c *EgLPCInterface_WriteFailsafeDurationMinimum_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, duration time.Duration)) *EgLPCInterface_WriteFailsafeDurationMinimum_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 time.Duration - if args[1] != nil { - arg1 = args[1].(time.Duration) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(time.Duration)) }) return _c } -func (_c *EgLPCInterface_WriteFailsafeDurationMinimum_Call) Return(msgCounterType *model.MsgCounterType, err error) *EgLPCInterface_WriteFailsafeDurationMinimum_Call { - _c.Call.Return(msgCounterType, err) +func (_c *EgLPCInterface_WriteFailsafeDurationMinimum_Call) Return(_a0 *model.MsgCounterType, _a1 error) *EgLPCInterface_WriteFailsafeDurationMinimum_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPCInterface_WriteFailsafeDurationMinimum_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, duration time.Duration) (*model.MsgCounterType, error)) *EgLPCInterface_WriteFailsafeDurationMinimum_Call { +func (_c *EgLPCInterface_WriteFailsafeDurationMinimum_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, time.Duration) (*model.MsgCounterType, error)) *EgLPCInterface_WriteFailsafeDurationMinimum_Call { _c.Call.Return(run) return _c } + +// NewEgLPCInterface creates a new instance of EgLPCInterface. 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 NewEgLPCInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *EgLPCInterface { + mock := &EgLPCInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/EgLPPInterface.go b/usecases/mocks/EgLPPInterface.go index 70f83792..66b8dccb 100644 --- a/usecases/mocks/EgLPPInterface.go +++ b/usecases/mocks/EgLPPInterface.go @@ -1,32 +1,19 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - "time" + eebus_goapi "github.com/enbility/eebus-go/api" + api "github.com/enbility/eebus-go/usecases/api" - api1 "github.com/enbility/eebus-go/api" - api0 "github.com/enbility/eebus-go/usecases/api" - "github.com/enbility/spine-go/api" - "github.com/enbility/spine-go/model" mock "github.com/stretchr/testify/mock" -) -// NewEgLPPInterface creates a new instance of EgLPPInterface. 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 NewEgLPPInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *EgLPPInterface { - mock := &EgLPPInterface{} - mock.Mock.Test(t) + model "github.com/enbility/spine-go/model" - t.Cleanup(func() { mock.AssertExpectations(t) }) + spine_goapi "github.com/enbility/spine-go/api" - return mock -} + time "time" +) // EgLPPInterface is an autogenerated mock type for the EgLPPInterface type type EgLPPInterface struct { @@ -41,10 +28,22 @@ func (_m *EgLPPInterface) EXPECT() *EgLPPInterface_Expecter { return &EgLPPInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *EgLPPInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // EgLPPInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -64,20 +63,19 @@ func (_c *EgLPPInterface_AddFeatures_Call) Run(run func()) *EgLPPInterface_AddFe return _c } -func (_c *EgLPPInterface_AddFeatures_Call) Return() *EgLPPInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *EgLPPInterface_AddFeatures_Call) Return(_a0 error) *EgLPPInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPPInterface_AddFeatures_Call) RunAndReturn(run func()) *EgLPPInterface_AddFeatures_Call { - _c.Run(run) +func (_c *EgLPPInterface_AddFeatures_Call) RunAndReturn(run func() error) *EgLPPInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *EgLPPInterface) AddUseCase() { + _m.Called() } // EgLPPInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -107,22 +105,23 @@ func (_c *EgLPPInterface_AddUseCase_Call) RunAndReturn(run func()) *EgLPPInterfa return _c } -// AvailableScenariosForEntity provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *EgLPPInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -132,37 +131,31 @@ type EgLPPInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPPInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *EgLPPInterface_AvailableScenariosForEntity_Call { return &EgLPPInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *EgLPPInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPPInterface_AvailableScenariosForEntity_Call { +func (_c *EgLPPInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPPInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPPInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *EgLPPInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *EgLPPInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *EgLPPInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPPInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *EgLPPInterface_AvailableScenariosForEntity_Call { +func (_c *EgLPPInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *EgLPPInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// FailsafeDurationMinimum provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) FailsafeDurationMinimum(entity api.EntityRemoteInterface) (time.Duration, error) { - ret := _mock.Called(entity) +// FailsafeDurationMinimum provides a mock function with given fields: entity +func (_m *EgLPPInterface) FailsafeDurationMinimum(entity spine_goapi.EntityRemoteInterface) (time.Duration, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for FailsafeDurationMinimum") @@ -170,19 +163,21 @@ func (_mock *EgLPPInterface) FailsafeDurationMinimum(entity api.EntityRemoteInte var r0 time.Duration var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (time.Duration, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (time.Duration, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) time.Duration); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) time.Duration); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(time.Duration) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -192,37 +187,31 @@ type EgLPPInterface_FailsafeDurationMinimum_Call struct { } // FailsafeDurationMinimum is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPPInterface_Expecter) FailsafeDurationMinimum(entity interface{}) *EgLPPInterface_FailsafeDurationMinimum_Call { return &EgLPPInterface_FailsafeDurationMinimum_Call{Call: _e.mock.On("FailsafeDurationMinimum", entity)} } -func (_c *EgLPPInterface_FailsafeDurationMinimum_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPPInterface_FailsafeDurationMinimum_Call { +func (_c *EgLPPInterface_FailsafeDurationMinimum_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPPInterface_FailsafeDurationMinimum_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPPInterface_FailsafeDurationMinimum_Call) Return(duration time.Duration, err error) *EgLPPInterface_FailsafeDurationMinimum_Call { - _c.Call.Return(duration, err) +func (_c *EgLPPInterface_FailsafeDurationMinimum_Call) Return(_a0 time.Duration, _a1 error) *EgLPPInterface_FailsafeDurationMinimum_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPPInterface_FailsafeDurationMinimum_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (time.Duration, error)) *EgLPPInterface_FailsafeDurationMinimum_Call { +func (_c *EgLPPInterface_FailsafeDurationMinimum_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (time.Duration, error)) *EgLPPInterface_FailsafeDurationMinimum_Call { _c.Call.Return(run) return _c } -// FailsafeProductionActivePowerLimit provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) FailsafeProductionActivePowerLimit(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// FailsafeProductionActivePowerLimit provides a mock function with given fields: entity +func (_m *EgLPPInterface) FailsafeProductionActivePowerLimit(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for FailsafeProductionActivePowerLimit") @@ -230,19 +219,21 @@ func (_mock *EgLPPInterface) FailsafeProductionActivePowerLimit(entity api.Entit var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -252,48 +243,43 @@ type EgLPPInterface_FailsafeProductionActivePowerLimit_Call struct { } // FailsafeProductionActivePowerLimit is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPPInterface_Expecter) FailsafeProductionActivePowerLimit(entity interface{}) *EgLPPInterface_FailsafeProductionActivePowerLimit_Call { return &EgLPPInterface_FailsafeProductionActivePowerLimit_Call{Call: _e.mock.On("FailsafeProductionActivePowerLimit", entity)} } -func (_c *EgLPPInterface_FailsafeProductionActivePowerLimit_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPPInterface_FailsafeProductionActivePowerLimit_Call { +func (_c *EgLPPInterface_FailsafeProductionActivePowerLimit_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPPInterface_FailsafeProductionActivePowerLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPPInterface_FailsafeProductionActivePowerLimit_Call) Return(f float64, err error) *EgLPPInterface_FailsafeProductionActivePowerLimit_Call { - _c.Call.Return(f, err) +func (_c *EgLPPInterface_FailsafeProductionActivePowerLimit_Call) Return(_a0 float64, _a1 error) *EgLPPInterface_FailsafeProductionActivePowerLimit_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPPInterface_FailsafeProductionActivePowerLimit_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *EgLPPInterface_FailsafeProductionActivePowerLimit_Call { +func (_c *EgLPPInterface_FailsafeProductionActivePowerLimit_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *EgLPPInterface_FailsafeProductionActivePowerLimit_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *EgLPPInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -303,48 +289,43 @@ type EgLPPInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPPInterface_Expecter) IsCompatibleEntityType(entity interface{}) *EgLPPInterface_IsCompatibleEntityType_Call { return &EgLPPInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *EgLPPInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPPInterface_IsCompatibleEntityType_Call { +func (_c *EgLPPInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPPInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPPInterface_IsCompatibleEntityType_Call) Return(b bool) *EgLPPInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *EgLPPInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *EgLPPInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPPInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *EgLPPInterface_IsCompatibleEntityType_Call { +func (_c *EgLPPInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *EgLPPInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsHeartbeatWithinDuration provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) IsHeartbeatWithinDuration(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsHeartbeatWithinDuration provides a mock function with given fields: entity +func (_m *EgLPPInterface) IsHeartbeatWithinDuration(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsHeartbeatWithinDuration") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -354,48 +335,43 @@ type EgLPPInterface_IsHeartbeatWithinDuration_Call struct { } // IsHeartbeatWithinDuration is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPPInterface_Expecter) IsHeartbeatWithinDuration(entity interface{}) *EgLPPInterface_IsHeartbeatWithinDuration_Call { return &EgLPPInterface_IsHeartbeatWithinDuration_Call{Call: _e.mock.On("IsHeartbeatWithinDuration", entity)} } -func (_c *EgLPPInterface_IsHeartbeatWithinDuration_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPPInterface_IsHeartbeatWithinDuration_Call { +func (_c *EgLPPInterface_IsHeartbeatWithinDuration_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPPInterface_IsHeartbeatWithinDuration_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPPInterface_IsHeartbeatWithinDuration_Call) Return(b bool) *EgLPPInterface_IsHeartbeatWithinDuration_Call { - _c.Call.Return(b) +func (_c *EgLPPInterface_IsHeartbeatWithinDuration_Call) Return(_a0 bool) *EgLPPInterface_IsHeartbeatWithinDuration_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPPInterface_IsHeartbeatWithinDuration_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *EgLPPInterface_IsHeartbeatWithinDuration_Call { +func (_c *EgLPPInterface_IsHeartbeatWithinDuration_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *EgLPPInterface_IsHeartbeatWithinDuration_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *EgLPPInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -405,63 +381,54 @@ type EgLPPInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *EgLPPInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *EgLPPInterface_IsScenarioAvailableAtEntity_Call { return &EgLPPInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *EgLPPInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *EgLPPInterface_IsScenarioAvailableAtEntity_Call { +func (_c *EgLPPInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *EgLPPInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *EgLPPInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *EgLPPInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *EgLPPInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *EgLPPInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPPInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *EgLPPInterface_IsScenarioAvailableAtEntity_Call { +func (_c *EgLPPInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *EgLPPInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// ProductionLimit provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) ProductionLimit(entity api.EntityRemoteInterface) (api0.LoadLimit, error) { - ret := _mock.Called(entity) +// ProductionLimit provides a mock function with given fields: entity +func (_m *EgLPPInterface) ProductionLimit(entity spine_goapi.EntityRemoteInterface) (api.LoadLimit, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for ProductionLimit") } - var r0 api0.LoadLimit + var r0 api.LoadLimit var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (api0.LoadLimit, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (api.LoadLimit, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) api0.LoadLimit); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) api.LoadLimit); ok { + r0 = rf(entity) } else { - r0 = ret.Get(0).(api0.LoadLimit) + r0 = ret.Get(0).(api.LoadLimit) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -471,37 +438,31 @@ type EgLPPInterface_ProductionLimit_Call struct { } // ProductionLimit is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPPInterface_Expecter) ProductionLimit(entity interface{}) *EgLPPInterface_ProductionLimit_Call { return &EgLPPInterface_ProductionLimit_Call{Call: _e.mock.On("ProductionLimit", entity)} } -func (_c *EgLPPInterface_ProductionLimit_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPPInterface_ProductionLimit_Call { +func (_c *EgLPPInterface_ProductionLimit_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPPInterface_ProductionLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPPInterface_ProductionLimit_Call) Return(limit api0.LoadLimit, resultErr error) *EgLPPInterface_ProductionLimit_Call { +func (_c *EgLPPInterface_ProductionLimit_Call) Return(limit api.LoadLimit, resultErr error) *EgLPPInterface_ProductionLimit_Call { _c.Call.Return(limit, resultErr) return _c } -func (_c *EgLPPInterface_ProductionLimit_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (api0.LoadLimit, error)) *EgLPPInterface_ProductionLimit_Call { +func (_c *EgLPPInterface_ProductionLimit_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (api.LoadLimit, error)) *EgLPPInterface_ProductionLimit_Call { _c.Call.Return(run) return _c } -// ProductionNominalMax provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) ProductionNominalMax(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// ProductionNominalMax provides a mock function with given fields: entity +func (_m *EgLPPInterface) ProductionNominalMax(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for ProductionNominalMax") @@ -509,19 +470,21 @@ func (_mock *EgLPPInterface) ProductionNominalMax(entity api.EntityRemoteInterfa var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -531,50 +494,45 @@ type EgLPPInterface_ProductionNominalMax_Call struct { } // ProductionNominalMax is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *EgLPPInterface_Expecter) ProductionNominalMax(entity interface{}) *EgLPPInterface_ProductionNominalMax_Call { return &EgLPPInterface_ProductionNominalMax_Call{Call: _e.mock.On("ProductionNominalMax", entity)} } -func (_c *EgLPPInterface_ProductionNominalMax_Call) Run(run func(entity api.EntityRemoteInterface)) *EgLPPInterface_ProductionNominalMax_Call { +func (_c *EgLPPInterface_ProductionNominalMax_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *EgLPPInterface_ProductionNominalMax_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *EgLPPInterface_ProductionNominalMax_Call) Return(f float64, err error) *EgLPPInterface_ProductionNominalMax_Call { - _c.Call.Return(f, err) +func (_c *EgLPPInterface_ProductionNominalMax_Call) Return(_a0 float64, _a1 error) *EgLPPInterface_ProductionNominalMax_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPPInterface_ProductionNominalMax_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *EgLPPInterface_ProductionNominalMax_Call { +func (_c *EgLPPInterface_ProductionNominalMax_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *EgLPPInterface_ProductionNominalMax_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) RemoteEntitiesScenarios() []api1.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *EgLPPInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api1.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api1.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api1.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -595,20 +553,19 @@ func (_c *EgLPPInterface_RemoteEntitiesScenarios_Call) Run(run func()) *EgLPPInt return _c } -func (_c *EgLPPInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api1.RemoteEntityScenarios) *EgLPPInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *EgLPPInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *EgLPPInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *EgLPPInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api1.RemoteEntityScenarios) *EgLPPInterface_RemoteEntitiesScenarios_Call { +func (_c *EgLPPInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *EgLPPInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *EgLPPInterface) RemoveUseCase() { + _m.Called() } // EgLPPInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -638,10 +595,9 @@ func (_c *EgLPPInterface_RemoveUseCase_Call) RunAndReturn(run func()) *EgLPPInte return _c } -// StartHeartbeat provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) StartHeartbeat() { - _mock.Called() - return +// StartHeartbeat provides a mock function with no fields +func (_m *EgLPPInterface) StartHeartbeat() { + _m.Called() } // EgLPPInterface_StartHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartHeartbeat' @@ -671,10 +627,9 @@ func (_c *EgLPPInterface_StartHeartbeat_Call) RunAndReturn(run func()) *EgLPPInt return _c } -// StopHeartbeat provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) StopHeartbeat() { - _mock.Called() - return +// StopHeartbeat provides a mock function with no fields +func (_m *EgLPPInterface) StopHeartbeat() { + _m.Called() } // EgLPPInterface_StopHeartbeat_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopHeartbeat' @@ -704,10 +659,9 @@ func (_c *EgLPPInterface_StopHeartbeat_Call) RunAndReturn(run func()) *EgLPPInte return _c } -// UpdateUseCaseAvailability provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *EgLPPInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // EgLPPInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -723,13 +677,7 @@ func (_e *EgLPPInterface_Expecter) UpdateUseCaseAvailability(available interface func (_c *EgLPPInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *EgLPPInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -739,14 +687,14 @@ func (_c *EgLPPInterface_UpdateUseCaseAvailability_Call) Return() *EgLPPInterfac return _c } -func (_c *EgLPPInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *EgLPPInterface_UpdateUseCaseAvailability_Call { +func (_c *EgLPPInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *EgLPPInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } -// WriteFailsafeDurationMinimum provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) WriteFailsafeDurationMinimum(entity api.EntityRemoteInterface, duration time.Duration) (*model.MsgCounterType, error) { - ret := _mock.Called(entity, duration) +// WriteFailsafeDurationMinimum provides a mock function with given fields: entity, duration +func (_m *EgLPPInterface) WriteFailsafeDurationMinimum(entity spine_goapi.EntityRemoteInterface, duration time.Duration) (*model.MsgCounterType, error) { + ret := _m.Called(entity, duration) if len(ret) == 0 { panic("no return value specified for WriteFailsafeDurationMinimum") @@ -754,21 +702,23 @@ func (_mock *EgLPPInterface) WriteFailsafeDurationMinimum(entity api.EntityRemot var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, time.Duration) (*model.MsgCounterType, error)); ok { - return returnFunc(entity, duration) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, time.Duration) (*model.MsgCounterType, error)); ok { + return rf(entity, duration) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, time.Duration) *model.MsgCounterType); ok { - r0 = returnFunc(entity, duration) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, time.Duration) *model.MsgCounterType); ok { + r0 = rf(entity, duration) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface, time.Duration) error); ok { - r1 = returnFunc(entity, duration) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface, time.Duration) error); ok { + r1 = rf(entity, duration) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -778,43 +728,32 @@ type EgLPPInterface_WriteFailsafeDurationMinimum_Call struct { } // WriteFailsafeDurationMinimum is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - duration time.Duration func (_e *EgLPPInterface_Expecter) WriteFailsafeDurationMinimum(entity interface{}, duration interface{}) *EgLPPInterface_WriteFailsafeDurationMinimum_Call { return &EgLPPInterface_WriteFailsafeDurationMinimum_Call{Call: _e.mock.On("WriteFailsafeDurationMinimum", entity, duration)} } -func (_c *EgLPPInterface_WriteFailsafeDurationMinimum_Call) Run(run func(entity api.EntityRemoteInterface, duration time.Duration)) *EgLPPInterface_WriteFailsafeDurationMinimum_Call { +func (_c *EgLPPInterface_WriteFailsafeDurationMinimum_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, duration time.Duration)) *EgLPPInterface_WriteFailsafeDurationMinimum_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 time.Duration - if args[1] != nil { - arg1 = args[1].(time.Duration) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(time.Duration)) }) return _c } -func (_c *EgLPPInterface_WriteFailsafeDurationMinimum_Call) Return(msgCounterType *model.MsgCounterType, err error) *EgLPPInterface_WriteFailsafeDurationMinimum_Call { - _c.Call.Return(msgCounterType, err) +func (_c *EgLPPInterface_WriteFailsafeDurationMinimum_Call) Return(_a0 *model.MsgCounterType, _a1 error) *EgLPPInterface_WriteFailsafeDurationMinimum_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPPInterface_WriteFailsafeDurationMinimum_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, duration time.Duration) (*model.MsgCounterType, error)) *EgLPPInterface_WriteFailsafeDurationMinimum_Call { +func (_c *EgLPPInterface_WriteFailsafeDurationMinimum_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, time.Duration) (*model.MsgCounterType, error)) *EgLPPInterface_WriteFailsafeDurationMinimum_Call { _c.Call.Return(run) return _c } -// WriteFailsafeProductionActivePowerLimit provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) WriteFailsafeProductionActivePowerLimit(entity api.EntityRemoteInterface, value float64) (*model.MsgCounterType, error) { - ret := _mock.Called(entity, value) +// WriteFailsafeProductionActivePowerLimit provides a mock function with given fields: entity, value +func (_m *EgLPPInterface) WriteFailsafeProductionActivePowerLimit(entity spine_goapi.EntityRemoteInterface, value float64) (*model.MsgCounterType, error) { + ret := _m.Called(entity, value) if len(ret) == 0 { panic("no return value specified for WriteFailsafeProductionActivePowerLimit") @@ -822,21 +761,23 @@ func (_mock *EgLPPInterface) WriteFailsafeProductionActivePowerLimit(entity api. var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, float64) (*model.MsgCounterType, error)); ok { - return returnFunc(entity, value) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, float64) (*model.MsgCounterType, error)); ok { + return rf(entity, value) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, float64) *model.MsgCounterType); ok { - r0 = returnFunc(entity, value) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, float64) *model.MsgCounterType); ok { + r0 = rf(entity, value) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface, float64) error); ok { - r1 = returnFunc(entity, value) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface, float64) error); ok { + r1 = rf(entity, value) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -846,43 +787,32 @@ type EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call struct { } // WriteFailsafeProductionActivePowerLimit is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - value float64 func (_e *EgLPPInterface_Expecter) WriteFailsafeProductionActivePowerLimit(entity interface{}, value interface{}) *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call { return &EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call{Call: _e.mock.On("WriteFailsafeProductionActivePowerLimit", entity, value)} } -func (_c *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call) Run(run func(entity api.EntityRemoteInterface, value float64)) *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call { +func (_c *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, value float64)) *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 float64 - if args[1] != nil { - arg1 = args[1].(float64) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(float64)) }) return _c } -func (_c *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call) Return(msgCounterType *model.MsgCounterType, err error) *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call { - _c.Call.Return(msgCounterType, err) +func (_c *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call) Return(_a0 *model.MsgCounterType, _a1 error) *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, value float64) (*model.MsgCounterType, error)) *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call { +func (_c *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, float64) (*model.MsgCounterType, error)) *EgLPPInterface_WriteFailsafeProductionActivePowerLimit_Call { _c.Call.Return(run) return _c } -// WriteProductionLimit provides a mock function for the type EgLPPInterface -func (_mock *EgLPPInterface) WriteProductionLimit(entity api.EntityRemoteInterface, limit api0.LoadLimit, resultCB func(result model.ResultDataType)) (*model.MsgCounterType, error) { - ret := _mock.Called(entity, limit, resultCB) +// WriteProductionLimit provides a mock function with given fields: entity, limit, resultCB +func (_m *EgLPPInterface) WriteProductionLimit(entity spine_goapi.EntityRemoteInterface, limit api.LoadLimit, resultCB func(model.ResultDataType)) (*model.MsgCounterType, error) { + ret := _m.Called(entity, limit, resultCB) if len(ret) == 0 { panic("no return value specified for WriteProductionLimit") @@ -890,21 +820,23 @@ func (_mock *EgLPPInterface) WriteProductionLimit(entity api.EntityRemoteInterfa var r0 *model.MsgCounterType var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, api0.LoadLimit, func(result model.ResultDataType)) (*model.MsgCounterType, error)); ok { - return returnFunc(entity, limit, resultCB) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, api.LoadLimit, func(model.ResultDataType)) (*model.MsgCounterType, error)); ok { + return rf(entity, limit, resultCB) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, api0.LoadLimit, func(result model.ResultDataType)) *model.MsgCounterType); ok { - r0 = returnFunc(entity, limit, resultCB) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, api.LoadLimit, func(model.ResultDataType)) *model.MsgCounterType); ok { + r0 = rf(entity, limit, resultCB) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*model.MsgCounterType) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface, api0.LoadLimit, func(result model.ResultDataType)) error); ok { - r1 = returnFunc(entity, limit, resultCB) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface, api.LoadLimit, func(model.ResultDataType)) error); ok { + r1 = rf(entity, limit, resultCB) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -914,42 +846,40 @@ type EgLPPInterface_WriteProductionLimit_Call struct { } // WriteProductionLimit is a helper method to define mock.On call -// - entity api.EntityRemoteInterface -// - limit api0.LoadLimit -// - resultCB func(result model.ResultDataType) +// - entity spine_goapi.EntityRemoteInterface +// - limit api.LoadLimit +// - resultCB func(model.ResultDataType) func (_e *EgLPPInterface_Expecter) WriteProductionLimit(entity interface{}, limit interface{}, resultCB interface{}) *EgLPPInterface_WriteProductionLimit_Call { return &EgLPPInterface_WriteProductionLimit_Call{Call: _e.mock.On("WriteProductionLimit", entity, limit, resultCB)} } -func (_c *EgLPPInterface_WriteProductionLimit_Call) Run(run func(entity api.EntityRemoteInterface, limit api0.LoadLimit, resultCB func(result model.ResultDataType))) *EgLPPInterface_WriteProductionLimit_Call { +func (_c *EgLPPInterface_WriteProductionLimit_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, limit api.LoadLimit, resultCB func(model.ResultDataType))) *EgLPPInterface_WriteProductionLimit_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 api0.LoadLimit - if args[1] != nil { - arg1 = args[1].(api0.LoadLimit) - } - var arg2 func(result model.ResultDataType) - if args[2] != nil { - arg2 = args[2].(func(result model.ResultDataType)) - } - run( - arg0, - arg1, - arg2, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(api.LoadLimit), args[2].(func(model.ResultDataType))) }) return _c } -func (_c *EgLPPInterface_WriteProductionLimit_Call) Return(msgCounterType *model.MsgCounterType, err error) *EgLPPInterface_WriteProductionLimit_Call { - _c.Call.Return(msgCounterType, err) +func (_c *EgLPPInterface_WriteProductionLimit_Call) Return(_a0 *model.MsgCounterType, _a1 error) *EgLPPInterface_WriteProductionLimit_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *EgLPPInterface_WriteProductionLimit_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, limit api0.LoadLimit, resultCB func(result model.ResultDataType)) (*model.MsgCounterType, error)) *EgLPPInterface_WriteProductionLimit_Call { +func (_c *EgLPPInterface_WriteProductionLimit_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, api.LoadLimit, func(model.ResultDataType)) (*model.MsgCounterType, error)) *EgLPPInterface_WriteProductionLimit_Call { _c.Call.Return(run) return _c } + +// NewEgLPPInterface creates a new instance of EgLPPInterface. 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 NewEgLPPInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *EgLPPInterface { + mock := &EgLPPInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/MaMGCPInterface.go b/usecases/mocks/MaMGCPInterface.go index 9287260e..0b128cfd 100644 --- a/usecases/mocks/MaMGCPInterface.go +++ b/usecases/mocks/MaMGCPInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api0 "github.com/enbility/eebus-go/api" - "github.com/enbility/spine-go/api" + eebus_goapi "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) - -// NewMaMGCPInterface creates a new instance of MaMGCPInterface. 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 NewMaMGCPInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *MaMGCPInterface { - mock := &MaMGCPInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // MaMGCPInterface is an autogenerated mock type for the MaMGCPInterface type type MaMGCPInterface struct { @@ -37,10 +22,22 @@ func (_m *MaMGCPInterface) EXPECT() *MaMGCPInterface_Expecter { return &MaMGCPInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *MaMGCPInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // MaMGCPInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -60,20 +57,19 @@ func (_c *MaMGCPInterface_AddFeatures_Call) Run(run func()) *MaMGCPInterface_Add return _c } -func (_c *MaMGCPInterface_AddFeatures_Call) Return() *MaMGCPInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *MaMGCPInterface_AddFeatures_Call) Return(_a0 error) *MaMGCPInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *MaMGCPInterface_AddFeatures_Call) RunAndReturn(run func()) *MaMGCPInterface_AddFeatures_Call { - _c.Run(run) +func (_c *MaMGCPInterface_AddFeatures_Call) RunAndReturn(run func() error) *MaMGCPInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *MaMGCPInterface) AddUseCase() { + _m.Called() } // MaMGCPInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -103,22 +99,23 @@ func (_c *MaMGCPInterface_AddUseCase_Call) RunAndReturn(run func()) *MaMGCPInter return _c } -// AvailableScenariosForEntity provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *MaMGCPInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -128,37 +125,31 @@ type MaMGCPInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMGCPInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *MaMGCPInterface_AvailableScenariosForEntity_Call { return &MaMGCPInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *MaMGCPInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMGCPInterface_AvailableScenariosForEntity_Call { +func (_c *MaMGCPInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMGCPInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMGCPInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *MaMGCPInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *MaMGCPInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *MaMGCPInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *MaMGCPInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *MaMGCPInterface_AvailableScenariosForEntity_Call { +func (_c *MaMGCPInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *MaMGCPInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// CurrentPerPhase provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) CurrentPerPhase(entity api.EntityRemoteInterface) ([]float64, error) { - ret := _mock.Called(entity) +// CurrentPerPhase provides a mock function with given fields: entity +func (_m *MaMGCPInterface) CurrentPerPhase(entity spine_goapi.EntityRemoteInterface) ([]float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for CurrentPerPhase") @@ -166,21 +157,23 @@ func (_mock *MaMGCPInterface) CurrentPerPhase(entity api.EntityRemoteInterface) var r0 []float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]float64) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -190,37 +183,31 @@ type MaMGCPInterface_CurrentPerPhase_Call struct { } // CurrentPerPhase is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMGCPInterface_Expecter) CurrentPerPhase(entity interface{}) *MaMGCPInterface_CurrentPerPhase_Call { return &MaMGCPInterface_CurrentPerPhase_Call{Call: _e.mock.On("CurrentPerPhase", entity)} } -func (_c *MaMGCPInterface_CurrentPerPhase_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMGCPInterface_CurrentPerPhase_Call { +func (_c *MaMGCPInterface_CurrentPerPhase_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMGCPInterface_CurrentPerPhase_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMGCPInterface_CurrentPerPhase_Call) Return(float64s []float64, err error) *MaMGCPInterface_CurrentPerPhase_Call { - _c.Call.Return(float64s, err) +func (_c *MaMGCPInterface_CurrentPerPhase_Call) Return(_a0 []float64, _a1 error) *MaMGCPInterface_CurrentPerPhase_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMGCPInterface_CurrentPerPhase_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]float64, error)) *MaMGCPInterface_CurrentPerPhase_Call { +func (_c *MaMGCPInterface_CurrentPerPhase_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]float64, error)) *MaMGCPInterface_CurrentPerPhase_Call { _c.Call.Return(run) return _c } -// EnergyConsumed provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) EnergyConsumed(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// EnergyConsumed provides a mock function with given fields: entity +func (_m *MaMGCPInterface) EnergyConsumed(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for EnergyConsumed") @@ -228,19 +215,21 @@ func (_mock *MaMGCPInterface) EnergyConsumed(entity api.EntityRemoteInterface) ( var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -250,37 +239,31 @@ type MaMGCPInterface_EnergyConsumed_Call struct { } // EnergyConsumed is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMGCPInterface_Expecter) EnergyConsumed(entity interface{}) *MaMGCPInterface_EnergyConsumed_Call { return &MaMGCPInterface_EnergyConsumed_Call{Call: _e.mock.On("EnergyConsumed", entity)} } -func (_c *MaMGCPInterface_EnergyConsumed_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMGCPInterface_EnergyConsumed_Call { +func (_c *MaMGCPInterface_EnergyConsumed_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMGCPInterface_EnergyConsumed_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMGCPInterface_EnergyConsumed_Call) Return(f float64, err error) *MaMGCPInterface_EnergyConsumed_Call { - _c.Call.Return(f, err) +func (_c *MaMGCPInterface_EnergyConsumed_Call) Return(_a0 float64, _a1 error) *MaMGCPInterface_EnergyConsumed_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMGCPInterface_EnergyConsumed_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *MaMGCPInterface_EnergyConsumed_Call { +func (_c *MaMGCPInterface_EnergyConsumed_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *MaMGCPInterface_EnergyConsumed_Call { _c.Call.Return(run) return _c } -// EnergyFeedIn provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) EnergyFeedIn(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// EnergyFeedIn provides a mock function with given fields: entity +func (_m *MaMGCPInterface) EnergyFeedIn(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for EnergyFeedIn") @@ -288,19 +271,21 @@ func (_mock *MaMGCPInterface) EnergyFeedIn(entity api.EntityRemoteInterface) (fl var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -310,37 +295,31 @@ type MaMGCPInterface_EnergyFeedIn_Call struct { } // EnergyFeedIn is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMGCPInterface_Expecter) EnergyFeedIn(entity interface{}) *MaMGCPInterface_EnergyFeedIn_Call { return &MaMGCPInterface_EnergyFeedIn_Call{Call: _e.mock.On("EnergyFeedIn", entity)} } -func (_c *MaMGCPInterface_EnergyFeedIn_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMGCPInterface_EnergyFeedIn_Call { +func (_c *MaMGCPInterface_EnergyFeedIn_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMGCPInterface_EnergyFeedIn_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMGCPInterface_EnergyFeedIn_Call) Return(f float64, err error) *MaMGCPInterface_EnergyFeedIn_Call { - _c.Call.Return(f, err) +func (_c *MaMGCPInterface_EnergyFeedIn_Call) Return(_a0 float64, _a1 error) *MaMGCPInterface_EnergyFeedIn_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMGCPInterface_EnergyFeedIn_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *MaMGCPInterface_EnergyFeedIn_Call { +func (_c *MaMGCPInterface_EnergyFeedIn_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *MaMGCPInterface_EnergyFeedIn_Call { _c.Call.Return(run) return _c } -// Frequency provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) Frequency(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// Frequency provides a mock function with given fields: entity +func (_m *MaMGCPInterface) Frequency(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for Frequency") @@ -348,19 +327,21 @@ func (_mock *MaMGCPInterface) Frequency(entity api.EntityRemoteInterface) (float var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -370,48 +351,43 @@ type MaMGCPInterface_Frequency_Call struct { } // Frequency is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMGCPInterface_Expecter) Frequency(entity interface{}) *MaMGCPInterface_Frequency_Call { return &MaMGCPInterface_Frequency_Call{Call: _e.mock.On("Frequency", entity)} } -func (_c *MaMGCPInterface_Frequency_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMGCPInterface_Frequency_Call { +func (_c *MaMGCPInterface_Frequency_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMGCPInterface_Frequency_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMGCPInterface_Frequency_Call) Return(f float64, err error) *MaMGCPInterface_Frequency_Call { - _c.Call.Return(f, err) +func (_c *MaMGCPInterface_Frequency_Call) Return(_a0 float64, _a1 error) *MaMGCPInterface_Frequency_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMGCPInterface_Frequency_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *MaMGCPInterface_Frequency_Call { +func (_c *MaMGCPInterface_Frequency_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *MaMGCPInterface_Frequency_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *MaMGCPInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -421,48 +397,43 @@ type MaMGCPInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMGCPInterface_Expecter) IsCompatibleEntityType(entity interface{}) *MaMGCPInterface_IsCompatibleEntityType_Call { return &MaMGCPInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *MaMGCPInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMGCPInterface_IsCompatibleEntityType_Call { +func (_c *MaMGCPInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMGCPInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMGCPInterface_IsCompatibleEntityType_Call) Return(b bool) *MaMGCPInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *MaMGCPInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *MaMGCPInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *MaMGCPInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *MaMGCPInterface_IsCompatibleEntityType_Call { +func (_c *MaMGCPInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *MaMGCPInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *MaMGCPInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -472,43 +443,32 @@ type MaMGCPInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *MaMGCPInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *MaMGCPInterface_IsScenarioAvailableAtEntity_Call { return &MaMGCPInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *MaMGCPInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *MaMGCPInterface_IsScenarioAvailableAtEntity_Call { +func (_c *MaMGCPInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *MaMGCPInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *MaMGCPInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *MaMGCPInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *MaMGCPInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *MaMGCPInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *MaMGCPInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *MaMGCPInterface_IsScenarioAvailableAtEntity_Call { +func (_c *MaMGCPInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *MaMGCPInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// Power provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) Power(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// Power provides a mock function with given fields: entity +func (_m *MaMGCPInterface) Power(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for Power") @@ -516,19 +476,21 @@ func (_mock *MaMGCPInterface) Power(entity api.EntityRemoteInterface) (float64, var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -538,37 +500,31 @@ type MaMGCPInterface_Power_Call struct { } // Power is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMGCPInterface_Expecter) Power(entity interface{}) *MaMGCPInterface_Power_Call { return &MaMGCPInterface_Power_Call{Call: _e.mock.On("Power", entity)} } -func (_c *MaMGCPInterface_Power_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMGCPInterface_Power_Call { +func (_c *MaMGCPInterface_Power_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMGCPInterface_Power_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMGCPInterface_Power_Call) Return(f float64, err error) *MaMGCPInterface_Power_Call { - _c.Call.Return(f, err) +func (_c *MaMGCPInterface_Power_Call) Return(_a0 float64, _a1 error) *MaMGCPInterface_Power_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMGCPInterface_Power_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *MaMGCPInterface_Power_Call { +func (_c *MaMGCPInterface_Power_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *MaMGCPInterface_Power_Call { _c.Call.Return(run) return _c } -// PowerLimitationFactor provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) PowerLimitationFactor(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// PowerLimitationFactor provides a mock function with given fields: entity +func (_m *MaMGCPInterface) PowerLimitationFactor(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for PowerLimitationFactor") @@ -576,19 +532,21 @@ func (_mock *MaMGCPInterface) PowerLimitationFactor(entity api.EntityRemoteInter var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -598,50 +556,45 @@ type MaMGCPInterface_PowerLimitationFactor_Call struct { } // PowerLimitationFactor is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMGCPInterface_Expecter) PowerLimitationFactor(entity interface{}) *MaMGCPInterface_PowerLimitationFactor_Call { return &MaMGCPInterface_PowerLimitationFactor_Call{Call: _e.mock.On("PowerLimitationFactor", entity)} } -func (_c *MaMGCPInterface_PowerLimitationFactor_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMGCPInterface_PowerLimitationFactor_Call { +func (_c *MaMGCPInterface_PowerLimitationFactor_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMGCPInterface_PowerLimitationFactor_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMGCPInterface_PowerLimitationFactor_Call) Return(f float64, err error) *MaMGCPInterface_PowerLimitationFactor_Call { - _c.Call.Return(f, err) +func (_c *MaMGCPInterface_PowerLimitationFactor_Call) Return(_a0 float64, _a1 error) *MaMGCPInterface_PowerLimitationFactor_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMGCPInterface_PowerLimitationFactor_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *MaMGCPInterface_PowerLimitationFactor_Call { +func (_c *MaMGCPInterface_PowerLimitationFactor_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *MaMGCPInterface_PowerLimitationFactor_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) RemoteEntitiesScenarios() []api0.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *MaMGCPInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api0.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api0.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -662,20 +615,19 @@ func (_c *MaMGCPInterface_RemoteEntitiesScenarios_Call) Run(run func()) *MaMGCPI return _c } -func (_c *MaMGCPInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api0.RemoteEntityScenarios) *MaMGCPInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *MaMGCPInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *MaMGCPInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *MaMGCPInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api0.RemoteEntityScenarios) *MaMGCPInterface_RemoteEntitiesScenarios_Call { +func (_c *MaMGCPInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *MaMGCPInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *MaMGCPInterface) RemoveUseCase() { + _m.Called() } // MaMGCPInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -705,10 +657,9 @@ func (_c *MaMGCPInterface_RemoveUseCase_Call) RunAndReturn(run func()) *MaMGCPIn return _c } -// UpdateUseCaseAvailability provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *MaMGCPInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // MaMGCPInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -724,13 +675,7 @@ func (_e *MaMGCPInterface_Expecter) UpdateUseCaseAvailability(available interfac func (_c *MaMGCPInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *MaMGCPInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -740,14 +685,14 @@ func (_c *MaMGCPInterface_UpdateUseCaseAvailability_Call) Return() *MaMGCPInterf return _c } -func (_c *MaMGCPInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *MaMGCPInterface_UpdateUseCaseAvailability_Call { +func (_c *MaMGCPInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *MaMGCPInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } -// VoltagePerPhase provides a mock function for the type MaMGCPInterface -func (_mock *MaMGCPInterface) VoltagePerPhase(entity api.EntityRemoteInterface) ([]float64, error) { - ret := _mock.Called(entity) +// VoltagePerPhase provides a mock function with given fields: entity +func (_m *MaMGCPInterface) VoltagePerPhase(entity spine_goapi.EntityRemoteInterface) ([]float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for VoltagePerPhase") @@ -755,21 +700,23 @@ func (_mock *MaMGCPInterface) VoltagePerPhase(entity api.EntityRemoteInterface) var r0 []float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]float64) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -779,30 +726,38 @@ type MaMGCPInterface_VoltagePerPhase_Call struct { } // VoltagePerPhase is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMGCPInterface_Expecter) VoltagePerPhase(entity interface{}) *MaMGCPInterface_VoltagePerPhase_Call { return &MaMGCPInterface_VoltagePerPhase_Call{Call: _e.mock.On("VoltagePerPhase", entity)} } -func (_c *MaMGCPInterface_VoltagePerPhase_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMGCPInterface_VoltagePerPhase_Call { +func (_c *MaMGCPInterface_VoltagePerPhase_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMGCPInterface_VoltagePerPhase_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMGCPInterface_VoltagePerPhase_Call) Return(float64s []float64, err error) *MaMGCPInterface_VoltagePerPhase_Call { - _c.Call.Return(float64s, err) +func (_c *MaMGCPInterface_VoltagePerPhase_Call) Return(_a0 []float64, _a1 error) *MaMGCPInterface_VoltagePerPhase_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMGCPInterface_VoltagePerPhase_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]float64, error)) *MaMGCPInterface_VoltagePerPhase_Call { +func (_c *MaMGCPInterface_VoltagePerPhase_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]float64, error)) *MaMGCPInterface_VoltagePerPhase_Call { _c.Call.Return(run) return _c } + +// NewMaMGCPInterface creates a new instance of MaMGCPInterface. 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 NewMaMGCPInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MaMGCPInterface { + mock := &MaMGCPInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/MaMPCInterface.go b/usecases/mocks/MaMPCInterface.go index 02b55cc3..0e6a4ea0 100644 --- a/usecases/mocks/MaMPCInterface.go +++ b/usecases/mocks/MaMPCInterface.go @@ -1,28 +1,13 @@ -// Code generated by mockery; DO NOT EDIT. -// github.com/vektra/mockery -// template: testify +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks import ( - api0 "github.com/enbility/eebus-go/api" - "github.com/enbility/spine-go/api" + eebus_goapi "github.com/enbility/eebus-go/api" mock "github.com/stretchr/testify/mock" -) - -// NewMaMPCInterface creates a new instance of MaMPCInterface. 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 NewMaMPCInterface(t interface { - mock.TestingT - Cleanup(func()) -}) *MaMPCInterface { - mock := &MaMPCInterface{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - return mock -} + spine_goapi "github.com/enbility/spine-go/api" +) // MaMPCInterface is an autogenerated mock type for the MaMPCInterface type type MaMPCInterface struct { @@ -37,10 +22,22 @@ func (_m *MaMPCInterface) EXPECT() *MaMPCInterface_Expecter { return &MaMPCInterface_Expecter{mock: &_m.Mock} } -// AddFeatures provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) AddFeatures() { - _mock.Called() - return +// AddFeatures provides a mock function with no fields +func (_m *MaMPCInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // MaMPCInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' @@ -60,20 +57,19 @@ func (_c *MaMPCInterface_AddFeatures_Call) Run(run func()) *MaMPCInterface_AddFe return _c } -func (_c *MaMPCInterface_AddFeatures_Call) Return() *MaMPCInterface_AddFeatures_Call { - _c.Call.Return() +func (_c *MaMPCInterface_AddFeatures_Call) Return(_a0 error) *MaMPCInterface_AddFeatures_Call { + _c.Call.Return(_a0) return _c } -func (_c *MaMPCInterface_AddFeatures_Call) RunAndReturn(run func()) *MaMPCInterface_AddFeatures_Call { - _c.Run(run) +func (_c *MaMPCInterface_AddFeatures_Call) RunAndReturn(run func() error) *MaMPCInterface_AddFeatures_Call { + _c.Call.Return(run) return _c } -// AddUseCase provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) AddUseCase() { - _mock.Called() - return +// AddUseCase provides a mock function with no fields +func (_m *MaMPCInterface) AddUseCase() { + _m.Called() } // MaMPCInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' @@ -103,22 +99,23 @@ func (_c *MaMPCInterface_AddUseCase_Call) RunAndReturn(run func()) *MaMPCInterfa return _c } -// AvailableScenariosForEntity provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) AvailableScenariosForEntity(entity api.EntityRemoteInterface) []uint { - ret := _mock.Called(entity) +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *MaMPCInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for AvailableScenariosForEntity") } var r0 []uint - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []uint); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]uint) } } + return r0 } @@ -128,37 +125,31 @@ type MaMPCInterface_AvailableScenariosForEntity_Call struct { } // AvailableScenariosForEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMPCInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *MaMPCInterface_AvailableScenariosForEntity_Call { return &MaMPCInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} } -func (_c *MaMPCInterface_AvailableScenariosForEntity_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMPCInterface_AvailableScenariosForEntity_Call { +func (_c *MaMPCInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMPCInterface_AvailableScenariosForEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMPCInterface_AvailableScenariosForEntity_Call) Return(uints []uint) *MaMPCInterface_AvailableScenariosForEntity_Call { - _c.Call.Return(uints) +func (_c *MaMPCInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *MaMPCInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *MaMPCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) []uint) *MaMPCInterface_AvailableScenariosForEntity_Call { +func (_c *MaMPCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *MaMPCInterface_AvailableScenariosForEntity_Call { _c.Call.Return(run) return _c } -// CurrentPerPhase provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) CurrentPerPhase(entity api.EntityRemoteInterface) ([]float64, error) { - ret := _mock.Called(entity) +// CurrentPerPhase provides a mock function with given fields: entity +func (_m *MaMPCInterface) CurrentPerPhase(entity spine_goapi.EntityRemoteInterface) ([]float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for CurrentPerPhase") @@ -166,21 +157,23 @@ func (_mock *MaMPCInterface) CurrentPerPhase(entity api.EntityRemoteInterface) ( var r0 []float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]float64) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -190,37 +183,31 @@ type MaMPCInterface_CurrentPerPhase_Call struct { } // CurrentPerPhase is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMPCInterface_Expecter) CurrentPerPhase(entity interface{}) *MaMPCInterface_CurrentPerPhase_Call { return &MaMPCInterface_CurrentPerPhase_Call{Call: _e.mock.On("CurrentPerPhase", entity)} } -func (_c *MaMPCInterface_CurrentPerPhase_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMPCInterface_CurrentPerPhase_Call { +func (_c *MaMPCInterface_CurrentPerPhase_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMPCInterface_CurrentPerPhase_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMPCInterface_CurrentPerPhase_Call) Return(float64s []float64, err error) *MaMPCInterface_CurrentPerPhase_Call { - _c.Call.Return(float64s, err) +func (_c *MaMPCInterface_CurrentPerPhase_Call) Return(_a0 []float64, _a1 error) *MaMPCInterface_CurrentPerPhase_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMPCInterface_CurrentPerPhase_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]float64, error)) *MaMPCInterface_CurrentPerPhase_Call { +func (_c *MaMPCInterface_CurrentPerPhase_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]float64, error)) *MaMPCInterface_CurrentPerPhase_Call { _c.Call.Return(run) return _c } -// EnergyConsumed provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) EnergyConsumed(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// EnergyConsumed provides a mock function with given fields: entity +func (_m *MaMPCInterface) EnergyConsumed(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for EnergyConsumed") @@ -228,19 +215,21 @@ func (_mock *MaMPCInterface) EnergyConsumed(entity api.EntityRemoteInterface) (f var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -250,37 +239,31 @@ type MaMPCInterface_EnergyConsumed_Call struct { } // EnergyConsumed is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMPCInterface_Expecter) EnergyConsumed(entity interface{}) *MaMPCInterface_EnergyConsumed_Call { return &MaMPCInterface_EnergyConsumed_Call{Call: _e.mock.On("EnergyConsumed", entity)} } -func (_c *MaMPCInterface_EnergyConsumed_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMPCInterface_EnergyConsumed_Call { +func (_c *MaMPCInterface_EnergyConsumed_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMPCInterface_EnergyConsumed_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMPCInterface_EnergyConsumed_Call) Return(f float64, err error) *MaMPCInterface_EnergyConsumed_Call { - _c.Call.Return(f, err) +func (_c *MaMPCInterface_EnergyConsumed_Call) Return(_a0 float64, _a1 error) *MaMPCInterface_EnergyConsumed_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMPCInterface_EnergyConsumed_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *MaMPCInterface_EnergyConsumed_Call { +func (_c *MaMPCInterface_EnergyConsumed_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *MaMPCInterface_EnergyConsumed_Call { _c.Call.Return(run) return _c } -// EnergyProduced provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) EnergyProduced(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// EnergyProduced provides a mock function with given fields: entity +func (_m *MaMPCInterface) EnergyProduced(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for EnergyProduced") @@ -288,19 +271,21 @@ func (_mock *MaMPCInterface) EnergyProduced(entity api.EntityRemoteInterface) (f var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -310,37 +295,31 @@ type MaMPCInterface_EnergyProduced_Call struct { } // EnergyProduced is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMPCInterface_Expecter) EnergyProduced(entity interface{}) *MaMPCInterface_EnergyProduced_Call { return &MaMPCInterface_EnergyProduced_Call{Call: _e.mock.On("EnergyProduced", entity)} } -func (_c *MaMPCInterface_EnergyProduced_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMPCInterface_EnergyProduced_Call { +func (_c *MaMPCInterface_EnergyProduced_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMPCInterface_EnergyProduced_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMPCInterface_EnergyProduced_Call) Return(f float64, err error) *MaMPCInterface_EnergyProduced_Call { - _c.Call.Return(f, err) +func (_c *MaMPCInterface_EnergyProduced_Call) Return(_a0 float64, _a1 error) *MaMPCInterface_EnergyProduced_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMPCInterface_EnergyProduced_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *MaMPCInterface_EnergyProduced_Call { +func (_c *MaMPCInterface_EnergyProduced_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *MaMPCInterface_EnergyProduced_Call { _c.Call.Return(run) return _c } -// Frequency provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) Frequency(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// Frequency provides a mock function with given fields: entity +func (_m *MaMPCInterface) Frequency(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for Frequency") @@ -348,19 +327,21 @@ func (_mock *MaMPCInterface) Frequency(entity api.EntityRemoteInterface) (float6 var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -370,48 +351,43 @@ type MaMPCInterface_Frequency_Call struct { } // Frequency is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMPCInterface_Expecter) Frequency(entity interface{}) *MaMPCInterface_Frequency_Call { return &MaMPCInterface_Frequency_Call{Call: _e.mock.On("Frequency", entity)} } -func (_c *MaMPCInterface_Frequency_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMPCInterface_Frequency_Call { +func (_c *MaMPCInterface_Frequency_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMPCInterface_Frequency_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMPCInterface_Frequency_Call) Return(f float64, err error) *MaMPCInterface_Frequency_Call { - _c.Call.Return(f, err) +func (_c *MaMPCInterface_Frequency_Call) Return(_a0 float64, _a1 error) *MaMPCInterface_Frequency_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMPCInterface_Frequency_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *MaMPCInterface_Frequency_Call { +func (_c *MaMPCInterface_Frequency_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *MaMPCInterface_Frequency_Call { _c.Call.Return(run) return _c } -// IsCompatibleEntityType provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) IsCompatibleEntityType(entity api.EntityRemoteInterface) bool { - ret := _mock.Called(entity) +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *MaMPCInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for IsCompatibleEntityType") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) bool); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -421,48 +397,43 @@ type MaMPCInterface_IsCompatibleEntityType_Call struct { } // IsCompatibleEntityType is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMPCInterface_Expecter) IsCompatibleEntityType(entity interface{}) *MaMPCInterface_IsCompatibleEntityType_Call { return &MaMPCInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} } -func (_c *MaMPCInterface_IsCompatibleEntityType_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMPCInterface_IsCompatibleEntityType_Call { +func (_c *MaMPCInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMPCInterface_IsCompatibleEntityType_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMPCInterface_IsCompatibleEntityType_Call) Return(b bool) *MaMPCInterface_IsCompatibleEntityType_Call { - _c.Call.Return(b) +func (_c *MaMPCInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *MaMPCInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) return _c } -func (_c *MaMPCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) bool) *MaMPCInterface_IsCompatibleEntityType_Call { +func (_c *MaMPCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *MaMPCInterface_IsCompatibleEntityType_Call { _c.Call.Return(run) return _c } -// IsScenarioAvailableAtEntity provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) IsScenarioAvailableAtEntity(entity api.EntityRemoteInterface, scenario uint) bool { - ret := _mock.Called(entity, scenario) +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *MaMPCInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) if len(ret) == 0 { panic("no return value specified for IsScenarioAvailableAtEntity") } var r0 bool - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface, uint) bool); ok { - r0 = returnFunc(entity, scenario) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) } else { r0 = ret.Get(0).(bool) } + return r0 } @@ -472,43 +443,32 @@ type MaMPCInterface_IsScenarioAvailableAtEntity_Call struct { } // IsScenarioAvailableAtEntity is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface // - scenario uint func (_e *MaMPCInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *MaMPCInterface_IsScenarioAvailableAtEntity_Call { return &MaMPCInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} } -func (_c *MaMPCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity api.EntityRemoteInterface, scenario uint)) *MaMPCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *MaMPCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *MaMPCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - var arg1 uint - if args[1] != nil { - arg1 = args[1].(uint) - } - run( - arg0, - arg1, - ) + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) }) return _c } -func (_c *MaMPCInterface_IsScenarioAvailableAtEntity_Call) Return(b bool) *MaMPCInterface_IsScenarioAvailableAtEntity_Call { - _c.Call.Return(b) +func (_c *MaMPCInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *MaMPCInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) return _c } -func (_c *MaMPCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(entity api.EntityRemoteInterface, scenario uint) bool) *MaMPCInterface_IsScenarioAvailableAtEntity_Call { +func (_c *MaMPCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *MaMPCInterface_IsScenarioAvailableAtEntity_Call { _c.Call.Return(run) return _c } -// Power provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) Power(entity api.EntityRemoteInterface) (float64, error) { - ret := _mock.Called(entity) +// Power provides a mock function with given fields: entity +func (_m *MaMPCInterface) Power(entity spine_goapi.EntityRemoteInterface) (float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for Power") @@ -516,19 +476,21 @@ func (_mock *MaMPCInterface) Power(entity api.EntityRemoteInterface) (float64, e var r0 float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) (float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) (float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) float64); ok { + r0 = rf(entity) } else { r0 = ret.Get(0).(float64) } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -538,37 +500,31 @@ type MaMPCInterface_Power_Call struct { } // Power is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMPCInterface_Expecter) Power(entity interface{}) *MaMPCInterface_Power_Call { return &MaMPCInterface_Power_Call{Call: _e.mock.On("Power", entity)} } -func (_c *MaMPCInterface_Power_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMPCInterface_Power_Call { +func (_c *MaMPCInterface_Power_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMPCInterface_Power_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMPCInterface_Power_Call) Return(f float64, err error) *MaMPCInterface_Power_Call { - _c.Call.Return(f, err) +func (_c *MaMPCInterface_Power_Call) Return(_a0 float64, _a1 error) *MaMPCInterface_Power_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMPCInterface_Power_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) (float64, error)) *MaMPCInterface_Power_Call { +func (_c *MaMPCInterface_Power_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) (float64, error)) *MaMPCInterface_Power_Call { _c.Call.Return(run) return _c } -// PowerPerPhase provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) PowerPerPhase(entity api.EntityRemoteInterface) ([]float64, error) { - ret := _mock.Called(entity) +// PowerPerPhase provides a mock function with given fields: entity +func (_m *MaMPCInterface) PowerPerPhase(entity spine_goapi.EntityRemoteInterface) ([]float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for PowerPerPhase") @@ -576,21 +532,23 @@ func (_mock *MaMPCInterface) PowerPerPhase(entity api.EntityRemoteInterface) ([] var r0 []float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]float64) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -600,50 +558,45 @@ type MaMPCInterface_PowerPerPhase_Call struct { } // PowerPerPhase is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMPCInterface_Expecter) PowerPerPhase(entity interface{}) *MaMPCInterface_PowerPerPhase_Call { return &MaMPCInterface_PowerPerPhase_Call{Call: _e.mock.On("PowerPerPhase", entity)} } -func (_c *MaMPCInterface_PowerPerPhase_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMPCInterface_PowerPerPhase_Call { +func (_c *MaMPCInterface_PowerPerPhase_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMPCInterface_PowerPerPhase_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMPCInterface_PowerPerPhase_Call) Return(float64s []float64, err error) *MaMPCInterface_PowerPerPhase_Call { - _c.Call.Return(float64s, err) +func (_c *MaMPCInterface_PowerPerPhase_Call) Return(_a0 []float64, _a1 error) *MaMPCInterface_PowerPerPhase_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMPCInterface_PowerPerPhase_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]float64, error)) *MaMPCInterface_PowerPerPhase_Call { +func (_c *MaMPCInterface_PowerPerPhase_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]float64, error)) *MaMPCInterface_PowerPerPhase_Call { _c.Call.Return(run) return _c } -// RemoteEntitiesScenarios provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) RemoteEntitiesScenarios() []api0.RemoteEntityScenarios { - ret := _mock.Called() +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *MaMPCInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() if len(ret) == 0 { panic("no return value specified for RemoteEntitiesScenarios") } - var r0 []api0.RemoteEntityScenarios - if returnFunc, ok := ret.Get(0).(func() []api0.RemoteEntityScenarios); ok { - r0 = returnFunc() + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]api0.RemoteEntityScenarios) + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) } } + return r0 } @@ -664,20 +617,19 @@ func (_c *MaMPCInterface_RemoteEntitiesScenarios_Call) Run(run func()) *MaMPCInt return _c } -func (_c *MaMPCInterface_RemoteEntitiesScenarios_Call) Return(remoteEntityScenarioss []api0.RemoteEntityScenarios) *MaMPCInterface_RemoteEntitiesScenarios_Call { - _c.Call.Return(remoteEntityScenarioss) +func (_c *MaMPCInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *MaMPCInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) return _c } -func (_c *MaMPCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []api0.RemoteEntityScenarios) *MaMPCInterface_RemoteEntitiesScenarios_Call { +func (_c *MaMPCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *MaMPCInterface_RemoteEntitiesScenarios_Call { _c.Call.Return(run) return _c } -// RemoveUseCase provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) RemoveUseCase() { - _mock.Called() - return +// RemoveUseCase provides a mock function with no fields +func (_m *MaMPCInterface) RemoveUseCase() { + _m.Called() } // MaMPCInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' @@ -707,10 +659,9 @@ func (_c *MaMPCInterface_RemoveUseCase_Call) RunAndReturn(run func()) *MaMPCInte return _c } -// UpdateUseCaseAvailability provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) UpdateUseCaseAvailability(available bool) { - _mock.Called(available) - return +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *MaMPCInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) } // MaMPCInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' @@ -726,13 +677,7 @@ func (_e *MaMPCInterface_Expecter) UpdateUseCaseAvailability(available interface func (_c *MaMPCInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *MaMPCInterface_UpdateUseCaseAvailability_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 bool - if args[0] != nil { - arg0 = args[0].(bool) - } - run( - arg0, - ) + run(args[0].(bool)) }) return _c } @@ -742,14 +687,14 @@ func (_c *MaMPCInterface_UpdateUseCaseAvailability_Call) Return() *MaMPCInterfac return _c } -func (_c *MaMPCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(available bool)) *MaMPCInterface_UpdateUseCaseAvailability_Call { +func (_c *MaMPCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *MaMPCInterface_UpdateUseCaseAvailability_Call { _c.Run(run) return _c } -// VoltagePerPhase provides a mock function for the type MaMPCInterface -func (_mock *MaMPCInterface) VoltagePerPhase(entity api.EntityRemoteInterface) ([]float64, error) { - ret := _mock.Called(entity) +// VoltagePerPhase provides a mock function with given fields: entity +func (_m *MaMPCInterface) VoltagePerPhase(entity spine_goapi.EntityRemoteInterface) ([]float64, error) { + ret := _m.Called(entity) if len(ret) == 0 { panic("no return value specified for VoltagePerPhase") @@ -757,21 +702,23 @@ func (_mock *MaMPCInterface) VoltagePerPhase(entity api.EntityRemoteInterface) ( var r0 []float64 var r1 error - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) ([]float64, error)); ok { - return returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) ([]float64, error)); ok { + return rf(entity) } - if returnFunc, ok := ret.Get(0).(func(api.EntityRemoteInterface) []float64); ok { - r0 = returnFunc(entity) + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []float64); ok { + r0 = rf(entity) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]float64) } } - if returnFunc, ok := ret.Get(1).(func(api.EntityRemoteInterface) error); ok { - r1 = returnFunc(entity) + + if rf, ok := ret.Get(1).(func(spine_goapi.EntityRemoteInterface) error); ok { + r1 = rf(entity) } else { r1 = ret.Error(1) } + return r0, r1 } @@ -781,30 +728,38 @@ type MaMPCInterface_VoltagePerPhase_Call struct { } // VoltagePerPhase is a helper method to define mock.On call -// - entity api.EntityRemoteInterface +// - entity spine_goapi.EntityRemoteInterface func (_e *MaMPCInterface_Expecter) VoltagePerPhase(entity interface{}) *MaMPCInterface_VoltagePerPhase_Call { return &MaMPCInterface_VoltagePerPhase_Call{Call: _e.mock.On("VoltagePerPhase", entity)} } -func (_c *MaMPCInterface_VoltagePerPhase_Call) Run(run func(entity api.EntityRemoteInterface)) *MaMPCInterface_VoltagePerPhase_Call { +func (_c *MaMPCInterface_VoltagePerPhase_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MaMPCInterface_VoltagePerPhase_Call { _c.Call.Run(func(args mock.Arguments) { - var arg0 api.EntityRemoteInterface - if args[0] != nil { - arg0 = args[0].(api.EntityRemoteInterface) - } - run( - arg0, - ) + run(args[0].(spine_goapi.EntityRemoteInterface)) }) return _c } -func (_c *MaMPCInterface_VoltagePerPhase_Call) Return(float64s []float64, err error) *MaMPCInterface_VoltagePerPhase_Call { - _c.Call.Return(float64s, err) +func (_c *MaMPCInterface_VoltagePerPhase_Call) Return(_a0 []float64, _a1 error) *MaMPCInterface_VoltagePerPhase_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *MaMPCInterface_VoltagePerPhase_Call) RunAndReturn(run func(entity api.EntityRemoteInterface) ([]float64, error)) *MaMPCInterface_VoltagePerPhase_Call { +func (_c *MaMPCInterface_VoltagePerPhase_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) ([]float64, error)) *MaMPCInterface_VoltagePerPhase_Call { _c.Call.Return(run) return _c } + +// NewMaMPCInterface creates a new instance of MaMPCInterface. 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 NewMaMPCInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MaMPCInterface { + mock := &MaMPCInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/MuMPCInterface.go b/usecases/mocks/MuMPCInterface.go new file mode 100644 index 00000000..6f343ea0 --- /dev/null +++ b/usecases/mocks/MuMPCInterface.go @@ -0,0 +1,1627 @@ +// Code generated by mockery v2.53.4. DO NOT EDIT. + +package mocks + +import ( + eebus_goapi "github.com/enbility/eebus-go/api" + api "github.com/enbility/eebus-go/usecases/api" + + mock "github.com/stretchr/testify/mock" + + model "github.com/enbility/spine-go/model" + + spine_goapi "github.com/enbility/spine-go/api" + + time "time" +) + +// MuMPCInterface is an autogenerated mock type for the MuMPCInterface type +type MuMPCInterface struct { + mock.Mock +} + +type MuMPCInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MuMPCInterface) EXPECT() *MuMPCInterface_Expecter { + return &MuMPCInterface_Expecter{mock: &_m.Mock} +} + +// AddFeatures provides a mock function with no fields +func (_m *MuMPCInterface) AddFeatures() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for AddFeatures") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MuMPCInterface_AddFeatures_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddFeatures' +type MuMPCInterface_AddFeatures_Call struct { + *mock.Call +} + +// AddFeatures is a helper method to define mock.On call +func (_e *MuMPCInterface_Expecter) AddFeatures() *MuMPCInterface_AddFeatures_Call { + return &MuMPCInterface_AddFeatures_Call{Call: _e.mock.On("AddFeatures")} +} + +func (_c *MuMPCInterface_AddFeatures_Call) Run(run func()) *MuMPCInterface_AddFeatures_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MuMPCInterface_AddFeatures_Call) Return(_a0 error) *MuMPCInterface_AddFeatures_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_AddFeatures_Call) RunAndReturn(run func() error) *MuMPCInterface_AddFeatures_Call { + _c.Call.Return(run) + return _c +} + +// AddUseCase provides a mock function with no fields +func (_m *MuMPCInterface) AddUseCase() { + _m.Called() +} + +// MuMPCInterface_AddUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddUseCase' +type MuMPCInterface_AddUseCase_Call struct { + *mock.Call +} + +// AddUseCase is a helper method to define mock.On call +func (_e *MuMPCInterface_Expecter) AddUseCase() *MuMPCInterface_AddUseCase_Call { + return &MuMPCInterface_AddUseCase_Call{Call: _e.mock.On("AddUseCase")} +} + +func (_c *MuMPCInterface_AddUseCase_Call) Run(run func()) *MuMPCInterface_AddUseCase_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MuMPCInterface_AddUseCase_Call) Return() *MuMPCInterface_AddUseCase_Call { + _c.Call.Return() + return _c +} + +func (_c *MuMPCInterface_AddUseCase_Call) RunAndReturn(run func()) *MuMPCInterface_AddUseCase_Call { + _c.Run(run) + return _c +} + +// AvailableScenariosForEntity provides a mock function with given fields: entity +func (_m *MuMPCInterface) AvailableScenariosForEntity(entity spine_goapi.EntityRemoteInterface) []uint { + ret := _m.Called(entity) + + if len(ret) == 0 { + panic("no return value specified for AvailableScenariosForEntity") + } + + var r0 []uint + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) []uint); ok { + r0 = rf(entity) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]uint) + } + } + + return r0 +} + +// MuMPCInterface_AvailableScenariosForEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AvailableScenariosForEntity' +type MuMPCInterface_AvailableScenariosForEntity_Call struct { + *mock.Call +} + +// AvailableScenariosForEntity is a helper method to define mock.On call +// - entity spine_goapi.EntityRemoteInterface +func (_e *MuMPCInterface_Expecter) AvailableScenariosForEntity(entity interface{}) *MuMPCInterface_AvailableScenariosForEntity_Call { + return &MuMPCInterface_AvailableScenariosForEntity_Call{Call: _e.mock.On("AvailableScenariosForEntity", entity)} +} + +func (_c *MuMPCInterface_AvailableScenariosForEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MuMPCInterface_AvailableScenariosForEntity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(spine_goapi.EntityRemoteInterface)) + }) + return _c +} + +func (_c *MuMPCInterface_AvailableScenariosForEntity_Call) Return(_a0 []uint) *MuMPCInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_AvailableScenariosForEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) []uint) *MuMPCInterface_AvailableScenariosForEntity_Call { + _c.Call.Return(run) + return _c +} + +// CurrentPerPhase provides a mock function with no fields +func (_m *MuMPCInterface) CurrentPerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for CurrentPerPhase") + } + + var r0 map[model.ElectricalConnectionPhaseNameType]float64 + var r1 error + if rf, ok := ret.Get(0).(func() (map[model.ElectricalConnectionPhaseNameType]float64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() map[model.ElectricalConnectionPhaseNameType]float64); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[model.ElectricalConnectionPhaseNameType]float64) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MuMPCInterface_CurrentPerPhase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurrentPerPhase' +type MuMPCInterface_CurrentPerPhase_Call struct { + *mock.Call +} + +// CurrentPerPhase is a helper method to define mock.On call +func (_e *MuMPCInterface_Expecter) CurrentPerPhase() *MuMPCInterface_CurrentPerPhase_Call { + return &MuMPCInterface_CurrentPerPhase_Call{Call: _e.mock.On("CurrentPerPhase")} +} + +func (_c *MuMPCInterface_CurrentPerPhase_Call) Run(run func()) *MuMPCInterface_CurrentPerPhase_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MuMPCInterface_CurrentPerPhase_Call) Return(_a0 map[model.ElectricalConnectionPhaseNameType]float64, _a1 error) *MuMPCInterface_CurrentPerPhase_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MuMPCInterface_CurrentPerPhase_Call) RunAndReturn(run func() (map[model.ElectricalConnectionPhaseNameType]float64, error)) *MuMPCInterface_CurrentPerPhase_Call { + _c.Call.Return(run) + return _c +} + +// EnergyConsumed provides a mock function with no fields +func (_m *MuMPCInterface) EnergyConsumed() (float64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for EnergyConsumed") + } + + var r0 float64 + var r1 error + if rf, ok := ret.Get(0).(func() (float64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() float64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(float64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MuMPCInterface_EnergyConsumed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnergyConsumed' +type MuMPCInterface_EnergyConsumed_Call struct { + *mock.Call +} + +// EnergyConsumed is a helper method to define mock.On call +func (_e *MuMPCInterface_Expecter) EnergyConsumed() *MuMPCInterface_EnergyConsumed_Call { + return &MuMPCInterface_EnergyConsumed_Call{Call: _e.mock.On("EnergyConsumed")} +} + +func (_c *MuMPCInterface_EnergyConsumed_Call) Run(run func()) *MuMPCInterface_EnergyConsumed_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MuMPCInterface_EnergyConsumed_Call) Return(_a0 float64, _a1 error) *MuMPCInterface_EnergyConsumed_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MuMPCInterface_EnergyConsumed_Call) RunAndReturn(run func() (float64, error)) *MuMPCInterface_EnergyConsumed_Call { + _c.Call.Return(run) + return _c +} + +// EnergyProduced provides a mock function with no fields +func (_m *MuMPCInterface) EnergyProduced() (float64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for EnergyProduced") + } + + var r0 float64 + var r1 error + if rf, ok := ret.Get(0).(func() (float64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() float64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(float64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MuMPCInterface_EnergyProduced_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnergyProduced' +type MuMPCInterface_EnergyProduced_Call struct { + *mock.Call +} + +// EnergyProduced is a helper method to define mock.On call +func (_e *MuMPCInterface_Expecter) EnergyProduced() *MuMPCInterface_EnergyProduced_Call { + return &MuMPCInterface_EnergyProduced_Call{Call: _e.mock.On("EnergyProduced")} +} + +func (_c *MuMPCInterface_EnergyProduced_Call) Run(run func()) *MuMPCInterface_EnergyProduced_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MuMPCInterface_EnergyProduced_Call) Return(_a0 float64, _a1 error) *MuMPCInterface_EnergyProduced_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MuMPCInterface_EnergyProduced_Call) RunAndReturn(run func() (float64, error)) *MuMPCInterface_EnergyProduced_Call { + _c.Call.Return(run) + return _c +} + +// Frequency provides a mock function with no fields +func (_m *MuMPCInterface) Frequency() (float64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Frequency") + } + + var r0 float64 + var r1 error + if rf, ok := ret.Get(0).(func() (float64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() float64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(float64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MuMPCInterface_Frequency_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Frequency' +type MuMPCInterface_Frequency_Call struct { + *mock.Call +} + +// Frequency is a helper method to define mock.On call +func (_e *MuMPCInterface_Expecter) Frequency() *MuMPCInterface_Frequency_Call { + return &MuMPCInterface_Frequency_Call{Call: _e.mock.On("Frequency")} +} + +func (_c *MuMPCInterface_Frequency_Call) Run(run func()) *MuMPCInterface_Frequency_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MuMPCInterface_Frequency_Call) Return(_a0 float64, _a1 error) *MuMPCInterface_Frequency_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MuMPCInterface_Frequency_Call) RunAndReturn(run func() (float64, error)) *MuMPCInterface_Frequency_Call { + _c.Call.Return(run) + return _c +} + +// IsCompatibleEntityType provides a mock function with given fields: entity +func (_m *MuMPCInterface) IsCompatibleEntityType(entity spine_goapi.EntityRemoteInterface) bool { + ret := _m.Called(entity) + + if len(ret) == 0 { + panic("no return value specified for IsCompatibleEntityType") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface) bool); ok { + r0 = rf(entity) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// MuMPCInterface_IsCompatibleEntityType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsCompatibleEntityType' +type MuMPCInterface_IsCompatibleEntityType_Call struct { + *mock.Call +} + +// IsCompatibleEntityType is a helper method to define mock.On call +// - entity spine_goapi.EntityRemoteInterface +func (_e *MuMPCInterface_Expecter) IsCompatibleEntityType(entity interface{}) *MuMPCInterface_IsCompatibleEntityType_Call { + return &MuMPCInterface_IsCompatibleEntityType_Call{Call: _e.mock.On("IsCompatibleEntityType", entity)} +} + +func (_c *MuMPCInterface_IsCompatibleEntityType_Call) Run(run func(entity spine_goapi.EntityRemoteInterface)) *MuMPCInterface_IsCompatibleEntityType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(spine_goapi.EntityRemoteInterface)) + }) + return _c +} + +func (_c *MuMPCInterface_IsCompatibleEntityType_Call) Return(_a0 bool) *MuMPCInterface_IsCompatibleEntityType_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_IsCompatibleEntityType_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface) bool) *MuMPCInterface_IsCompatibleEntityType_Call { + _c.Call.Return(run) + return _c +} + +// IsScenarioAvailableAtEntity provides a mock function with given fields: entity, scenario +func (_m *MuMPCInterface) IsScenarioAvailableAtEntity(entity spine_goapi.EntityRemoteInterface, scenario uint) bool { + ret := _m.Called(entity, scenario) + + if len(ret) == 0 { + panic("no return value specified for IsScenarioAvailableAtEntity") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(spine_goapi.EntityRemoteInterface, uint) bool); ok { + r0 = rf(entity, scenario) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// MuMPCInterface_IsScenarioAvailableAtEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsScenarioAvailableAtEntity' +type MuMPCInterface_IsScenarioAvailableAtEntity_Call struct { + *mock.Call +} + +// IsScenarioAvailableAtEntity is a helper method to define mock.On call +// - entity spine_goapi.EntityRemoteInterface +// - scenario uint +func (_e *MuMPCInterface_Expecter) IsScenarioAvailableAtEntity(entity interface{}, scenario interface{}) *MuMPCInterface_IsScenarioAvailableAtEntity_Call { + return &MuMPCInterface_IsScenarioAvailableAtEntity_Call{Call: _e.mock.On("IsScenarioAvailableAtEntity", entity, scenario)} +} + +func (_c *MuMPCInterface_IsScenarioAvailableAtEntity_Call) Run(run func(entity spine_goapi.EntityRemoteInterface, scenario uint)) *MuMPCInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(spine_goapi.EntityRemoteInterface), args[1].(uint)) + }) + return _c +} + +func (_c *MuMPCInterface_IsScenarioAvailableAtEntity_Call) Return(_a0 bool) *MuMPCInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_IsScenarioAvailableAtEntity_Call) RunAndReturn(run func(spine_goapi.EntityRemoteInterface, uint) bool) *MuMPCInterface_IsScenarioAvailableAtEntity_Call { + _c.Call.Return(run) + return _c +} + +// Power provides a mock function with no fields +func (_m *MuMPCInterface) Power() (float64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Power") + } + + var r0 float64 + var r1 error + if rf, ok := ret.Get(0).(func() (float64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() float64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(float64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MuMPCInterface_Power_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Power' +type MuMPCInterface_Power_Call struct { + *mock.Call +} + +// Power is a helper method to define mock.On call +func (_e *MuMPCInterface_Expecter) Power() *MuMPCInterface_Power_Call { + return &MuMPCInterface_Power_Call{Call: _e.mock.On("Power")} +} + +func (_c *MuMPCInterface_Power_Call) Run(run func()) *MuMPCInterface_Power_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MuMPCInterface_Power_Call) Return(_a0 float64, _a1 error) *MuMPCInterface_Power_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MuMPCInterface_Power_Call) RunAndReturn(run func() (float64, error)) *MuMPCInterface_Power_Call { + _c.Call.Return(run) + return _c +} + +// PowerPerPhase provides a mock function with no fields +func (_m *MuMPCInterface) PowerPerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for PowerPerPhase") + } + + var r0 map[model.ElectricalConnectionPhaseNameType]float64 + var r1 error + if rf, ok := ret.Get(0).(func() (map[model.ElectricalConnectionPhaseNameType]float64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() map[model.ElectricalConnectionPhaseNameType]float64); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[model.ElectricalConnectionPhaseNameType]float64) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MuMPCInterface_PowerPerPhase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PowerPerPhase' +type MuMPCInterface_PowerPerPhase_Call struct { + *mock.Call +} + +// PowerPerPhase is a helper method to define mock.On call +func (_e *MuMPCInterface_Expecter) PowerPerPhase() *MuMPCInterface_PowerPerPhase_Call { + return &MuMPCInterface_PowerPerPhase_Call{Call: _e.mock.On("PowerPerPhase")} +} + +func (_c *MuMPCInterface_PowerPerPhase_Call) Run(run func()) *MuMPCInterface_PowerPerPhase_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MuMPCInterface_PowerPerPhase_Call) Return(_a0 map[model.ElectricalConnectionPhaseNameType]float64, _a1 error) *MuMPCInterface_PowerPerPhase_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MuMPCInterface_PowerPerPhase_Call) RunAndReturn(run func() (map[model.ElectricalConnectionPhaseNameType]float64, error)) *MuMPCInterface_PowerPerPhase_Call { + _c.Call.Return(run) + return _c +} + +// RemoteEntitiesScenarios provides a mock function with no fields +func (_m *MuMPCInterface) RemoteEntitiesScenarios() []eebus_goapi.RemoteEntityScenarios { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for RemoteEntitiesScenarios") + } + + var r0 []eebus_goapi.RemoteEntityScenarios + if rf, ok := ret.Get(0).(func() []eebus_goapi.RemoteEntityScenarios); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]eebus_goapi.RemoteEntityScenarios) + } + } + + return r0 +} + +// MuMPCInterface_RemoteEntitiesScenarios_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoteEntitiesScenarios' +type MuMPCInterface_RemoteEntitiesScenarios_Call struct { + *mock.Call +} + +// RemoteEntitiesScenarios is a helper method to define mock.On call +func (_e *MuMPCInterface_Expecter) RemoteEntitiesScenarios() *MuMPCInterface_RemoteEntitiesScenarios_Call { + return &MuMPCInterface_RemoteEntitiesScenarios_Call{Call: _e.mock.On("RemoteEntitiesScenarios")} +} + +func (_c *MuMPCInterface_RemoteEntitiesScenarios_Call) Run(run func()) *MuMPCInterface_RemoteEntitiesScenarios_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MuMPCInterface_RemoteEntitiesScenarios_Call) Return(_a0 []eebus_goapi.RemoteEntityScenarios) *MuMPCInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_RemoteEntitiesScenarios_Call) RunAndReturn(run func() []eebus_goapi.RemoteEntityScenarios) *MuMPCInterface_RemoteEntitiesScenarios_Call { + _c.Call.Return(run) + return _c +} + +// RemoveUseCase provides a mock function with no fields +func (_m *MuMPCInterface) RemoveUseCase() { + _m.Called() +} + +// MuMPCInterface_RemoveUseCase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveUseCase' +type MuMPCInterface_RemoveUseCase_Call struct { + *mock.Call +} + +// RemoveUseCase is a helper method to define mock.On call +func (_e *MuMPCInterface_Expecter) RemoveUseCase() *MuMPCInterface_RemoveUseCase_Call { + return &MuMPCInterface_RemoveUseCase_Call{Call: _e.mock.On("RemoveUseCase")} +} + +func (_c *MuMPCInterface_RemoveUseCase_Call) Run(run func()) *MuMPCInterface_RemoveUseCase_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MuMPCInterface_RemoveUseCase_Call) Return() *MuMPCInterface_RemoveUseCase_Call { + _c.Call.Return() + return _c +} + +func (_c *MuMPCInterface_RemoveUseCase_Call) RunAndReturn(run func()) *MuMPCInterface_RemoveUseCase_Call { + _c.Run(run) + return _c +} + +// Update provides a mock function with given fields: data +func (_m *MuMPCInterface) Update(data ...api.UpdateMeasurementData) error { + _va := make([]interface{}, len(data)) + for _i := range data { + _va[_i] = data[_i] + } + var _ca []interface{} + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 error + if rf, ok := ret.Get(0).(func(...api.UpdateMeasurementData) error); ok { + r0 = rf(data...) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MuMPCInterface_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type MuMPCInterface_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - data ...api.UpdateMeasurementData +func (_e *MuMPCInterface_Expecter) Update(data ...interface{}) *MuMPCInterface_Update_Call { + return &MuMPCInterface_Update_Call{Call: _e.mock.On("Update", + append([]interface{}{}, data...)...)} +} + +func (_c *MuMPCInterface_Update_Call) Run(run func(data ...api.UpdateMeasurementData)) *MuMPCInterface_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]api.UpdateMeasurementData, len(args)-0) + for i, a := range args[0:] { + if a != nil { + variadicArgs[i] = a.(api.UpdateMeasurementData) + } + } + run(variadicArgs...) + }) + return _c +} + +func (_c *MuMPCInterface_Update_Call) Return(_a0 error) *MuMPCInterface_Update_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_Update_Call) RunAndReturn(run func(...api.UpdateMeasurementData) error) *MuMPCInterface_Update_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataCurrentPhaseA provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataCurrentPhaseA(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataCurrentPhaseA") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataCurrentPhaseA_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataCurrentPhaseA' +type MuMPCInterface_UpdateDataCurrentPhaseA_Call struct { + *mock.Call +} + +// UpdateDataCurrentPhaseA is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataCurrentPhaseA(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataCurrentPhaseA_Call { + return &MuMPCInterface_UpdateDataCurrentPhaseA_Call{Call: _e.mock.On("UpdateDataCurrentPhaseA", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataCurrentPhaseA_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataCurrentPhaseA_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataCurrentPhaseA_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataCurrentPhaseA_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataCurrentPhaseA_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataCurrentPhaseA_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataCurrentPhaseB provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataCurrentPhaseB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataCurrentPhaseB") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataCurrentPhaseB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataCurrentPhaseB' +type MuMPCInterface_UpdateDataCurrentPhaseB_Call struct { + *mock.Call +} + +// UpdateDataCurrentPhaseB is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataCurrentPhaseB(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataCurrentPhaseB_Call { + return &MuMPCInterface_UpdateDataCurrentPhaseB_Call{Call: _e.mock.On("UpdateDataCurrentPhaseB", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataCurrentPhaseB_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataCurrentPhaseB_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataCurrentPhaseB_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataCurrentPhaseB_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataCurrentPhaseB_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataCurrentPhaseB_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataCurrentPhaseC provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataCurrentPhaseC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataCurrentPhaseC") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataCurrentPhaseC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataCurrentPhaseC' +type MuMPCInterface_UpdateDataCurrentPhaseC_Call struct { + *mock.Call +} + +// UpdateDataCurrentPhaseC is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataCurrentPhaseC(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataCurrentPhaseC_Call { + return &MuMPCInterface_UpdateDataCurrentPhaseC_Call{Call: _e.mock.On("UpdateDataCurrentPhaseC", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataCurrentPhaseC_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataCurrentPhaseC_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataCurrentPhaseC_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataCurrentPhaseC_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataCurrentPhaseC_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataCurrentPhaseC_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataEnergyConsumed provides a mock function with given fields: value, timestamp, valueState, evaluationStart, evaluationEnd +func (_m *MuMPCInterface) UpdateDataEnergyConsumed(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType, evaluationStart *time.Time, evaluationEnd *time.Time) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState, evaluationStart, evaluationEnd) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataEnergyConsumed") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType, *time.Time, *time.Time) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState, evaluationStart, evaluationEnd) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataEnergyConsumed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataEnergyConsumed' +type MuMPCInterface_UpdateDataEnergyConsumed_Call struct { + *mock.Call +} + +// UpdateDataEnergyConsumed is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +// - evaluationStart *time.Time +// - evaluationEnd *time.Time +func (_e *MuMPCInterface_Expecter) UpdateDataEnergyConsumed(value interface{}, timestamp interface{}, valueState interface{}, evaluationStart interface{}, evaluationEnd interface{}) *MuMPCInterface_UpdateDataEnergyConsumed_Call { + return &MuMPCInterface_UpdateDataEnergyConsumed_Call{Call: _e.mock.On("UpdateDataEnergyConsumed", value, timestamp, valueState, evaluationStart, evaluationEnd)} +} + +func (_c *MuMPCInterface_UpdateDataEnergyConsumed_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType, evaluationStart *time.Time, evaluationEnd *time.Time)) *MuMPCInterface_UpdateDataEnergyConsumed_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType), args[3].(*time.Time), args[4].(*time.Time)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataEnergyConsumed_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataEnergyConsumed_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataEnergyConsumed_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType, *time.Time, *time.Time) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataEnergyConsumed_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataEnergyProduced provides a mock function with given fields: value, timestamp, valueState, evaluationStart, evaluationEnd +func (_m *MuMPCInterface) UpdateDataEnergyProduced(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType, evaluationStart *time.Time, evaluationEnd *time.Time) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState, evaluationStart, evaluationEnd) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataEnergyProduced") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType, *time.Time, *time.Time) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState, evaluationStart, evaluationEnd) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataEnergyProduced_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataEnergyProduced' +type MuMPCInterface_UpdateDataEnergyProduced_Call struct { + *mock.Call +} + +// UpdateDataEnergyProduced is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +// - evaluationStart *time.Time +// - evaluationEnd *time.Time +func (_e *MuMPCInterface_Expecter) UpdateDataEnergyProduced(value interface{}, timestamp interface{}, valueState interface{}, evaluationStart interface{}, evaluationEnd interface{}) *MuMPCInterface_UpdateDataEnergyProduced_Call { + return &MuMPCInterface_UpdateDataEnergyProduced_Call{Call: _e.mock.On("UpdateDataEnergyProduced", value, timestamp, valueState, evaluationStart, evaluationEnd)} +} + +func (_c *MuMPCInterface_UpdateDataEnergyProduced_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType, evaluationStart *time.Time, evaluationEnd *time.Time)) *MuMPCInterface_UpdateDataEnergyProduced_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType), args[3].(*time.Time), args[4].(*time.Time)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataEnergyProduced_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataEnergyProduced_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataEnergyProduced_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType, *time.Time, *time.Time) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataEnergyProduced_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataFrequency provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataFrequency(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataFrequency") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataFrequency_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataFrequency' +type MuMPCInterface_UpdateDataFrequency_Call struct { + *mock.Call +} + +// UpdateDataFrequency is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataFrequency(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataFrequency_Call { + return &MuMPCInterface_UpdateDataFrequency_Call{Call: _e.mock.On("UpdateDataFrequency", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataFrequency_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataFrequency_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataFrequency_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataFrequency_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataFrequency_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataFrequency_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataPowerPhaseA provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataPowerPhaseA(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataPowerPhaseA") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataPowerPhaseA_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataPowerPhaseA' +type MuMPCInterface_UpdateDataPowerPhaseA_Call struct { + *mock.Call +} + +// UpdateDataPowerPhaseA is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataPowerPhaseA(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataPowerPhaseA_Call { + return &MuMPCInterface_UpdateDataPowerPhaseA_Call{Call: _e.mock.On("UpdateDataPowerPhaseA", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataPowerPhaseA_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataPowerPhaseA_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataPowerPhaseA_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataPowerPhaseA_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataPowerPhaseA_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataPowerPhaseA_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataPowerPhaseB provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataPowerPhaseB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataPowerPhaseB") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataPowerPhaseB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataPowerPhaseB' +type MuMPCInterface_UpdateDataPowerPhaseB_Call struct { + *mock.Call +} + +// UpdateDataPowerPhaseB is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataPowerPhaseB(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataPowerPhaseB_Call { + return &MuMPCInterface_UpdateDataPowerPhaseB_Call{Call: _e.mock.On("UpdateDataPowerPhaseB", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataPowerPhaseB_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataPowerPhaseB_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataPowerPhaseB_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataPowerPhaseB_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataPowerPhaseB_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataPowerPhaseB_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataPowerPhaseC provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataPowerPhaseC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataPowerPhaseC") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataPowerPhaseC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataPowerPhaseC' +type MuMPCInterface_UpdateDataPowerPhaseC_Call struct { + *mock.Call +} + +// UpdateDataPowerPhaseC is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataPowerPhaseC(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataPowerPhaseC_Call { + return &MuMPCInterface_UpdateDataPowerPhaseC_Call{Call: _e.mock.On("UpdateDataPowerPhaseC", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataPowerPhaseC_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataPowerPhaseC_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataPowerPhaseC_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataPowerPhaseC_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataPowerPhaseC_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataPowerPhaseC_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataPowerTotal provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataPowerTotal(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataPowerTotal") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataPowerTotal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataPowerTotal' +type MuMPCInterface_UpdateDataPowerTotal_Call struct { + *mock.Call +} + +// UpdateDataPowerTotal is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataPowerTotal(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataPowerTotal_Call { + return &MuMPCInterface_UpdateDataPowerTotal_Call{Call: _e.mock.On("UpdateDataPowerTotal", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataPowerTotal_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataPowerTotal_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataPowerTotal_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataPowerTotal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataPowerTotal_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataPowerTotal_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataVoltagePhaseA provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataVoltagePhaseA(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataVoltagePhaseA") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataVoltagePhaseA_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataVoltagePhaseA' +type MuMPCInterface_UpdateDataVoltagePhaseA_Call struct { + *mock.Call +} + +// UpdateDataVoltagePhaseA is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataVoltagePhaseA(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataVoltagePhaseA_Call { + return &MuMPCInterface_UpdateDataVoltagePhaseA_Call{Call: _e.mock.On("UpdateDataVoltagePhaseA", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseA_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataVoltagePhaseA_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseA_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseA_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseA_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseA_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataVoltagePhaseAToB provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataVoltagePhaseAToB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataVoltagePhaseAToB") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataVoltagePhaseAToB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataVoltagePhaseAToB' +type MuMPCInterface_UpdateDataVoltagePhaseAToB_Call struct { + *mock.Call +} + +// UpdateDataVoltagePhaseAToB is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataVoltagePhaseAToB(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataVoltagePhaseAToB_Call { + return &MuMPCInterface_UpdateDataVoltagePhaseAToB_Call{Call: _e.mock.On("UpdateDataVoltagePhaseAToB", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseAToB_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataVoltagePhaseAToB_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseAToB_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseAToB_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseAToB_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseAToB_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataVoltagePhaseAToC provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataVoltagePhaseAToC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataVoltagePhaseAToC") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataVoltagePhaseAToC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataVoltagePhaseAToC' +type MuMPCInterface_UpdateDataVoltagePhaseAToC_Call struct { + *mock.Call +} + +// UpdateDataVoltagePhaseAToC is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataVoltagePhaseAToC(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataVoltagePhaseAToC_Call { + return &MuMPCInterface_UpdateDataVoltagePhaseAToC_Call{Call: _e.mock.On("UpdateDataVoltagePhaseAToC", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseAToC_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataVoltagePhaseAToC_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseAToC_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseAToC_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseAToC_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseAToC_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataVoltagePhaseB provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataVoltagePhaseB(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataVoltagePhaseB") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataVoltagePhaseB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataVoltagePhaseB' +type MuMPCInterface_UpdateDataVoltagePhaseB_Call struct { + *mock.Call +} + +// UpdateDataVoltagePhaseB is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataVoltagePhaseB(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataVoltagePhaseB_Call { + return &MuMPCInterface_UpdateDataVoltagePhaseB_Call{Call: _e.mock.On("UpdateDataVoltagePhaseB", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseB_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataVoltagePhaseB_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseB_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseB_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseB_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseB_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataVoltagePhaseBToC provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataVoltagePhaseBToC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataVoltagePhaseBToC") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataVoltagePhaseBToC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataVoltagePhaseBToC' +type MuMPCInterface_UpdateDataVoltagePhaseBToC_Call struct { + *mock.Call +} + +// UpdateDataVoltagePhaseBToC is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataVoltagePhaseBToC(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataVoltagePhaseBToC_Call { + return &MuMPCInterface_UpdateDataVoltagePhaseBToC_Call{Call: _e.mock.On("UpdateDataVoltagePhaseBToC", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseBToC_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataVoltagePhaseBToC_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseBToC_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseBToC_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseBToC_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseBToC_Call { + _c.Call.Return(run) + return _c +} + +// UpdateDataVoltagePhaseC provides a mock function with given fields: value, timestamp, valueState +func (_m *MuMPCInterface) UpdateDataVoltagePhaseC(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType) api.UpdateMeasurementData { + ret := _m.Called(value, timestamp, valueState) + + if len(ret) == 0 { + panic("no return value specified for UpdateDataVoltagePhaseC") + } + + var r0 api.UpdateMeasurementData + if rf, ok := ret.Get(0).(func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData); ok { + r0 = rf(value, timestamp, valueState) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(api.UpdateMeasurementData) + } + } + + return r0 +} + +// MuMPCInterface_UpdateDataVoltagePhaseC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateDataVoltagePhaseC' +type MuMPCInterface_UpdateDataVoltagePhaseC_Call struct { + *mock.Call +} + +// UpdateDataVoltagePhaseC is a helper method to define mock.On call +// - value float64 +// - timestamp *time.Time +// - valueState *model.MeasurementValueStateType +func (_e *MuMPCInterface_Expecter) UpdateDataVoltagePhaseC(value interface{}, timestamp interface{}, valueState interface{}) *MuMPCInterface_UpdateDataVoltagePhaseC_Call { + return &MuMPCInterface_UpdateDataVoltagePhaseC_Call{Call: _e.mock.On("UpdateDataVoltagePhaseC", value, timestamp, valueState)} +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseC_Call) Run(run func(value float64, timestamp *time.Time, valueState *model.MeasurementValueStateType)) *MuMPCInterface_UpdateDataVoltagePhaseC_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(float64), args[1].(*time.Time), args[2].(*model.MeasurementValueStateType)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseC_Call) Return(_a0 api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseC_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MuMPCInterface_UpdateDataVoltagePhaseC_Call) RunAndReturn(run func(float64, *time.Time, *model.MeasurementValueStateType) api.UpdateMeasurementData) *MuMPCInterface_UpdateDataVoltagePhaseC_Call { + _c.Call.Return(run) + return _c +} + +// UpdateUseCaseAvailability provides a mock function with given fields: available +func (_m *MuMPCInterface) UpdateUseCaseAvailability(available bool) { + _m.Called(available) +} + +// MuMPCInterface_UpdateUseCaseAvailability_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUseCaseAvailability' +type MuMPCInterface_UpdateUseCaseAvailability_Call struct { + *mock.Call +} + +// UpdateUseCaseAvailability is a helper method to define mock.On call +// - available bool +func (_e *MuMPCInterface_Expecter) UpdateUseCaseAvailability(available interface{}) *MuMPCInterface_UpdateUseCaseAvailability_Call { + return &MuMPCInterface_UpdateUseCaseAvailability_Call{Call: _e.mock.On("UpdateUseCaseAvailability", available)} +} + +func (_c *MuMPCInterface_UpdateUseCaseAvailability_Call) Run(run func(available bool)) *MuMPCInterface_UpdateUseCaseAvailability_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(bool)) + }) + return _c +} + +func (_c *MuMPCInterface_UpdateUseCaseAvailability_Call) Return() *MuMPCInterface_UpdateUseCaseAvailability_Call { + _c.Call.Return() + return _c +} + +func (_c *MuMPCInterface_UpdateUseCaseAvailability_Call) RunAndReturn(run func(bool)) *MuMPCInterface_UpdateUseCaseAvailability_Call { + _c.Run(run) + return _c +} + +// VoltagePerPhase provides a mock function with no fields +func (_m *MuMPCInterface) VoltagePerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for VoltagePerPhase") + } + + var r0 map[model.ElectricalConnectionPhaseNameType]float64 + var r1 error + if rf, ok := ret.Get(0).(func() (map[model.ElectricalConnectionPhaseNameType]float64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() map[model.ElectricalConnectionPhaseNameType]float64); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[model.ElectricalConnectionPhaseNameType]float64) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MuMPCInterface_VoltagePerPhase_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VoltagePerPhase' +type MuMPCInterface_VoltagePerPhase_Call struct { + *mock.Call +} + +// VoltagePerPhase is a helper method to define mock.On call +func (_e *MuMPCInterface_Expecter) VoltagePerPhase() *MuMPCInterface_VoltagePerPhase_Call { + return &MuMPCInterface_VoltagePerPhase_Call{Call: _e.mock.On("VoltagePerPhase")} +} + +func (_c *MuMPCInterface_VoltagePerPhase_Call) Run(run func()) *MuMPCInterface_VoltagePerPhase_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MuMPCInterface_VoltagePerPhase_Call) Return(_a0 map[model.ElectricalConnectionPhaseNameType]float64, _a1 error) *MuMPCInterface_VoltagePerPhase_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MuMPCInterface_VoltagePerPhase_Call) RunAndReturn(run func() (map[model.ElectricalConnectionPhaseNameType]float64, error)) *MuMPCInterface_VoltagePerPhase_Call { + _c.Call.Return(run) + return _c +} + +// NewMuMPCInterface creates a new instance of MuMPCInterface. 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 NewMuMPCInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MuMPCInterface { + mock := &MuMPCInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/UpdateData.go b/usecases/mocks/UpdateData.go new file mode 100644 index 00000000..089ea29e --- /dev/null +++ b/usecases/mocks/UpdateData.go @@ -0,0 +1,122 @@ +// Code generated by mockery v2.53.4. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// UpdateData is an autogenerated mock type for the UpdateData type +type UpdateData struct { + mock.Mock +} + +type UpdateData_Expecter struct { + mock *mock.Mock +} + +func (_m *UpdateData) EXPECT() *UpdateData_Expecter { + return &UpdateData_Expecter{mock: &_m.Mock} +} + +// NotSupportedError provides a mock function with no fields +func (_m *UpdateData) NotSupportedError() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NotSupportedError") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// UpdateData_NotSupportedError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotSupportedError' +type UpdateData_NotSupportedError_Call struct { + *mock.Call +} + +// NotSupportedError is a helper method to define mock.On call +func (_e *UpdateData_Expecter) NotSupportedError() *UpdateData_NotSupportedError_Call { + return &UpdateData_NotSupportedError_Call{Call: _e.mock.On("NotSupportedError")} +} + +func (_c *UpdateData_NotSupportedError_Call) Run(run func()) *UpdateData_NotSupportedError_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *UpdateData_NotSupportedError_Call) Return(_a0 error) *UpdateData_NotSupportedError_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *UpdateData_NotSupportedError_Call) RunAndReturn(run func() error) *UpdateData_NotSupportedError_Call { + _c.Call.Return(run) + return _c +} + +// Supported provides a mock function with no fields +func (_m *UpdateData) Supported() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Supported") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// UpdateData_Supported_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Supported' +type UpdateData_Supported_Call struct { + *mock.Call +} + +// Supported is a helper method to define mock.On call +func (_e *UpdateData_Expecter) Supported() *UpdateData_Supported_Call { + return &UpdateData_Supported_Call{Call: _e.mock.On("Supported")} +} + +func (_c *UpdateData_Supported_Call) Run(run func()) *UpdateData_Supported_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *UpdateData_Supported_Call) Return(_a0 bool) *UpdateData_Supported_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *UpdateData_Supported_Call) RunAndReturn(run func() bool) *UpdateData_Supported_Call { + _c.Call.Return(run) + return _c +} + +// NewUpdateData creates a new instance of UpdateData. 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 NewUpdateData(t interface { + mock.TestingT + Cleanup(func()) +}) *UpdateData { + mock := &UpdateData{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mocks/UpdateMeasurementData.go b/usecases/mocks/UpdateMeasurementData.go new file mode 100644 index 00000000..7185d141 --- /dev/null +++ b/usecases/mocks/UpdateMeasurementData.go @@ -0,0 +1,170 @@ +// Code generated by mockery v2.53.4. DO NOT EDIT. + +package mocks + +import ( + api "github.com/enbility/eebus-go/api" + mock "github.com/stretchr/testify/mock" +) + +// UpdateMeasurementData is an autogenerated mock type for the UpdateMeasurementData type +type UpdateMeasurementData struct { + mock.Mock +} + +type UpdateMeasurementData_Expecter struct { + mock *mock.Mock +} + +func (_m *UpdateMeasurementData) EXPECT() *UpdateMeasurementData_Expecter { + return &UpdateMeasurementData_Expecter{mock: &_m.Mock} +} + +// MeasurementData provides a mock function with no fields +func (_m *UpdateMeasurementData) MeasurementData() api.MeasurementDataForID { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MeasurementData") + } + + var r0 api.MeasurementDataForID + if rf, ok := ret.Get(0).(func() api.MeasurementDataForID); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(api.MeasurementDataForID) + } + + return r0 +} + +// UpdateMeasurementData_MeasurementData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MeasurementData' +type UpdateMeasurementData_MeasurementData_Call struct { + *mock.Call +} + +// MeasurementData is a helper method to define mock.On call +func (_e *UpdateMeasurementData_Expecter) MeasurementData() *UpdateMeasurementData_MeasurementData_Call { + return &UpdateMeasurementData_MeasurementData_Call{Call: _e.mock.On("MeasurementData")} +} + +func (_c *UpdateMeasurementData_MeasurementData_Call) Run(run func()) *UpdateMeasurementData_MeasurementData_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *UpdateMeasurementData_MeasurementData_Call) Return(_a0 api.MeasurementDataForID) *UpdateMeasurementData_MeasurementData_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *UpdateMeasurementData_MeasurementData_Call) RunAndReturn(run func() api.MeasurementDataForID) *UpdateMeasurementData_MeasurementData_Call { + _c.Call.Return(run) + return _c +} + +// NotSupportedError provides a mock function with no fields +func (_m *UpdateMeasurementData) NotSupportedError() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NotSupportedError") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// UpdateMeasurementData_NotSupportedError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NotSupportedError' +type UpdateMeasurementData_NotSupportedError_Call struct { + *mock.Call +} + +// NotSupportedError is a helper method to define mock.On call +func (_e *UpdateMeasurementData_Expecter) NotSupportedError() *UpdateMeasurementData_NotSupportedError_Call { + return &UpdateMeasurementData_NotSupportedError_Call{Call: _e.mock.On("NotSupportedError")} +} + +func (_c *UpdateMeasurementData_NotSupportedError_Call) Run(run func()) *UpdateMeasurementData_NotSupportedError_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *UpdateMeasurementData_NotSupportedError_Call) Return(_a0 error) *UpdateMeasurementData_NotSupportedError_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *UpdateMeasurementData_NotSupportedError_Call) RunAndReturn(run func() error) *UpdateMeasurementData_NotSupportedError_Call { + _c.Call.Return(run) + return _c +} + +// Supported provides a mock function with no fields +func (_m *UpdateMeasurementData) Supported() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Supported") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// UpdateMeasurementData_Supported_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Supported' +type UpdateMeasurementData_Supported_Call struct { + *mock.Call +} + +// Supported is a helper method to define mock.On call +func (_e *UpdateMeasurementData_Expecter) Supported() *UpdateMeasurementData_Supported_Call { + return &UpdateMeasurementData_Supported_Call{Call: _e.mock.On("Supported")} +} + +func (_c *UpdateMeasurementData_Supported_Call) Run(run func()) *UpdateMeasurementData_Supported_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *UpdateMeasurementData_Supported_Call) Return(_a0 bool) *UpdateMeasurementData_Supported_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *UpdateMeasurementData_Supported_Call) RunAndReturn(run func() bool) *UpdateMeasurementData_Supported_Call { + _c.Call.Return(run) + return _c +} + +// NewUpdateMeasurementData creates a new instance of UpdateMeasurementData. 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 NewUpdateMeasurementData(t interface { + mock.TestingT + Cleanup(func()) +}) *UpdateMeasurementData { + mock := &UpdateMeasurementData{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/usecases/mu/mpc/config.go b/usecases/mu/mpc/config.go new file mode 100644 index 00000000..52a1bbec --- /dev/null +++ b/usecases/mu/mpc/config.go @@ -0,0 +1,68 @@ +package mpc + +import ( + "strings" + + "github.com/enbility/spine-go/model" +) + +type PhaseMeasurementSourceMap map[model.ElectricalConnectionPhaseNameType]*model.MeasurementValueSourceType +type PhaseMeasurementConstraintsMap map[model.ElectricalConnectionPhaseNameType]*model.MeasurementConstraintsDataType + +// MonitorPowerConfig is the configuration for the monitor use case +// This config is required by the mpc use case and must be used in mpc.NewMPC +type MonitorPowerConfig struct { + ConnectedPhases model.ElectricalConnectionPhaseNameType // The phases that are measured + + ValueSourceTotal *model.MeasurementValueSourceType // The source of the values from the acPowerTotal (required) + ValueSourcePerPhase PhaseMeasurementSourceMap // The source of the values from the acPower per phase (required if the phase is supported) + + ValueConstraintsTotal *model.MeasurementConstraintsDataType // The constraints for the acPowerTotal (optional can be nil) + ValueConstraintsPerPhase PhaseMeasurementConstraintsMap // The constraints for the acPower per phase (optional can be nil) +} + +// MonitorEnergyConfig is the configuration for the monitor use case +// If this config is passed via NewMPC, the use case will support energy monitoring as specified +type MonitorEnergyConfig struct { + ValueSourceProduction *model.MeasurementValueSourceType // The source of the production values (if this is set, the use case will support production) (optional can be nil) + ValueConstraintsProduction *model.MeasurementConstraintsDataType // The constraints for the production values (optional can be nil) (requires ProductionValueSource to be set) + + ValueSourceConsumption *model.MeasurementValueSourceType // The source of the consumption values (if this is set, the use case will support consumption) (optional can be nil) + ValueConstraintsConsumption *model.MeasurementConstraintsDataType // The constraints for the consumption values (optional can be nil) (requires ConsumptionValueSource to be set) +} + +// MonitorCurrentConfig is the configuration for the monitor use case +// If this config is passed via NewMPC, the use case will support current monitoring +// The current phases will be the same as specified in MonitorPowerConfig +type MonitorCurrentConfig struct { + ValueSourcePerPhase PhaseMeasurementSourceMap // The source of the values per phase (required if the phase is supported) + ValueConstraintsPerPhase PhaseMeasurementConstraintsMap // The constraints for the current per phase (optional can be nil) (requires ValueSourcePerPhase to be set) +} + +// MonitorVoltageConfig is the configuration for the monitor use case +// If this config is passed via NewMPC, the use case will support voltage monitoring +// The voltage phases will be the same as specified in MonitorPowerConfig +type MonitorVoltageConfig struct { + ValueSourcePerPhase PhaseMeasurementSourceMap // The source of the values per phase (required if the phase is supported) + ValueConstraintsPerPhase PhaseMeasurementConstraintsMap // The constraints for the voltage per phase (optional can be nil) (requires ValueSourcePerPhase to be set) +} + +// MonitorFrequencyConfig is the configuration for the monitor use case +type MonitorFrequencyConfig struct { + ValueSource *model.MeasurementValueSourceType // The source of the values (required) + ValueConstraints *model.MeasurementConstraintsDataType // The constraints for the frequency values (optional can be nil) +} + +// SupportsPhases checks if the config supports the given phases +// e.g. SupportsPhases([]string{"a", "B"}) will return true if the config has ConnectedPhases set to "ab" or "abc" +func (c *MonitorPowerConfig) SupportsPhases(phase []string) bool { + phasesString := string(c.ConnectedPhases) + supports := true + for _, p := range phase { + if !strings.Contains(strings.ToLower(phasesString), strings.ToLower(p)) { + supports = false + break + } + } + return supports +} diff --git a/usecases/mu/mpc/config_test.go b/usecases/mu/mpc/config_test.go new file mode 100644 index 00000000..8df2279f --- /dev/null +++ b/usecases/mu/mpc/config_test.go @@ -0,0 +1,47 @@ +package mpc + +import ( + "github.com/enbility/spine-go/model" + "github.com/stretchr/testify/assert" +) + +func (s *MuMPCSuite) Test_SupportsPhases() { + allowedConstellations := map[model.ElectricalConnectionPhaseNameType][][]string{ + model.ElectricalConnectionPhaseNameTypeA: {{"a"}}, + model.ElectricalConnectionPhaseNameTypeB: {{"b"}}, + model.ElectricalConnectionPhaseNameTypeC: {{"C"}}, + model.ElectricalConnectionPhaseNameTypeAb: {{"a"}, {"b"}, {"a", "b"}}, + model.ElectricalConnectionPhaseNameTypeBc: {{"b"}, {"c"}, {"B", "c"}}, + model.ElectricalConnectionPhaseNameTypeAc: {{"a"}, {"c"}, {"A", "C"}}, + model.ElectricalConnectionPhaseNameTypeAbc: {{"a"}, {"b"}, {"c"}, {"a", "b"}, {"b", "c"}, {"a", "c"}, {"A", "b", "c"}}, + } + + for constellation, phases := range allowedConstellations { + config := MonitorPowerConfig{ + ConnectedPhases: constellation, + } + + for _, phase := range phases { + assert.True(s.T(), config.SupportsPhases(phase)) + } + } + + notAllowedConstellations := map[model.ElectricalConnectionPhaseNameType][]string{ + model.ElectricalConnectionPhaseNameTypeA: {"b", "c", "ab", "bc", "ac", "abc"}, + model.ElectricalConnectionPhaseNameTypeB: {"a", "c", "ab", "bc", "ac", "abc"}, + model.ElectricalConnectionPhaseNameTypeC: {"a", "b", "ab", "bc", "ac", "abc"}, + model.ElectricalConnectionPhaseNameTypeAb: {"c", "ac", "abc"}, + model.ElectricalConnectionPhaseNameTypeBc: {"a", "ab", "abc"}, + model.ElectricalConnectionPhaseNameTypeAc: {"b", "bc", "abc"}, + } + + for constellation, notSupportedPhases := range notAllowedConstellations { + config := MonitorPowerConfig{ + ConnectedPhases: constellation, + } + + for _, phase := range notSupportedPhases { + assert.False(s.T(), config.SupportsPhases([]string{phase})) + } + } +} diff --git a/usecases/mu/mpc/events.go b/usecases/mu/mpc/events.go new file mode 100644 index 00000000..c05e05aa --- /dev/null +++ b/usecases/mu/mpc/events.go @@ -0,0 +1,10 @@ +package mpc + +import ( + spineapi "github.com/enbility/spine-go/api" +) + +// handle SPINE events +func (e *MPC) HandleEvent(payload spineapi.EventPayload) { + // No events supported +} diff --git a/usecases/mu/mpc/public.go b/usecases/mu/mpc/public.go new file mode 100644 index 00000000..01c2415a --- /dev/null +++ b/usecases/mu/mpc/public.go @@ -0,0 +1,639 @@ +package mpc + +import ( + "time" + + "github.com/enbility/eebus-go/api" + "github.com/enbility/eebus-go/features/server" + usecaseapi "github.com/enbility/eebus-go/usecases/api" + "github.com/enbility/spine-go/model" +) + +// ------------------------- Getters ------------------------- // + +// Scenario 1 + +// get the momentary active power consumption or production +// +// possible errors: +// - ErrMissingData if the id is not available +// - and others +func (e *MPC) Power() (float64, error) { + if e.acPowerTotal == nil { + return 0, api.ErrMissingData + } + + return e.getMeasurementDataForId(e.acPowerTotal) +} + +// get the momentary active power consumption or production per phase +// +// possible errors: +// - ErrMissingData if the id is not available +// - and others +func (e *MPC) PowerPerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error) { + powerPerPhase := make(map[model.ElectricalConnectionPhaseNameType]float64) + + for phase, id := range e.acPowerPerPhase { + if id != nil { + power, err := e.getMeasurementDataForId(id) + if err != nil { + return nil, err + } + powerPerPhase[phase] = power + } + } + + return powerPerPhase, nil +} + +// Scenario 2 + +// get the total feed in energy +// +// - negative values are used for production +// +// possible errors: +// - ErrMissingData if the id is not available +// - and others +func (e *MPC) EnergyConsumed() (float64, error) { + if e.acEnergyConsumed == nil { + return 0, api.ErrMissingData + } + + return e.getMeasurementDataForId(e.acEnergyConsumed) +} + +// get the total feed in energy +// +// - negative values are used for production +// +// possible errors: +// - ErrMissingData if the id is not available +// - and others +func (e *MPC) EnergyProduced() (float64, error) { + if e.acEnergyProduced == nil { + return 0, api.ErrMissingData + } + + return e.getMeasurementDataForId(e.acEnergyProduced) +} + +// Scenario 3 + +// get the momentary phase specific current consumption or production +// +// - positive values are used for consumption +// - negative values are used for production +// +// possible errors: +// - ErrMissingData if the id is not available +// - and others +func (e *MPC) CurrentPerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error) { + currentPerPhase := make(map[model.ElectricalConnectionPhaseNameType]float64) + + for phase, id := range e.acCurrentPerPhase { + if id != nil { + current, err := e.getMeasurementDataForId(id) + if err != nil { + return nil, err + } + currentPerPhase[phase] = current + } + } + + return currentPerPhase, nil +} + +// Scenario 4 + +// get the phase specific voltage details +// +// possible errors: +// - ErrMissingData if the id is not available +// - and others +func (e *MPC) VoltagePerPhase() (map[model.ElectricalConnectionPhaseNameType]float64, error) { + voltagePerPhase := make(map[model.ElectricalConnectionPhaseNameType]float64) + + for phase, id := range e.acVoltagePerPhase { + if id != nil { + voltage, err := e.getMeasurementDataForId(id) + if err != nil { + return nil, err + } + voltagePerPhase[phase] = voltage + } + } + + return voltagePerPhase, nil +} + +// Scenario 5 + +// get frequency +// +// possible errors: +// - ErrMissingData if the id is not available +// - and others +func (e *MPC) Frequency() (float64, error) { + if e.acFrequency == nil { + return 0, api.ErrMissingData + } + + return e.getMeasurementDataForId(e.acFrequency) +} + +// ------------------------- Setters ------------------------- // + +// use MPC.Update to update the measurement data +// use it like this: +// +// mpc.Update( +// mpc.UpdateDataPowerTotal(1000, nil, nil), +// mpc.UpdateDataPowerPhaseA(500, nil, nil), +// ... +// ) +// +// possible errors: +// - ErrMissingData if the id is not available +// - and others +func (e *MPC) Update(updateData ...usecaseapi.UpdateMeasurementData) error { + measurements, err := server.NewMeasurement(e.LocalEntity) + if err != nil { + return err + } + + measurementDataForIds := make([]api.MeasurementDataForID, 0) + + for _, measurementDataForId := range updateData { + if !measurementDataForId.Supported() { + return measurementDataForId.NotSupportedError() + } + + measurementDataForIds = append(measurementDataForIds, measurementDataForId.MeasurementData()) + } + + return measurements.UpdateDataForIds(measurementDataForIds) +} + +// Scenario 1 + +// use MPC.UpdateDataPowerTotal in MPC.Update to set the momentary active power consumption or production +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataPowerTotal( + acPowerTotal float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + return newUpdateData( + "acPowerTotal is not supported, please check the configuration", + e.acPowerTotal, + measurementData( + acPowerTotal, + timestamp, + e.powerConfig.ValueSourceTotal, + valueState, + nil, + nil, + ), + ) +} + +// use MPC.UpdateDataPowerPhaseA in MPC.Update to set the momentary active power consumption or production per phase +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataPowerPhaseA( + acPowerPhaseA float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + return newUpdateData( + "acPowerPhaseA is not supported, please check the configuration", + e.acPowerPerPhase[model.ElectricalConnectionPhaseNameTypeA], + measurementData( + acPowerPhaseA, + timestamp, + e.powerConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeA], + valueState, + nil, + nil, + ), + ) +} + +// use MPC.UpdateDataPowerPhaseB in MPC.Update to set the momentary active power consumption or production per phase +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataPowerPhaseB( + acPowerPhaseB float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + return newUpdateData( + "acPowerPhaseB is not supported, please check the configuration", + e.acPowerPerPhase[model.ElectricalConnectionPhaseNameTypeB], + measurementData( + acPowerPhaseB, + timestamp, + e.powerConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeB], + valueState, + nil, + nil, + ), + ) +} + +// use MPC.UpdateDataPowerPhaseC in MPC.Update to set the momentary active power consumption or production per phase +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataPowerPhaseC( + acPowerPhaseC float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + return newUpdateData( + "acPowerPhaseC is not supported, please check the configuration", + e.acPowerPerPhase[model.ElectricalConnectionPhaseNameTypeC], + measurementData( + acPowerPhaseC, + timestamp, + e.powerConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeC], + valueState, + nil, + nil, + ), + ) +} + +// Scenario 2 + +// use MPC.UpdateDataEnergyConsumed in MPC.Update to set the total feed in energy +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +// The evaluationStart and End are optional and can be nil (both must be set to be used) +func (e *MPC) UpdateDataEnergyConsumed( + energyConsumed float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, + evaluationStart *time.Time, + evaluationEnd *time.Time, +) usecaseapi.UpdateMeasurementData { + if e.acEnergyConsumed == nil { + return newUpdateData( + "acEnergyConsumed is not supported, please check the configuration", + nil, + nil, + ) + } + return newUpdateData( + "acEnergyConsumed is not supported, please check the configuration", + e.acEnergyConsumed, + measurementData( + energyConsumed, + timestamp, + e.energyConfig.ValueSourceConsumption, + valueState, + evaluationStart, + evaluationEnd, + ), + ) +} + +// use MPC.MeasuredUpdateDataEnergyProduced in MPC.Update to set the total feed in energy +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +// The evaluationStart and End are optional and can be nil (both must be set to be used) +func (e *MPC) UpdateDataEnergyProduced( + energyProduced float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, + evaluationStart *time.Time, + evaluationEnd *time.Time, +) usecaseapi.UpdateMeasurementData { + if e.acEnergyProduced == nil { + return newUpdateData( + "acEnergyProduced is not supported, please check the configuration", + nil, + nil, + ) + } + return newUpdateData( + "acEnergyProduced is not supported, please check the configuration", + e.acEnergyProduced, + measurementData( + energyProduced, + timestamp, + e.energyConfig.ValueSourceProduction, + valueState, + evaluationStart, + evaluationEnd, + ), + ) +} + +// Scenario 3 + +// use MPC.UpdateDataCurrentPhaseA in MPC.Update to set the momentary phase specific current consumption or production +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataCurrentPhaseA( + acCurrentPhaseA float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + // validate first if current is supported + if e.currentConfig == nil { + return newUpdateData( + "acCurrent is not supported, please check the configuration", + nil, + nil, + ) + } + return newUpdateData( + "acCurrentPhaseA is not supported, please check the configuration", + e.acCurrentPerPhase[model.ElectricalConnectionPhaseNameTypeA], + measurementData( + acCurrentPhaseA, + timestamp, + e.currentConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeA], + valueState, + nil, + nil, + ), + ) +} + +// use MPC.UpdateDataCurrentPhaseB in MPC.Update to set the momentary phase specific current consumption or production +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataCurrentPhaseB( + acCurrentPhaseB float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + // validate first if current is supported + if e.currentConfig == nil { + return newUpdateData( + "acCurrent is not supported, please check the configuration", + nil, + nil, + ) + } + return newUpdateData( + "acCurrentPhaseB is not supported, please check the configuration", + e.acCurrentPerPhase[model.ElectricalConnectionPhaseNameTypeB], + measurementData( + acCurrentPhaseB, + timestamp, + e.currentConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeB], + valueState, + nil, + nil, + ), + ) +} + +// use MPC.UpdateDataCurrentPhaseC in MPC.Update to set the momentary phase specific current consumption or production +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataCurrentPhaseC( + acCurrentPhaseC float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + // validate first if current is supported + if e.currentConfig == nil { + return newUpdateData( + "acCurrent is not supported, please check the configuration", + nil, + nil, + ) + } + return newUpdateData( + "acCurrentPhaseC is not supported, please check the configuration", + e.acCurrentPerPhase[model.ElectricalConnectionPhaseNameTypeC], + measurementData( + acCurrentPhaseC, + timestamp, + e.currentConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeC], + valueState, + nil, + nil, + ), + ) +} + +// Scenario 4 + +// use MPC.UpdateDataVoltagePhaseA in MPC.Update to set the phase specific voltage details +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataVoltagePhaseA( + voltagePhaseA float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + // validate first if voltage is supported + if e.voltageConfig == nil { + return newUpdateData( + "acVoltage is not supported, please check the configuration", + nil, + nil, + ) + } + return newUpdateData( + "acVoltagePhaseA is not supported, please check the configuration", + e.acVoltagePerPhase[model.ElectricalConnectionPhaseNameTypeA], + measurementData( + voltagePhaseA, + timestamp, + e.voltageConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeA], + valueState, + nil, + nil, + ), + ) +} + +// use MPC.UpdateDataVoltagePhaseB in MPC.Update to set the phase specific voltage details +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataVoltagePhaseB( + voltagePhaseB float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + // validate first if voltage is supported + if e.voltageConfig == nil { + return newUpdateData( + "acVoltage is not supported, please check the configuration", + nil, + nil, + ) + } + return newUpdateData( + "acVoltagePhaseB is not supported, please check the configuration", + e.acVoltagePerPhase[model.ElectricalConnectionPhaseNameTypeB], + measurementData( + voltagePhaseB, + timestamp, + e.voltageConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeB], + valueState, + nil, + nil, + ), + ) +} + +// use MPC.UpdateDataVoltagePhaseC in MPC.Update to set the phase specific voltage details +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataVoltagePhaseC( + voltagePhaseC float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + // validate first if voltage is supported + if e.voltageConfig == nil { + return newUpdateData( + "acVoltage is not supported, please check the configuration", + nil, + nil, + ) + } + return newUpdateData( + "acVoltagePhaseC is not supported, please check the configuration", + e.acVoltagePerPhase[model.ElectricalConnectionPhaseNameTypeC], + measurementData( + voltagePhaseC, + timestamp, + e.voltageConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeC], + valueState, + nil, + nil, + ), + ) +} + +// use MPC.UpdateDataVoltagePhaseAToB in MPC.Update to set the phase specific voltage details +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataVoltagePhaseAToB( + voltagePhaseAToB float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + // validate first if voltage is supported + if e.voltageConfig == nil { + return newUpdateData( + "acVoltage is not supported, please check the configuration", + nil, + nil, + ) + } + return newUpdateData( + "acVoltagePhaseAToB is not supported, please check the configuration", + e.acVoltagePerPhase[model.ElectricalConnectionPhaseNameTypeAb], + measurementData( + voltagePhaseAToB, + timestamp, + e.voltageConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeAb], + valueState, + nil, + nil, + ), + ) +} + +// use MPC.UpdateDataVoltagePhaseBToC in MPC.Update to set the phase specific voltage details +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataVoltagePhaseBToC( + voltagePhaseBToC float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + // validate first if voltage is supported + if e.voltageConfig == nil { + return newUpdateData( + "acVoltage is not supported, please check the configuration", + nil, + nil, + ) + } + return newUpdateData( + "acVoltagePhaseBToC is not supported, please check the configuration", + e.acVoltagePerPhase[model.ElectricalConnectionPhaseNameTypeBc], + measurementData( + voltagePhaseBToC, + timestamp, + e.voltageConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeBc], + valueState, + nil, + nil, + ), + ) +} + +// use MPC.UpdateDataVoltagePhaseCToA in MPC.Update to set the phase specific voltage details +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataVoltagePhaseAToC( + voltagePhaseCToA float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + // validate first if voltage is supported + if e.voltageConfig == nil { + return newUpdateData( + "acVoltage is not supported, please check the configuration", + nil, + nil, + ) + } + return newUpdateData( + "acVoltagePhaseCToA is not supported, please check the configuration", + e.acVoltagePerPhase[model.ElectricalConnectionPhaseNameTypeAc], + measurementData( + voltagePhaseCToA, + timestamp, + e.voltageConfig.ValueSourcePerPhase[model.ElectricalConnectionPhaseNameTypeAc], + valueState, + nil, + nil, + ), + ) +} + +// Scenario 5 + +// use MPC.UpdateDataFrequency in MPC.Update to set the frequency +// The timestamp is optional and can be nil +// The valueState shall be set if it differs from the normal valueState otherwise it can be nil +func (e *MPC) UpdateDataFrequency( + frequency float64, + timestamp *time.Time, + valueState *model.MeasurementValueStateType, +) usecaseapi.UpdateMeasurementData { + // Validate first if frequency is supported + if e.frequencyConfig == nil { + return newUpdateData( + "acFrequency is not supported, please check the configuration", + e.acFrequency, + nil, + ) + } + return newUpdateData( + "acFrequency is not supported, please check the configuration", + e.acFrequency, + measurementData( + frequency, + timestamp, + e.frequencyConfig.ValueSource, + valueState, + nil, + nil, + ), + ) +} diff --git a/usecases/mu/mpc/public_abc_test.go b/usecases/mu/mpc/public_abc_test.go new file mode 100644 index 00000000..14a8ed30 --- /dev/null +++ b/usecases/mu/mpc/public_abc_test.go @@ -0,0 +1,255 @@ +package mpc + +import ( + "testing" + "time" + + "github.com/enbility/eebus-go/features/server" + ucapi "github.com/enbility/eebus-go/usecases/api" + "github.com/enbility/spine-go/model" + "github.com/enbility/spine-go/util" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" +) + +type MuMpcAbcSuite struct { + suite.Suite + *MuMPCSuite +} + +// Test suite testing an MPC MonitoredUnit that supports 3-phase metering (phases ABC) +func TestMuMpcAbcSuite(t *testing.T) { + suite.Run(t, new(MuMpcAbcSuite)) +} + +func (s *MuMpcAbcSuite) BeforeTest(suiteName, testName string) { + s.MuMPCSuite = NewMuMPCSuite( + &s.Suite, + &MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeAbc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + }, + &MonitorEnergyConfig{ + ValueSourceProduction: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueConstraintsProduction: util.Ptr(model.MeasurementConstraintsDataType{ + ValueRangeMin: model.NewScaledNumberType(0), + ValueStepSize: model.NewScaledNumberType(0.001), + }), + ValueSourceConsumption: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + &MonitorCurrentConfig{ + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + }, + &MonitorVoltageConfig{ + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeAb: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeBc: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeAc: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + }, + &MonitorFrequencyConfig{ + ValueSource: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueConstraints: util.Ptr(model.MeasurementConstraintsDataType{ + ValueRangeMin: model.NewScaledNumberType(0), + ValueRangeMax: model.NewScaledNumberType(100), + ValueStepSize: model.NewScaledNumberType(1), + }), + }, + ) + s.MuMPCSuite.BeforeTest(suiteName, testName) +} + +func (s *MuMpcAbcSuite) Test_Power() { + err := s.sut.Update( + s.sut.UpdateDataPowerTotal(5.0, util.Ptr(time.Now()), nil), + ) + assert.Nil(s.T(), err) + + power, err := s.sut.Power() + assert.Nil(s.T(), err) + assert.Equal(s.T(), 5.0, power) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypePower), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACPowerTotal), + } + values, err := s.measurementPhaseSpecificDataForFilter(filter, model.EnergyDirectionTypeConsume, nil) + assert.Nil(s.T(), err) + assert.Equal(s.T(), []float64{5.0}, values) +} + +func (s *MuMpcAbcSuite) Test_PowerPerPhase() { + err := s.sut.Update( + s.sut.UpdateDataPowerPhaseA(5.0, util.Ptr(time.Now()), nil), + s.sut.UpdateDataPowerPhaseB(6.0, util.Ptr(time.Now()), nil), + s.sut.UpdateDataPowerPhaseC(7.0, util.Ptr(time.Now()), util.Ptr(model.MeasurementValueStateTypeError)), + ) + assert.Nil(s.T(), err) + expectedPowerPerPhases := map[model.ElectricalConnectionPhaseNameType]float64{ + model.ElectricalConnectionPhaseNameTypeA: 5.0, + model.ElectricalConnectionPhaseNameTypeB: 6.0, + model.ElectricalConnectionPhaseNameTypeC: 7.0, + } + + powerPerPhases, err := s.sut.PowerPerPhase() + assert.Nil(s.T(), err) + assert.Equal(s.T(), expectedPowerPerPhases, powerPerPhases) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypePower), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACPower), + } + values, err := s.measurementPhaseSpecificDataForFilter(filter, model.EnergyDirectionTypeConsume, ucapi.PhaseNameMapping) + assert.Nil(s.T(), err) + assert.ElementsMatch(s.T(), []float64{5.0, 6.0, 7.0}, values) +} + +func (s *MuMpcAbcSuite) Test_EnergyConsumed() { + err := s.sut.Update( + s.sut.UpdateDataEnergyConsumed(5.0, util.Ptr(time.Now()), nil, util.Ptr(time.Now()), util.Ptr(time.Now())), + ) + assert.Nil(s.T(), err) + + energyConsumed, err := s.sut.EnergyConsumed() + assert.Nil(s.T(), err) + assert.Equal(s.T(), 5.0, energyConsumed) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeEnergy), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACEnergyConsumed), + } + measurement, err := server.NewMeasurement(s.sut.LocalEntity) + assert.Nil(s.T(), err) + values, err := measurement.GetDataForFilter(filter) + assert.Nil(s.T(), err) + assert.Equal(s.T(), 1, len(values)) + assert.Equal(s.T(), 5.0, (*values[0].Value).GetValue()) +} + +func (s *MuMpcAbcSuite) Test_EnergyProduced() { + err := s.sut.Update( + s.sut.UpdateDataEnergyProduced(5.0, nil, nil, nil, nil), + ) + assert.Nil(s.T(), err) + + energyProduced, err := s.sut.EnergyProduced() + assert.Nil(s.T(), err) + assert.Equal(s.T(), 5.0, energyProduced) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeEnergy), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACEnergyProduced), + } + measurement, err := server.NewMeasurement(s.sut.LocalEntity) + assert.Nil(s.T(), err) + values, err := measurement.GetDataForFilter(filter) + assert.Nil(s.T(), err) + assert.Equal(s.T(), 1, len(values)) + assert.Equal(s.T(), 5.0, (*values[0].Value).GetValue()) +} + +func (s *MuMpcAbcSuite) Test_CurrentPerPhase() { + err := s.sut.Update( + s.sut.UpdateDataCurrentPhaseA(5.0, nil, nil), + s.sut.UpdateDataCurrentPhaseB(3.0, nil, nil), + s.sut.UpdateDataCurrentPhaseC(1.0, nil, nil), + ) + assert.Nil(s.T(), err) + expectedCurrentPerPhases := map[model.ElectricalConnectionPhaseNameType]float64{ + model.ElectricalConnectionPhaseNameTypeA: 5.0, + model.ElectricalConnectionPhaseNameTypeB: 3.0, + model.ElectricalConnectionPhaseNameTypeC: 1.0, + } + + currentPerPhases, err := s.sut.CurrentPerPhase() + assert.Nil(s.T(), err) + assert.Equal(s.T(), expectedCurrentPerPhases, currentPerPhases) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeCurrent), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACCurrent), + } + values, err := s.measurementPhaseSpecificDataForFilter(filter, model.EnergyDirectionTypeConsume, ucapi.PhaseNameMapping) + assert.Nil(s.T(), err) + assert.ElementsMatch(s.T(), []float64{5.0, 3.0, 1.0}, values) +} + +func (s *MuMpcAbcSuite) Test_VoltagePerPhase() { + err := s.sut.Update( + s.sut.UpdateDataVoltagePhaseA(5.0, nil, nil), + s.sut.UpdateDataVoltagePhaseB(6.0, nil, nil), + s.sut.UpdateDataVoltagePhaseC(7.0, nil, nil), + s.sut.UpdateDataVoltagePhaseAToB(8.0, nil, nil), + s.sut.UpdateDataVoltagePhaseBToC(9.0, nil, nil), + s.sut.UpdateDataVoltagePhaseAToC(10.0, nil, nil), + ) + assert.Nil(s.T(), err) + expectedVoltagePerPhases := map[model.ElectricalConnectionPhaseNameType]float64{ + model.ElectricalConnectionPhaseNameTypeA: 5.0, + model.ElectricalConnectionPhaseNameTypeB: 6.0, + model.ElectricalConnectionPhaseNameTypeC: 7.0, + model.ElectricalConnectionPhaseNameTypeAb: 8.0, + model.ElectricalConnectionPhaseNameTypeBc: 9.0, + model.ElectricalConnectionPhaseNameTypeAc: 10.0, + } + + voltagePerPhases, err := s.sut.VoltagePerPhase() + assert.Nil(s.T(), err) + assert.Equal(s.T(), expectedVoltagePerPhases, voltagePerPhases) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeVoltage), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACVoltage), + } + values, err := s.measurementPhaseSpecificDataForFilter(filter, "", ucapi.PhaseNameMapping) + assert.Nil(s.T(), err) + assert.ElementsMatch(s.T(), []float64{5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, values) +} + +func (s *MuMpcAbcSuite) Test_Frequency() { + err := s.sut.Update( + s.sut.UpdateDataFrequency(5.0, nil, nil), + ) + assert.Nil(s.T(), err) + + frequency, err := s.sut.Frequency() + assert.Nil(s.T(), err) + assert.Equal(s.T(), 5.0, frequency) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeFrequency), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACFrequency), + } + measurements, err := server.NewMeasurement(s.sut.LocalEntity) + assert.Nil(s.T(), err) + values, err := measurements.GetDataForFilter(filter) + assert.Nil(s.T(), err) + assert.Equal(s.T(), 1, len(values)) + assert.Equal(s.T(), 5.0, (*values[0].Value).GetValue()) +} diff --git a/usecases/mu/mpc/public_bc_test.go b/usecases/mu/mpc/public_bc_test.go new file mode 100644 index 00000000..6965aae7 --- /dev/null +++ b/usecases/mu/mpc/public_bc_test.go @@ -0,0 +1,201 @@ +package mpc + +import ( + "testing" + "time" + + ucapi "github.com/enbility/eebus-go/usecases/api" + "github.com/enbility/spine-go/model" + "github.com/enbility/spine-go/util" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" +) + +type MuMpcBcSuite struct { + suite.Suite + *MuMPCSuite +} + +// Test suite testing an MPC MonitoredUnit that supports metering for 2 phases (phases AB) +func TestMuMpcAbSuite(t *testing.T) { + suite.Run(t, new(MuMpcBcSuite)) +} + +func (s *MuMpcBcSuite) BeforeTest(suiteName, testName string) { + s.MuMPCSuite = NewMuMPCSuite( + &s.Suite, + &MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeBc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + }, + &MonitorEnergyConfig{ + ValueSourceProduction: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourceConsumption: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + &MonitorCurrentConfig{ + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + }, + &MonitorVoltageConfig{ + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeBc: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + }, + &MonitorFrequencyConfig{ + ValueSource: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueConstraints: util.Ptr(model.MeasurementConstraintsDataType{ + ValueRangeMin: model.NewScaledNumberType(0), + ValueRangeMax: model.NewScaledNumberType(100), + ValueStepSize: model.NewScaledNumberType(1), + }), + }, + ) + s.MuMPCSuite.BeforeTest(suiteName, testName) +} + +func (s *MuMpcBcSuite) Test_Power() { + err := s.sut.Update( + s.sut.UpdateDataPowerTotal(5.0, util.Ptr(time.Now()), nil), + ) + assert.Nil(s.T(), err) + + power, err := s.sut.Power() + assert.Nil(s.T(), err) + assert.Equal(s.T(), 5.0, power) +} + +func (s *MuMpcBcSuite) Test_PowerPerPhase() { + err := s.sut.Update( + s.sut.UpdateDataPowerPhaseB(6.0, util.Ptr(time.Now()), nil), + s.sut.UpdateDataPowerPhaseC(7.0, util.Ptr(time.Now()), util.Ptr(model.MeasurementValueStateTypeError)), + ) + assert.Nil(s.T(), err) + expectedPowerPerPhase := map[model.ElectricalConnectionPhaseNameType]float64{ + model.ElectricalConnectionPhaseNameTypeB: 6.0, + model.ElectricalConnectionPhaseNameTypeC: 7.0, + } + + powerPerPhases, err := s.sut.PowerPerPhase() + assert.Nil(s.T(), err) + assert.Equal(s.T(), expectedPowerPerPhase, powerPerPhases) + + err = s.sut.Update( + s.sut.UpdateDataPowerPhaseA(5.0, util.Ptr(time.Now()), nil), + ) + assert.NotNil(s.T(), err) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypePower), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACPower), + } + values, err := s.measurementPhaseSpecificDataForFilter(filter, model.EnergyDirectionTypeConsume, ucapi.PhaseNameMapping) + assert.Nil(s.T(), err) + assert.ElementsMatch(s.T(), []float64{6.0, 7.0}, values) +} + +func (s *MuMpcBcSuite) Test_EnergyConsumed() { + err := s.sut.Update( + s.sut.UpdateDataEnergyConsumed(5.0, util.Ptr(time.Now()), nil, util.Ptr(time.Now()), util.Ptr(time.Now())), + ) + assert.Nil(s.T(), err) + + energyConsumed, err := s.sut.EnergyConsumed() + assert.Nil(s.T(), err) + assert.Equal(s.T(), 5.0, energyConsumed) +} + +func (s *MuMpcBcSuite) Test_EnergyProduced() { + err := s.sut.Update( + s.sut.UpdateDataEnergyProduced(5.0, nil, nil, nil, nil), + ) + assert.Nil(s.T(), err) + + energyProduced, err := s.sut.EnergyProduced() + assert.Nil(s.T(), err) + assert.Equal(s.T(), 5.0, energyProduced) +} + +func (s *MuMpcBcSuite) Test_CurrentPerPhase() { + err := s.sut.Update( + s.sut.UpdateDataCurrentPhaseB(3.0, nil, nil), + s.sut.UpdateDataCurrentPhaseC(1.0, nil, nil), + ) + assert.Nil(s.T(), err) + expectedCurrentPerPhases := map[model.ElectricalConnectionPhaseNameType]float64{ + model.ElectricalConnectionPhaseNameTypeB: 3.0, + model.ElectricalConnectionPhaseNameTypeC: 1.0, + } + + currentPerPhases, err := s.sut.CurrentPerPhase() + assert.Nil(s.T(), err) + assert.Equal(s.T(), expectedCurrentPerPhases, currentPerPhases) + + err = s.sut.Update( + s.sut.UpdateDataCurrentPhaseA(5.0, nil, nil), + ) + assert.NotNil(s.T(), err) +} + +func (s *MuMpcBcSuite) Test_VoltagePerPhase() { + err := s.sut.Update( + s.sut.UpdateDataVoltagePhaseB(6.0, nil, nil), + s.sut.UpdateDataVoltagePhaseC(7.0, nil, nil), + s.sut.UpdateDataVoltagePhaseBToC(9.0, nil, nil), + ) + assert.Nil(s.T(), err) + expectedVoltagePerPhases := map[model.ElectricalConnectionPhaseNameType]float64{ + model.ElectricalConnectionPhaseNameTypeB: 6.0, + model.ElectricalConnectionPhaseNameTypeC: 7.0, + model.ElectricalConnectionPhaseNameTypeBc: 9.0, + } + + voltagePerPhases, err := s.sut.VoltagePerPhase() + assert.Nil(s.T(), err) + assert.Equal(s.T(), expectedVoltagePerPhases, voltagePerPhases) + + err = s.sut.Update( + s.sut.UpdateDataVoltagePhaseA(5.0, nil, nil), + ) + assert.NotNil(s.T(), err) + + err = s.sut.Update( + s.sut.UpdateDataVoltagePhaseAToB(5.0, nil, nil), + ) + assert.NotNil(s.T(), err) + + err = s.sut.Update( + s.sut.UpdateDataVoltagePhaseAToC(5.0, nil, nil), + ) + assert.NotNil(s.T(), err) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeVoltage), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACVoltage), + } + values, err := s.measurementPhaseSpecificDataForFilter(filter, "", ucapi.PhaseNameMapping) + assert.Nil(s.T(), err) + assert.ElementsMatch(s.T(), []float64{6.0, 7.0, 9.0}, values) +} + +func (s *MuMpcBcSuite) Test_Frequency() { + err := s.sut.Update( + s.sut.UpdateDataFrequency(5.0, nil, nil), + ) + assert.Nil(s.T(), err) + + frequency, err := s.sut.Frequency() + assert.Nil(s.T(), err) + assert.Equal(s.T(), 5.0, frequency) +} diff --git a/usecases/mu/mpc/public_constraint_test.go b/usecases/mu/mpc/public_constraint_test.go new file mode 100644 index 00000000..16e286dd --- /dev/null +++ b/usecases/mu/mpc/public_constraint_test.go @@ -0,0 +1,428 @@ +package mpc + +import ( + "testing" + "time" + + "github.com/enbility/eebus-go/features/server" + ucapi "github.com/enbility/eebus-go/usecases/api" + "github.com/enbility/spine-go/model" + "github.com/enbility/spine-go/util" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" +) + +type MuMpcConstraintSuite struct { + suite.Suite + *MuMPCSuite +} + +// Test suite testing an MPC MonitoredUnit that uses ValueConstraints on its measurements +func TestMuMpcConstraintSuite(t *testing.T) { + suite.Run(t, new(MuMpcConstraintSuite)) +} + +func (s *MuMpcConstraintSuite) BeforeTest(suiteName, testName string) { + s.MuMPCSuite = NewMuMPCSuite( + &s.Suite, + &MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeA, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + ValueConstraintsTotal: util.Ptr(model.MeasurementConstraintsDataType{ + ValueRangeMin: model.NewScaledNumberType(0), + ValueStepSize: model.NewScaledNumberType(0.1), + }), + ValueConstraintsPerPhase: PhaseMeasurementConstraintsMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementConstraintsDataType{ + ValueRangeMin: model.NewScaledNumberType(0), + ValueStepSize: model.NewScaledNumberType(0.1), + }), + }, + }, + &MonitorEnergyConfig{ + ValueSourceConsumption: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueConstraintsConsumption: util.Ptr(model.MeasurementConstraintsDataType{ + ValueRangeMin: model.NewScaledNumberType(0), + ValueStepSize: model.NewScaledNumberType(100), + }), + }, + &MonitorCurrentConfig{ + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + ValueConstraintsPerPhase: PhaseMeasurementConstraintsMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementConstraintsDataType{ + ValueRangeMin: model.NewScaledNumberType(0), + ValueRangeMax: model.NewScaledNumberType(32), + ValueStepSize: model.NewScaledNumberType(0.1), + }), + }, + }, + &MonitorVoltageConfig{ + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + ValueConstraintsPerPhase: PhaseMeasurementConstraintsMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementConstraintsDataType{ + ValueStepSize: model.NewScaledNumberType(0.1), + }), + }, + }, + &MonitorFrequencyConfig{ + ValueSource: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueConstraints: util.Ptr(model.MeasurementConstraintsDataType{ + ValueRangeMin: model.NewScaledNumberType(40), + ValueRangeMax: model.NewScaledNumberType(60), + ValueStepSize: model.NewScaledNumberType(0.01), + }), + }, + ) + s.MuMPCSuite.BeforeTest(suiteName, testName) +} + +func (s *MuMpcConstraintSuite) Test_Power() { + // Test when getMeasurementId returns error + { + _, err := s.sut.Power() + assert.Error(s.T(), err) + } + + // Testing updating the power total and read this update + { + err := s.sut.Update( + s.sut.UpdateDataPowerTotal(5.7, util.Ptr(time.Now()), nil), + ) + assert.Nil(s.T(), err) + + power, err := s.sut.Power() + expectedPowerValue := 5.7 + assert.Nil(s.T(), err) + assert.Equal(s.T(), expectedPowerValue, power) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypePower), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACPowerTotal), + } + values, err := s.measurementPhaseSpecificDataForFilter(filter, model.EnergyDirectionTypeConsume, nil) + assert.Nil(s.T(), err) + assert.Equal(s.T(), []float64{5.7}, values) + } +} + +func (s *MuMpcConstraintSuite) Test_PowerPerPhase() { + // Test when getMeasurementId returns error + { + _, err := s.sut.PowerPerPhase() + assert.Error(s.T(), err) + } + + // Test when updating power power per phase and read this update + { + err := s.sut.Update( + s.sut.UpdateDataPowerPhaseA(5.7, util.Ptr(time.Now()), nil), + ) + expectedPowerPerPhases := map[model.ElectricalConnectionPhaseNameType]float64{ + model.ElectricalConnectionPhaseNameTypeA: 5.7, + } + assert.Nil(s.T(), err) + + powerPerPhases, err := s.sut.PowerPerPhase() + assert.Nil(s.T(), err) + assert.Equal(s.T(), expectedPowerPerPhases, powerPerPhases) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypePower), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACPower), + } + values, err := s.measurementPhaseSpecificDataForFilter(filter, model.EnergyDirectionTypeConsume, ucapi.PhaseNameMapping) + assert.Nil(s.T(), err) + assert.Equal(s.T(), []float64{5.7}, values) + } + + // Test updating the energy consumed when it is not supported + { + mpcInstance, err := NewMPC(s.sut.LocalEntity, s.Event, s.powerConfig, nil, s.currentConfig, s.voltageConfig, s.frequencyConfig) + assert.Nil(s.T(), err) + assert.NotNil(s.T(), mpcInstance) + + err = mpcInstance.AddFeatures() + assert.Nil(s.T(), err) + mpcInstance.AddUseCase() + + err = mpcInstance.Update( + mpcInstance.UpdateDataEnergyConsumed(100, nil, nil, nil, nil), + ) + assert.Error(s.T(), err) + } +} + +func (s *MuMpcConstraintSuite) Test_EnergyConsumed() { + // Test when getMeasurementId returns error + { + _, err := s.sut.EnergyConsumed() + assert.Error(s.T(), err) + } + + // Test when acEnergyConsumed has no measurement id + { + mpcInstance, err := NewMPC(s.sut.LocalEntity, s.Event, s.powerConfig, s.energyConfig, s.currentConfig, s.voltageConfig, s.frequencyConfig) + assert.Nil(s.T(), err) + assert.NotNil(s.T(), mpcInstance) + + err = mpcInstance.AddFeatures() + assert.Nil(s.T(), err) + mpcInstance.AddUseCase() + + mpcInstance.acEnergyConsumed = nil + _, err = mpcInstance.EnergyConsumed() + assert.Error(s.T(), err) + } + + // Test when updating the energy consumed and get this update + { + err := s.sut.Update( + s.sut.UpdateDataEnergyConsumed(570, util.Ptr(time.Now()), nil, util.Ptr(time.Now()), util.Ptr(time.Now())), + ) + assert.Nil(s.T(), err) + + energyConsumed, err := s.sut.EnergyConsumed() + assert.Nil(s.T(), err) + assert.Equal(s.T(), 570.0, energyConsumed) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeEnergy), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACEnergyConsumed), + } + measurement, err := server.NewMeasurement(s.sut.LocalEntity) + assert.Nil(s.T(), err) + values, err := measurement.GetDataForFilter(filter) + assert.Nil(s.T(), err) + assert.Equal(s.T(), 1, len(values)) + assert.Equal(s.T(), 570.0, (*values[0].Value).GetValue()) + } +} + +func (s *MuMpcConstraintSuite) Test_EnergyProduced() { + // Test when getMeasurementId returns error + { + _, err := s.sut.EnergyProduced() + assert.Error(s.T(), err) + } + + // Test when updating the energy produced and read this update + { + err := s.sut.Update( + s.sut.UpdateDataEnergyProduced(5.0, nil, nil, nil, nil), + ) + assert.NotNil(s.T(), err) + + _, err = s.sut.EnergyProduced() + assert.NotNil(s.T(), err) + + // Check if the client filter works (it shouldn't) + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeEnergy), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACEnergyProduced), + } + measurement, err := server.NewMeasurement(s.sut.LocalEntity) + assert.Nil(s.T(), err) + _, err = measurement.GetDataForFilter(filter) + assert.NotNil(s.T(), err) + } + + // Test updating the energy produced when it is not supported + { + mpcInstance, err := NewMPC(s.sut.LocalEntity, s.Event, s.powerConfig, nil, s.currentConfig, s.voltageConfig, s.frequencyConfig) + assert.Nil(s.T(), err) + assert.NotNil(s.T(), mpcInstance) + + err = mpcInstance.AddFeatures() + assert.Nil(s.T(), err) + mpcInstance.AddUseCase() + + err = mpcInstance.Update( + mpcInstance.UpdateDataEnergyProduced(100, nil, nil, nil, nil), + ) + assert.Error(s.T(), err) + } +} + +func (s *MuMpcConstraintSuite) Test_CurrentPerPhase() { + // Test when getMeasurementId returns error + { + _, err := s.sut.CurrentPerPhase() + assert.Error(s.T(), err) + } + + // Test when updating the current per phase and read this update + { + err := s.sut.Update( + s.sut.UpdateDataCurrentPhaseA(0.1, nil, nil), + ) + assert.Nil(s.T(), err) + expectedCurrentPerPhases := map[model.ElectricalConnectionPhaseNameType]float64{ + model.ElectricalConnectionPhaseNameTypeA: 0.1, + } + + currentPerPhases, err := s.sut.CurrentPerPhase() + assert.Nil(s.T(), err) + assert.Equal(s.T(), expectedCurrentPerPhases, currentPerPhases) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeCurrent), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACCurrent), + } + values, err := s.measurementPhaseSpecificDataForFilter(filter, model.EnergyDirectionTypeConsume, ucapi.PhaseNameMapping) + assert.Nil(s.T(), err) + assert.Equal(s.T(), []float64{0.1}, values) + } + + // Test updating the current per phase when it is not supported + { + mpcInstance, err := NewMPC(s.sut.LocalEntity, s.Event, s.powerConfig, s.energyConfig, nil, s.voltageConfig, s.frequencyConfig) + assert.Nil(s.T(), err) + assert.NotNil(s.T(), mpcInstance) + + err = mpcInstance.AddFeatures() + assert.Nil(s.T(), err) + mpcInstance.AddUseCase() + + err = mpcInstance.Update( + mpcInstance.UpdateDataCurrentPhaseA(10, nil, nil), + mpcInstance.UpdateDataCurrentPhaseB(10, nil, nil), + mpcInstance.UpdateDataCurrentPhaseC(10, nil, nil), + ) + assert.Error(s.T(), err) + } +} + +func (s *MuMpcConstraintSuite) Test_VoltagePerPhase() { + // Test when getMeasurementId returns error + { + _, err := s.sut.VoltagePerPhase() + assert.Error(s.T(), err) + } + + // Test when updating the voltage per phase and read this update + { + err := s.sut.Update( + s.sut.UpdateDataVoltagePhaseA(230, nil, nil), + ) + assert.Nil(s.T(), err) + + expectedVoltagePerPhases := map[model.ElectricalConnectionPhaseNameType]float64{ + model.ElectricalConnectionPhaseNameTypeA: 230, + } + + voltagePerPhases, err := s.sut.VoltagePerPhase() + assert.Nil(s.T(), err) + assert.Equal(s.T(), expectedVoltagePerPhases, voltagePerPhases) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeVoltage), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACVoltage), + } + values, err := s.measurementPhaseSpecificDataForFilter(filter, "", ucapi.PhaseNameMapping) + assert.Nil(s.T(), err) + assert.Equal(s.T(), []float64{230}, values) + } + + // Test updating the voltage per phase when it is not supported + { + mpcInstance, err := NewMPC(s.sut.LocalEntity, s.Event, s.powerConfig, s.energyConfig, s.currentConfig, nil, s.frequencyConfig) + assert.Nil(s.T(), err) + assert.NotNil(s.T(), mpcInstance) + + err = mpcInstance.AddFeatures() + assert.Nil(s.T(), err) + mpcInstance.AddUseCase() + + err = mpcInstance.Update( + mpcInstance.UpdateDataVoltagePhaseA(230, nil, nil), + mpcInstance.UpdateDataVoltagePhaseB(230, nil, nil), + mpcInstance.UpdateDataVoltagePhaseC(230, nil, nil), + mpcInstance.UpdateDataVoltagePhaseAToB(0, nil, nil), + mpcInstance.UpdateDataVoltagePhaseBToC(0, nil, nil), + mpcInstance.UpdateDataVoltagePhaseAToC(0, nil, nil), + ) + assert.Error(s.T(), err) + } +} + +func (s *MuMpcConstraintSuite) Test_Frequency() { + // Test when getMeasurementId returns error + { + _, err := s.sut.Frequency() + assert.Error(s.T(), err) + } + + // Test when acFrequency has no measurement id + { + mpcInstance, err := NewMPC(s.sut.LocalEntity, s.Event, s.powerConfig, s.energyConfig, s.currentConfig, s.voltageConfig, s.frequencyConfig) + assert.Nil(s.T(), err) + assert.NotNil(s.T(), mpcInstance) + + err = mpcInstance.AddFeatures() + assert.Nil(s.T(), err) + mpcInstance.AddUseCase() + + mpcInstance.acFrequency = nil + _, err = mpcInstance.Frequency() + assert.Error(s.T(), err) + } + + // Test when updating the frequency and read this update + { + err := s.sut.Update( + s.sut.UpdateDataFrequency(50, nil, nil), + ) + assert.Nil(s.T(), err) + + frequency, err := s.sut.Frequency() + assert.Nil(s.T(), err) + assert.Equal(s.T(), 50.0, frequency) + + // Check if the client filter works + filter := model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeFrequency), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + ScopeType: util.Ptr(model.ScopeTypeTypeACFrequency), + } + measurements, err := server.NewMeasurement(s.sut.LocalEntity) + assert.Nil(s.T(), err) + values, err := measurements.GetDataForFilter(filter) + assert.Nil(s.T(), err) + assert.Equal(s.T(), 1, len(values)) + assert.Equal(s.T(), 50.0, (*values[0].Value).GetValue()) + } + + // Test covering updating frequency when it is not supported + { + mpcInstance, err := NewMPC(s.sut.LocalEntity, s.Event, s.powerConfig, s.energyConfig, s.currentConfig, s.voltageConfig, nil) + assert.Nil(s.T(), err) + assert.NotNil(s.T(), mpcInstance) + + err = mpcInstance.AddFeatures() + assert.Nil(s.T(), err) + mpcInstance.AddUseCase() + + err = mpcInstance.Update( + mpcInstance.UpdateDataFrequency(50, nil, nil), + ) + assert.Error(s.T(), err) + } +} diff --git a/usecases/mu/mpc/testhelper_test.go b/usecases/mu/mpc/testhelper_test.go new file mode 100644 index 00000000..2e503215 --- /dev/null +++ b/usecases/mu/mpc/testhelper_test.go @@ -0,0 +1,147 @@ +package mpc + +import ( + "slices" + "time" + + "github.com/enbility/eebus-go/features/server" + + "github.com/enbility/eebus-go/api" + "github.com/enbility/eebus-go/mocks" + "github.com/enbility/eebus-go/service" + shipapi "github.com/enbility/ship-go/api" + "github.com/enbility/ship-go/cert" + spineapi "github.com/enbility/spine-go/api" + "github.com/enbility/spine-go/model" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/suite" +) + +const remoteSki string = "testremoteski" + +type MuMPCSuite struct { + *suite.Suite + + powerConfig *MonitorPowerConfig + energyConfig *MonitorEnergyConfig + currentConfig *MonitorCurrentConfig + voltageConfig *MonitorVoltageConfig + frequencyConfig *MonitorFrequencyConfig + sut *MPC + + service api.ServiceInterface +} + +func NewMuMPCSuite( + suite *suite.Suite, + powerConfig *MonitorPowerConfig, + energyConfig *MonitorEnergyConfig, + currentConfig *MonitorCurrentConfig, + voltageConfig *MonitorVoltageConfig, + frequencyConfig *MonitorFrequencyConfig, +) *MuMPCSuite { + return &MuMPCSuite{ + Suite: suite, + powerConfig: powerConfig, + energyConfig: energyConfig, + currentConfig: currentConfig, + voltageConfig: voltageConfig, + frequencyConfig: frequencyConfig, + } +} + +func (s *MuMPCSuite) Event(_ string, _ spineapi.DeviceRemoteInterface, _ spineapi.EntityRemoteInterface, _ api.EventType) { +} + +func (s *MuMPCSuite) BeforeTest(_, _ string) { + cert, _ := cert.CreateCertificate("test", "test", "DE", "test") + configuration, _ := api.NewConfiguration( + "test", "test", "test", "test", + []shipapi.DeviceCategoryType{shipapi.DeviceCategoryTypeEnergyManagementSystem}, + model.DeviceTypeTypeEnergyManagementSystem, + []model.EntityTypeType{model.EntityTypeTypeInverter}, + 9999, cert, time.Second*4) + + serviceHandler := mocks.NewServiceReaderInterface(s.T()) + serviceHandler.EXPECT().ServicePairingDetailUpdate(mock.Anything, mock.Anything).Return().Maybe() + + s.service = service.NewService(configuration, serviceHandler) + _ = s.service.Setup() + + localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeInverter) + s.sut, _ = NewMPC( + localEntity, + s.Event, + s.powerConfig, + s.energyConfig, + s.currentConfig, + s.voltageConfig, + s.frequencyConfig, + ) + + assert.Nil(s.T(), s.sut.AddFeatures()) + s.sut.AddUseCase() +} + +func (s *MuMPCSuite) measurementPhaseSpecificDataForFilter( + measurementFilter model.MeasurementDescriptionDataType, + energyDirection model.EnergyDirectionType, + validPhaseNameTypes []model.ElectricalConnectionPhaseNameType, +) ([]float64, error) { + measurements, err := server.NewMeasurement(s.sut.LocalEntity) + if err != nil { + return nil, err + } + + electricalConnection, err := server.NewElectricalConnection(s.sut.LocalEntity) + if err != nil { + return nil, err + } + + data, err := measurements.GetDataForFilter(measurementFilter) + if err != nil || len(data) == 0 { + return nil, api.ErrDataNotAvailable + } + + var result []float64 + + for _, item := range data { + if item.Value == nil || item.MeasurementId == nil { + continue + } + + if validPhaseNameTypes != nil { + filter := model.ElectricalConnectionParameterDescriptionDataType{ + MeasurementId: item.MeasurementId, + } + param, err := electricalConnection.GetParameterDescriptionsForFilter(filter) + if err != nil || len(param) == 0 || + param[0].AcMeasuredPhases == nil || + !slices.Contains(validPhaseNameTypes, *param[0].AcMeasuredPhases) { + continue + } + } + + if energyDirection != "" { + filter := model.ElectricalConnectionParameterDescriptionDataType{ + MeasurementId: item.MeasurementId, + } + desc, err := electricalConnection.GetDescriptionForParameterDescriptionFilter(filter) + if err != nil || desc == nil { + continue + } + + // if energy direction is not consume + if desc.PositiveEnergyDirection == nil || *desc.PositiveEnergyDirection != energyDirection { + return nil, err + } + } + + value := item.Value.GetValue() + + result = append(result, value) + } + + return result, nil +} diff --git a/usecases/mu/mpc/types.go b/usecases/mu/mpc/types.go new file mode 100644 index 00000000..67f2d3f0 --- /dev/null +++ b/usecases/mu/mpc/types.go @@ -0,0 +1,10 @@ +package mpc + +import "github.com/enbility/eebus-go/api" + +const ( + // Update of the list of remote entities supporting the Use Case + // + // Use `RemoteEntities` to get the current data + UseCaseSupportUpdate api.EventType = "mu-mpc-UseCaseSupportUpdate" +) diff --git a/usecases/mu/mpc/update_helper.go b/usecases/mu/mpc/update_helper.go new file mode 100644 index 00000000..279f03bc --- /dev/null +++ b/usecases/mu/mpc/update_helper.go @@ -0,0 +1,77 @@ +package mpc + +import ( + "errors" + "github.com/enbility/eebus-go/api" + "github.com/enbility/spine-go/model" + "github.com/enbility/spine-go/util" + "time" +) + +type UpdateData struct { + supported bool + notSupportedError error + measurementData api.MeasurementDataForID +} + +func (u *UpdateData) Supported() bool { + return u.supported +} + +func (u *UpdateData) NotSupportedError() error { + return u.notSupportedError +} + +func (u *UpdateData) MeasurementData() api.MeasurementDataForID { + return u.measurementData +} + +func newUpdateData( + errorString string, + id *model.MeasurementIdType, + data *model.MeasurementDataType, +) *UpdateData { + if id == nil || data == nil { + return &UpdateData{ + supported: false, + notSupportedError: errors.New(errorString), + } + } else { + return &UpdateData{ + supported: true, + measurementData: api.MeasurementDataForID{ + Id: *id, + Data: *data, + }, + } + } +} + +func measurementData( + value float64, + timestamp *time.Time, + valueSource *model.MeasurementValueSourceType, + valueState *model.MeasurementValueStateType, + evaluationStart *time.Time, + evaluationEnd *time.Time, +) *model.MeasurementDataType { + measurement := model.MeasurementDataType{ + ValueType: util.Ptr(model.MeasurementValueTypeTypeValue), + Value: model.NewScaledNumberType(value), + ValueSource: valueSource, + ValueState: valueState, + } + + if timestamp != nil { + measurement.Timestamp = model.NewAbsoluteOrRelativeTimeTypeFromTime(*timestamp) + } + + if evaluationStart != nil && evaluationEnd != nil { + measurement.EvaluationPeriod = &model.TimePeriodType{ + StartTime: model.NewAbsoluteOrRelativeTimeTypeFromTime(*evaluationStart), + EndTime: model.NewAbsoluteOrRelativeTimeTypeFromTime(*evaluationEnd), + } + } + + return &measurement +} diff --git a/usecases/mu/mpc/usecase.go b/usecases/mu/mpc/usecase.go new file mode 100644 index 00000000..b4ffdca2 --- /dev/null +++ b/usecases/mu/mpc/usecase.go @@ -0,0 +1,530 @@ +package mpc + +import ( + "errors" + "fmt" + + "github.com/enbility/eebus-go/api" + "github.com/enbility/eebus-go/features/server" + "github.com/enbility/eebus-go/usecases/usecase" + spineapi "github.com/enbility/spine-go/api" + "github.com/enbility/spine-go/model" + "github.com/enbility/spine-go/spine" + "github.com/enbility/spine-go/util" +) + +type PhaseMeasurementIdMap map[model.ElectricalConnectionPhaseNameType]*model.MeasurementIdType + +type MPC struct { + *usecase.UseCaseBase + + powerConfig *MonitorPowerConfig + energyConfig *MonitorEnergyConfig + currentConfig *MonitorCurrentConfig + voltageConfig *MonitorVoltageConfig + frequencyConfig *MonitorFrequencyConfig + + acPowerTotal *model.MeasurementIdType + acPowerPerPhase PhaseMeasurementIdMap + acEnergyConsumed *model.MeasurementIdType + acEnergyProduced *model.MeasurementIdType + acCurrentPerPhase PhaseMeasurementIdMap + acVoltagePerPhase PhaseMeasurementIdMap + acFrequency *model.MeasurementIdType +} + +// creates a new MPC usecase instance for a MonitoredUnit entity +// +// parameters: +// - localEntity: the local entity for which to construct an MPC instance +// - eventCB: the callback to notify about events for this usecase +// - monitorPowerConfig: (required) configuration parameters for MPC scenario 1 +// - monitorEnergyConfig: (optional) configuration parameters for MPC scenario 2, nil if not supported +// - monitorCurrentConfig: (optional) configuration parameters for MPC scenario 3, nil if not supported +// - monitorVoltageConfig: (optional) configuration parameters for MPC scenario 4, nil if not supported +// - monitorFrequencyConfig: (optional) configuration parameters for MPC scenario, nil if not supported +// +// possible errors: +// - if required fields in parameters are unset +func NewMPC( + localEntity spineapi.EntityLocalInterface, + eventCB api.EntityEventCallback, + monitorPowerConfig *MonitorPowerConfig, + monitorEnergyConfig *MonitorEnergyConfig, + monitorCurrentConfig *MonitorCurrentConfig, + monitorVoltageConfig *MonitorVoltageConfig, + monitorFrequencyConfig *MonitorFrequencyConfig, +) (*MPC, error) { + if monitorPowerConfig == nil { + return nil, errors.New("the monitor power config for the MPC-Use-Case must not be nil") + } + + validActorTypes := []model.UseCaseActorType{model.UseCaseActorTypeMonitoringAppliance} + useCaseScenarios := []api.UseCaseScenario{ + { + Scenario: model.UseCaseScenarioSupportType(1), + Mandatory: true, + ServerFeatures: []model.FeatureTypeType{ + model.FeatureTypeTypeElectricalConnection, + model.FeatureTypeTypeMeasurement, + }, + }, + } + + if monitorEnergyConfig != nil { + useCaseScenarios = append(useCaseScenarios, api.UseCaseScenario{ + Scenario: model.UseCaseScenarioSupportType(2), + Mandatory: false, + ServerFeatures: []model.FeatureTypeType{ + model.FeatureTypeTypeElectricalConnection, + model.FeatureTypeTypeMeasurement, + }, + }) + } + + if monitorCurrentConfig != nil { + useCaseScenarios = append(useCaseScenarios, api.UseCaseScenario{ + Scenario: model.UseCaseScenarioSupportType(3), + Mandatory: false, + ServerFeatures: []model.FeatureTypeType{ + model.FeatureTypeTypeElectricalConnection, + model.FeatureTypeTypeMeasurement, + }, + }) + } + + if monitorVoltageConfig != nil { + useCaseScenarios = append(useCaseScenarios, api.UseCaseScenario{ + Scenario: model.UseCaseScenarioSupportType(4), + Mandatory: false, + ServerFeatures: []model.FeatureTypeType{ + model.FeatureTypeTypeElectricalConnection, + model.FeatureTypeTypeMeasurement, + }, + }) + } + + if monitorFrequencyConfig != nil { + useCaseScenarios = append(useCaseScenarios, api.UseCaseScenario{ + Scenario: model.UseCaseScenarioSupportType(5), + Mandatory: false, + ServerFeatures: []model.FeatureTypeType{ + model.FeatureTypeTypeElectricalConnection, + model.FeatureTypeTypeMeasurement, + }, + }) + } + + u := usecase.NewUseCaseBase( + localEntity, + model.UseCaseActorTypeMonitoredUnit, + model.UseCaseNameTypeMonitoringOfPowerConsumption, + "1.0.0", + "release", + useCaseScenarios, + eventCB, + UseCaseSupportUpdate, + validActorTypes, + nil, + true, + ) + + uc := &MPC{ + UseCaseBase: u, + powerConfig: monitorPowerConfig, + energyConfig: monitorEnergyConfig, + currentConfig: monitorCurrentConfig, + voltageConfig: monitorVoltageConfig, + frequencyConfig: monitorFrequencyConfig, + } + uc.acPowerPerPhase = PhaseMeasurementIdMap{} + uc.acCurrentPerPhase = PhaseMeasurementIdMap{} + uc.acVoltagePerPhase = PhaseMeasurementIdMap{} + + _ = spine.Events.Subscribe(uc) + + return uc, nil +} + +func (e *MPC) AddFeatures() error { + // server features + electricalConnectionFeature := e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer) + if electricalConnectionFeature == nil { + return errors.New("could not add feature: " + string(model.FeatureTypeTypeElectricalConnection)) + } + electricalConnectionFeature.AddFunctionType(model.FunctionTypeElectricalConnectionDescriptionListData, true, false) + electricalConnectionFeature.AddFunctionType(model.FunctionTypeElectricalConnectionParameterDescriptionListData, true, false) + + measurementFeature := e.LocalEntity.GetOrAddFeature(model.FeatureTypeTypeMeasurement, model.RoleTypeServer) + if measurementFeature == nil { + return errors.New("could not add feature: " + string(model.FeatureTypeTypeMeasurement)) + } + measurementFeature.AddFunctionType(model.FunctionTypeMeasurementDescriptionListData, true, false) + measurementFeature.AddFunctionType(model.FunctionTypeMeasurementConstraintsListData, true, false) + measurementFeature.AddFunctionType(model.FunctionTypeMeasurementListData, true, false) + + measurements, err := server.NewMeasurement(e.LocalEntity) + if err != nil { + return err + } + + electricalConnection, err := server.NewElectricalConnection(e.LocalEntity) + if err != nil { + return err + } + + electricalConnectionId, err := electricalConnection.GetOrAddIdForDescription(model.ElectricalConnectionDescriptionDataType{ + PowerSupplyType: util.Ptr(model.ElectricalConnectionVoltageTypeTypeAc), + PositiveEnergyDirection: util.Ptr(model.EnergyDirectionTypeConsume), + }) + if err != nil { + return err + } + + constraints := make([]model.MeasurementConstraintsDataType, 0) + + configMethods := []func( + measurements *server.Measurement, + electricalConnection api.ElectricalConnectionServerInterface, + electricalConnectionId *model.ElectricalConnectionIdType, + measurementsConstraintData *[]model.MeasurementConstraintsDataType, + ) error{ + e.configureMonitorPower, + e.configureMonitorEnergy, + e.configureMonitorCurrent, + e.configureMonitorVoltage, + e.configureMonitorFrequency, + } + + for _, configMethod := range configMethods { + if err := configMethod(measurements, electricalConnection, electricalConnectionId, &constraints); err != nil { + return err + } + } + + // if any of the configured measurements set constraints, update the + // measurementFeature with those accumulated constraints + if len(constraints) > 0 { + measurementFeature.UpdateData( + model.FunctionTypeMeasurementConstraintsListData, + &model.MeasurementConstraintsListDataType{ + MeasurementConstraintsData: constraints, + }, nil, nil, + ) + } + + return nil +} + +func (e *MPC) configureMonitorPower( + measurements *server.Measurement, + electricalConnection api.ElectricalConnectionServerInterface, + electricalConnectionId *model.ElectricalConnectionIdType, + measurementsConstraintData *[]model.MeasurementConstraintsDataType, +) error { + if e.powerConfig == nil { + return errors.New("mpc monitoring power must be configured") + } + + e.acPowerTotal = measurements.AddDescription(model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypePower), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + Unit: util.Ptr(model.UnitOfMeasurementTypeW), + ScopeType: util.Ptr(model.ScopeTypeTypeACPowerTotal), + }) + + // if constraints are configured for acPowerTotal, set the + // constraint id and update measurementsConstraintData + if e.powerConfig.ValueConstraintsTotal != nil { + e.powerConfig.ValueConstraintsTotal.MeasurementId = e.acPowerTotal + *measurementsConstraintData = append(*measurementsConstraintData, *e.powerConfig.ValueConstraintsTotal) + } + + parameterDescription := model.ElectricalConnectionParameterDescriptionDataType{ + ElectricalConnectionId: electricalConnectionId, + MeasurementId: e.acPowerTotal, + VoltageType: util.Ptr(model.ElectricalConnectionVoltageTypeTypeAc), + AcMeasuredPhases: util.Ptr(model.ElectricalConnectionPhaseNameType(e.powerConfig.ConnectedPhases)), + AcMeasuredInReferenceTo: util.Ptr(model.ElectricalConnectionPhaseNameTypeNeutral), + AcMeasurementType: util.Ptr(model.ElectricalConnectionAcMeasurementTypeTypeReal), + AcMeasurementVariant: util.Ptr(model.ElectricalConnectionMeasurandVariantTypeRms), + } + + parameterDescriptionId := electricalConnection.AddParameterDescription(parameterDescription) + if parameterDescriptionId == nil { + return errors.New("could not add parameter description") + } + + for phase := range e.powerConfig.ValueSourcePerPhase { + if !e.powerConfig.SupportsPhases([]string{string(phase)}) { + errStr := fmt.Sprintf("power configuration for phase %s is not supported, please check the configuration", phase) + return errors.New(errStr) + } + e.acPowerPerPhase[phase] = measurements.AddDescription(model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypePower), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + Unit: util.Ptr(model.UnitOfMeasurementTypeW), + ScopeType: util.Ptr(model.ScopeTypeTypeACPower), + }) + + parameterDescription := model.ElectricalConnectionParameterDescriptionDataType{ + ElectricalConnectionId: electricalConnectionId, + MeasurementId: e.acPowerPerPhase[phase], + VoltageType: util.Ptr(model.ElectricalConnectionVoltageTypeTypeAc), + AcMeasuredPhases: util.Ptr(phase), + AcMeasuredInReferenceTo: util.Ptr(model.ElectricalConnectionPhaseNameTypeNeutral), + AcMeasurementType: util.Ptr(model.ElectricalConnectionAcMeasurementTypeTypeReal), + AcMeasurementVariant: util.Ptr(model.ElectricalConnectionMeasurandVariantTypeRms), + } + parameterDescriptionId := electricalConnection.AddParameterDescription(parameterDescription) + if parameterDescriptionId == nil { + return errors.New("could not add parameter description") + } + + if e.powerConfig.ValueConstraintsPerPhase[phase] == nil { + continue + } + e.powerConfig.ValueConstraintsPerPhase[phase].MeasurementId = e.acPowerPerPhase[phase] + *measurementsConstraintData = append(*measurementsConstraintData, *e.powerConfig.ValueConstraintsPerPhase[phase]) + + } + + return nil +} + +func (e *MPC) configureMonitorEnergy( + measurements *server.Measurement, + electricalConnection api.ElectricalConnectionServerInterface, + electricalConnectionId *model.ElectricalConnectionIdType, + measurementsConstraintData *[]model.MeasurementConstraintsDataType, +) error { + if e.energyConfig == nil { + return nil + } + + if e.energyConfig.ValueSourceConsumption != nil { + e.acEnergyConsumed = measurements.AddDescription(model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeEnergy), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + Unit: util.Ptr(model.UnitOfMeasurementTypeWh), + ScopeType: util.Ptr(model.ScopeTypeTypeACEnergyConsumed), + }) + + // if constraints are configured for acEnergyConsumed, set the + // constraint id and update measurementsConstraintData + if e.energyConfig.ValueConstraintsConsumption != nil { + e.energyConfig.ValueConstraintsConsumption.MeasurementId = e.acEnergyConsumed + *measurementsConstraintData = append(*measurementsConstraintData, *e.energyConfig.ValueConstraintsConsumption) + } + + parameterDescription := model.ElectricalConnectionParameterDescriptionDataType{ + ElectricalConnectionId: electricalConnectionId, + MeasurementId: e.acEnergyConsumed, + VoltageType: util.Ptr(model.ElectricalConnectionVoltageTypeTypeAc), + AcMeasurementType: util.Ptr(model.ElectricalConnectionAcMeasurementTypeTypeReal), + } + + parameterDescriptionId := electricalConnection.AddParameterDescription(parameterDescription) + if parameterDescriptionId == nil { + return errors.New("could not add parameter description") + } + } + + if e.energyConfig.ValueSourceProduction != nil { + e.acEnergyProduced = measurements.AddDescription(model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeEnergy), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + Unit: util.Ptr(model.UnitOfMeasurementTypeWh), + ScopeType: util.Ptr(model.ScopeTypeTypeACEnergyProduced), + }) + + // if constraints are configured for acEnergyProduced, set the + // constraint id and update measurementsConstraintData + if e.energyConfig.ValueConstraintsProduction != nil { + e.energyConfig.ValueConstraintsProduction.MeasurementId = e.acEnergyProduced + *measurementsConstraintData = append(*measurementsConstraintData, *e.energyConfig.ValueConstraintsProduction) + } + + p4 := model.ElectricalConnectionParameterDescriptionDataType{ + ElectricalConnectionId: electricalConnectionId, + MeasurementId: e.acEnergyProduced, + VoltageType: util.Ptr(model.ElectricalConnectionVoltageTypeTypeAc), + AcMeasurementType: util.Ptr(model.ElectricalConnectionAcMeasurementTypeTypeReal), + } + idP4 := electricalConnection.AddParameterDescription(p4) + if idP4 == nil { + return errors.New("could not add parameter description") + } + } + + return nil +} + +func (e *MPC) configureMonitorCurrent( + measurements *server.Measurement, + electricalConnection api.ElectricalConnectionServerInterface, + electricalConnectionId *model.ElectricalConnectionIdType, + measurementsConstraintData *[]model.MeasurementConstraintsDataType, +) error { + if e.currentConfig == nil { + return nil + } + + for phase := range e.currentConfig.ValueSourcePerPhase { + if !e.powerConfig.SupportsPhases([]string{string(phase)}) { + errStr := fmt.Sprintf("power configuration for phase %s is not supported, please check the configuration", phase) + return errors.New(errStr) + } + e.acCurrentPerPhase[phase] = measurements.AddDescription(model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeCurrent), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + Unit: util.Ptr(model.UnitOfMeasurementTypeA), + ScopeType: util.Ptr(model.ScopeTypeTypeACCurrent), + }) + + parameterDescription := model.ElectricalConnectionParameterDescriptionDataType{ + ElectricalConnectionId: electricalConnectionId, + MeasurementId: e.acCurrentPerPhase[phase], + VoltageType: util.Ptr(model.ElectricalConnectionVoltageTypeTypeAc), + AcMeasuredPhases: util.Ptr(phase), + AcMeasurementType: util.Ptr(model.ElectricalConnectionAcMeasurementTypeTypeReal), + AcMeasurementVariant: util.Ptr(model.ElectricalConnectionMeasurandVariantTypeRms), + } + + parameterDescriptionId := electricalConnection.AddParameterDescription(parameterDescription) + if parameterDescriptionId == nil { + return errors.New("could not add parameter description") + } + + if e.currentConfig.ValueConstraintsPerPhase[phase] == nil { + continue + } + e.currentConfig.ValueConstraintsPerPhase[phase].MeasurementId = e.acCurrentPerPhase[phase] + *measurementsConstraintData = append(*measurementsConstraintData, *e.currentConfig.ValueConstraintsPerPhase[phase]) + + } + + return nil +} + +func (e *MPC) configureMonitorVoltage( + measurements *server.Measurement, + electricalConnection api.ElectricalConnectionServerInterface, + electricalConnectionId *model.ElectricalConnectionIdType, + measurementsConstraintData *[]model.MeasurementConstraintsDataType, +) error { + if e.voltageConfig == nil { + return nil + } + + for phase := range e.voltageConfig.ValueSourcePerPhase { + switch len(string(phase)) { + case 1: + if !e.powerConfig.SupportsPhases([]string{string(phase)}) { + errStr := fmt.Sprintf("power configuration for phase %s is not supported, please check the configuration", phase) + return errors.New(errStr) + } + case 2: + fromPhase := string(string(phase)[0]) + toPhase := string(string(phase)[1]) + if !e.powerConfig.SupportsPhases([]string{fromPhase, toPhase}) { + errStr := fmt.Sprintf("power configuration for phase %s is not supported, please check the configuration", phase) + return errors.New(errStr) + } + } + e.acVoltagePerPhase[phase] = measurements.AddDescription(model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeVoltage), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + Unit: util.Ptr(model.UnitOfMeasurementTypeV), + ScopeType: util.Ptr(model.ScopeTypeTypeACVoltage), + }) + parameterDescription := model.ElectricalConnectionParameterDescriptionDataType{} + + switch len(string(phase)) { + case 1: + parameterDescription = model.ElectricalConnectionParameterDescriptionDataType{ + ElectricalConnectionId: electricalConnectionId, + MeasurementId: e.acVoltagePerPhase[phase], + VoltageType: util.Ptr(model.ElectricalConnectionVoltageTypeTypeAc), + AcMeasuredPhases: util.Ptr(phase), + AcMeasuredInReferenceTo: util.Ptr(model.ElectricalConnectionPhaseNameTypeNeutral), + AcMeasurementType: util.Ptr(model.ElectricalConnectionAcMeasurementTypeTypeApparent), + AcMeasurementVariant: util.Ptr(model.ElectricalConnectionMeasurandVariantTypeRms), + } + case 2: + fromPhase := string(string(phase)[0]) + toPhase := string(string(phase)[1]) + parameterDescription = model.ElectricalConnectionParameterDescriptionDataType{ + ElectricalConnectionId: electricalConnectionId, + MeasurementId: e.acVoltagePerPhase[phase], + VoltageType: util.Ptr(model.ElectricalConnectionVoltageTypeTypeAc), + AcMeasuredPhases: util.Ptr(model.ElectricalConnectionPhaseNameType(fromPhase)), + AcMeasuredInReferenceTo: util.Ptr(model.ElectricalConnectionPhaseNameType(toPhase)), + AcMeasurementType: util.Ptr(model.ElectricalConnectionAcMeasurementTypeTypeApparent), + AcMeasurementVariant: util.Ptr(model.ElectricalConnectionMeasurandVariantTypeRms), + } + } + parameterDescriptionId := electricalConnection.AddParameterDescription(parameterDescription) + if parameterDescriptionId == nil { + return errors.New("could not add parameter description") + } + } + + return nil +} + +func (e *MPC) configureMonitorFrequency( + measurements *server.Measurement, + electricalConnection api.ElectricalConnectionServerInterface, + electricalConnectionId *model.ElectricalConnectionIdType, + measurementsConstraintData *[]model.MeasurementConstraintsDataType, +) error { + if e.frequencyConfig == nil { + return nil + } + + e.acFrequency = measurements.AddDescription(model.MeasurementDescriptionDataType{ + MeasurementType: util.Ptr(model.MeasurementTypeTypeFrequency), + CommodityType: util.Ptr(model.CommodityTypeTypeElectricity), + Unit: util.Ptr(model.UnitOfMeasurementTypeHz), + ScopeType: util.Ptr(model.ScopeTypeTypeACFrequency), + }) + + // if constraints are configured for acFrequency, set the + // constraint id and update measurementsConstraintData + if e.frequencyConfig.ValueConstraints != nil { + e.frequencyConfig.ValueConstraints.MeasurementId = e.acFrequency + *measurementsConstraintData = append(*measurementsConstraintData, *e.frequencyConfig.ValueConstraints) + } + + parameterDescription := model.ElectricalConnectionParameterDescriptionDataType{ + ElectricalConnectionId: electricalConnectionId, + MeasurementId: e.acFrequency, + VoltageType: util.Ptr(model.ElectricalConnectionVoltageTypeTypeAc), + } + + parameterDescriptionId := electricalConnection.AddParameterDescription(parameterDescription) + if parameterDescriptionId == nil { + return errors.New("could not add parameter description") + } + + return nil +} + +func (e *MPC) getMeasurementDataForId(id *model.MeasurementIdType) (float64, error) { + measurements, err := server.NewMeasurement(e.LocalEntity) + if err != nil { + return 0, err + } + + data, err := measurements.GetDataForId(*id) + if err != nil { + return 0, err + } + + if data == nil { + return 0, api.ErrDataNotAvailable + } + + return data.Value.GetValue(), nil +} diff --git a/usecases/mu/mpc/usecase_test.go b/usecases/mu/mpc/usecase_test.go new file mode 100644 index 00000000..85df088e --- /dev/null +++ b/usecases/mu/mpc/usecase_test.go @@ -0,0 +1,719 @@ +package mpc + +import ( + "errors" + "testing" + "time" + + "github.com/enbility/eebus-go/features/server" + spineMocks "github.com/enbility/spine-go/mocks" + + "github.com/enbility/eebus-go/api" + "github.com/enbility/eebus-go/mocks" + "github.com/enbility/eebus-go/service" + shipapi "github.com/enbility/ship-go/api" + "github.com/enbility/ship-go/cert" + spineapi "github.com/enbility/spine-go/api" + "github.com/enbility/spine-go/model" + "github.com/enbility/spine-go/util" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/suite" +) + +func TestBasicSuite(t *testing.T) { + suite.Run(t, new(MuMpcUsecaseSuite)) +} + +type MuMpcUsecaseSuite struct { + suite.Suite + + service api.ServiceInterface + mockedService *mocks.ServiceInterface + + localEntity spineapi.EntityLocalInterface + mockedLocalEntity *spineMocks.EntityLocalInterface + mockedLocalDevice *spineMocks.DeviceLocalInterface + mockedLocalFeature *spineMocks.FeatureLocalInterface + + mockedRemoteEntity *spineMocks.EntityRemoteInterface + mockedRemoteDevice *spineMocks.DeviceRemoteInterface + mockedRemoteFeature *spineMocks.FeatureRemoteInterface + + mockedElectricalConnectionFeature *mocks.ElectricalConnectionServerInterface +} + +func (s *MuMpcUsecaseSuite) Event(_ string, _ spineapi.DeviceRemoteInterface, _ spineapi.EntityRemoteInterface, _ api.EventType) { +} + +func (s *MuMpcUsecaseSuite) BeforeTest(_, _ string) { + cert, err := cert.CreateCertificate("test", "test", "DE", "test") + assert.Nil(s.T(), err) + configuration, _ := api.NewConfiguration( + "test", "test", "test", "test", + []shipapi.DeviceCategoryType{shipapi.DeviceCategoryTypeEnergyManagementSystem}, + model.DeviceTypeTypeEnergyManagementSystem, + []model.EntityTypeType{model.EntityTypeTypeInverter}, + 9999, cert, time.Second*4) + + serviceHandler := mocks.NewServiceReaderInterface(s.T()) + serviceHandler.EXPECT().ServicePairingDetailUpdate(mock.Anything, mock.Anything).Return().Maybe() + + s.service = service.NewService(configuration, serviceHandler) + err = s.service.Setup() + assert.Nil(s.T(), err) + + s.mockedRemoteDevice = spineMocks.NewDeviceRemoteInterface(s.T()) + s.mockedRemoteEntity = spineMocks.NewEntityRemoteInterface(s.T()) + s.mockedRemoteFeature = spineMocks.NewFeatureRemoteInterface(s.T()) + s.mockedRemoteDevice.EXPECT().FeatureByEntityTypeAndRole(mock.Anything, mock.Anything, mock.Anything).Return(s.mockedRemoteFeature).Maybe() + s.mockedRemoteDevice.EXPECT().Ski().Return(remoteSki).Maybe() + s.mockedRemoteEntity.EXPECT().Device().Return(s.mockedRemoteDevice).Maybe() + s.mockedRemoteEntity.EXPECT().EntityType().Return(mock.Anything).Maybe() + entityAddress := &model.EntityAddressType{} + s.mockedRemoteEntity.EXPECT().Address().Return(entityAddress).Maybe() + s.mockedRemoteFeature.EXPECT().DataCopy(mock.Anything).Return(mock.Anything).Maybe() + s.mockedRemoteFeature.EXPECT().Address().Return(&model.FeatureAddressType{}).Maybe() + s.mockedRemoteFeature.EXPECT().Operations().Return(nil).Maybe() +} + +func (s *MuMpcUsecaseSuite) Test_MpcOptionalParameters() { + localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeInverter) + + // required + var monitorPowerConfig = &MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeAbc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + } + + // the following 4 parameters are optional and can be nil + var monitorEnergyConfig = MonitorEnergyConfig{ + ValueSourceProduction: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourceConsumption: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + } + var monitorCurrentConfig = MonitorCurrentConfig{ + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + } + var monitorVoltageConfig = MonitorVoltageConfig{ + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeAb: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeBc: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeAc: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + } + var monitorFrequencyConfig = MonitorFrequencyConfig{ + ValueSource: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueConstraints: util.Ptr(model.MeasurementConstraintsDataType{ + ValueRangeMin: model.NewScaledNumberType(0), + ValueRangeMax: model.NewScaledNumberType(100), + ValueStepSize: model.NewScaledNumberType(1), + }), + } + + numOptionalParams := 4 + + // iterate over all permutations of nil/set + for i := 0; i < (1 << numOptionalParams); i++ { + // Determine which parameters to set + var optEnergyConfig *MonitorEnergyConfig + var optCurrentConfig *MonitorCurrentConfig + var optVoltageConfig *MonitorVoltageConfig + var optFrequencyConfig *MonitorFrequencyConfig + if i&1 != 0 { + optEnergyConfig = &monitorEnergyConfig + } + if i&2 != 0 { + optCurrentConfig = &monitorCurrentConfig + } + if i&4 != 0 { + optVoltageConfig = &monitorVoltageConfig + } + if i&8 != 0 { + optFrequencyConfig = &monitorFrequencyConfig + } + + mpc, err := NewMPC( + localEntity, + s.Event, + monitorPowerConfig, + optEnergyConfig, + optCurrentConfig, + optVoltageConfig, + optFrequencyConfig, + ) + + assert.Nil(s.T(), err) + + err = mpc.AddFeatures() + assert.Nil(s.T(), err) + mpc.AddUseCase() + } + + // test creating new mpc instance without power configuration + { + mpcInstance, err := NewMPC(s.localEntity, s.Event, nil, nil, nil, nil, nil) + expectedError := "the monitor power config for the MPC-Use-Case must not be nil" + assert.ErrorContains(s.T(), err, expectedError) + assert.Nil(s.T(), mpcInstance) + } +} + +func (s *MuMpcUsecaseSuite) Test_MpcRequredParametersError() { + localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeInverter) + + _, err := NewMPC( + localEntity, + s.Event, + nil, + nil, + nil, + nil, + nil, + ) + + assert.NotNil(s.T(), err) +} + +func (s *MuMpcUsecaseSuite) Test_getMeasurementDataForId() { + localEntity := s.service.LocalDevice().EntityForType(model.EntityTypeTypeInverter) + + monitorPowerConfig := MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeAbc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + } + + mpc, err := NewMPC( + localEntity, + s.Event, + &monitorPowerConfig, + nil, + nil, + nil, + nil, + ) + assert.Nil(s.T(), err) + + _, err = mpc.getMeasurementDataForId(mpc.acPowerTotal) + assert.NotNil(s.T(), err) + + err = mpc.AddFeatures() + assert.Nil(s.T(), err) + mpc.AddUseCase() + + _, err = mpc.getMeasurementDataForId(mpc.acPowerTotal) + assert.NotNil(s.T(), err) + + err = mpc.Update( + mpc.UpdateDataPowerTotal(5.0, util.Ptr(time.Now()), nil), + ) + assert.Nil(s.T(), err) + + measurementData, err := mpc.getMeasurementDataForId(mpc.acPowerTotal) + assert.Nil(s.T(), err) + assert.NotNil(s.T(), measurementData) +} + +func (s *MuMpcAbcSuite) Test_AddFeatures_ElectricalFeatureNilError() { + localEntity := spineMocks.NewEntityLocalInterface(s.T()) + s.sut.LocalEntity = localEntity + + localEntity.EXPECT().GetOrAddFeature(model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer).Return(nil) + err := s.sut.AddFeatures() + assert.NotNil(s.T(), err) +} + +func (s *MuMpcAbcSuite) Test_AddFeatures_MeasurementFeatureNilError() { + localEntity := spineMocks.NewEntityLocalInterface(s.T()) + s.sut.LocalEntity = localEntity + + anyFeature := spineMocks.NewFeatureLocalInterface(s.T()) + anyFeature.EXPECT().AddFunctionType(mock.Anything, mock.Anything, mock.Anything).Return() + + localEntity.EXPECT().GetOrAddFeature(model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer).Return(anyFeature) + localEntity.EXPECT().GetOrAddFeature(model.FeatureTypeTypeMeasurement, model.RoleTypeServer).Return(nil) + + err := s.sut.AddFeatures() + assert.NotNil(s.T(), err) +} + +func (s *MuMpcAbcSuite) Test_AddFeatures_NewMeasurementsError() { + localEntity := spineMocks.NewEntityLocalInterface(s.T()) + s.sut.LocalEntity = localEntity + + anyFeature := spineMocks.NewFeatureLocalInterface(s.T()) + anyFeature.EXPECT().AddFunctionType(mock.Anything, mock.Anything, mock.Anything).Return() + + localEntity.EXPECT().GetOrAddFeature(model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer).Return(anyFeature) + localEntity.EXPECT().GetOrAddFeature(model.FeatureTypeTypeMeasurement, model.RoleTypeServer).Return(anyFeature) + + localEntity.EXPECT().Device().Return(nil) + localEntity.EXPECT().FeatureOfTypeAndRole(model.FeatureTypeTypeMeasurement, model.RoleTypeServer).Return(nil) + + err := s.sut.AddFeatures() + assert.NotNil(s.T(), err) +} + +func (s *MuMpcAbcSuite) Test_AddFeatures_NewElectricalConnectionError() { + localEntity := spineMocks.NewEntityLocalInterface(s.T()) + s.sut.LocalEntity = localEntity + + anyFeature := spineMocks.NewFeatureLocalInterface(s.T()) + anyFeature.EXPECT().AddFunctionType(mock.Anything, mock.Anything, mock.Anything).Return() + + localEntity.EXPECT().GetOrAddFeature(model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer).Return(anyFeature) + localEntity.EXPECT().GetOrAddFeature(model.FeatureTypeTypeMeasurement, model.RoleTypeServer).Return(anyFeature) + + localEntity.EXPECT().Device().Return(nil) + localEntity.EXPECT().FeatureOfTypeAndRole(model.FeatureTypeTypeMeasurement, model.RoleTypeServer).Return(anyFeature) + localEntity.EXPECT().FeatureOfTypeAndRole(model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer).Return(nil) + + err := s.sut.AddFeatures() + assert.NotNil(s.T(), err) +} + +func (s *MuMpcUsecaseSuite) Test_configureMonitorPower() { + localEntity := spineMocks.NewEntityLocalInterface(s.T()) + localEntity.EXPECT().Device().Return(nil) + + anyFeature := spineMocks.NewFeatureLocalInterface(s.T()) + anyFeature.EXPECT().DataCopy(mock.Anything).Return(nil) + anyFeature.EXPECT().UpdateData(mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) + + localEntity.EXPECT().FeatureOfTypeAndRole(mock.Anything, mock.Anything).Return(anyFeature) + + monitorPowerConfig := MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeAbc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + } + + mpc, err := NewMPC( + localEntity, + s.Event, + &monitorPowerConfig, + nil, + nil, + nil, + nil, + ) + assert.Nil(s.T(), err) + + measurements, err := server.NewMeasurement(localEntity) + assert.Nil(s.T(), err) + + var electricalConnection api.ElectricalConnectionServerInterface + electricalConnection, err = server.NewElectricalConnection(localEntity) + assert.Nil(s.T(), err) + + electricalConnectionId := model.ElectricalConnectionIdType(111) + constraints := make([]model.MeasurementConstraintsDataType, 0) + + mpc.powerConfig = nil + err = mpc.configureMonitorPower( + measurements, + electricalConnection, + &electricalConnectionId, + &constraints, + ) + assert.NotNil(s.T(), err) // no monitorPowerConfig + + mpc.powerConfig = &monitorPowerConfig + electricalConnection = mocks.NewElectricalConnectionServerInterface(s.T()) + electricalConnection.(*mocks.ElectricalConnectionServerInterface).EXPECT().AddParameterDescription(mock.Anything).Return(nil) + + constellationsToCheck := []model.ElectricalConnectionPhaseNameType{ + model.ElectricalConnectionPhaseNameTypeA, + model.ElectricalConnectionPhaseNameTypeB, + model.ElectricalConnectionPhaseNameTypeC, + } + + for _, phaseConstellation := range constellationsToCheck { + mpc.powerConfig.ConnectedPhases = phaseConstellation + + err = mpc.configureMonitorPower( + measurements, + electricalConnection, + &electricalConnectionId, + nil, + ) + + assert.NotNil(s.T(), err) // could not add parameter description + } +} + +func (s *MuMpcUsecaseSuite) Test_configureMonitorEnergy() { + localEntity := spineMocks.NewEntityLocalInterface(s.T()) + localEntity.EXPECT().Device().Return(nil) + + anyFeature := spineMocks.NewFeatureLocalInterface(s.T()) + anyFeature.EXPECT().DataCopy(mock.Anything).Return(nil) + anyFeature.EXPECT().UpdateData(mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) + + localEntity.EXPECT().FeatureOfTypeAndRole(mock.Anything, mock.Anything).Return(anyFeature) + + monitorPowerConfig := MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeAbc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + } + + monitorEnergyConfig := MonitorEnergyConfig{ + ValueSourceProduction: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourceConsumption: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + } + + mpc, err := NewMPC( + localEntity, + s.Event, + &monitorPowerConfig, + &monitorEnergyConfig, + nil, + nil, + nil, + ) + assert.Nil(s.T(), err) + + measurements, err := server.NewMeasurement(localEntity) + assert.Nil(s.T(), err) + + var electricalConnection api.ElectricalConnectionServerInterface + electricalConnection, err = server.NewElectricalConnection(localEntity) + assert.Nil(s.T(), err) + + electricalConnectionId := model.ElectricalConnectionIdType(111) + constraints := make([]model.MeasurementConstraintsDataType, 0) + electricalConnection = mocks.NewElectricalConnectionServerInterface(s.T()) + electricalConnection.(*mocks.ElectricalConnectionServerInterface).EXPECT().AddParameterDescription(mock.Anything).Return(nil) + + err = mpc.configureMonitorEnergy( + measurements, + electricalConnection, + &electricalConnectionId, + &constraints, + ) + + assert.NotNil(s.T(), err) // could not add parameter description 1 + mpc.energyConfig.ValueConstraintsConsumption = nil + + err = mpc.configureMonitorEnergy( + measurements, + electricalConnection, + &electricalConnectionId, + &constraints, + ) + + assert.NotNil(s.T(), err) // could not add parameter description 2 +} + +func (s *MuMpcUsecaseSuite) Test_configureMonitorCurrent() { + localEntity := spineMocks.NewEntityLocalInterface(s.T()) + localEntity.EXPECT().Device().Return(nil) + + anyFeature := spineMocks.NewFeatureLocalInterface(s.T()) + anyFeature.EXPECT().DataCopy(mock.Anything).Return(nil).Maybe() + anyFeature.EXPECT().UpdateData(mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil).Maybe() + + localEntity.EXPECT().FeatureOfTypeAndRole(mock.Anything, mock.Anything).Return(anyFeature).Maybe() + + monitorPowerConfig := MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeAbc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + } + + monitorCurrentConfig := MonitorCurrentConfig{ + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + } + + mpc, err := NewMPC( + localEntity, + s.Event, + &monitorPowerConfig, + nil, + &monitorCurrentConfig, + nil, + nil, + ) + assert.Nil(s.T(), err) + + measurements, err := server.NewMeasurement(localEntity) + assert.Nil(s.T(), err) + + var electricalConnection api.ElectricalConnectionServerInterface + electricalConnection, err = server.NewElectricalConnection(localEntity) + assert.Nil(s.T(), err) + + electricalConnectionId := model.ElectricalConnectionIdType(111) + constraints := make([]model.MeasurementConstraintsDataType, 0) + electricalConnection = mocks.NewElectricalConnectionServerInterface(s.T()) + electricalConnection.(*mocks.ElectricalConnectionServerInterface).EXPECT().AddParameterDescription(mock.Anything).Return(nil).Maybe() + + constellationsToCheck := []model.ElectricalConnectionPhaseNameType{ + model.ElectricalConnectionPhaseNameTypeA, + model.ElectricalConnectionPhaseNameTypeB, + model.ElectricalConnectionPhaseNameTypeC, + } + + for _, phaseConstellation := range constellationsToCheck { + mpc.powerConfig.ConnectedPhases = phaseConstellation + + err = mpc.configureMonitorCurrent( + measurements, + electricalConnection, + &electricalConnectionId, + &constraints, + ) + + assert.NotNil(s.T(), err) // could not add parameter description + } + + // test when using phase to phase + monitorVoltageConfig := MonitorVoltageConfig{ + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeAb: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + } + + mpcInstance, err := NewMPC(s.localEntity, s.Event, &monitorPowerConfig, nil, nil, &monitorVoltageConfig, nil) + assert.Nil(s.T(), err) + assert.NotNil(s.T(), mpcInstance) + + err = mpcInstance.configureMonitorVoltage(measurements, electricalConnection, &electricalConnectionId, &constraints) + assert.NotNil(s.T(), err) + +} + +func (s *MuMpcUsecaseSuite) Test_configureMonitorVoltage() { + localEntity := spineMocks.NewEntityLocalInterface(s.T()) + localEntity.EXPECT().Device().Return(nil) + + anyFeature := spineMocks.NewFeatureLocalInterface(s.T()) + anyFeature.EXPECT().DataCopy(mock.Anything).Return(nil).Maybe() + anyFeature.EXPECT().UpdateData(mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil).Maybe() + + localEntity.EXPECT().FeatureOfTypeAndRole(mock.Anything, mock.Anything).Return(anyFeature).Maybe() + + monitorPowerConfig := MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeAbc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + } + + monitorVoltageConfig := MonitorVoltageConfig{ + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeAb: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeBc: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeAc: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + } + + mpc, err := NewMPC( + localEntity, + s.Event, + &monitorPowerConfig, + nil, + nil, + &monitorVoltageConfig, + nil, + ) + assert.Nil(s.T(), err) + + measurements, err := server.NewMeasurement(localEntity) + assert.Nil(s.T(), err) + + var electricalConnection api.ElectricalConnectionServerInterface + electricalConnection, err = server.NewElectricalConnection(localEntity) + assert.Nil(s.T(), err) + + electricalConnectionId := model.ElectricalConnectionIdType(111) + constraints := make([]model.MeasurementConstraintsDataType, 0) + + electricalConnection = mocks.NewElectricalConnectionServerInterface(s.T()) + electricalConnection.(*mocks.ElectricalConnectionServerInterface).EXPECT().AddParameterDescription(mock.Anything).Return(nil).Maybe() + + constellationsToCheck := []model.ElectricalConnectionPhaseNameType{ + model.ElectricalConnectionPhaseNameTypeA, + model.ElectricalConnectionPhaseNameTypeB, + model.ElectricalConnectionPhaseNameTypeC, + } + + for _, phaseConstellation := range constellationsToCheck { + mpc.powerConfig.ConnectedPhases = phaseConstellation + + err = mpc.configureMonitorVoltage( + measurements, + electricalConnection, + &electricalConnectionId, + &constraints, + ) + + assert.NotNil(s.T(), err) // could not add parameter description + } +} + +func (s *MuMpcUsecaseSuite) Test_configureMonitorFrequency() { + localEntity := spineMocks.NewEntityLocalInterface(s.T()) + localEntity.EXPECT().Device().Return(nil) + + anyFeature := spineMocks.NewFeatureLocalInterface(s.T()) + anyFeature.EXPECT().DataCopy(mock.Anything).Return(nil) + anyFeature.EXPECT().UpdateData(mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) + + localEntity.EXPECT().FeatureOfTypeAndRole(mock.Anything, mock.Anything).Return(anyFeature) + + monitorPowerConfig := MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeAbc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueSourcePerPhase: PhaseMeasurementSourceMap{ + model.ElectricalConnectionPhaseNameTypeA: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeB: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + model.ElectricalConnectionPhaseNameTypeC: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + }, + } + + monitorFrequencyConfig := MonitorFrequencyConfig{ + ValueSource: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + ValueConstraints: util.Ptr(model.MeasurementConstraintsDataType{ + ValueRangeMin: model.NewScaledNumberType(0), + ValueRangeMax: model.NewScaledNumberType(100), + ValueStepSize: model.NewScaledNumberType(1), + }), + } + + mpc, err := NewMPC( + localEntity, + s.Event, + &monitorPowerConfig, + nil, + nil, + nil, + &monitorFrequencyConfig, + ) + assert.Nil(s.T(), err) + + measurements, err := server.NewMeasurement(localEntity) + assert.Nil(s.T(), err) + + var electricalConnection api.ElectricalConnectionServerInterface + electricalConnection, err = server.NewElectricalConnection(localEntity) + assert.Nil(s.T(), err) + + electricalConnectionId := model.ElectricalConnectionIdType(111) + constraints := make([]model.MeasurementConstraintsDataType, 0) + electricalConnection = mocks.NewElectricalConnectionServerInterface(s.T()) + electricalConnection.(*mocks.ElectricalConnectionServerInterface).EXPECT().AddParameterDescription(mock.Anything).Return(nil) + + err = mpc.configureMonitorFrequency( + measurements, + electricalConnection, + &electricalConnectionId, + &constraints, + ) + assert.NotNil(s.T(), err) // could not add parameter description +} + +func (s *MuMpcUsecaseSuite) TestAddFeatures() { + // Testing function AddFeatures() and cover the paths that newMeasurement will return error in it + // Covering first path when calling newMeasurement returns nil + { + s.mockedService = mocks.NewServiceInterface(s.T()) + s.mockedService.EXPECT().AddUseCase(mock.Anything).Return(nil).Maybe() + s.mockedLocalDevice = spineMocks.NewDeviceLocalInterface(s.T()) + s.mockedService.EXPECT().LocalDevice().Return(s.mockedLocalDevice).Maybe() + s.mockedLocalEntity = spineMocks.NewEntityLocalInterface(s.T()) + s.mockedLocalDevice.EXPECT().EntityForType(mock.Anything).Return(s.mockedLocalEntity).Maybe() + s.mockedLocalFeature = spineMocks.NewFeatureLocalInterface(s.T()) + s.mockedLocalEntity.EXPECT().GetOrAddFeature(mock.Anything, mock.Anything).Return(s.mockedLocalFeature).Maybe() + s.mockedLocalEntity.EXPECT().Device().Return(s.mockedLocalDevice).Maybe() + s.mockedLocalFeature.EXPECT().AddFunctionType(mock.Anything, mock.Anything, mock.Anything).Return().Maybe() + s.mockedLocalEntity.EXPECT().FeatureOfTypeAndRole(model.FeatureTypeTypeMeasurement, model.RoleTypeServer).Return(nil).Once().Maybe() + + powerConfig := &MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeAbc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + } + mpcInstance, err := NewMPC(s.mockedLocalEntity, s.Event, powerConfig, nil, nil, nil, nil) + + assert.Nil(s.T(), err) + assert.NotNil(s.T(), mpcInstance) + + err = mpcInstance.AddFeatures() + assert.NotNil(s.T(), err) + } + + // Test covering when calling newElectricalConnection and return error + { + s.mockedLocalEntity.EXPECT().FeatureOfTypeAndRole(model.FeatureTypeTypeMeasurement, model.RoleTypeServer).Return(s.mockedLocalFeature).Maybe() + s.mockedLocalEntity.EXPECT().FeatureOfTypeAndRole(model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer).Return(nil).Once().Maybe() + + powerConfig := &MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeAbc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + } + mpcInstance, err := NewMPC(s.mockedLocalEntity, s.Event, powerConfig, nil, nil, nil, nil) + + assert.Nil(s.T(), err) + assert.NotNil(s.T(), mpcInstance) + + err = mpcInstance.AddFeatures() + assert.NotNil(s.T(), err) + } + + // Test covering when calling GetOrAddIdForDescription Return nil + { + err := errors.New("test") + mErr := model.ErrorType{} + s.mockedElectricalConnectionFeature = mocks.NewElectricalConnectionServerInterface(s.T()) + s.mockedElectricalConnectionFeature.EXPECT().GetOrAddIdForDescription(mock.Anything).Return(nil, err).Maybe() + s.mockedLocalEntity.EXPECT().FeatureOfTypeAndRole(model.FeatureTypeTypeMeasurement, model.RoleTypeServer).Return(s.mockedLocalFeature).Maybe() + s.mockedLocalEntity.EXPECT().FeatureOfTypeAndRole(model.FeatureTypeTypeElectricalConnection, model.RoleTypeServer).Return(s.mockedLocalFeature).Maybe() + s.mockedLocalFeature.EXPECT().UpdateData(mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(util.Ptr(mErr)).Maybe() + s.mockedLocalFeature.EXPECT().DataCopy(mock.Anything).Return(util.Ptr(model.ElectricalConnectionDescriptionListDataType{})).Maybe() + powerConfig := &MonitorPowerConfig{ + ConnectedPhases: model.ElectricalConnectionPhaseNameTypeAbc, + ValueSourceTotal: util.Ptr(model.MeasurementValueSourceTypeMeasuredValue), + } + mpcInstance, err := NewMPC(s.mockedLocalEntity, s.Event, powerConfig, nil, nil, nil, nil) + + assert.Nil(s.T(), err) + assert.NotNil(s.T(), mpcInstance) + + err = mpcInstance.AddFeatures() + assert.NotNil(s.T(), err) + } +} diff --git a/usecases/usecase/events.go b/usecases/usecase/events.go index 73c62cbc..eef8137a 100644 --- a/usecases/usecase/events.go +++ b/usecases/usecase/events.go @@ -91,7 +91,7 @@ func (u *UseCaseBase) useCaseDataUpdate( } for _, entity := range entitiesToCheck { - if !slices.Contains(u.validEntityTypes, entity.EntityType()) { + if !u.allEntityTypesValid && !slices.Contains(u.validEntityTypes, entity.EntityType()) { continue } diff --git a/usecases/usecase/testhelper_test.go b/usecases/usecase/testhelper_test.go index df37c8f6..95247d7b 100644 --- a/usecases/usecase/testhelper_test.go +++ b/usecases/usecase/testhelper_test.go @@ -110,6 +110,7 @@ func (s *UseCaseSuite) BeforeTest(suiteName, testName string) { useCaseUpdateEvent, validActorTypes, validEntityTypes, + false, ) } diff --git a/usecases/usecase/usecase.go b/usecases/usecase/usecase.go index b164a518..fe4f349a 100644 --- a/usecases/usecase/usecase.go +++ b/usecases/usecase/usecase.go @@ -25,8 +25,9 @@ type UseCaseBase struct { availableEntityScenarios []api.RemoteEntityScenarios // map of scenarios and their availability for each compatible remote entity - validActorTypes []model.UseCaseActorType // valid remote actor types for this use case - validEntityTypes []model.EntityTypeType // valid remote entity types for this use case + validActorTypes []model.UseCaseActorType // valid remote actor types for this use case + validEntityTypes []model.EntityTypeType // valid remote entity types for this use case + allEntityTypesValid bool mux sync.Mutex } @@ -57,6 +58,7 @@ func NewUseCaseBase( useCaseUpdateEvent api.EventType, validActorTypes []model.UseCaseActorType, validEntityTypes []model.EntityTypeType, + allEntityTypesValid bool, ) *UseCaseBase { ucb := &UseCaseBase{ LocalEntity: localEntity, @@ -69,6 +71,7 @@ func NewUseCaseBase( useCaseUpdateEvent: useCaseUpdateEvent, validActorTypes: validActorTypes, validEntityTypes: validEntityTypes, + allEntityTypesValid: allEntityTypesValid, } _ = spine.Events.Subscribe(ucb) @@ -114,6 +117,10 @@ func (u *UseCaseBase) IsCompatibleEntityType(entity spineapi.EntityRemoteInterfa return false } + if u.allEntityTypesValid { + return true + } + return slices.Contains(u.validEntityTypes, entity.EntityType()) } diff --git a/usecases/usecase/usecase_test.go b/usecases/usecase/usecase_test.go index 58a4a524..299963f2 100644 --- a/usecases/usecase/usecase_test.go +++ b/usecases/usecase/usecase_test.go @@ -23,6 +23,10 @@ func (s *UseCaseSuite) Test() { result = s.uc.IsCompatibleEntityType(payload.Entity) assert.True(s.T(), result) + s.uc.allEntityTypesValid = true + result = s.uc.IsCompatibleEntityType(payload.Entity) + assert.True(s.T(), result) + usecaseFilter := model.UseCaseFilterType{ Actor: useCaseActor, UseCaseName: useCaseName,