StandardPlaceholder.java

1
package pro.verron.officestamper.core;
2
3
import pro.verron.officestamper.api.Placeholder;
4
5
/**
6
 * Represents an expression with a configured Matcher.
7
 */
8
public record StandardPlaceholder(
9
        Matcher matcher,
10
        String expression
11
)
12
        implements Placeholder {
13
    /**
14
     * Returns the inner part of the expression
15
     * by stripping the prefix and suffix.
16
     *
17
     * @return the inner part of the expression.
18
     */
19
    @Override
20
    public String content() {
21 2 1. content : negated conditional → KILLED
2. content : replaced return value with "" for pro/verron/officestamper/core/StandardPlaceholder::content → KILLED
        return matcher.match(expression)
22
                ? matcher.strip(expression)
23
                : expression;
24
    }
25
26
    @Override public String toString() {
27 1 1. toString : replaced return value with "" for pro/verron/officestamper/core/StandardPlaceholder::toString → SURVIVED
        return "[%s]".formatted(expression);
28
    }
29
}

Mutations

21

1.1
Location : content
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]
negated conditional → KILLED

2.2
Location : content
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:#30]
replaced return value with "" for pro/verron/officestamper/core/StandardPlaceholder::content → KILLED

27

1.1
Location : toString
Killed by : none
replaced return value with "" for pro/verron/officestamper/core/StandardPlaceholder::toString → SURVIVED
Covering tests

Active mutators

Tests examined


Report generated by PIT 1.17.1