Skip to content

Test Spat Minimum Data Event

Ivan Yourshaw edited this page Mar 27, 2024 · 7 revisions

Test for SPAT Minimum Data Events

Output Topic

topic.CmSpatMinimumDataEvents

1. SPAT with Missing Elements

Inputs

One SPAT with missing required elements.

Script File

Script: SPAT_MinData.csv

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)"
	]

2. Valid SPAT

Inputs

One Valid SPAT message

Test Script

Script: SPAT_MinData-valid.csv

Expected Output

No event.

Actual Output

No event.

Comments