Keploy as a Spring Boot testing framework
Keploy tests Spring Boot applications by recording traffic through the embedded server and every downstream call it triggers, then replaying both as assertions. There is no @SpringBootTest context to load, no @MockBean to wire, and no Testcontainers Docker requirement in CI.
keploy record -c "./gradlew bootRun"What Keploy gives a Spring Boot team
Spring Boot 2 and 3, unchanged
Keploy starts the app through bootRun, spring-boot:run, or the packaged JAR. MVC and WebFlux record identically, and the embedded server choice makes no difference because capture happens at the socket.
- Spring Boot 2.x and 3.x
- Tomcat, Jetty, or Undertow
- MVC and reactive WebFlux
- No test slice annotations needed
Why Spring Boot 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 Spring Boot: by hand, with @SpringBootTest + @MockBean, or with Keploy
Spring's testing support is excellent, but its fidelity is bounded by the mocks you declare and its speed by how many contexts your suite needs. Keploy runs the real application once instead.
Select any row for the full comparison, with code.
What you write for Spring Boot vs what Keploy records
All three produce the same assertion. Only the third still passes after the next refactor without anyone editing it.
Fast, because Spring is never involved — which also means filters, converters, validation, and exception handlers are never exercised.
A full context load plus a MySQL container per run, and the payment contract is still whatever the when(...) line claims it is.
This case travelled the whole Spring stack — security filters, validation, and Jackson serialisation included — because it was recorded from a real request, not a slice.
Times are estimates for authoring one endpoint’s coverage from scratch, not measurements.
Spring Boot 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 Spring Boot app once, replay it forever
Keploy sits below your Spring Boot 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 Spring Boot service and captures the dependency calls it makes.
What Keploy mocks for Spring Boot, with zero config
7 of the 8 dependencies a typical Spring Boot service talks to are stubbed from the recording itself — no mock classes, no fixture files, no containers in CI.
- Auto-mocked
MySQLView page
MySQL protocol under Spring Data JPA / JdbcTemplate
- Auto-mocked
PostgreSQLView page
Postgres protocol under Spring Data JPA
- Auto-mocked
MongoDBView page
Wire protocol under Spring Data MongoDB
- Auto-mocked
RedisView page
RESP under Spring Data Redis / Lettuce
- Auto-mocked
Apache KafkaView page
Kafka protocol under Spring Kafka
- Auto-mocked
gRPCView page
HTTP/2 frames from grpc-spring-boot-starter
- Auto-mocked
RestTemplate / WebClient
Any outbound HTTP call from the app
- Partial
Amazon S3
S3 REST API via the AWS SDK
Your first Spring Boot test suite in under five minutes
Every command below runs against your existing Spring Boot service. Nothing in your source tree changes.
1Install the Keploy CLI
One binary. Nothing is added to your Maven or Gradle build, and no agent is attached to the JVM.
curl -sSL https://keploy.io/install.sh | bash2Record through your normal start command
Use bootRun, spring-boot:run, or the built JAR — whichever your team already runs locally.
keploy record -c "./gradlew bootRun"3Exercise the endpoints that matter
Every request served while recording becomes a test case, complete with the SQL and upstream HTTP it triggered.
curl -X POST localhost:8080/orders/ord_1/confirm -H 'Content-Type: application/json' -d '{"paymentToken":"tok_123"}'4Replay in CI as a single step
Replay boots the app once against recorded mocks — no MySQL service, no Docker daemon, no context reloads.
keploy test -c "java -jar build/libs/orders.jar" --delay 20
Ready to try it on your own Spring Boot service?
Works with the rest of your Spring Boot stack
Keploy records at the network layer, so framework and driver choices inside your Spring Boot app do not change how it captures traffic.
Java
The language page covers JVM-wide capture and mock coverage.
Spring Data JPA
Repository methods record as the SQL Hibernate emits.
Spring WebFlux
Reactive endpoints record identically — capture is not blocking-aware.
Spring Security
Filters run on every recorded request, so auth is genuinely exercised.
Gradle
Wrap bootRun; no plugin or test task changes needed.
Apache Maven
Same for spring-boot:run or the packaged JAR.
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 - 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 - 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 - 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