DocxStamperConfiguration.java

1
package pro.verron.officestamper.core;
2
3
4
import org.springframework.expression.spel.SpelParserConfiguration;
5
import org.springframework.lang.NonNull;
6
import pro.verron.officestamper.api.*;
7
import pro.verron.officestamper.api.CustomFunction.NeedsBiFunctionImpl;
8
import pro.verron.officestamper.api.CustomFunction.NeedsFunctionImpl;
9
import pro.verron.officestamper.core.functions.BiFunctionBuilder;
10
import pro.verron.officestamper.core.functions.FunctionBuilder;
11
import pro.verron.officestamper.core.functions.TriFunctionBuilder;
12
import pro.verron.officestamper.preset.EvaluationContextConfigurers;
13
import pro.verron.officestamper.preset.ExceptionResolvers;
14
15
import java.util.ArrayList;
16
import java.util.HashMap;
17
import java.util.List;
18
import java.util.Map;
19
import java.util.function.Function;
20
import java.util.function.Supplier;
21
22
/// The [DocxStamperConfiguration] class represents the configuration for the [DocxStamper] class.
23
/// It provides methods to customize the behavior of the stamper.
24
///
25
/// @author Joseph Verron
26
/// @author Tom Hombergs
27
/// @version ${version}
28
/// @since 1.0.3
29
public class DocxStamperConfiguration
30
        implements OfficeStamperConfiguration {
31
    private final Map<Class<?>, Function<ParagraphPlaceholderReplacer, CommentProcessor>> commentProcessors;
32
    private final List<ObjectResolver> resolvers;
33
    private final Map<Class<?>, Object> expressionFunctions;
34
    private final List<PreProcessor> preprocessors;
35
    private final List<PostProcessor> postprocessors;
36
    private final List<CustomFunction> functions;
37
    private String lineBreakPlaceholder;
38
    private EvaluationContextConfigurer evaluationContextConfigurer;
39
    private boolean failOnUnresolvedExpression;
40
    private boolean leaveEmptyOnExpressionError;
41
    private boolean replaceUnresolvedExpressions;
42
    private String unresolvedExpressionsDefaultValue;
43
    private SpelParserConfiguration spelParserConfiguration;
44
    private ExceptionResolver exceptionResolver;
45
46
    /**
47
     * Constructs a new instance of the {@code DocxStamperConfiguration} class
48
     * and initializes its default configuration settings.
49
     *
50
     * This constructor sets up internal structures and default behaviors
51
     * for managing document stamping configurations, including:
52
     * - Initializing collections for processors, resolvers, and functions.
53
     * - Setting default values for expression handling and evaluation.
54
     * - Creating and configuring a default {@code SpelParserConfiguration}.
55
     * - Establishing resolvers and exception handling strategies.
56
     */
57
    public DocxStamperConfiguration() {
58
        commentProcessors = new HashMap<>();
59
        resolvers = new ArrayList<>();
60
        expressionFunctions = new HashMap<>();
61
        preprocessors = new ArrayList<>();
62
        postprocessors = new ArrayList<>();
63
        functions = new ArrayList<>();
64
        evaluationContextConfigurer = EvaluationContextConfigurers.defaultConfigurer();
65
        lineBreakPlaceholder = "\n";
66
        failOnUnresolvedExpression = true;
67
        leaveEmptyOnExpressionError = false;
68
        replaceUnresolvedExpressions = false;
69
        unresolvedExpressionsDefaultValue = null;
70
        spelParserConfiguration = new SpelParserConfiguration();
71
        exceptionResolver = computeExceptionResolver();
72
    }
73
74
    private ExceptionResolver computeExceptionResolver() {
75 2 1. computeExceptionResolver : negated conditional → KILLED
2. computeExceptionResolver : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::computeExceptionResolver → KILLED
        if (failOnUnresolvedExpression) return ExceptionResolvers.throwing();
76 2 1. computeExceptionResolver : negated conditional → NO_COVERAGE
2. computeExceptionResolver : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::computeExceptionResolver → NO_COVERAGE
        if (replaceWithDefaultOnError()) return ExceptionResolvers.defaulting(replacementDefault());
77 1 1. computeExceptionResolver : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::computeExceptionResolver → NO_COVERAGE
        return ExceptionResolvers.passing();
78
    }
79
80
    private boolean replaceWithDefaultOnError() {
81 3 1. replaceWithDefaultOnError : negated conditional → NO_COVERAGE
2. replaceWithDefaultOnError : replaced boolean return with true for pro/verron/officestamper/core/DocxStamperConfiguration::replaceWithDefaultOnError → NO_COVERAGE
3. replaceWithDefaultOnError : negated conditional → NO_COVERAGE
        return isLeaveEmptyOnExpressionError() || isReplaceUnresolvedExpressions();
82
    }
83
84
    private String replacementDefault() {
85 2 1. replacementDefault : replaced return value with "" for pro/verron/officestamper/core/DocxStamperConfiguration::replacementDefault → NO_COVERAGE
2. replacementDefault : negated conditional → NO_COVERAGE
        return isLeaveEmptyOnExpressionError() ? "" : getUnresolvedExpressionsDefaultValue();
86
    }
87
88
    /// Resets all processors in the configuration.
89
    public void resetCommentProcessors() {
90 1 1. resetCommentProcessors : removed call to java/util/Map::clear → SURVIVED
        this.commentProcessors.clear();
91
    }
92
93
    /// Resets all resolvers in the configuration.
94
    public void resetResolvers() {
95 1 1. resetResolvers : removed call to java/util/List::clear → SURVIVED
        this.resolvers.clear();
96
    }
97
98
    @Deprecated(since = "2.5", forRemoval = true)
99
    @Override
100
    public boolean isFailOnUnresolvedExpression() {
101 2 1. isFailOnUnresolvedExpression : replaced boolean return with true for pro/verron/officestamper/core/DocxStamperConfiguration::isFailOnUnresolvedExpression → NO_COVERAGE
2. isFailOnUnresolvedExpression : replaced boolean return with false for pro/verron/officestamper/core/DocxStamperConfiguration::isFailOnUnresolvedExpression → NO_COVERAGE
        return failOnUnresolvedExpression;
102
    }
103
104
    /// If true, stamper throws an [OfficeStamperException] if an expression within the document can’t be resolved.
105
    /// Set to `TRUE` by default.
106
    ///
107
    /// @param failOnUnresolvedExpression a boolean
108
    ///
109
    /// @return the same [DocxStamperConfiguration] object
110
    @Deprecated(since = "2.5", forRemoval = true)
111
    @Override
112
    public DocxStamperConfiguration setFailOnUnresolvedExpression(boolean failOnUnresolvedExpression) {
113
        this.failOnUnresolvedExpression = failOnUnresolvedExpression;
114
        this.exceptionResolver = computeExceptionResolver();
115 1 1. setFailOnUnresolvedExpression : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setFailOnUnresolvedExpression → NO_COVERAGE
        return this;
116
    }
117
118
    @Override
119
    public boolean isLeaveEmptyOnExpressionError() {
120 2 1. isLeaveEmptyOnExpressionError : replaced boolean return with false for pro/verron/officestamper/core/DocxStamperConfiguration::isLeaveEmptyOnExpressionError → NO_COVERAGE
2. isLeaveEmptyOnExpressionError : replaced boolean return with true for pro/verron/officestamper/core/DocxStamperConfiguration::isLeaveEmptyOnExpressionError → NO_COVERAGE
        return leaveEmptyOnExpressionError;
121
    }
122
123
    @Override
124
    public boolean isReplaceUnresolvedExpressions() {
125 2 1. isReplaceUnresolvedExpressions : replaced boolean return with true for pro/verron/officestamper/core/DocxStamperConfiguration::isReplaceUnresolvedExpressions → NO_COVERAGE
2. isReplaceUnresolvedExpressions : replaced boolean return with false for pro/verron/officestamper/core/DocxStamperConfiguration::isReplaceUnresolvedExpressions → NO_COVERAGE
        return replaceUnresolvedExpressions;
126
    }
127
128
    @Override
129
    public String getUnresolvedExpressionsDefaultValue() {
130 1 1. getUnresolvedExpressionsDefaultValue : replaced return value with "" for pro/verron/officestamper/core/DocxStamperConfiguration::getUnresolvedExpressionsDefaultValue → NO_COVERAGE
        return unresolvedExpressionsDefaultValue;
131
    }
132
133
    /// Default value to use for expressions that doesn't resolve.
134
    ///
135
    /// @param unresolvedExpressionsDefaultValue value to use instead for expression that doesn't resolve
136
    ///
137
    /// @return a [DocxStamperConfiguration] object
138
    ///
139
    /// @see DocxStamperConfiguration#replaceUnresolvedExpressions
140
    @Deprecated(since = "2.5", forRemoval = true)
141
    @Override
142
    public DocxStamperConfiguration unresolvedExpressionsDefaultValue(String unresolvedExpressionsDefaultValue) {
143
        this.unresolvedExpressionsDefaultValue = unresolvedExpressionsDefaultValue;
144
        this.exceptionResolver = computeExceptionResolver();
145 1 1. unresolvedExpressionsDefaultValue : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::unresolvedExpressionsDefaultValue → NO_COVERAGE
        return this;
146
    }
147
148
    /// Indicates if a default value should replace expressions that don't resolve.
149
    ///
150
    /// @param replaceUnresolvedExpressions true to replace expression with resolved value `null`
151
    ///
152
    ///
153
    ///                                                                         false to leave the expression as is.
154
    ///
155
    /// @return a [DocxStamperConfiguration] object
156
    @Deprecated(since = "2.5", forRemoval = true)
157
    @Override
158
    public DocxStamperConfiguration replaceUnresolvedExpressions(boolean replaceUnresolvedExpressions) {
159
        this.replaceUnresolvedExpressions = replaceUnresolvedExpressions;
160
        this.exceptionResolver = computeExceptionResolver();
161 1 1. replaceUnresolvedExpressions : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::replaceUnresolvedExpressions → NO_COVERAGE
        return this;
162
    }
163
164
    /// Indicate if expressions failing during evaluation needs removal.
165
    ///
166
    /// @param leaveEmpty true to replace expressions with empty string when an error occurs during evaluation.
167
    ///
168
    /// @return a [DocxStamperConfiguration] object
169
    @Deprecated(since = "2.5", forRemoval = true)
170
    @Override
171
    public DocxStamperConfiguration leaveEmptyOnExpressionError(
172
            boolean leaveEmpty
173
    ) {
174
        this.leaveEmptyOnExpressionError = leaveEmpty;
175
        this.exceptionResolver = computeExceptionResolver();
176 1 1. leaveEmptyOnExpressionError : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::leaveEmptyOnExpressionError → NO_COVERAGE
        return this;
177
    }
178
179
    /// Exposes all methods of a given interface to the expression language.
180
    ///
181
    /// @param interfaceClass the interface holding methods to expose in the expression language.
182
    /// @param implementation the implementation to call to evaluate invocations of those methods.
183
    ///
184
    ///                       Must implement the
185
    ///                                             mentioned interface.
186
    ///
187
    /// @return a [DocxStamperConfiguration] object
188
    @Override
189
    public DocxStamperConfiguration exposeInterfaceToExpressionLanguage(
190
            Class<?> interfaceClass,
191
            Object implementation
192
    ) {
193
        this.expressionFunctions.put(interfaceClass, implementation);
194 1 1. exposeInterfaceToExpressionLanguage : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::exposeInterfaceToExpressionLanguage → KILLED
        return this;
195
    }
196
197
    /// Registers the specified ICommentProcessor as an implementation of the specified interface.
198
    ///
199
    /// @param interfaceClass          the interface, implemented by the commentProcessor.
200
    /// @param commentProcessorFactory the commentProcessor factory generating instances of the specified interface.
201
    ///
202
    /// @return a [DocxStamperConfiguration] object
203
    @Override
204
    public DocxStamperConfiguration addCommentProcessor(
205
            Class<?> interfaceClass,
206
            Function<ParagraphPlaceholderReplacer, CommentProcessor> commentProcessorFactory
207
    ) {
208
        this.commentProcessors.put(interfaceClass, commentProcessorFactory);
209 1 1. addCommentProcessor : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::addCommentProcessor → KILLED
        return this;
210
    }
211
212
    /// Adds a preprocessor to the configuration.
213
    ///
214
    /// @param preprocessor the preprocessor to add.
215
    @Override
216
    public void addPreprocessor(PreProcessor preprocessor) {
217
        preprocessors.add(preprocessor);
218
    }
219
220
221
    @Override
222
    public String getLineBreakPlaceholder() {
223 1 1. getLineBreakPlaceholder : replaced return value with "" for pro/verron/officestamper/core/DocxStamperConfiguration::getLineBreakPlaceholder → KILLED
        return lineBreakPlaceholder;
224
    }
225
226
    /// String to replace with a line break when stamping a document.
227
    /// By default, `\\n` is the placeholder.
228
    ///
229
    /// @param lineBreakPlaceholder string to replace with line breaks during stamping.
230
    ///
231
    /// @return the configuration object for chaining.
232
    @Override
233
    public DocxStamperConfiguration setLineBreakPlaceholder(@NonNull String lineBreakPlaceholder) {
234
        this.lineBreakPlaceholder = lineBreakPlaceholder;
235 1 1. setLineBreakPlaceholder : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setLineBreakPlaceholder → KILLED
        return this;
236
    }
237
238
    @Override
239
    public EvaluationContextConfigurer getEvaluationContextConfigurer() {
240 1 1. getEvaluationContextConfigurer : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::getEvaluationContextConfigurer → KILLED
        return evaluationContextConfigurer;
241
    }
242
243
    /// Provides an [EvaluationContextConfigurer] which may change the configuration of a Spring
244
    /// [EvaluationContext] used for evaluating expressions in comments and text.
245
    ///
246
    /// @param evaluationContextConfigurer the configurer to use.
247
    ///
248
    /// @return the configuration object for chaining.
249
    @Override
250
    public DocxStamperConfiguration setEvaluationContextConfigurer(
251
            EvaluationContextConfigurer evaluationContextConfigurer
252
    ) {
253
        this.evaluationContextConfigurer = evaluationContextConfigurer;
254 1 1. setEvaluationContextConfigurer : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setEvaluationContextConfigurer → KILLED
        return this;
255
    }
256
257
    @Override
258
    public SpelParserConfiguration getSpelParserConfiguration() {
259 1 1. getSpelParserConfiguration : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::getSpelParserConfiguration → KILLED
        return spelParserConfiguration;
260
    }
261
262
    /// Sets the [SpelParserConfiguration] used for expression parsing.
263
    /// Note that this configuration is the same for all expressions in the document, including expressions in comments.
264
    ///
265
    /// @param spelParserConfiguration the configuration to use.
266
    ///
267
    /// @return the configuration object for chaining.
268
    @Override
269
    public DocxStamperConfiguration setSpelParserConfiguration(
270
            SpelParserConfiguration spelParserConfiguration
271
    ) {
272
        this.spelParserConfiguration = spelParserConfiguration;
273 1 1. setSpelParserConfiguration : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setSpelParserConfiguration → KILLED
        return this;
274
    }
275
276
    @Override
277
    public Map<Class<?>, Object> getExpressionFunctions() {
278 1 1. getExpressionFunctions : replaced return value with Collections.emptyMap for pro/verron/officestamper/core/DocxStamperConfiguration::getExpressionFunctions → KILLED
        return expressionFunctions;
279
    }
280
281
    @Override
282
    public Map<Class<?>, Function<ParagraphPlaceholderReplacer, CommentProcessor>> getCommentProcessors() {
283 1 1. getCommentProcessors : replaced return value with Collections.emptyMap for pro/verron/officestamper/core/DocxStamperConfiguration::getCommentProcessors → KILLED
        return commentProcessors;
284
    }
285
286
    @Override
287
    public List<PreProcessor> getPreprocessors() {
288 1 1. getPreprocessors : replaced return value with Collections.emptyList for pro/verron/officestamper/core/DocxStamperConfiguration::getPreprocessors → KILLED
        return preprocessors;
289
    }
290
291
    @Override
292
    public List<ObjectResolver> getResolvers() {
293 1 1. getResolvers : replaced return value with Collections.emptyList for pro/verron/officestamper/core/DocxStamperConfiguration::getResolvers → KILLED
        return resolvers;
294
    }
295
296
    /// Sets resolvers for resolving objects in the DocxStamperConfiguration.
297
    ///
298
    /// This method is the evolution of the method `addTypeResolver`,
299
    /// and the order in which the resolvers are ordered is determinant - the first resolvers
300
    /// in the list will be tried first. If a fallback resolver is desired, it should be placed last in the list.
301
    ///
302
    /// @param resolvers The list of ObjectResolvers to be set.
303
    ///
304
    /// @return the configuration object for chaining.
305
    @Override
306
    public DocxStamperConfiguration setResolvers(List<ObjectResolver> resolvers) {
307 1 1. setResolvers : removed call to java/util/List::clear → SURVIVED
        this.resolvers.clear();
308
        this.resolvers.addAll(resolvers);
309 1 1. setResolvers : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setResolvers → SURVIVED
        return this;
310
    }
311
312
    /// Adds a resolver to the list of resolvers in the `DocxStamperConfiguration` object.
313
    /// Resolvers are used to resolve objects during the stamping process.
314
    ///
315
    /// @param resolver The resolver to be added. This resolver should implement the `ObjectResolver` interface.
316
    ///
317
    /// @return The modified `DocxStamperConfiguration` object, with the resolver added to the beginning of the
318
    /// resolver list.
319
    @Override
320
    public DocxStamperConfiguration addResolver(ObjectResolver resolver) {
321 1 1. addResolver : removed call to java/util/List::addFirst → KILLED
        resolvers.addFirst(resolver);
322 1 1. addResolver : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::addResolver → KILLED
        return this;
323
    }
324
325
    @Override
326
    public ExceptionResolver getExceptionResolver() {
327 1 1. getExceptionResolver : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::getExceptionResolver → KILLED
        return exceptionResolver;
328
    }
329
330
    @Override
331
    public DocxStamperConfiguration setExceptionResolver(ExceptionResolver exceptionResolver) {
332
        this.exceptionResolver = exceptionResolver;
333 1 1. setExceptionResolver : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setExceptionResolver → KILLED
        return this;
334
    }
335
336
    @Override
337
    public List<CustomFunction> customFunctions() {
338 1 1. customFunctions : replaced return value with Collections.emptyList for pro/verron/officestamper/core/DocxStamperConfiguration::customFunctions → KILLED
        return functions;
339
    }
340
341
    @Override
342
    public void addCustomFunction(String name, Supplier<?> implementation) {
343 2 1. lambda$addCustomFunction$0 : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::lambda$addCustomFunction$0 → KILLED
2. addCustomFunction : removed call to pro/verron/officestamper/core/DocxStamperConfiguration::addCustomFunction → KILLED
        this.addCustomFunction(new CustomFunction(name, List.of(), args -> implementation.get()));
344
    }
345
346
    public void addCustomFunction(CustomFunction function) {
347
        this.functions.add(function);
348
    }
349
350
    @Override
351
    public <T> NeedsFunctionImpl<T> addCustomFunction(String name, Class<T> class0) {
352 1 1. addCustomFunction : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::addCustomFunction → KILLED
        return new FunctionBuilder<>(this, name, class0);
353
    }
354
355
    @Override
356
    public <T, U> NeedsBiFunctionImpl<T, U> addCustomFunction(String name, Class<T> class0, Class<U> class1) {
357 1 1. addCustomFunction : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::addCustomFunction → KILLED
        return new BiFunctionBuilder<>(this, name, class0, class1);
358
    }
359
360
    @Override
361
    public <T, U, V> CustomFunction.NeedsTriFunctionImpl<T, U, V> addCustomFunction(
362
            String name,
363
            Class<T> class0,
364
            Class<U> class1,
365
            Class<V> class2
366
    ) {
367 1 1. addCustomFunction : replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::addCustomFunction → KILLED
        return new TriFunctionBuilder<>(this, name, class0, class1, class2);
368
    }
369
370
    @Override
371
    public List<PostProcessor> getPostprocessors() {
372 1 1. getPostprocessors : replaced return value with Collections.emptyList for pro/verron/officestamper/core/DocxStamperConfiguration::getPostprocessors → KILLED
        return postprocessors;
373
    }
374
375
    @Override
376
    public void addPostprocessor(PostProcessor postprocessor) {
377
        postprocessors.add(postprocessor);
378
    }
379
}

Mutations

75

1.1
Location : computeExceptionResolver
Killed by : pro.verron.officestamper.test.SpelInjectionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.SpelInjectionTest]/[test-template:spelInjectionTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
negated conditional → KILLED

2.2
Location : computeExceptionResolver
Killed by : pro.verron.officestamper.test.SpelInjectionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.SpelInjectionTest]/[test-template:spelInjectionTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::computeExceptionResolver → KILLED

76

1.1
Location : computeExceptionResolver
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : computeExceptionResolver
Killed by : none
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::computeExceptionResolver → NO_COVERAGE

77

1.1
Location : computeExceptionResolver
Killed by : none
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::computeExceptionResolver → NO_COVERAGE

81

1.1
Location : replaceWithDefaultOnError
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : replaceWithDefaultOnError
Killed by : none
replaced boolean return with true for pro/verron/officestamper/core/DocxStamperConfiguration::replaceWithDefaultOnError → NO_COVERAGE

3.3
Location : replaceWithDefaultOnError
Killed by : none
negated conditional → NO_COVERAGE

85

1.1
Location : replacementDefault
Killed by : none
replaced return value with "" for pro/verron/officestamper/core/DocxStamperConfiguration::replacementDefault → NO_COVERAGE

2.2
Location : replacementDefault
Killed by : none
negated conditional → NO_COVERAGE

90

1.1
Location : resetCommentProcessors
Killed by : none
removed call to java/util/Map::clear → SURVIVED
Covering tests

95

1.1
Location : resetResolvers
Killed by : none
removed call to java/util/List::clear → SURVIVED
Covering tests

101

1.1
Location : isFailOnUnresolvedExpression
Killed by : none
replaced boolean return with true for pro/verron/officestamper/core/DocxStamperConfiguration::isFailOnUnresolvedExpression → NO_COVERAGE

2.2
Location : isFailOnUnresolvedExpression
Killed by : none
replaced boolean return with false for pro/verron/officestamper/core/DocxStamperConfiguration::isFailOnUnresolvedExpression → NO_COVERAGE

115

1.1
Location : setFailOnUnresolvedExpression
Killed by : none
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setFailOnUnresolvedExpression → NO_COVERAGE

120

1.1
Location : isLeaveEmptyOnExpressionError
Killed by : none
replaced boolean return with false for pro/verron/officestamper/core/DocxStamperConfiguration::isLeaveEmptyOnExpressionError → NO_COVERAGE

2.2
Location : isLeaveEmptyOnExpressionError
Killed by : none
replaced boolean return with true for pro/verron/officestamper/core/DocxStamperConfiguration::isLeaveEmptyOnExpressionError → NO_COVERAGE

125

1.1
Location : isReplaceUnresolvedExpressions
Killed by : none
replaced boolean return with true for pro/verron/officestamper/core/DocxStamperConfiguration::isReplaceUnresolvedExpressions → NO_COVERAGE

2.2
Location : isReplaceUnresolvedExpressions
Killed by : none
replaced boolean return with false for pro/verron/officestamper/core/DocxStamperConfiguration::isReplaceUnresolvedExpressions → NO_COVERAGE

130

1.1
Location : getUnresolvedExpressionsDefaultValue
Killed by : none
replaced return value with "" for pro/verron/officestamper/core/DocxStamperConfiguration::getUnresolvedExpressionsDefaultValue → NO_COVERAGE

145

1.1
Location : unresolvedExpressionsDefaultValue
Killed by : none
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::unresolvedExpressionsDefaultValue → NO_COVERAGE

161

1.1
Location : replaceUnresolvedExpressions
Killed by : none
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::replaceUnresolvedExpressions → NO_COVERAGE

176

1.1
Location : leaveEmptyOnExpressionError
Killed by : none
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::leaveEmptyOnExpressionError → NO_COVERAGE

194

1.1
Location : exposeInterfaceToExpressionLanguage
Killed by : pro.verron.officestamper.test.CustomFunctionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.CustomFunctionTests]/[test-template:interfaces(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::exposeInterfaceToExpressionLanguage → KILLED

209

1.1
Location : addCommentProcessor
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#35]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::addCommentProcessor → KILLED

223

1.1
Location : getLineBreakPlaceholder
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:#28]
replaced return value with "" for pro/verron/officestamper/core/DocxStamperConfiguration::getLineBreakPlaceholder → KILLED

235

1.1
Location : setLineBreakPlaceholder
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#14]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setLineBreakPlaceholder → KILLED

240

1.1
Location : getEvaluationContextConfigurer
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:#29]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::getEvaluationContextConfigurer → KILLED

254

1.1
Location : setEvaluationContextConfigurer
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setEvaluationContextConfigurer → KILLED

259

1.1
Location : getSpelParserConfiguration
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:#29]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::getSpelParserConfiguration → KILLED

273

1.1
Location : setSpelParserConfiguration
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setSpelParserConfiguration → KILLED

278

1.1
Location : getExpressionFunctions
Killed by : pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[method:test64()]
replaced return value with Collections.emptyMap for pro/verron/officestamper/core/DocxStamperConfiguration::getExpressionFunctions → KILLED

283

1.1
Location : getCommentProcessors
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#35]
replaced return value with Collections.emptyMap for pro/verron/officestamper/core/DocxStamperConfiguration::getCommentProcessors → KILLED

288

1.1
Location : getPreprocessors
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#2]
replaced return value with Collections.emptyList for pro/verron/officestamper/core/DocxStamperConfiguration::getPreprocessors → KILLED

293

1.1
Location : getResolvers
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:#28]
replaced return value with Collections.emptyList for pro/verron/officestamper/core/DocxStamperConfiguration::getResolvers → KILLED

307

1.1
Location : setResolvers
Killed by : none
removed call to java/util/List::clear → SURVIVED
Covering tests

309

1.1
Location : setResolvers
Killed by : none
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setResolvers → SURVIVED
Covering tests

321

1.1
Location : addResolver
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:#28]
removed call to java/util/List::addFirst → KILLED

322

1.1
Location : addResolver
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::addResolver → KILLED

327

1.1
Location : getExceptionResolver
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:#29]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::getExceptionResolver → KILLED

333

1.1
Location : setExceptionResolver
Killed by : pro.verron.officestamper.test.FailOnUnresolvedPlaceholderTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.FailOnUnresolvedPlaceholderTest]/[test-template:fails(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::setExceptionResolver → KILLED

338

1.1
Location : customFunctions
Killed by : pro.verron.officestamper.test.CustomFunctionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.CustomFunctionTests]/[test-template:trifunctions(pro.verron.officestamper.test.ContextFactory, java.lang.String, java.lang.String)]/[test-template-invocation:#8]
replaced return value with Collections.emptyList for pro/verron/officestamper/core/DocxStamperConfiguration::customFunctions → KILLED

343

1.1
Location : lambda$addCustomFunction$0
Killed by : pro.verron.officestamper.test.CustomFunctionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.CustomFunctionTests]/[test-template:suppliers(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::lambda$addCustomFunction$0 → KILLED

2.2
Location : addCustomFunction
Killed by : pro.verron.officestamper.test.CustomFunctionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.CustomFunctionTests]/[test-template:suppliers(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
removed call to pro/verron/officestamper/core/DocxStamperConfiguration::addCustomFunction → KILLED

352

1.1
Location : addCustomFunction
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:#7]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::addCustomFunction → KILLED

357

1.1
Location : addCustomFunction
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:#7]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::addCustomFunction → KILLED

367

1.1
Location : addCustomFunction
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:#7]
replaced return value with null for pro/verron/officestamper/core/DocxStamperConfiguration::addCustomFunction → KILLED

372

1.1
Location : getPostprocessors
Killed by : pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfEndnotes(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
replaced return value with Collections.emptyList for pro/verron/officestamper/core/DocxStamperConfiguration::getPostprocessors → KILLED

Active mutators

Tests examined


Report generated by PIT 1.20.0