EnumHandlerSerializer.java

1
package com.fwmotion.threescale.cms.mixins;
2
3
import com.fasterxml.jackson.core.JsonGenerator;
4
import com.fasterxml.jackson.databind.SerializerProvider;
5
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
6
import com.redhat.threescale.rest.cms.model.EnumHandler;
7
import jakarta.annotation.Nonnull;
8
import jakarta.annotation.Nullable;
9
10
import java.io.IOException;
11
12
public class EnumHandlerSerializer extends StdSerializer<EnumHandler> {
13
14
    public EnumHandlerSerializer() {
15
        this(EnumHandler.class);
16
    }
17
18
    protected EnumHandlerSerializer(@Nonnull Class<EnumHandler> t) {
19
        super(t);
20
    }
21
22
    @Override
23
    public void serialize(@Nullable EnumHandler value,
24
                          @Nonnull JsonGenerator gen,
25
                          @Nullable SerializerProvider provider) throws IOException {
26 4 1. serialize : removed conditional - replaced equality check with true → KILLED
2. serialize : removed conditional - replaced equality check with false → KILLED
3. serialize : removed conditional - replaced equality check with false → KILLED
4. serialize : removed conditional - replaced equality check with true → KILLED
        if (value == null
27
            || value == EnumHandler.UNKNOWN_DEFAULT_OPEN_API) {
28 1 1. serialize : removed call to com/fasterxml/jackson/core/JsonGenerator::writeNull → KILLED
            gen.writeNull();
29
        } else {
30 1 1. serialize : removed call to com/fasterxml/jackson/core/JsonGenerator::writeString → KILLED
            gen.writeString(value.getValue());
31
        }
32
    }
33
}

Mutations

26

1.1
Location : serialize
Killed by : com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest.[engine:junit-jupiter]/[class:com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest]/[method:serialize_Value()]
removed conditional - replaced equality check with true → KILLED

2.2
Location : serialize
Killed by : com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest.[engine:junit-jupiter]/[class:com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest]/[method:serialize_Unknown()]
removed conditional - replaced equality check with false → KILLED

3.3
Location : serialize
Killed by : com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest.[engine:junit-jupiter]/[class:com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest]/[method:serialize_Value()]
removed conditional - replaced equality check with false → KILLED

4.4
Location : serialize
Killed by : com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest.[engine:junit-jupiter]/[class:com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest]/[method:serialize_Null()]
removed conditional - replaced equality check with true → KILLED

28

1.1
Location : serialize
Killed by : com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest.[engine:junit-jupiter]/[class:com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest]/[method:serialize_Unknown()]
removed call to com/fasterxml/jackson/core/JsonGenerator::writeNull → KILLED

30

1.1
Location : serialize
Killed by : com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest.[engine:junit-jupiter]/[class:com.fwmotion.threescale.cms.mixins.EnumHandlerSerializerUnitTest]/[method:serialize_Value()]
removed call to com/fasterxml/jackson/core/JsonGenerator::writeString → KILLED

Active mutators

Tests examined


Report generated by PIT 1.15.3