QA 在候选上实测出两条: - P0 处置接口 500:LoadReconciliationActionView 的 SELECT 用了未限定的 reconciliationFindingColumns,而语句 JOIN 了 reconciliation_runs 与 test_publications(两者也有 id/title/path/source),PostgreSQL 直接报 column reference "id" is ambiguous,writeback/requeue/remove 全部 500。 改为按别名限定列(qualifiedFindingColumns),补真库集成用例。 - R-102 契约偏差:空的 document_id 被多段路由规范化成 307、含未编码斜杠的 id 落到 404,契约要求 400。补子树兜底路由,并在鉴权之后加 guard 把 // 路径拦成 400 (未登录仍是 401),补接口用例。
This commit is contained in:
@@ -126,3 +126,21 @@ func TestReconciliationFindingTypeValidation(t *testing.T) {
|
||||
t.Fatalf("invalid type = %d", recorder.Code)
|
||||
}
|
||||
}
|
||||
|
||||
func TestReconciliationProgressRejectsMalformedDocumentIDWith400(t *testing.T) {
|
||||
service := &reconciliationServiceStub{}
|
||||
handler, err := NewHandler(Config{Store: &fakeJobStore{}, Reconciliation: service})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, path := range []string{
|
||||
"/api/v1/reconciliation/documents//progress",
|
||||
"/api/v1/reconciliation/documents/doc-1/extra/progress",
|
||||
} {
|
||||
recorder := httptest.NewRecorder()
|
||||
handler.ServeHTTP(recorder, reconciliationRequest(http.MethodGet, path, roleViewer, ""))
|
||||
if recorder.Code != http.StatusBadRequest || !strings.Contains(recorder.Body.String(), "invalid document id") {
|
||||
t.Fatalf("%s = %d %s, want 400 invalid document id", path, recorder.Code, recorder.Body.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user