Interface ResponseMailpitInterface
- All Known Implementing Classes:
AssertableMailpitResponse
public interface ResponseMailpitInterface
-
Method Summary
Modifier and TypeMethodDescriptioncheck()Asserts that the response body is valid for subsequent checks.Retrieves a field value of any type from the Mailpit response body.seeEmailAttachmentsCountExactly(int expectedCount) Asserts that the email message contains exactly the expected number of attachments.seeEmailBccCountExactly(int expectedCount) Asserts that the email message contains exactly the expected number of "Bcc" email addresses.seeEmailBodyContains(String expectedSubString) Asserts that the email message body contains the expected string.seeEmailBodyEqual(String expectedBody) Asserts that the email message body equals the expected string.seeEmailCcCountExactly(int expectedCount) Asserts that the email message contains exactly the expected number of "Cc" email addresses.seeEmailContainsBcc(String expectedEmail) Asserts that the email message contains the expected email address in the "Bcc" field.seeEmailContainsCc(String expectedEmail) Asserts that the email message contains the expected email address in the "Cc" field.seeEmailContainsFrom(String expectedEmail) Asserts that the email message contains the expected email address in the "From" field.seeEmailContainsReplyTo(String expectedEmail) Asserts that the email message contains the expected email address in the "ReplyTo" field.seeEmailContainsTo(String expectedEmail) Asserts that the email message contains the expected email address in the "To" field.seeEmailReplyToCountExactly(int expectedCount) Asserts that the email message contains exactly the expected number of "ReplyTo" email addresses.seeEmailSubjectContains(String expectedSubString) Asserts that the email message subject contains the expected string.seeEmailSubjectEqual(String expectedSubject) Asserts that the email message subject equals the expected string.seeEmailToCountExactly(int expectedCount) Asserts that the email message contains exactly the expected number of "To" email addresses.seeResponseBodyFieldMatch(String path, org.hamcrest.Matcher<?> matcher) Asserts that the email message body matches the specified matcher.
-
Method Details
-
check
AssertableMailpitResponse check()Asserts that the response body is valid for subsequent checks.Used internally by EmailMailpit methods.
- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeResponseBodyFieldMatch
Asserts that the email message body matches the specified matcher.NOTE: Use for some custom asserts or not yet supported features
- Parameters:
path- path to the field (for example:data.user.id)matcher- Matcher- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailBodyEqual
Asserts that the email message body equals the expected string.- Parameters:
expectedBody- expected email body- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailBodyContains
Asserts that the email message body contains the expected string.- Parameters:
expectedSubString- expected substring- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailSubjectEqual
Asserts that the email message subject equals the expected string.- Parameters:
expectedSubject- expected email subject- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailSubjectContains
Asserts that the email message subject contains the expected string.- Parameters:
expectedSubString- expected substring- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailContainsFrom
Asserts that the email message contains the expected email address in the "From" field.- Parameters:
expectedEmail- expected email address in the "From" field- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailContainsTo
Asserts that the email message contains the expected email address in the "To" field.- Parameters:
expectedEmail- expected email address in the "To" field- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailContainsCc
Asserts that the email message contains the expected email address in the "Cc" field.- Parameters:
expectedEmail- expected email address in the "Cc" field- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailContainsBcc
Asserts that the email message contains the expected email address in the "Bcc" field.- Parameters:
expectedEmail- expected email address in the "Bcc" field- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailContainsReplyTo
Asserts that the email message contains the expected email address in the "ReplyTo" field.- Parameters:
expectedEmail- expected email address in the "ReplyTo" field- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailAttachmentsCountExactly
Asserts that the email message contains exactly the expected number of attachments.- Parameters:
expectedCount- expected number of attachments- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailToCountExactly
Asserts that the email message contains exactly the expected number of "To" email addresses.- Parameters:
expectedCount- expected number of "To" email addresses in the message- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailCcCountExactly
Asserts that the email message contains exactly the expected number of "Cc" email addresses.- Parameters:
expectedCount- expected number of "Cc" email addresses in the message- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailBccCountExactly
Asserts that the email message contains exactly the expected number of "Bcc" email addresses.- Parameters:
expectedCount- expected number of "Bcc" email addresses in the message- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
seeEmailReplyToCountExactly
Asserts that the email message contains exactly the expected number of "ReplyTo" email addresses.- Parameters:
expectedCount- expected number of "ReplyTo" email addresses in the message- Returns:
- this instance for method chaining
- Throws:
AssertionError- if the assertion fails
-
grabDataFromResponseByPath
Retrieves a field value of any type from the Mailpit response body.- Parameters:
path- path to the field (for example:messages[0].To)- Returns:
- field value from the response body
-