---
type: system
title: Integration test harness on testcontainers
domain: fintech
services: [quality-knowledge, backend-platform]
skills: [Integration Testing, Test Architecture, CI/CD, Reliability]
technologies: [Go, testcontainers, testify, Kafka, PostgreSQL, gRPC, Redis]
problem: A 20+ service payments platform had thin, flaky coverage — mocks drifted from reality, tests slept instead of polling, and defects reached production undetected.
approach: Built a shared testcontainers harness that spins up real infrastructure per run — PostgreSQL with real migrations, Kafka over TLS + SASL, Redis, NATS, plus WireMock for provider APIs — boots each service in-process against it, and exposes a reusable testkit (stub/seed/consume helpers, builder fixtures). Replaced sleeps with Eventually-style polling and added contract-level assertions on status codes, emitted events, and wallet side effects.
result: Lifted 15/15 platform services to ≥80% scenario coverage (HTTP endpoints, Kafka consumers, and gRPC methods counted as distinct paths) with a single green run — ~126 tests in ~96s in CI — and added integration coverage for all 13 payment-provider adapters. The suite became a defect net that repeatedly caught production-class bugs before release.
evidence: Described in work history (Korvax, 2022–present). Caught bugs include a 500-instead-of-404 on a missing wallet, a JWT middleware that let unauthenticated requests through, and a production migration missing from main — walkthrough available on a call.
public_links: []
available_for: private walkthrough
language: en
canonical: https://asmanmalikov.com/en/proof/integration-testing-harness/
---

# Integration test harness on testcontainers

- **Problem:** A 20+ service payments platform had thin, flaky coverage — mocks drifted from reality, tests slept instead of polling, and defects reached production undetected.
- **Approach:** Built a shared testcontainers harness that spins up real infrastructure per run — PostgreSQL with real migrations, Kafka over TLS + SASL, Redis, NATS, plus WireMock for provider APIs — boots each service in-process against it, and exposes a reusable testkit (stub/seed/consume helpers, builder fixtures). Replaced sleeps with Eventually-style polling and added contract-level assertions on status codes, emitted events, and wallet side effects.
- **Result:** Lifted 15/15 platform services to ≥80% scenario coverage (HTTP endpoints, Kafka consumers, and gRPC methods counted as distinct paths) with a single green run — ~126 tests in ~96s in CI — and added integration coverage for all 13 payment-provider adapters. The suite became a defect net that repeatedly caught production-class bugs before release.
- **Evidence:** Described in work history (Korvax, 2022–present). Caught bugs include a 500-instead-of-404 on a missing wallet, a JWT middleware that let unauthenticated requests through, and a production migration missing from main — walkthrough available on a call.
