|
1
|
|
package fr.sii.ogham.email.builder; |
|
2
|
|
|
|
3
|
|
import fr.sii.ogham.core.builder.Builder; |
|
4
|
|
import fr.sii.ogham.core.builder.context.BuildContext; |
|
5
|
|
import fr.sii.ogham.core.builder.env.EnvironmentBuilder; |
|
6
|
|
import fr.sii.ogham.core.fluent.AbstractParent; |
|
7
|
|
import fr.sii.ogham.core.translator.content.ContentTranslator; |
|
8
|
|
|
|
9
|
|
/** |
|
10
|
|
* CSS handling consists of defining how CSS are inlined in the email. Inlining |
|
11
|
|
* CSS means that CSS styles are loaded and applied on the matching HTML nodes |
|
12
|
|
* using the {@code style} HTML attribute. |
|
13
|
|
* |
|
14
|
|
* @author Aurélien Baudet |
|
15
|
|
* |
|
16
|
|
*/ |
|
17
|
|
public class CssHandlingBuilder extends AbstractParent<EmailBuilder> implements Builder<ContentTranslator> { |
|
18
|
|
private final BuildContext buildContext; |
|
19
|
|
private CssInliningBuilder cssInliningBuilder; |
|
20
|
|
|
|
21
|
|
/** |
|
22
|
|
* Initializes the builder with a parent builder. The parent builder is used |
|
23
|
|
* when calling {@link #and()} method. The {@link EnvironmentBuilder} is |
|
24
|
|
* used to evaluate properties when {@link #build()} method is called. |
|
25
|
|
* |
|
26
|
|
* @param parent |
|
27
|
|
* the parent builder |
|
28
|
|
* @param buildContext |
|
29
|
|
* for registering instances and property evaluation |
|
30
|
|
*/ |
|
31
|
|
public CssHandlingBuilder(EmailBuilder parent, BuildContext buildContext) { |
|
32
|
|
super(parent); |
|
33
|
|
this.buildContext = buildContext; |
|
34
|
|
} |
|
35
|
|
|
|
36
|
|
/** |
|
37
|
|
* Configures how CSS are applied on HTML emails. |
|
38
|
|
* |
|
39
|
|
* Inlining CSS means that CSS styles are loaded and applied on the matching |
|
40
|
|
* HTML nodes using the {@code style} HTML attribute. |
|
41
|
|
* |
|
42
|
|
* @return the builder to configure how CSS styles are inlined |
|
43
|
|
*/ |
|
44
|
|
public CssInliningBuilder inline() { |
|
45
|
8
1. inline : negated conditional → NO_COVERAGE
2. inline : negated conditional → KILLED
3. inline : negated conditional → KILLED
4. inline : negated conditional → KILLED
5. inline : negated conditional → KILLED
6. inline : negated conditional → KILLED
7. inline : negated conditional → KILLED
8. inline : negated conditional → KILLED
|
if (cssInliningBuilder == null) { |
|
46
|
|
cssInliningBuilder = new CssInliningBuilder(this, buildContext); |
|
47
|
|
} |
|
48
|
8
1. inline : replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → NO_COVERAGE
2. inline : replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED
3. inline : replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED
4. inline : replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED
5. inline : replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED
6. inline : replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED
7. inline : replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED
8. inline : replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED
|
return cssInliningBuilder; |
|
49
|
|
} |
|
50
|
|
|
|
51
|
|
@Override |
|
52
|
|
public ContentTranslator build() { |
|
53
|
3
1. build : negated conditional → NO_COVERAGE
2. build : negated conditional → SURVIVED
3. build : negated conditional → KILLED
|
if (cssInliningBuilder == null) { |
|
54
|
|
return null; |
|
55
|
|
} |
|
56
|
3
1. build : replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::build → SURVIVED
2. build : replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::build → NO_COVERAGE
3. build : replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::build → KILLED
|
return cssInliningBuilder.build(); |
|
57
|
|
} |
|
58
|
|
} |
| | Mutations |
| 45 |
|
1.1 Location : inline Killed by : oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests.oghamPropertiesWithSpringPropsShouldUseOghamPropertiesPrecedence(oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests) negated conditional → KILLED 2.2 Location : inline Killed by : oghamcore.it.core.service.CleanupTest.manualCleanupShouldAutomaticallyCleanTheSenders(oghamcore.it.core.service.CleanupTest) negated conditional → KILLED 3.3 Location : inline Killed by : oghamjavamail.it.UnreadableAttachmentTest.attachmentUnreadable(oghamjavamail.it.UnreadableAttachmentTest) negated conditional → KILLED 4.4 Location : inline Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec negated conditional → KILLED 5.5 Location : inline Killed by : oghamall.it.html.translator.JsoupInlineCssTranslatorTest.notHtml(oghamall.it.html.translator.JsoupInlineCssTranslatorTest) negated conditional → KILLED 6.6 Location : inline Killed by : oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests.oghamAloneShouldUseOghamProperties(oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests) negated conditional → KILLED 7.7 Location : inline Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest) negated conditional → KILLED 8.8 Location : inline Killed by : none negated conditional → NO_COVERAGE
|
| 48 |
|
1.1 Location : inline Killed by : oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests.oghamPropertiesWithSpringPropsShouldUseOghamPropertiesPrecedence(oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests) replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED 2.2 Location : inline Killed by : oghamjavamail.it.UnreadableAttachmentTest.attachmentUnreadable(oghamjavamail.it.UnreadableAttachmentTest) replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED 3.3 Location : inline Killed by : oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests.oghamAloneShouldUseOghamProperties(oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests) replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED 4.4 Location : inline Killed by : oghamall.it.html.translator.JsoupInlineCssTranslatorTest.notHtml(oghamall.it.html.translator.JsoupInlineCssTranslatorTest) replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED 5.5 Location : inline Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED 6.6 Location : inline Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest) replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED 7.7 Location : inline Killed by : none replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → NO_COVERAGE 8.8 Location : inline Killed by : oghamcore.it.core.service.CleanupTest.manualCleanupShouldAutomaticallyCleanTheSenders(oghamcore.it.core.service.CleanupTest) replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::inline → KILLED
|
| 53 |
|
1.1 Location : build Killed by : none negated conditional → NO_COVERAGE 2.2 Location : build Killed by : none negated conditional → SURVIVED 3.3 Location : build Killed by : oghamall.it.resolver.FreemarkerRelativeResourcesTests.relativeToPrefixSuffixAndPath(oghamall.it.resolver.FreemarkerRelativeResourcesTests) negated conditional → KILLED
|
| 56 |
|
1.1 Location : build Killed by : none replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::build → SURVIVED 2.2 Location : build Killed by : none replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::build → NO_COVERAGE 3.3 Location : build Killed by : oghamall.it.resolver.FreemarkerRelativeResourcesTests.relativeToPrefixSuffixAndPath(oghamall.it.resolver.FreemarkerRelativeResourcesTests) replaced return value with null for fr/sii/ogham/email/builder/CssHandlingBuilder::build → KILLED
|