| 1 | package fr.sii.ogham.testing.assertion.email; | |
| 2 | ||
| 3 | ||
| 4 | /** | |
| 5 | * Class used in tests for ensuring that the email is respected. It provides the | |
| 6 | * following information: | |
| 7 | * <ul> | |
| 8 | * <li>The expected subject</li> | |
| 9 | * <li>The expected body</li> | |
| 10 | * <li>The expected sender address</li> | |
| 11 | * <li>The expected recipients (to, cc, bcc)</li> | |
| 12 | * </ul> | |
| 13 | * | |
| 14 | * @author Aurélien Baudet | |
| 15 | * @see ExpectedEmailHeader | |
| 16 | */ | |
| 17 | public class ExpectedEmail extends ExpectedEmailHeader { | |
| 18 | /** | |
| 19 | * The expected body content | |
| 20 | */ | |
| 21 | private ExpectedContent expectedContent; | |
| 22 | ||
| 23 | /** | |
| 24 | * Initialize the expected email with string values. The body is used as-is | |
| 25 | * and is expected to provide a "text/plain" Mime Type. | |
| 26 | * | |
| 27 | * @param subject | |
| 28 | * the expected subject of the email | |
| 29 | * @param body | |
| 30 | * the expected body of the email in plain text | |
| 31 | * @param from | |
| 32 | * the expected email sender address | |
| 33 | * @param to | |
| 34 | * the expected recipients | |
| 35 | */ | |
| 36 | public ExpectedEmail(String subject, String body, String from, String... to) { | |
| 37 | this(subject, new ExpectedContent(body, "text/plain.*"), from, to); | |
| 38 | } | |
| 39 | ||
| 40 | /** | |
| 41 | * Initialize the expected email with provided values. | |
| 42 | * | |
| 43 | * @param subject | |
| 44 | * the expected subject of the email | |
| 45 | * @param expectedContent | |
| 46 | * the expected body of the email with the expected Mime Type | |
| 47 | * @param from | |
| 48 | * the expected email sender address | |
| 49 | * @param to | |
| 50 | * the expected recipients | |
| 51 | */ | |
| 52 | public ExpectedEmail(String subject, ExpectedContent expectedContent, String from, String... to) { | |
| 53 | super(subject, from, to); | |
| 54 | this.expectedContent = expectedContent; | |
| 55 | } | |
| 56 | ||
| 57 | public ExpectedContent getExpectedContent() { | |
| 58 |
2
1. getExpectedContent : replaced return value with null for fr/sii/ogham/testing/assertion/email/ExpectedEmail::getExpectedContent → NO_COVERAGE 2. getExpectedContent : replaced return value with null for fr/sii/ogham/testing/assertion/email/ExpectedEmail::getExpectedContent → KILLED |
return expectedContent; |
| 59 | } | |
| 60 | } | |
Mutations | ||
| 58 |
1.1 2.2 |