feat(platform): expose source consistency in vehicle coverage
This commit is contained in:
@@ -94,8 +94,9 @@ func TestHandlerVehicleCoverage(t *testing.T) {
|
||||
}
|
||||
var rawBody struct {
|
||||
Data Page[struct {
|
||||
VIN string `json:"vin"`
|
||||
MissingProtocols []string `json:"missingProtocols"`
|
||||
VIN string `json:"vin"`
|
||||
MissingProtocols []string `json:"missingProtocols"`
|
||||
SourceConsistency *VehicleSourceConsistency `json:"sourceConsistency"`
|
||||
}] `json:"data"`
|
||||
}
|
||||
if err := json.Unmarshal(rec.Body.Bytes(), &rawBody); err != nil {
|
||||
@@ -104,6 +105,12 @@ func TestHandlerVehicleCoverage(t *testing.T) {
|
||||
if len(rawBody.Data.Items) == 0 || !containsString(rawBody.Data.Items[0].MissingProtocols, "YUTONG_MQTT") {
|
||||
t.Fatalf("coverage row should expose missing canonical protocols, got %+v body=%s", rawBody.Data.Items, rec.Body.String())
|
||||
}
|
||||
if len(rawBody.Data.Items) == 0 || rawBody.Data.Items[0].SourceConsistency == nil {
|
||||
t.Fatalf("coverage row should expose vehicle-level source consistency: %s", rec.Body.String())
|
||||
}
|
||||
if rawBody.Data.Items[0].SourceConsistency.Status != "degraded" || !containsString(rawBody.Data.Items[0].SourceConsistency.MissingProtocols, "YUTONG_MQTT") {
|
||||
t.Fatalf("coverage source consistency should diagnose missing source evidence, got %+v body=%s", rawBody.Data.Items[0].SourceConsistency, rec.Body.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandlerVehicleCoverageFiltersServiceStatus(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user