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.Email; | |
8 | import com.sendgrid.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 WrongPackageNamePersonalizationCompat implements PersonalizationCompat { | |
19 | private final Personalization delegate; | |
20 | | |
21 | public WrongPackageNamePersonalizationCompat() { | |
22 | this(new Personalization()); | |
23 | } | |
24 | ||
25 | public WrongPackageNamePersonalizationCompat(Personalization delegate) { | |
26 | super(); | |
27 | this.delegate = delegate; | |
28 | } | |
29 | ||
30 | @Override | |
31 | public void addTo(String address, String personal) { | |
32 |
1
1. addTo : removed call to com/sendgrid/Personalization::addTo → NO_COVERAGE |
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/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/Personalization::addBcc → NO_COVERAGE |
delegate.addBcc(new Email(address, personal)); |
43 | } | |
44 | ||
45 | @Override | |
46 | public List<EmailCompat> getTos() { | |
47 |
1
1. getTos : replaced return value with Collections.emptyList for fr/sii/ogham/email/sendgrid/v4/sender/impl/sendgrid/compat/WrongPackageNamePersonalizationCompat::getTos → NO_COVERAGE |
return delegate.getTos().stream() |
48 | .map(WrongPackageNameEmailCompat::new) | |
49 | .collect(toList()); | |
50 | } | |
51 | ||
52 | public Personalization getDelegate() { | |
53 |
1
1. getDelegate : replaced return value with null for fr/sii/ogham/email/sendgrid/v4/sender/impl/sendgrid/compat/WrongPackageNamePersonalizationCompat::getDelegate → NO_COVERAGE |
return delegate; |
54 | } | |
55 | } | |
Mutations | ||
32 |
1.1 |
|
37 |
1.1 |
|
42 |
1.1 |
|
47 |
1.1 |
|
53 |
1.1 |