Keploy as a Scala testing framework
Keploy tests Scala services by recording real HTTP and JDBC traffic from a running JVM process, then replaying it as assertions. There is no cake pattern or ZIO layer to restructure for testability, and no Testcontainers fixture to boot per suite.
keploy record -c "java -jar target/scala-3.3/orders.jar"What Keploy gives a Scala team
Any Scala JVM service, unchanged
Keploy runs the assembled JAR. Play, Akka HTTP, http4s, and ZIO HTTP all record the same way because capture is at the socket rather than inside the effect system.
- Scala 2.13 and 3.x on the JVM
- Play, Akka HTTP, http4s, ZIO HTTP
- Futures, cats-effect, and ZIO alike
- sbt or Mill, no plugin needed
Why Scala integration tests slow teams down
The friction is rarely the assertions. It is everything around them — spinning up dependencies, keeping mocks honest, and repairing tests after every refactor.
Testing Scala: by hand, with ScalaTest + Testcontainers, or with Keploy
ScalaTest describes the exchange and Testcontainers supplies a real database at a container per suite. Keploy records both halves once and replays them with nothing running.
Select any row for the full comparison, with code.
What you write for Scala vs what Keploy records
All three produce the same assertion. Only the third still passes after the next refactor without anyone editing it.
Two traits exist in production code purely so these stubs can be injected, and neither stub fails when the real Stripe or Postgres contract changes.
Real query semantics — and every job pulls a Postgres image, boots it, and replays the migration history before the first assertion.
The SQL Doobie emitted and the upstream response are both recorded, so no trait had to exist for substitution and the effect stack ran as written.
Times are estimates for authoring one endpoint’s coverage from scratch, not measurements.
Scala testing tools, compared
The options a team on the JVM actually reaches for, and where each one genuinely wins. Select a row for the full comparison.
Assessments reflect each tool’s documented behaviour, not benchmark measurements.
Record your Scala app once, replay it forever
Keploy sits below your Scala process at the network layer. It watches the calls your app already makes, then serves them back on replay so tests run with no dependencies attached.
Keploy records a GET call to /api/v1/orders/{id} on a Scala service and captures the dependency calls it makes.
What Keploy mocks for Scala, with zero config
7 of the 7 dependencies a typical Scala service talks to are stubbed from the recording itself — no mock classes, no fixture files, no containers in CI.
- Auto-mocked
PostgreSQLView page
Postgres frontend/backend protocol
- Auto-mocked
MySQLView page
MySQL wire protocol
- Auto-mocked
MongoDBView page
MongoDB wire protocol
- Auto-mocked
RedisView page
RESP over TCP
- Auto-mocked
Apache KafkaView page
Kafka producer and consumer protocol
- Auto-mocked
gRPCView page
HTTP/2 framed gRPC calls
- Outbound HTTPAuto-mocked
Outbound HTTP
Any HTTP client call the service makes
Your first Scala test suite in under five minutes
Every command below runs against your existing Scala service. Nothing in your source tree changes.
1Install the Keploy CLI
A single binary. It needs a Linux kernel with eBPF support, or Docker on macOS and Windows — and it adds nothing to your project's dependencies.
curl -sSL https://keploy.io/install.sh | bash2Record your service
Pass the command you already use to start the app. Keploy runs it and watches every socket it opens.
keploy record -c "java -jar target/scala-3.3/orders.jar"3Exercise the paths you care about
Assemble as normal, then drive the JAR. Every request becomes a test case with its JDBC and HTTP calls captured alongside.
sbt assemblycurl -X POST localhost:9000/orders/ord_1/confirm -H 'Content-Type: application/json' -d '{"paymentToken":"tok_123"}'4Replay in CI
Replay serves the recorded dependency responses, so the job needs no service containers and no Docker daemon.
keploy test -c "java -jar target/scala-3.3/orders.jar" --delay 18
Ready to try it on your own Scala service?
Works with the rest of your Scala stack
Keploy records at the network layer, so framework and driver choices inside your Scala app do not change how it captures traffic.
Java
The JVM page covers driver-level coverage in depth.
- Play Framework
Play Framework
Recorded through the embedded server; filters run for real.
Akka HTTP
Routes record identically; directives execute as written.
PostgreSQL
Doobie and Slick queries record at the protocol layer.
Apache Kafka
Producer and consumer traffic records at the protocol layer.
Kotlin
The other major JVM language page.
Testing the rest of your stack
- Languages
Keploy as a Java testing framework
Generate JUnit-grade integration tests for any JVM service by recording the traffic it already serves.
Read the guide - Languages
Keploy as a Kotlin testing framework
Record a running Kotlin service once and get coroutine-safe integration coverage without MockK relaxed mocks or Testcontainers.
Read the guide - Databases
Keploy as a PostgreSQL testing framework
Record the Postgres frontend/backend protocol once and replay real result sets in tests — no container, no pg-mem, no schema to rebuild.
Read the guide - Message Queues
Keploy as a Apache Kafka testing framework
Test producers and consumers against recorded broker exchanges — no embedded Kafka, no Testcontainers cluster, no flaky poll loops.
Read the guide - Caches & Stores
Keploy as a Redis testing framework
Record RESP traffic once and replay real cache hits, misses, TTLs, and pipeline responses without a Redis server in CI.
Read the guide - Databases
Keploy as a MySQL testing framework
Mock MySQL at the wire protocol instead of standing up a container or swapping in H2 — the rows your queries really returned, replayed.
Read the guide
Join our GlobalCommunity
Connect with developers worldwide. Follow updates, ask questions, share feedback, and ship faster with other Keploy builders.
“Best report of integration and API tests I've seen — which we don't get from RestAssured.”
G2“Future of microservices testing. I don't write tests now!”
G2 · 5/5“An amazing product that simplifies the automation.”
Gartner · 4.0