Skip to content

[CT-27] Write integration tests for GET /health #559

@mftee

Description

@mftee

Problem

The /health endpoint checks Stellar and Redis connectivity but has no automated test coverage. A broken health endpoint would silently report incorrect status to load balancers and monitoring systems.

Proposed Solution

Write integration tests for the health check endpoint inside contract/module/tests/health_tests.rs.

Acceptance Criteria

  • Test: when both StellarClient.check_connection() and CacheBackend.check_connection() return true the endpoint returns 200 with status: healthy
  • Test: when StellarClient.check_connection() returns false the endpoint returns 200 with status: degraded and stellar_connected: false
  • Test: when CacheBackend.check_connection() returns false the endpoint returns 200 with status: degraded and redis_connected: false
  • Test: when both checks fail the endpoint returns 200 with status: degraded and both connected fields as false
  • Tests use mock implementations of StellarClient and CacheBackend to control check_connection return values
  • All test files live inside contract/module/tests/

Metadata

Metadata

Assignees

No one assigned

    Labels

    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