Keploy as a Kotlin testing framework
Keploy tests Kotlin services by recording real HTTP and JDBC traffic from a running JVM process, then replaying it as assertions. There are no MockK stubs to declare, no coEvery blocks to keep in sync, and no Testcontainers Docker requirement in CI.
keploy record -c "java -jar build/libs/orders.jar"What Keploy gives a Kotlin team
Any Kotlin JVM service, unchanged
Keploy runs the JAR Gradle builds. Ktor, Spring Boot with Kotlin, Micronaut, and Http4k all record the same way, because capture happens at the socket rather than inside the framework or the coroutine dispatcher.
- Kotlin 1.8 and above on the JVM
- Ktor, Spring Boot, Micronaut, Http4k
- Coroutines and blocking code alike
- No test source set changes
Why Kotlin 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 Kotlin: by hand, with JUnit 5 + MockK, or with Keploy
MockK stubs and a Ktor MockEngine are both written from your model of a dependency. Keploy records what the dependency actually returned, so a stub cannot quietly diverge from it.
Select any row for the full comparison, with code.
What you write for Kotlin vs what Keploy records
All three produce the same assertion. Only the third still passes after the next refactor without anyone editing it.
Two interfaces exist in production code purely so these fakes can be substituted, and neither fails when the real contract changes.
Concise and coroutine-aware — and the payment contract is whatever the coEvery line claims, while the relaxed repo hides any call nobody declared.
Every suspend function on the path actually ran, so a call nobody thought to declare cannot silently return a relaxed default.
Times are estimates for authoring one endpoint’s coverage from scratch, not measurements.
Kotlin 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 Kotlin app once, replay it forever
Keploy sits below your Kotlin 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 Kotlin service and captures the dependency calls it makes.
What Keploy mocks for Kotlin, with zero config
7 of the 7 dependencies a typical Kotlin service talks to are stubbed from the recording itself — no mock classes, no fixture files, no containers in CI.
- Auto-mocked
PostgreSQLView page
Postgres protocol under Exposed and JDBC
- Auto-mocked
MySQLView page
MySQL protocol under Exposed and JDBC
- Auto-mocked
RedisView page
RESP under Lettuce and Jedis
- Auto-mocked
MongoDBView page
Wire protocol under the Kotlin driver
- Auto-mocked
Apache KafkaView page
Kafka protocol under the Java client
- Auto-mocked
gRPCView page
HTTP/2 framed calls from grpc-kotlin
- Outbound HTTPAuto-mocked
Outbound HTTP
Any Ktor HttpClient or OkHttp call
Your first Kotlin test suite in under five minutes
Every command below runs against your existing Kotlin 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 build/libs/orders.jar"3Exercise the paths you care about
Build as normal, then drive the JAR. Every request becomes a test case with its JDBC and HTTP client calls captured alongside.
./gradlew buildcurl -X POST localhost:8080/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 build/libs/orders.jar" --delay 15
Ready to try it on your own Kotlin service?
Works with the rest of your Kotlin stack
Keploy records at the network layer, so framework and driver choices inside your Kotlin app do not change how it captures traffic.
Java
The JVM page covers driver-level coverage in depth.
Ktor
Recorded through the embedded engine — plugins run for real.
Spring Boot
Kotlin Spring services record exactly as Java ones do.
Exposed
Queries record as the SQL they emit, with real rows.
Gradle
Wrap the built JAR; no test task changes needed.
PostgreSQL
The database page covers protocol-level capture in depth.
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 - Frameworks
Keploy as a Spring Boot testing framework
Skip @SpringBootTest context loads and @MockBean wiring — record the running application and replay every layer from real traffic.
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 - 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 - 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 - Cloud & Infra
Keploy as a gRPC testing framework
Record real gRPC exchanges over HTTP/2 and replay them as tests — no in-process stub server, no hand-written mock service implementation.
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