Keploy logo
Amazon S3 logo

Keploy as a Amazon S3 testing framework

Keploy mocks Amazon S3 by recording the SDK's HTTP traffic, capturing object bodies, ETags, metadata, and presigned URL responses exactly as the service returned them, then replaying them in tests. No bucket exists, no MinIO runs, and no credentials are needed.

Generate Amazon S3 tests free
keploy record -c "./uploads-service"
18.4K+VS Code1.2M+300M+mocks created

What Keploy gives a Amazon S3 team

Captured at the S3 REST API

The AWS SDK talks to S3 over HTTPS, so Keploy records the real exchange — PutObject and GetObject bodies, ETags, content types, and the XML responses for list operations.

  • Below every AWS SDK language binding
  • ETags and object metadata preserved
  • Multipart upload parts captured
  • List responses recorded verbatim
The problem

Why Amazon S3 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.

Three ways to do it

Testing Amazon S3: by hand, with MinIO or LocalStack, or with Keploy

MinIO gives a working S3 API in a container that every environment must run. Keploy records the real service once and replays exactly what it returned.

Select any row for the full comparison, with code.

Same coverage, three costs

What you write for Amazon S3 vs what Keploy records

All three produce the same assertion. Only the third still passes after the next refactor without anyone editing it.

By hand2–4 hours
storage_stub.go
hand-written
// Hand-written stub: no ETag, no metadata, no multipart.
package storage
 
type StubStore struct {
objects map[string][]byte
}
 
func (s *StubStore) Put(key string, body []byte, contentType string) error {
// The content type is accepted and discarded.
s.objects[key] = body
return nil
}
 
func (s *StubStore) Presign(key string, ttl time.Duration) (string, error) {
// Not a real signature, so nothing about it can be verified.
return "https://example.test/" + key, nil
}

The presigned URL is a fabricated string, so a wrong expiry or a missing content-type constraint is impossible to catch here.

MinIO or LocalStack1–2 hours
storage_minio_test.go
tool-assisted
// MinIO: an S3-compatible server per suite.
package storage
 
import (
"context"
"testing"
)
 
func TestUploadsAnInvoice(t *testing.T) {
client := minioClient(t) // points at localhost:9000
 
// Every environment creates and cleans up the bucket.
mustMakeBucket(t, client, "invoices")
t.Cleanup(func() { mustRemoveBucket(t, client, "invoices") })
 
store := New(client, "invoices")
err := store.Put(context.Background(), "inv_1.pdf", pdfBytes, "application/pdf")
 
if err != nil {
t.Fatalf("upload failed: %v", err)
}
}

Real ETags and metadata against a local endpoint — and it needs a MinIO server plus bucket creation and cleanup in every environment.

With Keploy~5 minutes
mocks.yaml
auto-generated
# Recorded with: keploy record -c './uploads-service'
# The S3 response, captured at the REST API layer.
version: api.keploy.io/v1beta1
kind: Http
name: mock-4
spec:
request:
method: PUT
url: https://invoices.storage.example.com/inv_1.pdf
header:
Content-Type: application/pdf
x-amz-content-sha256: "<captured>"
response:
status_code: 200
header:
# The real ETag, so a body change is detectable.
ETag: '"9f2c1e7b4a..."'
x-amz-server-side-encryption: "AES256"

The ETag and encryption header are what S3 really returned, so a change to the uploaded bytes shows up as a diff rather than passing silently.

Times are estimates for authoring one endpoint’s coverage from scratch, not measurements.

Keploy vs the alternatives

Amazon S3 testing tools, compared

The options a team on service and platform integrations actually reaches for, and where each one genuinely wins. Select a row for the full comparison.

Best in classStrongPartialNot covered

Assessments reflect each tool’s documented behaviour, not benchmark measurements.

How it works

Record your Amazon S3 app once, replay it forever

Keploy sits below your Amazon S3 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 Amazon S3 service and captures the dependency calls it makes.

Amazon S3 logo
Your Amazon S3 app
GET/api/v1/orders/{id}200
RecordingKeploy proxyeBPF · userspace
+3 more Amazon S3 clients
An example shape of a captured call. Your own endpoints and dependencies come from your real traffic, so nothing here has to be written by hand.
Quick start

Your first Amazon S3 test suite in under five minutes

Every command below runs against your existing Amazon S3 service. Nothing in your source tree changes.

  1. 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 | bash
  2. 2Record your service

    Pass the command you already use to start the app. Keploy runs it and watches every socket it opens.

    keploy record -c "./uploads-service"
  3. 3Exercise the paths you care about

    Run the app against your development bucket. Every upload, download, and presign call, with the response S3 returned, is captured together.

    curl -X POST localhost:8080/invoices -F 'file=@inv_1.pdf'
    curl localhost:8080/invoices/inv_1.pdf/link
  4. 4Replay in CI

    Replay serves the recorded dependency responses, so the job needs no service containers and no Docker daemon.

    keploy test -c "./uploads-service" --delay 8

Ready to try it on your own Amazon S3 service?

FAQ

Amazon S3 testing with Keploy: common questions

Join our GlobalCommunity

Connect with developers worldwide. Follow updates, ask questions, share feedback, and ship faster with other Keploy builders.

1.2M+Installs
18.4K+GitHub
100K+Devs
300M+Mocks
1K+Contributors
#1OSS Trending
4.9★★★★★from 500+ reviews onG2GartnerVS CodeChrome
★★★★★

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
XGitHubSlackYouTubeLinkedIn
Built by developers, for developers.Let's build the future, together.