feat(platform): include identity resolution in vehicle detail
This commit is contained in:
@@ -75,6 +75,18 @@ func TestHandlerVehicleDetailResolvesPlateToVIN(t *testing.T) {
|
||||
if !strings.Contains(rec.Body.String(), `"vin":"LB9A32A24R0LS1426"`) {
|
||||
t.Fatalf("response should resolve plate to VIN: %s", rec.Body.String())
|
||||
}
|
||||
var body struct {
|
||||
Data VehicleDetail `json:"data"`
|
||||
}
|
||||
if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil {
|
||||
t.Fatalf("response JSON should decode: %v body=%s", err, rec.Body.String())
|
||||
}
|
||||
if body.Data.Resolution == nil || !body.Data.Resolution.Resolved || body.Data.Resolution.VIN != "LB9A32A24R0LS1426" {
|
||||
t.Fatalf("vehicle detail should include canonical identity resolution, got %+v body=%s", body.Data.Resolution, rec.Body.String())
|
||||
}
|
||||
if len(body.Data.Resolution.Protocols) < 2 {
|
||||
t.Fatalf("vehicle detail resolution should include source protocols, got %+v", body.Data.Resolution.Protocols)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandlerVehicleDetailAcceptsKeyword(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user