View on GitHub

examples

Email testing and SMS verification examples using MailSlurp and a wide range of frameworks.

MailSlurp SMS Deliverability + Simulation in JMeter

This project is a runnable reference for QA/SRE/load-test teams who want to validate SMS delivery at scale using MailSlurp deliverability tests.

It includes two JMeter approaches:

  1. HTTP Sampler approach (classic JMeter style): explicit REST calls and JSON extractors.
  2. Java Request approach (JMeter pro style): Java sampler using mailslurp-client-java:17.1.0 + API client calls.

Both approaches support:

What This Example Does

End-to-end flow:

  1. Read API_KEY (or -JapiKey=...).
  2. GET /phone/numbers and select phones.
  3. Select one phone as the simulation sender.
  4. Create deliverability test (POST /test/deliverability) with scope PHONE.
  5. Exclude the simulation sender from targets.
  6. Start test (POST /test/deliverability/{testId}/start).
  7. If sendMode=SIMULATOR, create simulation job (POST /test/deliverability/{testId}/simulation-jobs).
  8. Poll status (GET /test/deliverability/{testId}/status) until done/fail/timeout.
  9. Emit final pass/fail result for CI.

Why exclude the simulation sender?

Some telecom routes can allow self-delivery/loopback behavior. We explicitly exclude the sender phone from target selection to keep results clean and deterministic.

Run Modes

runType=ALL (default)

runType=SINGLE

SINGLE requires at least 2 phone numbers.

Send Modes

sendMode=SIMULATOR (default)

This example creates a MailSlurp simulation job to generate SMS sends automatically.

sendMode=EXTERNAL

Simulation call is skipped. Use this when you want your own system-under-test to send SMS while MailSlurp deliverability test tracks outcomes.

Project Files

Prerequisites

Quick Start

Set your key:

export API_KEY='your_mailslurp_api_key'

HTTP approach

make test-http-all
make test-http-single

Java SDK approach

make test-java-all
make test-java-single

Backward-compatible shortcuts (HTTP default)

make test
make test-all
make test-single

GUI Usage

JMeter is auto-downloaded to opt/ on first GUI run.

make gui                 # HTTP plan
make gui-single          # HTTP + runType=SINGLE
make gui-java            # Java sampler plan
make gui-java-single     # Java sampler + runType=SINGLE

Make Targets

List all commands:

make help

Most used:

Optional runtime override:

API_KEY=... SEND_MODE=EXTERNAL make test-java-single

Reports and Logs

Console progress markers

HTTP approach prints:

Java approach prints:

JMeter logs

Result CSV

HTML dashboard report

make report-http
make report-java

Outputs:

JMeter Conventions Used Here

Troubleshooting

No useful output while running

Use:

make logs-tail
make logs-tail-java

Java/Groovy compatibility error (Unsupported class file major version)

The Makefile auto-selects Java 21/17 on macOS for JMeter runs. You can also force:

API_KEY=... JAVA_COMPAT_HOME=$(/usr/libexec/java_home -v 21) make test-single

SINGLE mode seems to run all targets

Confirm run actually used runType=SINGLE and check setup log lines:

SINGLE mode requirements

You must have at least 2 phones in the account.

Notes for Teams Integrating Their Own Sender

Set sendMode=EXTERNAL and trigger your platform’s SMS sender after test start.

You still get MailSlurp deliverability status/progress tracking and deterministic polling without fragile inbox waitFor patterns.

References