| 1 | package fr.sii.ogham.testing.assertion.filter; | |
| 2 | ||
| 3 | import javax.mail.MessagingException; | |
| 4 | import javax.mail.Part; | |
| 5 | ||
| 6 | import com.google.common.base.Predicate; | |
| 7 | ||
| 8 | /** | |
| 9 | * Predicate that matches the {@link Part} only if {@link Part#getFileName()} | |
| 10 | * exactly matches the provided filename. | |
| 11 | * | |
| 12 | * @author Aurélien Baudet | |
| 13 | * | |
| 14 | */ | |
| 15 | public class FileNamePredicate implements Predicate<Part> { | |
| 16 | private final String filename; | |
| 17 | ||
| 18 | public FileNamePredicate(String filename) { | |
| 19 | super(); | |
| 20 | this.filename = filename; | |
| 21 | } | |
| 22 | ||
| 23 | @Override | |
| 24 | public boolean apply(Part input) { | |
| 25 | try { | |
| 26 |
8
1. apply : replaced boolean return with false for fr/sii/ogham/testing/assertion/filter/FileNamePredicate::apply → NO_COVERAGE 2. apply : replaced boolean return with true for fr/sii/ogham/testing/assertion/filter/FileNamePredicate::apply → SURVIVED 3. apply : replaced boolean return with true for fr/sii/ogham/testing/assertion/filter/FileNamePredicate::apply → NO_COVERAGE 4. apply : replaced boolean return with false for fr/sii/ogham/testing/assertion/filter/FileNamePredicate::apply → KILLED 5. apply : replaced boolean return with false for fr/sii/ogham/testing/assertion/filter/FileNamePredicate::apply → KILLED 6. apply : replaced boolean return with false for fr/sii/ogham/testing/assertion/filter/FileNamePredicate::apply → KILLED 7. apply : replaced boolean return with true for fr/sii/ogham/testing/assertion/filter/FileNamePredicate::apply → KILLED 8. apply : replaced boolean return with true for fr/sii/ogham/testing/assertion/filter/FileNamePredicate::apply → KILLED |
return filename.equals(input.getFileName()); |
| 27 | } catch (MessagingException e) { | |
| 28 | throw new AssertionError("Failed to access message", e); | |
| 29 | } | |
| 30 | } | |
| 31 | ||
| 32 | @Override | |
| 33 | public String toString() { | |
| 34 |
3
1. toString : replaced return value with "" for fr/sii/ogham/testing/assertion/filter/FileNamePredicate::toString → SURVIVED 2. toString : replaced return value with "" for fr/sii/ogham/testing/assertion/filter/FileNamePredicate::toString → NO_COVERAGE 3. toString : replaced return value with "" for fr/sii/ogham/testing/assertion/filter/FileNamePredicate::toString → KILLED |
return "named '" + filename + "'"; |
| 35 | } | |
| 36 | } | |
Mutations | ||
| 26 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 |
|
| 34 |
1.1 2.2 3.3 |