TamperingType.java

1
package com.jsql.util.tampering;
2
3
import com.jsql.util.LogLevelUtil;
4
import org.apache.logging.log4j.LogManager;
5
import org.yaml.snakeyaml.Yaml;
6
7
import java.io.IOException;
8
9
public enum TamperingType {
10
    
11
    BASE64("base64.yml"),
12
    COMMENT_TO_METHOD_SIGNATURE("comment-to-method-signature.yml"),
13
    EQUAL_TO_LIKE("equal-to-like.yml"),
14
    RANDOM_CASE("random-case.yml"),
15
    SPACE_TO_DASH_COMMENT("space-to-dash-comment.yml"),
16
    SPACE_TO_MULTILINE_COMMENT("space-to-multiline-comment.yml"),
17
    SPACE_TO_SHARP_COMMENT("space-to-sharp-comment.yml"),
18
    VERSIONED_COMMENT_TO_METHOD_SIGNATURE("version-comment-to-method-signature.yml"),
19
    HEX_TO_CHAR("hex-to-char.yml"),
20
    STRING_TO_CHAR("string-to-char.yml"),
21
    QUOTE_TO_UTF8("quote-to-utf8.yml");
22
23
    private ModelYamlTampering instanceModelYaml;
24
    
25
    TamperingType(String fileYaml) {
26
        
27
        var yaml = new Yaml();
28
        
29
        try (var inputStream = TamperingType.class.getClassLoader().getResourceAsStream("tamper/"+ fileYaml)) {
30
            this.instanceModelYaml = yaml.loadAs(inputStream, ModelYamlTampering.class);
31
        } catch (IOException e) {
32
            LogManager.getRootLogger().log(LogLevelUtil.CONSOLE_JAVA, e, e);
33
        }
34
    }
35
    
36
    public ModelYamlTampering instance() {
37 1 1. instance : replaced return value with null for com/jsql/util/tampering/TamperingType::instance → KILLED
        return this.instanceModelYaml;
38
    }
39
}

Mutations

37

1.1
Location : instance
Killed by : TamperingUtilSpock.[engine:spock]/[spec:TamperingUtilSpock]/[feature:$spock_feature_0_3]
replaced return value with null for com/jsql/util/tampering/TamperingType::instance → KILLED

Active mutators

Tests examined


Report generated by PIT 1.16.1