feat(platform): expose source slots in realtime vehicles
This commit is contained in:
@@ -679,6 +679,18 @@ func TestHandlerVehicleRealtime(t *testing.T) {
|
||||
if len(body.Data.Items) == 0 || body.Data.Items[0].ServiceStatus == nil {
|
||||
t.Fatalf("realtime vehicle row should include canonical serviceStatus: %s", rec.Body.String())
|
||||
}
|
||||
byProtocol := map[string]VehicleSourceStatus{}
|
||||
for _, source := range body.Data.Items[0].SourceStatus {
|
||||
byProtocol[source.Protocol] = source
|
||||
}
|
||||
for _, protocol := range []string{"GB32960", "JT808", "YUTONG_MQTT"} {
|
||||
if _, ok := byProtocol[protocol]; !ok {
|
||||
t.Fatalf("realtime row should expose canonical source slot %s, got %+v body=%s", protocol, body.Data.Items[0].SourceStatus, rec.Body.String())
|
||||
}
|
||||
}
|
||||
if !byProtocol["JT808"].Online || byProtocol["YUTONG_MQTT"].Online || byProtocol["YUTONG_MQTT"].HasRealtime {
|
||||
t.Fatalf("realtime source slots should expose online and missing evidence, got %+v", byProtocol)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandlerVehicleRealtimeFiltersServiceStatus(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user