CallableVendor.java

1
package com.jsql.model.injection.strategy.blind;
2
3
import com.jsql.model.injection.strategy.blind.patch.Diff;
4
import com.jsql.model.injection.strategy.blind.patch.DiffMatchPatch;
5
6
import java.util.LinkedList;
7
import java.util.List;
8
import java.util.concurrent.CopyOnWriteArrayList;
9
10
public class CallableVendor extends AbstractCallableBoolean<CallableVendor> {
11
12
    // List of differences found between the reference page, and the present page
13
    private LinkedList<Diff> opcodes = new LinkedList<>();
14
15
    private static final DiffMatchPatch DIFF_MATCH_PATCH = new DiffMatchPatch();
16
17
    private final InjectionVendor injectionCharInsertion;
18
19
    private final String metadataInjectionProcess;
20
21
    public CallableVendor(String inj, InjectionVendor injectionCharInsertion, String metadataInjectionProcess) {
22
        
23
        this.injectionCharInsertion = injectionCharInsertion;
24
        this.metadataInjectionProcess = metadataInjectionProcess;
25
        this.booleanUrl = inj;
26
    }
27
28
    @Override
29
    public boolean isTrue() {
30
31
        List<Diff> copyTrueMarks = new CopyOnWriteArrayList<>(this.injectionCharInsertion.getConstantTrueMark());
32
        for (Diff trueDiff: copyTrueMarks) {
33 1 1. isTrue : negated conditional → NO_COVERAGE
            if (!this.opcodes.contains(trueDiff)) {
34 1 1. isTrue : replaced boolean return with true for com/jsql/model/injection/strategy/blind/CallableVendor::isTrue → NO_COVERAGE
                return false;
35
            }
36
        }
37
38 1 1. isTrue : replaced boolean return with false for com/jsql/model/injection/strategy/blind/CallableVendor::isTrue → NO_COVERAGE
        return true;
39
    }
40
41
    @Override
42
    public CallableVendor call() {
43
        
44
        String source = this.injectionCharInsertion.callUrl(this.booleanUrl, this.metadataInjectionProcess, this);
45
        
46
        this.opcodes = CallableVendor.DIFF_MATCH_PATCH.diffMain(
47
            this.injectionCharInsertion.getBlankFalseMark(),
48
            source,
49
            false
50
        );
51
52 1 1. call : removed call to com/jsql/model/injection/strategy/blind/patch/DiffMatchPatch::diffCleanupEfficiency → NO_COVERAGE
        CallableVendor.DIFF_MATCH_PATCH.diffCleanupEfficiency(this.opcodes);
53
        
54 1 1. call : replaced return value with null for com/jsql/model/injection/strategy/blind/CallableVendor::call → NO_COVERAGE
        return this;
55
    }
56
    
57
    public List<Diff> getOpcodes() {
58 1 1. getOpcodes : replaced return value with Collections.emptyList for com/jsql/model/injection/strategy/blind/CallableVendor::getOpcodes → NO_COVERAGE
        return this.opcodes;
59
    }
60
}

Mutations

33

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

34

1.1
Location : isTrue
Killed by : none
replaced boolean return with true for com/jsql/model/injection/strategy/blind/CallableVendor::isTrue → NO_COVERAGE

38

1.1
Location : isTrue
Killed by : none
replaced boolean return with false for com/jsql/model/injection/strategy/blind/CallableVendor::isTrue → NO_COVERAGE

52

1.1
Location : call
Killed by : none
removed call to com/jsql/model/injection/strategy/blind/patch/DiffMatchPatch::diffCleanupEfficiency → NO_COVERAGE

54

1.1
Location : call
Killed by : none
replaced return value with null for com/jsql/model/injection/strategy/blind/CallableVendor::call → NO_COVERAGE

58

1.1
Location : getOpcodes
Killed by : none
replaced return value with Collections.emptyList for com/jsql/model/injection/strategy/blind/CallableVendor::getOpcodes → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1