Skip to content

Test Spat Minimum Data Event

Ivan Yourshaw edited this page Jan 31, 2025 · 9 revisions

Test for SPAT Minimum Data Events

Note: SPAT Minimum Data Events can be configured to enable aggregation using the spat.validation.aggregateMinimumDataEvents configuration setting, or the ENABLE_AGGREGATE_SPAT_MINIMUM_DATA_EVENTS environment variable. If aggregation is enabled, events will be delayed by up to the configured aggregation.interval, which is 60 seconds by default.

Output Topics

If aggregation is enabled, events are output to:

  • topic.CmSpatMinimumDataEventAggregation

If aggregation is disabled, events are output to:

  • topic.CmSpatMinimumDataEvents

1. SPAT with Missing Elements

Inputs

One SPAT with missing required elements.

Script File

Script: SPAT_MinData.csv

With Aggregation

Expected Output

One Minimum Data Event

Actual Output

Topic: topic.CmSpatMinimumDataEvents
Key: {"rsuId":"10.11.81.12","intersectionId":12109,"region":-1}
Offset: 582
Timestamp: 1711514348275
Value: 
{
	"eventGeneratedAt":1711514348680,
	"eventType":"SpatMinimumData",
	"intersectionID":12109,
	"roadRegulatorID":-1,
	"source":"{ rsuId='10.11.81.12', intersectionId='12109', region='-1'}",
	"timePeriod":{
		"beginTimestamp":1711514340000,
		"endTimestamp":1711514350000},
	"missingDataElements":[
		"$.payload.data.intersectionStateList.intersectionStatelist[0].id.region: null found, integer expected (#/$defs/J2735RoadRegulatorID/type)",
		"DE_TimeMark is missing (#/$defs/J2735TimeMark/type)",
		"DE_TimeMark is missing (#/$defs/J2735TimeMark/type)",
		"DE_TimeMark is missing (#/$defs/J2735TimeMark/type)",
		"DE_TimeMark is missing (#/$defs/J2735TimeMark/type)",
		"DE_TimeMark is missing (#/$defs/J2735TimeMark/type)",
		"DE_TimeMark is missing (#/$defs/J2735TimeMark/type)"
	]
}

Comments

  • Spat validation string is missing JSON path to identify missing item, should look like the following, or at least contain the name of the property, eg. "startTime", "nextTime":
"missingDataElements": [
		"$.payload.data.intersectionStateList.intersectionStatelist[0].id.region: null found, integer expected (#/$defs/J2735RoadRegulatorID/type)",
		"$.payload.data.intersectionStateList.intersectionStatelist[0].states.movementList[0].state_time_speed.movementEventList[0].timing.startTime: null found, integer expected (#/$defs/J2735TimeMark/type)",
		"$.payload.data.intersectionStateList.intersectionStatelist[0].states.movementList[0].state_time_speed.movementEventList[0].timing.nextTime: null found, integer expected (#/$defs/J2735TimeMark/type)",
		"$.payload.data.intersectionStateList.intersectionStatelist[0].states.movementList[1].state_time_speed.movementEventList[0].timing.startTime: null found, integer expected (#/$defs/J2735TimeMark/type)",
		"$.payload.data.intersectionStateList.intersectionStatelist[0].states.movementList[1].state_time_speed.movementEventList[0].timing.nextTime: null found, integer expected (#/$defs/J2735TimeMark/type)",
		"$.payload.data.intersectionStateList.intersectionStatelist[0].states.movementList[2].state_time_speed.movementEventList[0].timing.startTime: null found, integer expected (#/$defs/J2735TimeMark/type)",
		"$.payload.data.intersectionStateList.intersectionStatelist[0].states.movementList[2].state_time_speed.movementEventList[0].timing.nextTime: null found, integer expected (#/$defs/J2735TimeMark/type)"
	]

Without Aggregation

TODO

2. Valid SPAT

Inputs

One Valid SPAT message

Test Script

Script: SPAT_MinData-valid.csv

With or Without Aggregation

Expected Output

No event.

Actual Output

No event.

Comments