Skip to content

[BE-124] Unit tests for the external-validation module #983

Description

@mftee

Overview

backend/src/external-validation/ has 9 files and 1 entity with no tests. It calls third-party validation providers, so its resilience behaviour is what stands between a slow provider and a hung request.

Tasks

  • Mock all outbound HTTP — tests must never call a real provider.
  • Test the success path for each configured provider and correct normalization of their differing response shapes.
  • Test provider failure, timeout, rate-limit (429), and malformed-response handling.
  • Test that one provider failing does not prevent others from returning results.
  • Test retry and backoff behaviour if implemented, including that retries are bounded.
  • Test that provider credentials never appear in logs or error messages.
  • Target ≥75% coverage.

Acceptance Criteria

  • npm run test -- external-validation passes at ≥75% coverage with no network access.
  • A slow or failing provider cannot hang the request.
  • Credentials are proven absent from log output.

Notes for Contributors

Comment below to be assigned.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions