TestProtectionPutRequiresTopLevelKeys: a body missing a top-level section is a 422 (D3 — no silent reset).
(t *testing.T)
| 97 | // TestProtectionPutRequiresTopLevelKeys: a body missing a top-level section is a |
| 98 | // 422 (D3 — no silent reset). |
| 99 | func TestProtectionPutRequiresTopLevelKeys(t *testing.T) { |
| 100 | srv, _ := protectionServer(t) |
| 101 | // Missing "holds". |
| 102 | put := map[string]any{ |
| 103 | "inbound": map[string]any{"gate": map[string]any{}, "scan": map[string]any{}}, |
| 104 | "outbound": map[string]any{"gate": map[string]any{}, "scan": map[string]any{}}, |
| 105 | } |
| 106 | code, body := sendJSON(t, "PUT", srv.URL+"/v1/agents/support%40acme.com/protection", "good", put) |
| 107 | if code != 422 { |
| 108 | t.Fatalf("missing holds: status %d, want 422 (body %v)", code, body) |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | // TestProtectionPutEmptyLeavesDefault: present top-level keys with empty leaves |
| 113 | // fill the safe-permissive defaults. |
nothing calls this directly
no test coverage detected