| 1 | package fr.sii.ogham.testing.assertion.email; | |
| 2 | ||
| 3 | import java.util.function.Predicate; | |
| 4 | ||
| 5 | import javax.mail.Part; | |
| 6 | ||
| 7 | import fr.sii.ogham.testing.assertion.filter.ContentIdPredicate; | |
| 8 | import fr.sii.ogham.testing.assertion.filter.FileNamePredicate; | |
| 9 | ||
| 10 | /** | |
| 11 | * Helper class to provide well-known predicates. | |
| 12 | * | |
| 13 | * @author Aurélien Baudet | |
| 14 | * | |
| 15 | */ | |
| 16 | public final class By { | |
| 17 | private final Predicate<Part> predicate; | |
| 18 | ||
| 19 | private By(Predicate<Part> predicate) { | |
| 20 | super(); | |
| 21 | this.predicate = predicate; | |
| 22 | } | |
| 23 | ||
| 24 | /** | |
| 25 | * Find an attachment using its name (exact match). | |
| 26 | * | |
| 27 | * @param name | |
| 28 | * the name of the attachment to find | |
| 29 | * @return the finder method | |
| 30 | */ | |
| 31 | public static By filename(String name) { | |
| 32 |
4
1. filename : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::filename → NO_COVERAGE 2. filename : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::filename → KILLED 3. filename : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::filename → KILLED 4. filename : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::filename → KILLED |
return new By(new FileNamePredicate(name)); |
| 33 | } | |
| 34 | ||
| 35 | /** | |
| 36 | * Find an attachment by the Content-ID header value (exact match). | |
| 37 | * | |
| 38 | * @param contentId | |
| 39 | * the value of the Content-ID header of the attachment to find | |
| 40 | * @return the finder method | |
| 41 | */ | |
| 42 | public static By contentId(String contentId) { | |
| 43 |
2
1. contentId : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::contentId → NO_COVERAGE 2. contentId : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::contentId → KILLED |
return new By(new ContentIdPredicate(contentId)); |
| 44 | } | |
| 45 | ||
| 46 | Predicate<Part> toPredicate() { | |
| 47 |
4
1. toPredicate : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::toPredicate → NO_COVERAGE 2. toPredicate : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::toPredicate → KILLED 3. toPredicate : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::toPredicate → KILLED 4. toPredicate : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::toPredicate → KILLED |
return predicate; |
| 48 | } | |
| 49 | } | |
Mutations | ||
| 32 |
1.1 2.2 3.3 4.4 |
|
| 43 |
1.1 2.2 |
|
| 47 |
1.1 2.2 3.3 4.4 |