Skip to content

[CT-16] Write integration tests for POST /submit #548

Description

@mftee

Problem

The POST /submit endpoint (CT-01) has no test coverage. Once implemented it can regress silently — a broken submission handler would prevent all new documents from being anchored on Stellar.

Proposed Solution

Write integration tests using axum-test and httpmock inside contract/module/tests/submit_tests.rs.

Acceptance Criteria

  • Test: valid 64-character hex hash returns 200 with a SubmitResponse containing success=true and a non-null transaction_id
  • Test: hash shorter than 64 characters returns 400 with a descriptive error message
  • Test: hash containing non-hex characters returns 400
  • Test: empty document_hash field returns 400
  • Test: submitting the same hash twice returns 409 Conflict with an already submitted error
  • Test: Stellar client failure returns 500 (mock the StellarClient to return an error)
  • All test files live inside contract/module/tests/

Metadata

Metadata

Assignees

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