Skip to content

Commit a95b7d3

Browse files
author
Stan Misiurev
committed
fix: decode paginated response in backup lifecycle integration test
`GET /api/v1/backups` now returns `{backups, total, limit, offset}` rather than a flat array; update the test to decode the new envelope.
1 parent c381e97 commit a95b7d3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

control-plane/internal/handlers/backup_integration_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,13 @@ func TestIntegration_BackupLifecycle(t *testing.T) {
172172
t.Fatalf("list all backups: expected 200, got %d", resp.StatusCode)
173173
_ = body
174174
}
175-
var allBackups []map[string]interface{}
176-
json.NewDecoder(resp.Body).Decode(&allBackups)
175+
var allBackupsResp struct {
176+
Backups []map[string]interface{} `json:"backups"`
177+
}
178+
json.NewDecoder(resp.Body).Decode(&allBackupsResp)
177179
resp.Body.Close()
178180
found := false
179-
for _, b := range allBackups {
181+
for _, b := range allBackupsResp.Backups {
180182
if uint(b["id"].(float64)) == backupID {
181183
found = true
182184
break

0 commit comments

Comments
 (0)