| 1 | package fr.sii.ogham.email.sendgrid.v4.sender.impl.sendgrid.compat; | |
| 2 | ||
| 3 | import static java.util.stream.Collectors.toList; | |
| 4 | ||
| 5 | import java.util.List; | |
| 6 | ||
| 7 | import com.sendgrid.helpers.mail.objects.Email; | |
| 8 | import com.sendgrid.helpers.mail.objects.Personalization; | |
| 9 | ||
| 10 | /** | |
| 11 | * Compatibility wrapper that wraps {@link Personalization} instance and | |
| 12 | * delegates operations to it. | |
| 13 | * | |
| 14 | * @author Aurélien Baudet | |
| 15 | * @see CompatUtil | |
| 16 | * @see CompatFactory | |
| 17 | */ | |
| 18 | public class CorrectPackageNamePersonalizationCompat implements PersonalizationCompat { | |
| 19 | private final Personalization delegate; | |
| 20 | ||
| 21 | public CorrectPackageNamePersonalizationCompat() { | |
| 22 | this(new Personalization()); | |
| 23 | } | |
| 24 | ||
| 25 | public CorrectPackageNamePersonalizationCompat(Personalization delegate) { | |
| 26 | super(); | |
| 27 | this.delegate = delegate; | |
| 28 | } | |
| 29 | ||
| 30 | @Override | |
| 31 | public void addTo(String address, String personal) { | |
| 32 |
2
1. addTo : removed call to com/sendgrid/helpers/mail/objects/Personalization::addTo → NO_COVERAGE 2. addTo : removed call to com/sendgrid/helpers/mail/objects/Personalization::addTo → KILLED |
delegate.addTo(new Email(address, personal)); |
| 33 | } | |
| 34 | ||
| 35 | @Override | |
| 36 | public void addCc(String address, String personal) { | |
| 37 |
1
1. addCc : removed call to com/sendgrid/helpers/mail/objects/Personalization::addCc → NO_COVERAGE |
delegate.addCc(new Email(address, personal)); |
| 38 | } | |
| 39 | ||
| 40 | @Override | |
| 41 | public void addBcc(String address, String personal) { | |
| 42 |
1
1. addBcc : removed call to com/sendgrid/helpers/mail/objects/Personalization::addBcc → NO_COVERAGE |
delegate.addBcc(new Email(address, personal)); |
| 43 | } | |
| 44 | ||
| 45 | @Override | |
| 46 | public List<EmailCompat> getTos() { | |
| 47 |
2
1. getTos : replaced return value with Collections.emptyList for fr/sii/ogham/email/sendgrid/v4/sender/impl/sendgrid/compat/CorrectPackageNamePersonalizationCompat::getTos → NO_COVERAGE 2. getTos : replaced return value with Collections.emptyList for fr/sii/ogham/email/sendgrid/v4/sender/impl/sendgrid/compat/CorrectPackageNamePersonalizationCompat::getTos → SURVIVED |
return delegate.getTos().stream().map(CorrectPackageNameEmailCompat::new).collect(toList()); |
| 48 | } | |
| 49 | ||
| 50 | public Personalization getDelegate() { | |
| 51 |
2
1. getDelegate : replaced return value with null for fr/sii/ogham/email/sendgrid/v4/sender/impl/sendgrid/compat/CorrectPackageNamePersonalizationCompat::getDelegate → NO_COVERAGE 2. getDelegate : replaced return value with null for fr/sii/ogham/email/sendgrid/v4/sender/impl/sendgrid/compat/CorrectPackageNamePersonalizationCompat::getDelegate → KILLED |
return delegate; |
| 52 | } | |
| 53 | } | |
Mutations | ||
| 32 |
1.1 2.2 |
|
| 37 |
1.1 |
|
| 42 |
1.1 |
|
| 47 |
1.1 2.2 |
|
| 51 |
1.1 2.2 |