Keploy as a Clojure testing framework
Keploy tests Clojure services by recording real HTTP and database traffic from a running process, then replaying it as assertions. There is no var to rebind and nothing to mock by hand, because capture happens below the JVM at the socket.
keploy record -c "java -jar target/app-standalone.jar"What Keploy gives a Clojure team
Any Clojure service, unchanged
Keploy runs the uberjar. Ring, Pedestal, Reitit and a bare Jetty adapter all record identically, because capture is at the socket rather than inside the handler stack.
- Clojure 1.10 and above
- Ring, Pedestal, Reitit
- Leiningen or deps.edn
- No plugin needed
Why Clojure 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 Clojure: by hand, with clojure.test + with-redefs, or with Keploy
clojure.test + with-redefs describes the exchange by hand and still needs the dependency supplied. Keploy records both halves once and replays them with nothing running.
Select any row for the full comparison, with code.
What you write for Clojure vs what Keploy records
All three produce the same assertion. Only the third still passes after the next refactor without anyone editing it.
with-redefs rebinds the var for this form only, so next.jdbc never runs.
WireMock serves the upstream. The database is still a real one.
Recorded from one real request. Nothing here was typed by hand.
Times are estimates for authoring one endpoint’s coverage from scratch, not measurements.
Clojure 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 Clojure app once, replay it forever
Keploy sits below your Clojure 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 Clojure service and captures the dependency calls it makes.
What Keploy mocks for Clojure, with zero config
5 of the 6 dependencies a typical Clojure 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 beneath next.jdbc
- Auto-mocked
MySQLView page
MySQL protocol beneath the JDBC driver
- DatomicOn the roadmap
Datomic
Peer protocol, where it crosses the network
- Auto-mocked
RedisView page
RESP beneath carmine
- Auto-mocked
Apache KafkaView page
Kafka protocol beneath jackdaw
- Outbound HTTPAuto-mocked
Outbound HTTP
Every clj-http and hato call
Your first Clojure test suite in under five minutes
Every command below runs against your existing Clojure 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/app-standalone.jar"3Exercise the paths you care about
Use curl, your frontend, or an existing smoke script. Every request becomes a test case with its Clojure calls captured alongside it.
curl -X POST localhost:3000/orders/o-1/confirmcurl localhost:3000/orders/o-14Replay 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/app-standalone.jar" --delay 20
Ready to try it on your own Clojure service?
Works with the rest of your Clojure stack
Keploy records at the network layer, so framework and driver choices inside your Clojure app do not change how it captures traffic.
Java
Clojure services run on the JVM and record identically
Ring
Handlers record as ordinary HTTP
Pedestal
Interceptor chains are captured end to end
Leiningen
No plugin needed; Keploy runs the uberjar
PostgreSQL
The most common Clojure data store
Apache Kafka
Streaming Clojure services record the same way
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 - Languages
Keploy as a Scala testing framework
Record a running Scala service once and get integration coverage without cake-pattern wiring or a Testcontainers fixture per suite.
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
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