By.java

1
package fr.sii.ogham.testing.assertion.email;
2
3
import java.util.function.Predicate;
4
5
import ogham.testing.jakarta.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 1 1. filename : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::filename → NO_COVERAGE
		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 1 1. contentId : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::contentId → NO_COVERAGE
		return new By(new ContentIdPredicate(contentId));
44
	}
45
46
	Predicate<Part> toPredicate() {
47 1 1. toPredicate : replaced return value with null for fr/sii/ogham/testing/assertion/email/By::toPredicate → NO_COVERAGE
		return predicate;
48
	}
49
}

Mutations

32

1.1
Location : filename
Killed by :
replaced return value with null for fr/sii/ogham/testing/assertion/email/By::filename → NO_COVERAGE

43

1.1
Location : contentId
Killed by :
replaced return value with null for fr/sii/ogham/testing/assertion/email/By::contentId → NO_COVERAGE

47

1.1
Location : toPredicate
Killed by :
replaced return value with null for fr/sii/ogham/testing/assertion/email/By::toPredicate → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.13.1