Skip to content

Dependency Injection or Service Locator for Tests #197

@Baskarayelu

Description

@Baskarayelu

Description:

Allow replacing Soroban client and DB in tests via dependency injection or a test-only service locator so unit tests do not hit real RPC or DB.

Requirements

  • Define interfaces or types for “SorobanClient” and “DbClient”; in production use real implementations from env
  • In tests, inject mocks (e.g. mock Server that returns fixed invoke results)
  • Refactor at least one route or lib/contracts module to use injected client; add one test that uses mock
  • Document pattern for adding new tests

Acceptance Criteria

  • DI or service locator in place
  • At least one route/module refactored and tested with mock
  • Documented

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions