Skip to main content
Interactive Service Mesh VisualizationAn interactive mesh representing service-to-service communication and microservices architecture.
Real Database Testing

Spring Boot +
Testcontainers

Real PostgreSQL, MongoDB, Redis via Testcontainers. External APIs auto-stubbed from captured traces. Catch schema drift, real SQL edge cases, and migration issues. Database auto-seeded from production data.

RealDB
PostgreSQL, MongoDB, Redis
Auto
Seeded from Traces
Stubbed
External APIs
Supported Databases & Tech
PostgreSQL - Supported technology for Testcontainers integration testingPostgreSQL
MongoDB - Supported technology for Testcontainers integration testingMongoDB
Redis - Supported technology for Testcontainers integration testingRedis
Spring Boot - Supported technology for Testcontainers integration testingSpring Boot
JUnit 5 - Supported technology for Testcontainers integration testingJUnit 5
Docker - Supported technology for Testcontainers integration testingDocker
Java 17+ - Supported technology for Testcontainers integration testingJava 17+
Kafka - Supported technology for Testcontainers integration testingKafka
Keycloak - Supported technology for Testcontainers integration testingKeycloak
Real Database in DockerActual PostgreSQL, MongoDB, MySQL. Not mocks. Not H2.
External APIs ReplayedOnly what crosses the service boundary is stubbed from traces.
Auto-Seeded DataDatabase populated from captured production state. No manual fixtures.
HOW IT WORKS

Real Database, Replayed APIs, Auto-Seeded Data

BitDive boots the full Spring context with a real database via Testcontainers. External APIs are replayed from captured traces. The database is auto-seeded from production data.

01
CAPTURE

Record Everything

BitDive captures the full execution trace: HTTP entry, method calls, SQL queries with results, API responses, Kafka messages, and the database state needed to reproduce the scenario.

02
REAL DB + REPLAYED APIs

Hybrid Execution

The database runs in a real Testcontainer (PostgreSQL, MongoDB). Your SQL hits real indexes, constraints, and types. External HTTP and Kafka calls are replayed from traces. No flakiness from 3rd-party services.

03
AUTO-SEED

Production Data State

BitDive seeds the Testcontainer with the exact data state from your captured trace. No manual SQL fixtures, no factory classes, no YAML files. The database starts with the data your code actually ran against.

WHY REAL DB MATTERS

Bugs That Only Real Databases Reveal

H2 and mocked repositories hide production-breaking issues

H2 doesn't support JSONB, partial indexes, or database-specific collations. Mocked repositories don't catch constraint violations. A real PostgreSQL or MongoDB in a Testcontainer catches the bugs that matter.

  • Schema Drift: A migration renames a column. Your JPQL query still compiles but fails at runtime. Real DB catches it.
  • Constraint Violations: Unique constraints, foreign keys, CHECK constraints. Only a real database enforces them.
  • Type-Specific Behavior: JSONB operators, array columns, enum types, collation-dependent sorting. None of this works in H2.
IMPLEMENTATION

Zero-Boilerplate Setup

Same ReplayTestBase, real database under the hood

Inherit from `ReplayTestBase` with Testcontainers mode enabled. BitDive manages the container lifecycle, seeds the database, and replays external API calls. Your test code stays minimal.

  • Managed Lifecycle: BitDive starts and stops Testcontainers automatically. No @Container annotations needed.
  • Auto-Seeded Data: The database is populated from captured trace data. No manual fixtures to maintain.
  • External APIs Still Replayed: HTTP calls to other microservices are replayed from traces. No flakiness from external systems.
TESTCONTAINERS vs REPLAY

Two Modes, One Platform

Choose the right level of realism for each test

Replay mode replays everything (including DB) from traces. Zero infrastructure, maximum speed. Testcontainers mode runs a real database for maximum realism. Both share the same test harness and captured traces.

  • Replay Mode: All deps replayed. No Docker needed. Catches wiring, serialization, validation, @Transactional bugs.
  • Testcontainers Mode: Real DB in Docker. Same bugs PLUS schema drift, constraint violations, migration issues, real SQL behavior.
  • Same Traces: Both modes use the same captured production traces. Switch modes per test class.
SUPPORT

Frequently Asked Questions

Common questions about the platform.

Replay mode replays ALL external dependencies from traces, including database responses. No infrastructure needed. Testcontainers mode runs a real database in Docker while replaying only external API calls from traces. Use Testcontainers when you need to catch schema drift, test real SQL behavior, or validate migrations.
PostgreSQL, MongoDB, MySQL, Redis, and anything else Testcontainers supports. BitDive manages the container lifecycle and auto-seeds the database from captured production data.
Yes. Testcontainers requires a Docker-compatible runtime. If Docker is not available in your environment, use BitDive's Replay mode instead, which requires zero infrastructure and runs anywhere with `mvn test`.
BitDive captures the database state from your running application and auto-seeds the Testcontainer with that data before each test. No manual fixtures, no SQL scripts, no factory classes.
Yes. Both modes share the same captured traces and the same ReplayTestBase harness. You choose the mode per test class. Use Replay for speed, Testcontainers for database-specific verification.

Test Against Real Databases. No Manual Fixtures.

Real PostgreSQL, MongoDB, Redis via Testcontainers. Auto-seeded from production data. External APIs replayed from traces. Start testing with real databases today.