Skip to content

[Testing] Admin indexer routes /v1/admin/indexer/{status,reset,replay} have no route-level test #847

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

tests/integration/admin-metrics.test.ts mocks indexerService and only exercises GET /metrics. The HTTP handlers in admin.routes.ts:176-249 - including the validation that a missing/negative ledger returns 400 and that reset/replay return ok/202 - are never tested through the router, so auth + validation + status codes on these operational endpoints are unverified.

Acceptance criteria

  • Add integration tests hitting GET /status, POST /reset, POST /replay
  • Assert 400 for negative/non-integer ledger, 202 for a valid replay, and that requireAdmin is enforced
  • Assert resetIndexer/replayFromLedger are called with the parsed values

Files to touch

  • backend/tests/integration/admin-metrics.test.ts
  • backend/src/routes/v1/admin.routes.ts

Out of scope

  • Re-testing the metrics aggregation already covered

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related taskstestingTesting related tasks

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions