By.java

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
Location : filename
Killed by : oghamjavamail.it.JavaMailSmtpTest.attachment(oghamjavamail.it.JavaMailSmtpTest)
replaced return value with null for fr/sii/ogham/testing/assertion/email/By::filename → KILLED

2.2
Location : filename
Killed by : oghamall.it.email.EmailSMTPDefaultsTest.attachmentLookup(oghamall.it.email.EmailSMTPDefaultsTest)
replaced return value with null for fr/sii/ogham/testing/assertion/email/By::filename → KILLED

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

4.4
Location : filename
Killed by : oghamtesting.it.assertion.FluentEmailAssertionsSpec
replaced return value with null for fr/sii/ogham/testing/assertion/email/By::filename → KILLED

43

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

2.2
Location : contentId
Killed by : oghamall.it.email.FluentEmailTest.embedStream(oghamall.it.email.FluentEmailTest)
replaced return value with null for fr/sii/ogham/testing/assertion/email/By::contentId → KILLED

47

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

2.2
Location : toPredicate
Killed by : oghamtesting.it.assertion.FluentEmailAssertionsSpec
replaced return value with null for fr/sii/ogham/testing/assertion/email/By::toPredicate → KILLED

3.3
Location : toPredicate
Killed by : oghamall.it.email.EmailSMTPDefaultsTest.attachmentLookup(oghamall.it.email.EmailSMTPDefaultsTest)
replaced return value with null for fr/sii/ogham/testing/assertion/email/By::toPredicate → KILLED

4.4
Location : toPredicate
Killed by : oghamjavamail.it.JavaMailSmtpTest.attachment(oghamjavamail.it.JavaMailSmtpTest)
replaced return value with null for fr/sii/ogham/testing/assertion/email/By::toPredicate → KILLED

Active mutators

Tests examined


Report generated by PIT OGHAM