1
|
|
package fr.sii.ogham.email.filler; |
2
|
|
|
3
|
|
import static fr.sii.ogham.email.message.RecipientType.BCC; |
4
|
|
import static fr.sii.ogham.email.message.RecipientType.CC; |
5
|
|
import static fr.sii.ogham.email.message.RecipientType.TO; |
6
|
|
|
7
|
|
import java.util.Map; |
8
|
|
|
9
|
|
import fr.sii.ogham.core.builder.configuration.ConfigurationValueBuilderHelper; |
10
|
|
import fr.sii.ogham.core.filler.AbstractMessageAwareFiller; |
11
|
|
import fr.sii.ogham.email.message.Email; |
12
|
|
import fr.sii.ogham.email.message.Recipient; |
13
|
|
import fr.sii.ogham.email.message.RecipientType; |
14
|
|
|
15
|
|
public class EmailFiller extends AbstractMessageAwareFiller<Email> { |
16
|
|
|
17
|
|
public EmailFiller(Map<String, ConfigurationValueBuilderHelper<?, ?>> defaultValues) { |
18
|
|
super(defaultValues, Email.class); |
19
|
|
} |
20
|
|
|
21
|
|
@Override |
22
|
|
protected void fill(Email email) { |
23
|
8
1. fill : negated conditional → NO_COVERAGE
2. fill : negated conditional → SURVIVED
3. fill : negated conditional → NO_COVERAGE
4. fill : negated conditional → TIMED_OUT
5. fill : negated conditional → KILLED
6. fill : negated conditional → KILLED
7. fill : negated conditional → KILLED
8. fill : negated conditional → KILLED
|
if (email.getSubject() == null && containsProperty("subject")) { |
24
|
|
email.subject(getProperty("subject", String.class)); |
25
|
|
} |
26
|
8
1. fill : negated conditional → SURVIVED
2. fill : negated conditional → NO_COVERAGE
3. fill : negated conditional → NO_COVERAGE
4. fill : negated conditional → TIMED_OUT
5. fill : negated conditional → KILLED
6. fill : negated conditional → KILLED
7. fill : negated conditional → KILLED
8. fill : negated conditional → KILLED
|
if (email.getFrom() == null && containsProperty("from")) { |
27
|
|
email.from(getProperty("from", String.class)); |
28
|
|
} |
29
|
8
1. fill : negated conditional → NO_COVERAGE
2. fill : negated conditional → SURVIVED
3. fill : negated conditional → NO_COVERAGE
4. fill : negated conditional → TIMED_OUT
5. fill : negated conditional → KILLED
6. fill : negated conditional → KILLED
7. fill : negated conditional → KILLED
8. fill : negated conditional → KILLED
|
if (!hasRecipient(email, TO) && containsProperty("to")) { |
30
|
|
email.to(getProperty("to", String[].class)); |
31
|
|
} |
32
|
10
1. fill : negated conditional → SURVIVED
2. fill : negated conditional → NO_COVERAGE
3. fill : negated conditional → NO_COVERAGE
4. fill : negated conditional → TIMED_OUT
5. fill : negated conditional → TIMED_OUT
6. fill : negated conditional → KILLED
7. fill : negated conditional → KILLED
8. fill : negated conditional → KILLED
9. fill : negated conditional → KILLED
10. fill : negated conditional → KILLED
|
if (!hasRecipient(email, CC) && containsProperty("cc")) { |
33
|
|
email.cc(getProperty("cc", String[].class)); |
34
|
|
} |
35
|
10
1. fill : negated conditional → SURVIVED
2. fill : negated conditional → NO_COVERAGE
3. fill : negated conditional → NO_COVERAGE
4. fill : negated conditional → TIMED_OUT
5. fill : negated conditional → TIMED_OUT
6. fill : negated conditional → KILLED
7. fill : negated conditional → KILLED
8. fill : negated conditional → KILLED
9. fill : negated conditional → KILLED
10. fill : negated conditional → KILLED
|
if (!hasRecipient(email, BCC) && containsProperty("bcc")) { |
36
|
|
email.bcc(getProperty("bcc", String[].class)); |
37
|
|
} |
38
|
|
} |
39
|
|
|
40
|
|
private static boolean hasRecipient(Email email, RecipientType type) { |
41
|
4
1. hasRecipient : negated conditional → SURVIVED
2. hasRecipient : negated conditional → NO_COVERAGE
3. hasRecipient : negated conditional → TIMED_OUT
4. hasRecipient : negated conditional → KILLED
|
if (email.getRecipients() == null) { |
42
|
2
1. hasRecipient : replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → NO_COVERAGE
2. hasRecipient : replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → KILLED
|
return false; |
43
|
|
} |
44
|
|
for (Recipient recipient : email.getRecipients()) { |
45
|
5
1. hasRecipient : negated conditional → NO_COVERAGE
2. hasRecipient : negated conditional → SURVIVED
3. hasRecipient : negated conditional → TIMED_OUT
4. hasRecipient : negated conditional → KILLED
5. hasRecipient : negated conditional → KILLED
|
if (type == recipient.getType()) { |
46
|
4
1. hasRecipient : replaced boolean return with false for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → NO_COVERAGE
2. hasRecipient : replaced boolean return with false for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → SURVIVED
3. hasRecipient : replaced boolean return with false for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → TIMED_OUT
4. hasRecipient : replaced boolean return with false for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → KILLED
|
return true; |
47
|
|
} |
48
|
|
} |
49
|
5
1. hasRecipient : replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → NO_COVERAGE
2. hasRecipient : replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → SURVIVED
3. hasRecipient : replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → TIMED_OUT
4. hasRecipient : replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → KILLED
5. hasRecipient : replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → KILLED
|
return false; |
50
|
|
} |
51
|
|
} |
| | Mutations |
23 |
|
1.1 Location : fill Killed by : oghamall.it.email.EmailExtractSubjectTest.subjectExtractedFromTextWithDefaultSubjectShouldSendWithSubjectExtractedFromText(oghamall.it.email.EmailExtractSubjectTest) negated conditional → KILLED 2.2 Location : fill Killed by : none negated conditional → NO_COVERAGE 3.3 Location : fill Killed by : none negated conditional → TIMED_OUT 4.4 Location : fill Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED 5.5 Location : fill Killed by : none negated conditional → SURVIVED 6.6 Location : fill Killed by : none negated conditional → NO_COVERAGE 7.7 Location : fill Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED 8.8 Location : fill Killed by : oghamall.it.email.EmailExtractSubjectTest.noSubjectInContentsWithDefaultSubjectShouldSendWithDefaultSubject(oghamall.it.email.EmailExtractSubjectTest) negated conditional → KILLED
|
26 |
|
1.1 Location : fill Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED 2.2 Location : fill Killed by : none negated conditional → SURVIVED 3.3 Location : fill Killed by : none negated conditional → NO_COVERAGE 4.4 Location : fill Killed by : oghamall.it.email.EmailSMTPAuthenticationTest.authenticated(oghamall.it.email.EmailSMTPAuthenticationTest) negated conditional → KILLED 5.5 Location : fill Killed by : none negated conditional → TIMED_OUT 6.6 Location : fill Killed by : none negated conditional → NO_COVERAGE 7.7 Location : fill Killed by : oghamall.it.email.EmailSMTPAuthenticationTest.authenticated(oghamall.it.email.EmailSMTPAuthenticationTest) negated conditional → KILLED 8.8 Location : fill Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED
|
29 |
|
1.1 Location : fill Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED 2.2 Location : fill Killed by : oghamall.it.email.EmailPropertiesTest.simple(oghamall.it.email.EmailPropertiesTest) negated conditional → KILLED 3.3 Location : fill Killed by : none negated conditional → TIMED_OUT 4.4 Location : fill Killed by : none negated conditional → NO_COVERAGE 5.5 Location : fill Killed by : none negated conditional → SURVIVED 6.6 Location : fill Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED 7.7 Location : fill Killed by : oghamall.it.email.EmailPropertiesTest.simple(oghamall.it.email.EmailPropertiesTest) negated conditional → KILLED 8.8 Location : fill Killed by : none negated conditional → NO_COVERAGE
|
32 |
|
1.1 Location : fill Killed by : none negated conditional → TIMED_OUT 2.2 Location : fill Killed by : oghamall.it.email.EmailPropertiesTest.simple(oghamall.it.email.EmailPropertiesTest) negated conditional → KILLED 3.3 Location : fill Killed by : none negated conditional → SURVIVED 4.4 Location : fill Killed by : none negated conditional → NO_COVERAGE 5.5 Location : fill Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED 6.6 Location : fill Killed by : none negated conditional → NO_COVERAGE 7.7 Location : fill Killed by : oghamall.it.email.EmailSMTPAuthenticationTest.authenticated(oghamall.it.email.EmailSMTPAuthenticationTest) negated conditional → KILLED 8.8 Location : fill Killed by : oghamjavamail.it.UnreadableAttachmentTest.attachmentUnreadable(oghamjavamail.it.UnreadableAttachmentTest) negated conditional → KILLED 9.9 Location : fill Killed by : none negated conditional → TIMED_OUT 10.10 Location : fill Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED
|
35 |
|
1.1 Location : fill Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED 2.2 Location : fill Killed by : none negated conditional → SURVIVED 3.3 Location : fill Killed by : none negated conditional → NO_COVERAGE 4.4 Location : fill Killed by : oghamall.it.email.EmailPropertiesTest.simple(oghamall.it.email.EmailPropertiesTest) negated conditional → KILLED 5.5 Location : fill Killed by : none negated conditional → TIMED_OUT 6.6 Location : fill Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED 7.7 Location : fill Killed by : oghamjavamail.it.UnreadableAttachmentTest.attachmentUnreadable(oghamjavamail.it.UnreadableAttachmentTest) negated conditional → KILLED 8.8 Location : fill Killed by : none negated conditional → NO_COVERAGE 9.9 Location : fill Killed by : oghamall.it.email.EmailSMTPAuthenticationTest.authenticated(oghamall.it.email.EmailSMTPAuthenticationTest) negated conditional → KILLED 10.10 Location : fill Killed by : none negated conditional → TIMED_OUT
|
41 |
|
1.1 Location : hasRecipient Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED 2.2 Location : hasRecipient Killed by : none negated conditional → SURVIVED 3.3 Location : hasRecipient Killed by : none negated conditional → TIMED_OUT 4.4 Location : hasRecipient Killed by : none negated conditional → NO_COVERAGE
|
42 |
|
1.1 Location : hasRecipient Killed by : none replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → NO_COVERAGE 2.2 Location : hasRecipient Killed by : oghamcore.ut.email.EmailFillerSpec replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → KILLED
|
45 |
|
1.1 Location : hasRecipient Killed by : none negated conditional → TIMED_OUT 2.2 Location : hasRecipient Killed by : none negated conditional → NO_COVERAGE 3.3 Location : hasRecipient Killed by : none negated conditional → SURVIVED 4.4 Location : hasRecipient Killed by : oghamall.it.email.EmailPropertiesTest.simple(oghamall.it.email.EmailPropertiesTest) negated conditional → KILLED 5.5 Location : hasRecipient Killed by : oghamcore.ut.email.EmailFillerSpec negated conditional → KILLED
|
46 |
|
1.1 Location : hasRecipient Killed by : oghamcore.ut.email.EmailFillerSpec replaced boolean return with false for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → KILLED 2.2 Location : hasRecipient Killed by : none replaced boolean return with false for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → TIMED_OUT 3.3 Location : hasRecipient Killed by : none replaced boolean return with false for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → NO_COVERAGE 4.4 Location : hasRecipient Killed by : none replaced boolean return with false for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → SURVIVED
|
49 |
|
1.1 Location : hasRecipient Killed by : none replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → TIMED_OUT 2.2 Location : hasRecipient Killed by : none replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → NO_COVERAGE 3.3 Location : hasRecipient Killed by : none replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → SURVIVED 4.4 Location : hasRecipient Killed by : oghamall.it.email.EmailPropertiesTest.simple(oghamall.it.email.EmailPropertiesTest) replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → KILLED 5.5 Location : hasRecipient Killed by : oghamcore.ut.email.EmailFillerSpec replaced boolean return with true for fr/sii/ogham/email/filler/EmailFiller::hasRecipient → KILLED
|