feat(operations): add auditable source provider maintenance
This commit is contained in:
@@ -475,6 +475,15 @@ func TestHandlerVehicleSourceDiagnosticAndPolicyUpdate(t *testing.T) {
|
||||
if rec.Code != http.StatusOK || !strings.Contains(rec.Body.String(), `"version":2`) {
|
||||
t.Fatalf("policy update status=%d body=%s", rec.Code, rec.Body.String())
|
||||
}
|
||||
payload = fmt.Sprintf(`{"version":2,"providerName":"G7s","providerEvidence":"GPS 运维终端清单","enabled":true,"priority":%d,"remark":"人工核验"}`, source.Priority)
|
||||
rec = httptest.NewRecorder()
|
||||
req = httptest.NewRequest(http.MethodPut, "/api/v2/operations/vehicles/LB9A32A24R0LS1426/sources/"+source.SourceRef, strings.NewReader(payload)).WithContext(ctx)
|
||||
handler.ServeHTTP(rec, req)
|
||||
if rec.Code != http.StatusOK || !strings.Contains(rec.Body.String(), `"version":3`) ||
|
||||
!strings.Contains(rec.Body.String(), `"providerOverride":"G7s"`) ||
|
||||
strings.Contains(rec.Body.String(), `"sourceKey"`) {
|
||||
t.Fatalf("provider update status=%d body=%s", rec.Code, rec.Body.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandlerVehicleServiceCanonicalEndpoint(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user