CallableVendor.java

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

Mutations

31

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

32

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

35

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

46

1.1
Location : call
Killed by : none
removed call to name/fraser/neil/plaintext/diff_match_patch::diff_cleanupEfficiency → NO_COVERAGE

47

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

51

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

Active mutators

Tests examined


Report generated by PIT 1.19.1