Install
Gradle:Quick start
JUnit 5 + Selenium
Filtering
Parallel tests
generateInbox() runs locally — safe with JUnit parallel execution and TestNG parallel suites. Every call returns a unique isolated inbox.
Free API key (private inboxes)
Without a key, anyone who knows an inbox’s name can read it, and one sender can reach only 5 different inboxes a day: past that, the inbox gets a notice fromnotice@zerodrop.dev instead of the email. Sign in with GitHub at zerodrop.dev/keys for a free key and set it as ZERODROP_API_KEY. With v0.2.0 or later, the client reads it, generateInbox() starts names with your key’s prefix, only your key can read those inboxes, and mail to them isn’t limited:
Error handling
ZeroDropException.Held is new in v0.3.0. Without an API key, one sender can reach only 5 different inboxes a day; past that, the email isn’t stored and the inbox gets a notice instead. waitForLatest then throws ZeroDropException.Held at once rather than waiting for the timeout, and fetchLatest throws it when nothing matches. Older versions treat the notice as an email: without a filter they return it, and an OTP filter skips it, so the wait times out. A free key from zerodrop.dev/keys lifts the limit for inboxes under your key’s prefix.
Workspaces & self-hosting
A Workspace receives mail on a domain of its own, such asyourcompany-qa.com, and every inbox on it can be read only with your key. Set the domain as ZERODROP_DOMAIN, which ZeroDrop.create() reads like your key, or pass it to the builder (v0.4.0 or later):
mail.waitForLatest("qa@yourcompany-qa.com") reads the inbox k7x2-qa. mail.domain() returns the domain in use, and a value that isn’t a domain name makes ZeroDrop.create() and build() throw IllegalArgumentException. Use the domain as your API keys page shows it. See Workspaces for how mail on it is filed.
A self-hosted instance takes its own base URL: