Package io.quarkiverse.mailpit.test
Class Mailbox
java.lang.Object
io.quarkiverse.mailpit.test.Mailbox
Injected MailContext wrapping the API to Mailpit for unit testing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Delete all messages.com.fasterxml.jackson.databind.ObjectMapperCreate the JSON Mapper with some defaults and custom LocalDateTime parsing.voidDelete a single message.Search messages.Search messages.Get application information Returns basic runtime information, message totals and latest release version.Use "mailpit.http.server" to get the running Mailpit API Server.
-
Constructor Details
-
Mailbox
public Mailbox()
-
-
Method Details
-
delete
Delete a single message.- Parameters:
ID- Database ID to delete- Throws:
ApiException- if fails to make API call
-
clear
Delete all messages.- Throws:
ApiException- if fails to make API call
-
find
Search messages. Returns the latest messages matching a search.- Parameters:
query- Search query (required)start- Pagination offset (optional, default to 0)limit- Limit results (optional, default to 50)- Returns:
- List
- Throws:
ApiException- if fails to make API call
-
findFirst
Search messages. Returns the first message matching a search.- Parameters:
query- Search query (required)- Returns:
- Message
- Throws:
ApiException- if fails to make API call
-
getApplicationInfo
Get application information Returns basic runtime information, message totals and latest release version.- Returns:
- AppInformation
- Throws:
ApiException- if fails to make API call
-
getApiClient
-
getApplicationApi
-
getMessagesApi
-
getMessageApi
-
createApiClient
-
getMailApiUrl
Use "mailpit.http.server" to get the running Mailpit API Server.- Returns:
- the mailer URL or an exception if not found
-
createDefaultObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper createDefaultObjectMapper()Create the JSON Mapper with some defaults and custom LocalDateTime parsing.- Returns:
- the
ObjectMapper
-