ExpectedMultiPartEmail.java

1
package fr.sii.ogham.testing.assertion.email;
2
3
import static java.util.Arrays.asList;
4
5
import java.util.List;
6
7
/**
8
 * Class used in tests for ensuring that the email is respected. It provides the
9
 * following information:
10
 * <ul>
11
 * <li>The expected subject</li>
12
 * <li>The expected bodies (an email may have several contents)</li>
13
 * <li>The expected sender address</li>
14
 * <li>The expected recipients (to, cc, bcc)</li>
15
 * </ul>
16
 * 
17
 * @author Aurélien Baudet
18
 * @see ExpectedEmailHeader
19
 */
20
public class ExpectedMultiPartEmail extends ExpectedEmailHeader {
21
	/**
22
	 * List of expected contents
23
	 */
24
	private List<ExpectedContent> expectedContents;
25
26
27
	/**
28
	 * Initialize the expected email with provided values.
29
	 * 
30
	 * @param subject
31
	 *            the expected subject of the email
32
	 * @param bodies
33
	 *            the list of expected bodies of the email with their respective
34
	 *            expected Mime Type
35
	 * @param from
36
	 *            the expected email sender address
37
	 * @param to
38
	 *            the expected recipients
39
	 */
40
	public ExpectedMultiPartEmail(String subject, List<ExpectedContent> bodies, String from, String... to) {
41
		super(subject, from, to);
42
		this.expectedContents = bodies;
43
	}
44
	
45
	/**
46
	 * Initialize the expected email with provided values.
47
	 * 
48
	 * @param subject
49
	 *            the expected subject of the email
50
	 * @param bodies
51
	 *            the list of expected bodies of the email with their respective
52
	 *            expected Mime Type
53
	 * @param from
54
	 *            the expected email sender address
55
	 * @param to
56
	 *            the expected recipients
57
	 */
58
	public ExpectedMultiPartEmail(String subject, ExpectedContent[] bodies, String from, String... to) {
59
		this(subject, asList(bodies), from, to);
60
	}
61
62
	public List<ExpectedContent> getExpectedContents() {
63 2 1. getExpectedContents : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/ExpectedMultiPartEmail::getExpectedContents → NO_COVERAGE
2. getExpectedContents : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/ExpectedMultiPartEmail::getExpectedContents → KILLED
		return expectedContents;
64
	}
65
}

Mutations

63

1.1
Location : getExpectedContents
Killed by : none
replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/ExpectedMultiPartEmail::getExpectedContents → NO_COVERAGE

2.2
Location : getExpectedContents
Killed by : oghamtesting.it.assertion.AssertEmailSpec
replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/ExpectedMultiPartEmail::getExpectedContents → KILLED

Active mutators

Tests examined


Report generated by PIT OGHAM