OfficeStamperConfigurations.java

1
package pro.verron.officestamper.preset;
2
3
import pro.verron.officestamper.api.OfficeStamperConfiguration;
4
import pro.verron.officestamper.api.OfficeStamperException;
5
import pro.verron.officestamper.core.DocxStamperConfiguration;
6
7
import java.time.temporal.TemporalAccessor;
8
9
import static java.time.format.DateTimeFormatter.*;
10
import static java.time.format.FormatStyle.valueOf;
11
import static java.util.Locale.forLanguageTag;
12
13
14
/**
15
 * The OfficeStamperConfigurations class provides static methods
16
 * to create different configurations for the OfficeStamper.
17
 */
18
public class OfficeStamperConfigurations {
19
20
21
    private OfficeStamperConfigurations() {
22
        throw new OfficeStamperException("OfficeStamperConfigurations cannot be instantiated");
23
    }
24
25
    /**
26
     * Creates a new OfficeStamperConfiguration with the standard configuration and additional preprocessors.
27
     *
28
     * @return the OfficeStamperConfiguration
29
     *
30
     * @see OfficeStamperConfiguration
31
     */
32
    public static OfficeStamperConfiguration standardWithPreprocessing() {
33
        var configuration = standard();
34 1 1. standardWithPreprocessing : removed call to pro/verron/officestamper/api/OfficeStamperConfiguration::addPreprocessor → SURVIVED
        configuration.addPreprocessor(Preprocessors.removeLanguageProof());
35 1 1. standardWithPreprocessing : removed call to pro/verron/officestamper/api/OfficeStamperConfiguration::addPreprocessor → SURVIVED
        configuration.addPreprocessor(Preprocessors.mergeSimilarRuns());
36 1 1. standardWithPreprocessing : replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::standardWithPreprocessing → KILLED
        return configuration;
37
    }
38
39
    /**
40
     * Creates a new standard OfficeStamperConfiguration.
41
     *
42
     * @return the standard OfficeStamperConfiguration
43
     */
44
    public static OfficeStamperConfiguration standard() {
45
        var configuration = new DocxStamperConfiguration();
46 1 1. standard : removed call to pro/verron/officestamper/core/DocxStamperConfiguration::addPreprocessor → SURVIVED
        configuration.addPreprocessor(Preprocessors.removeMalformedComments());
47
        configuration.addCustomFunction("ftime", TemporalAccessor.class)
48 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_TIME::format);
49
        configuration.addCustomFunction("fdate", TemporalAccessor.class)
50 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_DATE::format);
51
        configuration.addCustomFunction("fdatetime", TemporalAccessor.class)
52 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_DATE_TIME::format);
53
        configuration.addCustomFunction("finstant", TemporalAccessor.class)
54 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_INSTANT::format);
55
        configuration.addCustomFunction("fordinaldate", TemporalAccessor.class)
56 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_ORDINAL_DATE::format);
57
        configuration.addCustomFunction("f1123datetime", TemporalAccessor.class)
58 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(RFC_1123_DATE_TIME::format);
59
        configuration.addCustomFunction("flocaldate", TemporalAccessor.class)
60 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_LOCAL_DATE::format);
61
        configuration.addCustomFunction("fbasicdate", TemporalAccessor.class)
62 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(BASIC_ISO_DATE::format);
63
        configuration.addCustomFunction("fweekdate", TemporalAccessor.class)
64 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_WEEK_DATE::format);
65
        configuration.addCustomFunction("flocaldatetime", TemporalAccessor.class)
66 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_LOCAL_DATE_TIME::format);
67
        configuration.addCustomFunction("flocaldatetime", TemporalAccessor.class, String.class)
68 2 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsBiFunctionImpl::withImplementation → KILLED
2. lambda$standard$0 : replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$0 → KILLED
                     .withImplementation((date, style) -> ofLocalizedDateTime(valueOf(style)).format(date));
69
        configuration.addCustomFunction("flocaldatetime", TemporalAccessor.class, String.class, String.class)
70 2 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsTriFunctionImpl::withImplementation → KILLED
2. lambda$standard$1 : replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$1 → KILLED
                     .withImplementation((date, dateStyle, timeStyle) -> ofLocalizedDateTime(valueOf(dateStyle),
71
                             valueOf(timeStyle)).format(date));
72
        configuration.addCustomFunction("foffsetdatetime", TemporalAccessor.class)
73 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_OFFSET_DATE_TIME::format);
74
        configuration.addCustomFunction("fzoneddatetime", TemporalAccessor.class)
75 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_ZONED_DATE_TIME::format);
76
        configuration.addCustomFunction("foffsetdate", TemporalAccessor.class)
77 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_OFFSET_DATE::format);
78
        configuration.addCustomFunction("flocaltime", TemporalAccessor.class)
79 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_LOCAL_TIME::format);
80
        configuration.addCustomFunction("foffsettime", TemporalAccessor.class)
81 1 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED
                     .withImplementation(ISO_OFFSET_TIME::format);
82
        configuration.addCustomFunction("flocaldate", TemporalAccessor.class, String.class)
83 2 1. lambda$standard$2 : replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$2 → KILLED
2. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsBiFunctionImpl::withImplementation → KILLED
                     .withImplementation((date, style) -> ofLocalizedDate(valueOf(style)).format(date));
84
        configuration.addCustomFunction("flocaltime", TemporalAccessor.class, String.class)
85 2 1. lambda$standard$3 : replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$3 → KILLED
2. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsBiFunctionImpl::withImplementation → KILLED
                     .withImplementation((date, style) -> ofLocalizedTime(valueOf(style)).format(date));
86
        configuration.addCustomFunction("fpattern", TemporalAccessor.class, String.class)
87 2 1. lambda$standard$4 : replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$4 → KILLED
2. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsBiFunctionImpl::withImplementation → KILLED
                     .withImplementation((date, pattern) -> ofPattern(pattern).format(date));
88
        configuration.addCustomFunction("fpattern", TemporalAccessor.class, String.class, String.class)
89 2 1. standard : removed call to pro/verron/officestamper/api/CustomFunction$NeedsTriFunctionImpl::withImplementation → KILLED
2. lambda$standard$5 : replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$5 → KILLED
                     .withImplementation((date, pattern, locale) -> ofPattern(pattern, forLanguageTag(locale)).format(
90
                             date));
91 1 1. standard : replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::standard → KILLED
        return configuration;
92
    }
93
94
    /**
95
     * Creates a new standard OfficeStamperConfiguration.
96
     *
97
     * @return the standard OfficeStamperConfiguration
98
     */
99
    public static OfficeStamperConfiguration raw() {
100
        var configuration = new DocxStamperConfiguration();
101 1 1. raw : removed call to pro/verron/officestamper/core/DocxStamperConfiguration::resetResolvers → KILLED
        configuration.resetResolvers();
102
        configuration.setEvaluationContextConfigurer(EvaluationContextConfigurers.defaultConfigurer());
103 1 1. raw : removed call to pro/verron/officestamper/core/DocxStamperConfiguration::resetCommentProcessors → SURVIVED
        configuration.resetCommentProcessors();
104 1 1. raw : replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::raw → KILLED
        return configuration;
105
    }
106
}

Mutations

34

1.1
Location : standardWithPreprocessing
Killed by : none
removed call to pro/verron/officestamper/api/OfficeStamperConfiguration::addPreprocessor → SURVIVED
Covering tests

35

1.1
Location : standardWithPreprocessing
Killed by : none
removed call to pro/verron/officestamper/api/OfficeStamperConfiguration::addPreprocessor → SURVIVED
Covering tests

36

1.1
Location : standardWithPreprocessing
Killed by : pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[method:test64()]
replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::standardWithPreprocessing → KILLED

46

1.1
Location : standard
Killed by : none
removed call to pro/verron/officestamper/core/DocxStamperConfiguration::addPreprocessor → SURVIVED
Covering tests

48

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

50

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

52

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

54

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

56

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

58

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

60

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

62

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

64

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

66

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

68

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsBiFunctionImpl::withImplementation → KILLED

2.2
Location : lambda$standard$0
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$0 → KILLED

70

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsTriFunctionImpl::withImplementation → KILLED

2.2
Location : lambda$standard$1
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$1 → KILLED

73

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

75

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

77

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

79

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

81

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsFunctionImpl::withImplementation → KILLED

83

1.1
Location : lambda$standard$2
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$2 → KILLED

2.2
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsBiFunctionImpl::withImplementation → KILLED

85

1.1
Location : lambda$standard$3
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$3 → KILLED

2.2
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsBiFunctionImpl::withImplementation → KILLED

87

1.1
Location : lambda$standard$4
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$4 → KILLED

2.2
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsBiFunctionImpl::withImplementation → KILLED

89

1.1
Location : standard
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
removed call to pro/verron/officestamper/api/CustomFunction$NeedsTriFunctionImpl::withImplementation → KILLED

2.2
Location : lambda$standard$5
Killed by : pro.verron.officestamper.test.DateFormatTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DateFormatTests]/[method:features()]
replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::lambda$standard$5 → KILLED

91

1.1
Location : standard
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testStaticResolution(java.lang.String, boolean, boolean, boolean, java.lang.String, java.lang.String)]/[test-template-invocation:#6]
replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::standard → KILLED

101

1.1
Location : raw
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#21]
removed call to pro/verron/officestamper/core/DocxStamperConfiguration::resetResolvers → KILLED

103

1.1
Location : raw
Killed by : none
removed call to pro/verron/officestamper/core/DocxStamperConfiguration::resetCommentProcessors → SURVIVED
Covering tests

104

1.1
Location : raw
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#21]
replaced return value with null for pro/verron/officestamper/preset/OfficeStamperConfigurations::raw → KILLED

Active mutators

Tests examined


Report generated by PIT 1.17.1