You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2023/05/02 12:01:56 UTC

[plc4x] branch develop updated: test(plc4go/cbus): more tests for Subscriber

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new 4ffc2fda8c test(plc4go/cbus): more tests for Subscriber
4ffc2fda8c is described below

commit 4ffc2fda8c89e73ef7cdc5479030de126c261024
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Tue May 2 14:01:48 2023 +0200

    test(plc4go/cbus): more tests for Subscriber
---
 plc4go/internal/cbus/Subscriber.go      |   75 ++-
 plc4go/internal/cbus/Subscriber_test.go | 1006 ++++++++++++++++++++++++++++++-
 2 files changed, 1023 insertions(+), 58 deletions(-)

diff --git a/plc4go/internal/cbus/Subscriber.go b/plc4go/internal/cbus/Subscriber.go
index c6819b779e..bd4b5ae27b 100644
--- a/plc4go/internal/cbus/Subscriber.go
+++ b/plc4go/internal/cbus/Subscriber.go
@@ -75,7 +75,7 @@ func (m *Subscriber) Unsubscribe(ctx context.Context, unsubscriptionRequest apiM
 	result := make(chan apiModel.PlcUnsubscriptionRequestResult)
 
 	// TODO: As soon as we establish a connection, we start getting data...
-	// subscriptions are more an internal handling of which values to pass where.
+	// subscriptions are more a internal handling of which values to pass where.
 
 	return result
 }
@@ -203,8 +203,6 @@ func (m *Subscriber) offerMMI(unitAddressString string, calData readWriteModel.C
 					plcListValues[i] = spiValues.NewPlcSTRING("corrupted")
 				case readWriteModel.LevelInformationNormalExactly:
 					plcListValues[i] = spiValues.NewPlcUSINT(levelInformation.GetActualLevel())
-				default:
-					panic("Impossible case")
 				}
 			}
 			plcValues[tagName] = spiValues.NewPlcList(plcListValues)
@@ -226,10 +224,6 @@ func (m *Subscriber) offerMMI(unitAddressString string, calData readWriteModel.C
 	address[tagName] = fmt.Sprintf("status/%s/%s", statusType, applicationString)
 
 	// Assemble a PlcSubscription event
-	if len(plcValues) <= 0 {
-		log.Debug().Msg("no values")
-		return false
-	}
 	event := NewSubscriptionEvent(tags, types, intervals, responseCodes, address, sources, plcValues)
 	consumer(&event)
 	return true
@@ -271,6 +265,10 @@ func (m *Subscriber) offerSAL(sal readWriteModel.MonitoredSAL, subscriptionHandl
 	var salData readWriteModel.SALData
 	var unitAddressString, applicationString string
 	switch sal := sal.(type) {
+	case readWriteModel.MonitoredSALShortFormBasicModeExactly:
+		unitAddressString = "u0" // On short form it should be always unit 0 TODO: double check that
+		applicationString = sal.GetApplication().ApplicationId().String()
+		salData = sal.GetSalData()
 	case readWriteModel.MonitoredSALLongFormSmartModeExactly:
 		if sal.GetIsUnitAddress() {
 			unitAddressString = fmt.Sprintf("u%d", sal.GetUnitAddress().GetAddress())
@@ -284,10 +282,6 @@ func (m *Subscriber) offerSAL(sal readWriteModel.MonitoredSAL, subscriptionHandl
 		}
 		applicationString = sal.GetApplication().ApplicationId().String()
 		salData = sal.GetSalData()
-	case readWriteModel.MonitoredSALShortFormBasicModeExactly:
-		unitAddressString = "u0" // On short form it should be always unit 0 TODO: double check that
-		applicationString = sal.GetApplication().ApplicationId().String()
-		salData = sal.GetSalData()
 	}
 	if unitAddress := tag.GetUnitAddress(); unitAddress != nil {
 		unitSuffix := fmt.Sprintf("u%d", unitAddress.GetAddress())
@@ -305,57 +299,62 @@ func (m *Subscriber) offerSAL(sal readWriteModel.MonitoredSAL, subscriptionHandl
 		}
 	}
 
-	var commandType string
+	var commandTypeGetter interface {
+		PLC4XEnumName() string
+	}
 	switch salData := salData.(type) {
 	case readWriteModel.SALDataAccessControlExactly:
-		commandType = salData.GetAccessControlData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetAccessControlData().GetCommandType()
 	case readWriteModel.SALDataAirConditioningExactly:
-		commandType = salData.GetAirConditioningData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetAirConditioningData().GetCommandType()
 	case readWriteModel.SALDataAudioAndVideoExactly:
-		commandType = salData.GetAudioVideoData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetAudioVideoData().GetCommandType()
 	case readWriteModel.SALDataClockAndTimekeepingExactly:
-		commandType = salData.GetClockAndTimekeepingData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetClockAndTimekeepingData().GetCommandType()
 	case readWriteModel.SALDataEnableControlExactly:
-		commandType = salData.GetEnableControlData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetEnableControlData().GetCommandType()
 	case readWriteModel.SALDataErrorReportingExactly:
-		commandType = salData.GetErrorReportingData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetErrorReportingData().GetCommandType()
 	case readWriteModel.SALDataFreeUsageExactly:
-		commandType = "Unknown"
+		log.Info().Msg("Unknown command type")
 	case readWriteModel.SALDataHeatingExactly:
-		commandType = salData.GetHeatingData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetHeatingData().GetCommandType()
 	case readWriteModel.SALDataHvacActuatorExactly:
-		commandType = salData.GetHvacActuatorData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetHvacActuatorData().GetCommandType()
 	case readWriteModel.SALDataIrrigationControlExactly:
-		commandType = salData.GetIrrigationControlData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetIrrigationControlData().GetCommandType()
 	case readWriteModel.SALDataLightingExactly:
-		commandType = salData.GetLightingData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetLightingData().GetCommandType()
 	case readWriteModel.SALDataMeasurementExactly:
-		commandType = salData.GetMeasurementData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetMeasurementData().GetCommandType()
 	case readWriteModel.SALDataMediaTransportExactly:
-		commandType = salData.GetMediaTransportControlData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetMediaTransportControlData().GetCommandType()
 	case readWriteModel.SALDataMeteringExactly:
-		commandType = salData.GetMeteringData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetMeteringData().GetCommandType()
 	case readWriteModel.SALDataPoolsSpasPondsFountainsControlExactly:
-		commandType = salData.GetPoolsSpaPondsFountainsData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetPoolsSpaPondsFountainsData().GetCommandType()
 	case readWriteModel.SALDataReservedExactly:
-		commandType = "Unknown"
+		log.Info().Msg("Unknown command type")
 	case readWriteModel.SALDataRoomControlSystemExactly:
-		panic("Not implemented yet") // TODO: implement once there
+		log.Info().Msg("Unknown command type not implemented yet") // TODO: implement once there
 	case readWriteModel.SALDataSecurityExactly:
-		commandType = salData.GetSecurityData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetSecurityData().GetCommandType()
 	case readWriteModel.SALDataTelephonyStatusAndControlExactly:
-		commandType = salData.GetTelephonyData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetTelephonyData().GetCommandType()
 	case readWriteModel.SALDataTemperatureBroadcastExactly:
-		commandType = salData.GetTemperatureBroadcastData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetTemperatureBroadcastData().GetCommandType()
 	case readWriteModel.SALDataTestingExactly:
-		panic("Not implemented yet") // TODO: implement once there
+		log.Info().Msg("Unknown command type not implemented yet") // TODO: implement once there
 	case readWriteModel.SALDataTriggerControlExactly:
-		commandType = salData.GetTriggerControlData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetTriggerControlData().GetCommandType()
 	case readWriteModel.SALDataVentilationExactly:
-		commandType = salData.GetVentilationData().GetCommandType().PLC4XEnumName()
+		commandTypeGetter = salData.GetVentilationData().GetCommandType()
 	default:
 		log.Error().Msgf("Unmapped type %T", salData)
-		commandType = "Unknown"
+	}
+	commandType := "Unknown"
+	if commandTypeGetter != nil {
+		commandType = commandTypeGetter.PLC4XEnumName()
 	}
 
 	// TODO: we need to map commands e.g. if we get a MeteringDataElectricityConsumption we can map that to MeteringDataMeasureElectricity
@@ -373,10 +372,6 @@ func (m *Subscriber) offerSAL(sal readWriteModel.MonitoredSAL, subscriptionHandl
 	responseCodes[tagName] = apiModel.PlcResponseCode_OK
 
 	// Assemble a PlcSubscription event
-	if len(plcValues) <= 0 {
-		log.Debug().Msg("no values")
-		return false
-	}
 	event := NewSubscriptionEvent(tags, types, intervals, responseCodes, address, sources, plcValues)
 	consumer(&event)
 	return true
diff --git a/plc4go/internal/cbus/Subscriber_test.go b/plc4go/internal/cbus/Subscriber_test.go
index 6117d7d388..4cd204a9ac 100644
--- a/plc4go/internal/cbus/Subscriber_test.go
+++ b/plc4go/internal/cbus/Subscriber_test.go
@@ -151,7 +151,7 @@ func TestSubscriber_handleMonitoredMMI(t *testing.T) {
 			},
 		},
 		{
-			name: "handle the MMI short with consumer",
+			name: "handle the MMI short with consumerProvider",
 			fields: fields{
 				consumers: map[*spiModel.DefaultPlcConsumerRegistration]apiModel.PlcSubscriptionEventConsumer{
 					func() *spiModel.DefaultPlcConsumerRegistration {
@@ -230,7 +230,7 @@ func TestSubscriber_offerMMI(t *testing.T) {
 		unitAddressString  string
 		calData            model.CALData
 		subscriptionHandle *SubscriptionHandle
-		consumer           apiModel.PlcSubscriptionEventConsumer
+		consumerProvider   func(t *testing.T) apiModel.PlcSubscriptionEventConsumer
 	}
 	tests := []struct {
 		name   string
@@ -241,19 +241,226 @@ func TestSubscriber_offerMMI(t *testing.T) {
 		{
 			name: "offer not fitting tag",
 			args: args{
-				subscriptionHandle: &SubscriptionHandle{},
+				subscriptionHandle: NewSubscriptionHandle(
+					nil,
+					"nada",
+					nil,
+					spiModel.SubscriptionEvent,
+					0,
+				),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(_ apiModel.PlcSubscriptionEvent) {
+						t.Error("should not be called")
+					}
+				},
+			},
+		},
+		{
+			name: "valid monitor tag wrong address",
+			args: args{
+				unitAddressString: "banana",
+				subscriptionHandle: NewSubscriptionHandle(
+					nil,
+					"tag",
+					NewMMIMonitorTag(
+						readWriteModel.NewUnitAddress(13),
+						nil,
+						1,
+					),
+					spiModel.SubscriptionEvent,
+					0,
+				),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(_ apiModel.PlcSubscriptionEvent) {
+						t.Error("should not be called")
+					}
+				},
 			},
+			want: false,
 		},
 		{
 			name: "valid monitor tag unmapped",
 			args: args{
-				subscriptionHandle: &SubscriptionHandle{
-					tag: &mmiMonitorTag{},
+				subscriptionHandle: NewSubscriptionHandle(
+					nil,
+					"nada",
+					nil,
+					spiModel.SubscriptionEvent,
+					0,
+				),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(_ apiModel.PlcSubscriptionEvent) {
+						t.Error("should not be called")
+					}
+				},
+			},
+			want: false,
+		},
+		{
+			name: "valid monitor tag cal unrelated",
+			args: args{
+				unitAddressString: "u13",
+				calData:           readWriteModel.NewCALDataReset(readWriteModel.CALCommandTypeContainer_CALCommandGetStatus, nil, nil),
+				subscriptionHandle: NewSubscriptionHandle(
+					nil,
+					"tag",
+					NewMMIMonitorTag(
+						readWriteModel.NewUnitAddress(13),
+						nil,
+						1,
+					),
+					spiModel.SubscriptionEvent,
+					0,
+				),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: false,
+		},
+		{
+			name: "valid monitor tag cal status",
+			args: args{
+				unitAddressString: "u13",
+				calData: readWriteModel.NewCALDataStatus(
+					readWriteModel.ApplicationIdContainer_LIGHTING_3A,
+					0,
+					[]readWriteModel.StatusByte{
+						readWriteModel.NewStatusByte(readWriteModel.GAVState_DOES_NOT_EXIST, readWriteModel.GAVState_OFF, readWriteModel.GAVState_ON, readWriteModel.GAVState_ERROR),
+					},
+					readWriteModel.CALCommandTypeContainer_CALCommandIdentify,
+					nil,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(
+					nil,
+					"tag",
+					NewMMIMonitorTag(
+						readWriteModel.NewUnitAddress(13),
+						nil,
+						1,
+					),
+					spiModel.SubscriptionEvent,
+					0,
+				),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "valid monitor tag cal status wrong application",
+			args: args{
+				unitAddressString: "u13",
+				calData: readWriteModel.NewCALDataStatus(
+					readWriteModel.ApplicationIdContainer_LIGHTING_3A,
+					0,
+					[]readWriteModel.StatusByte{
+						readWriteModel.NewStatusByte(readWriteModel.GAVState_DOES_NOT_EXIST, readWriteModel.GAVState_OFF, readWriteModel.GAVState_ON, readWriteModel.GAVState_ERROR),
+					},
+					readWriteModel.CALCommandTypeContainer_CALCommandIdentify,
+					nil,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(
+					nil,
+					"tag",
+					NewMMIMonitorTag(
+						readWriteModel.NewUnitAddress(13),
+						func() *readWriteModel.ApplicationIdContainer {
+							a := readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74
+							return &a
+						}(),
+						1,
+					),
+					spiModel.SubscriptionEvent,
+					0,
+				),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
 				},
 			},
 			want: false,
 		},
-		// TODO: add other cases
+		{
+			name: "valid monitor tag cal status extended binary",
+			args: args{
+				unitAddressString: "u13",
+				calData: readWriteModel.NewCALDataStatusExtended(
+					readWriteModel.StatusCoding_BINARY_BY_THIS_SERIAL_INTERFACE,
+					readWriteModel.ApplicationIdContainer_LIGHTING_3A,
+					0,
+					[]readWriteModel.StatusByte{
+						readWriteModel.NewStatusByte(readWriteModel.GAVState_DOES_NOT_EXIST, readWriteModel.GAVState_OFF, readWriteModel.GAVState_ON, readWriteModel.GAVState_ERROR),
+					},
+					nil,
+					readWriteModel.CALCommandTypeContainer_CALCommandIdentify,
+					nil,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(
+					nil,
+					"tag",
+					NewMMIMonitorTag(
+						readWriteModel.NewUnitAddress(13),
+						nil,
+						1,
+					),
+					spiModel.SubscriptionEvent,
+					0,
+				),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "valid monitor tag cal status extended level",
+			args: args{
+				unitAddressString: "u13",
+				calData: readWriteModel.NewCALDataStatusExtended(
+					readWriteModel.StatusCoding_LEVEL_BY_THIS_SERIAL_INTERFACE,
+					readWriteModel.ApplicationIdContainer_LIGHTING_3A,
+					0,
+					nil,
+					[]readWriteModel.LevelInformation{
+						readWriteModel.NewLevelInformationAbsent(13),
+						readWriteModel.NewLevelInformationCorrupted(1, 2, 3, 4, 5),
+						readWriteModel.NewLevelInformationNormal(readWriteModel.LevelInformationNibblePair_Value_0, readWriteModel.LevelInformationNibblePair_Value_2, 13),
+					},
+					readWriteModel.CALCommandTypeContainer_CALCommandIdentify,
+					nil,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(
+					nil,
+					"tag",
+					NewMMIMonitorTag(
+						readWriteModel.NewUnitAddress(13),
+						nil,
+						1,
+					),
+					spiModel.SubscriptionEvent,
+					0,
+				),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
@@ -261,7 +468,7 @@ func TestSubscriber_offerMMI(t *testing.T) {
 				connection: tt.fields.connection,
 				consumers:  tt.fields.consumers,
 			}
-			assert.Equalf(t, tt.want, m.offerMMI(tt.args.unitAddressString, tt.args.calData, tt.args.subscriptionHandle, tt.args.consumer), "offerMMI(%v, %v, %v, %v)", tt.args.unitAddressString, tt.args.calData, tt.args.subscriptionHandle, tt.args.consumer)
+			assert.Equalf(t, tt.want, m.offerMMI(tt.args.unitAddressString, tt.args.calData, tt.args.subscriptionHandle, tt.args.consumerProvider(t)), "offerMMI(%v,\n%v\n, \n%v\n, func())", tt.args.unitAddressString, tt.args.calData, tt.args.subscriptionHandle)
 		})
 	}
 }
@@ -284,7 +491,7 @@ func TestSubscriber_handleMonitoredSAL(t *testing.T) {
 			name: "no sal, no consumers",
 		},
 		{
-			name: "handle the SAL short with consumer",
+			name: "handle the SAL short with consumerProvider",
 			fields: fields{
 				consumers: map[*spiModel.DefaultPlcConsumerRegistration]apiModel.PlcSubscriptionEventConsumer{
 					func() *spiModel.DefaultPlcConsumerRegistration {
@@ -319,7 +526,7 @@ func TestSubscriber_offerSAL(t *testing.T) {
 	type args struct {
 		sal                model.MonitoredSAL
 		subscriptionHandle *SubscriptionHandle
-		consumer           apiModel.PlcSubscriptionEventConsumer
+		consumerProvider   func(t *testing.T) apiModel.PlcSubscriptionEventConsumer
 	}
 	tests := []struct {
 		name   string
@@ -330,19 +537,23 @@ func TestSubscriber_offerSAL(t *testing.T) {
 		{
 			name: "offer wong tag",
 			args: args{
-				subscriptionHandle: &SubscriptionHandle{},
+				subscriptionHandle: NewSubscriptionHandle(nil, "", nil, spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						t.Fail()
+					}
+				},
 			},
 		},
 		{
-			name: "offer sal tag",
+			name: "offer sal tag short",
 			args: args{
-				sal: readWriteModel.NewMonitoredSALLongFormSmartMode(
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
 					0,
-					readWriteModel.NewUnitAddress(0),
 					nil,
-					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
 					nil,
 					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
 					readWriteModel.NewSALDataLighting(
 						readWriteModel.NewLightingDataOn(2, readWriteModel.LightingCommandTypeContainer_LightingCommandOn),
 						nil,
@@ -350,10 +561,769 @@ func TestSubscriber_offerSAL(t *testing.T) {
 					0,
 					nil,
 				),
-				subscriptionHandle: &SubscriptionHandle{
-					tag: &salMonitorTag{},
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short sal access control",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataAccessControl(
+						readWriteModel.NewAccessControlDataAccessPointClosed(readWriteModel.AccessControlCommandTypeContainer_AccessControlCommandAccessPointClosed, 0, 0),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short sal air conditioning",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataAirConditioning(
+						readWriteModel.NewAirConditioningDataRefresh(0, readWriteModel.AirConditioningCommandTypeContainer_AirConditioningCommandRefresh),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short sal audio & video",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataAudioAndVideo(
+						readWriteModel.NewLightingDataOff(0, readWriteModel.LightingCommandTypeContainer_LightingCommandOn),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short sal clock and timekeeping",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataClockAndTimekeeping(
+						readWriteModel.NewClockAndTimekeepingDataRequestRefresh(
+							1,
+							0,
+						),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short sal enable control",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataEnableControl(
+						readWriteModel.NewEnableControlData(0, 0, 0),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short sal error reporting",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataErrorReporting(
+						readWriteModel.NewErrorReportingDataGeneric(
+							readWriteModel.NewErrorReportingSystemCategory(
+								readWriteModel.ErrorReportingSystemCategoryClass_INPUT_UNITS,
+								readWriteModel.NewErrorReportingSystemCategoryTypeInputUnits(
+									readWriteModel.ErrorReportingSystemCategoryTypeForInputUnits_RESERVED_2,
+								),
+								readWriteModel.ErrorReportingSystemCategoryVariant_RESERVED_0,
+							),
+							true,
+							true,
+							true,
+							readWriteModel.ErrorReportingSeverity_ALL_OK,
+							1,
+							2,
+							3,
+							4,
+						),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short sal free usage",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataFreeUsage(nil),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short heating",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataHeating(
+						readWriteModel.NewLightingDataOn(2, readWriteModel.LightingCommandTypeContainer_LightingCommandOn),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short actuator",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataHvacActuator(
+						readWriteModel.NewLightingDataOn(2, readWriteModel.LightingCommandTypeContainer_LightingCommandOn),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
 				},
-				consumer: func(_ apiModel.PlcSubscriptionEvent) {
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short irrigation control",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataIrrigationControl(
+						readWriteModel.NewLightingDataOn(2, readWriteModel.LightingCommandTypeContainer_LightingCommandOn),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short lighting",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataLighting(
+						readWriteModel.NewLightingDataOn(2, readWriteModel.LightingCommandTypeContainer_LightingCommandOn),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short measurement",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataMeasurement(
+						readWriteModel.NewMeasurementDataChannelMeasurementData(
+							0,
+							0,
+							readWriteModel.MeasurementUnits_ANGLE_DEGREES,
+							0,
+							0,
+							0,
+							0,
+						),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short media transport",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataMediaTransport(
+						readWriteModel.NewMediaTransportControlDataFastForward(
+							0,
+							0,
+							0,
+						),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short metering",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataMetering(
+						readWriteModel.NewMeteringDataGasConsumption(
+							0,
+							0,
+							0,
+						),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short pools spas ponds",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataPoolsSpasPondsFountainsControl(
+						readWriteModel.NewLightingDataOn(
+							0,
+							0,
+						),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short reserved",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataReserved(
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short reserved",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataRoomControlSystem(
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short reserved",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataSecurity(
+						readWriteModel.NewSecurityDataAlarmOn(
+							0,
+							0,
+						),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short telephony",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataTelephonyStatusAndControl(
+						readWriteModel.NewTelephonyDataDivert(
+							"1234",
+							0,
+							0,
+						),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short temperature broadcast",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataTemperatureBroadcast(
+						readWriteModel.NewTemperatureBroadcastData(
+							0,
+							0,
+							0,
+						),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short testing",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataTesting(
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short trigger control",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataTriggerControl(
+						readWriteModel.NewTriggerControlDataTriggerEvent(
+							0,
+							0,
+							0,
+						),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short ventilation",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataVentilation(
+						readWriteModel.NewLightingDataOn(
+							0,
+							0,
+						),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag short wrong unit address",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataLighting(
+						readWriteModel.NewLightingDataOn(2, readWriteModel.LightingCommandTypeContainer_LightingCommandOn),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(
+					nil,
+					"",
+					NewSALMonitorTag(
+						readWriteModel.NewUnitAddress(13),
+						nil,
+						1,
+					),
+					spiModel.SubscriptionEvent,
+					0,
+				),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: false,
+		},
+		{
+			name: "offer sal tag short wrong application",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALShortFormBasicMode(
+					0,
+					nil,
+					nil,
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					readWriteModel.NewSALDataLighting(
+						readWriteModel.NewLightingDataOn(2, readWriteModel.LightingCommandTypeContainer_LightingCommandOn),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(
+					nil,
+					"",
+					NewSALMonitorTag(
+						nil,
+						func() *readWriteModel.ApplicationIdContainer {
+							a := readWriteModel.ApplicationIdContainer_LIGHTING_3A
+							return &a
+						}(),
+						1,
+					),
+					spiModel.SubscriptionEvent,
+					0,
+				),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: false,
+		},
+		{
+			name: "offer sal tag long",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALLongFormSmartMode(
+					0,
+					readWriteModel.NewUnitAddress(0),
+					nil,
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					nil,
+					nil,
+					readWriteModel.NewSALDataLighting(
+						readWriteModel.NewLightingDataOn(2, readWriteModel.LightingCommandTypeContainer_LightingCommandOn),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
+				},
+			},
+			want: true,
+		},
+		{
+			name: "offer sal tag long bridged",
+			args: args{
+				sal: readWriteModel.NewMonitoredSALLongFormSmartMode(
+					1,
+					nil,
+					readWriteModel.NewBridgeAddress(2),
+					readWriteModel.ApplicationIdContainer_HVAC_ACTUATOR_74,
+					nil,
+					readWriteModel.NewReplyNetwork(
+						readWriteModel.NewNetworkRoute(
+							readWriteModel.NewNetworkProtocolControlInformation(1, 1),
+							[]readWriteModel.BridgeAddress{
+								readWriteModel.NewBridgeAddress(2),
+							},
+						),
+						readWriteModel.NewUnitAddress(0),
+					),
+					readWriteModel.NewSALDataLighting(
+						readWriteModel.NewLightingDataOn(2, readWriteModel.LightingCommandTypeContainer_LightingCommandOn),
+						nil,
+					),
+					0,
+					nil,
+				),
+				subscriptionHandle: NewSubscriptionHandle(nil, "", NewSALMonitorTag(nil, nil, 1), spiModel.SubscriptionEvent, 0),
+				consumerProvider: func(t *testing.T) apiModel.PlcSubscriptionEventConsumer {
+					return func(event apiModel.PlcSubscriptionEvent) {
+						assert.NotNil(t, event)
+					}
 				},
 			},
 			want: true,
@@ -365,7 +1335,7 @@ func TestSubscriber_offerSAL(t *testing.T) {
 				connection: tt.fields.connection,
 				consumers:  tt.fields.consumers,
 			}
-			assert.Equalf(t, tt.want, m.offerSAL(tt.args.sal, tt.args.subscriptionHandle, tt.args.consumer), "offerSAL(\n%v\n, %v)", tt.args.sal, tt.args.subscriptionHandle)
+			assert.Equalf(t, tt.want, m.offerSAL(tt.args.sal, tt.args.subscriptionHandle, tt.args.consumerProvider(t)), "offerSAL(\n%v\n, \n%v\n)", tt.args.sal, tt.args.subscriptionHandle)
 		})
 	}
 }