TASK-3585: idempotency keys on patch.
(t *testing.T, key string, body map[string]any)
| 18 | // TASK-3585: idempotency keys on patch. |
| 19 | |
| 20 | func (f *patchFixture) patchKey(t *testing.T, key string, body map[string]any) (int, map[string]any, http.Header) { |
| 21 | t.Helper() |
| 22 | rr := doRequestWithHeaders(f.srv, "POST", f.path+"/patch", body, map[string]string{"Idempotency-Key": key}) |
| 23 | var out map[string]any |
| 24 | _ = json.Unmarshal(rr.Body.Bytes(), &out) |
| 25 | return rr.Code, out, rr.Header() |
| 26 | } |
| 27 | |
| 28 | // An insert-shaped edit keeps its anchor, so a plain retry would insert it |
| 29 | // twice. With a key, the retry replays the first answer. |
no test coverage detected