UrlEncodedKeyValue.java

1
package com.renomad.minum.web;
2
3
import java.util.Objects;
4
5
/**
6
 * Represents a key-value pair with URL-encoding.
7
 * This is the format of data when the Request is sent with a
8
 * content-type header of application/x-www-form-urlencoded.
9
 */
10
public final class UrlEncodedKeyValue {
11
    private final String key;
12
    private final UrlEncodedDataGetter uedg;
13
14
    public UrlEncodedKeyValue(String key, UrlEncodedDataGetter uedg) {
15
        this.key = key;
16
        this.uedg = uedg;
17
    }
18
19
    public String getKey() {
20 1 1. getKey : replaced return value with "" for com/renomad/minum/web/UrlEncodedKeyValue::getKey → KILLED
        return key;
21
    }
22
23
    public UrlEncodedDataGetter getUedg() {
24 1 1. getUedg : replaced return value with null for com/renomad/minum/web/UrlEncodedKeyValue::getUedg → KILLED
        return uedg;
25
    }
26
27
    @Override
28
    public boolean equals(Object o) {
29 2 1. equals : replaced boolean return with false for com/renomad/minum/web/UrlEncodedKeyValue::equals → KILLED
2. equals : negated conditional → KILLED
        if (this == o) return true;
30 3 1. equals : negated conditional → TIMED_OUT
2. equals : negated conditional → KILLED
3. equals : replaced boolean return with true for com/renomad/minum/web/UrlEncodedKeyValue::equals → KILLED
        if (o == null || getClass() != o.getClass()) return false;
31
        UrlEncodedKeyValue that = (UrlEncodedKeyValue) o;
32 3 1. equals : replaced boolean return with true for com/renomad/minum/web/UrlEncodedKeyValue::equals → TIMED_OUT
2. equals : negated conditional → TIMED_OUT
3. equals : negated conditional → KILLED
        return Objects.equals(key, that.key) && Objects.equals(uedg, that.uedg);
33
    }
34
35
    @Override
36
    public int hashCode() {
37 1 1. hashCode : replaced int return with 0 for com/renomad/minum/web/UrlEncodedKeyValue::hashCode → KILLED
        return Objects.hash(key, uedg);
38
    }
39
}

Mutations

20

1.1
Location : getKey
Killed by : com.renomad.minum.web.RequestTests.testReadingAStreamingUrlEncoded(com.renomad.minum.web.RequestTests)
replaced return value with "" for com/renomad/minum/web/UrlEncodedKeyValue::getKey → KILLED

24

1.1
Location : getUedg
Killed by : com.renomad.minum.web.RequestTests.test_Request_getUrlEncoded_EdgeCase_ContentLengthTooLong(com.renomad.minum.web.RequestTests)
replaced return value with null for com/renomad/minum/web/UrlEncodedKeyValue::getUedg → KILLED

29

1.1
Location : equals
Killed by : com.renomad.minum.EqualsTests.equalsTest(com.renomad.minum.EqualsTests)
replaced boolean return with false for com/renomad/minum/web/UrlEncodedKeyValue::equals → KILLED

2.2
Location : equals
Killed by : com.renomad.minum.EqualsTests.equalsTest(com.renomad.minum.EqualsTests)
negated conditional → KILLED

30

1.1
Location : equals
Killed by : com.renomad.minum.EqualsTests.equalsTest(com.renomad.minum.EqualsTests)
negated conditional → KILLED

2.2
Location : equals
Killed by : none
negated conditional → TIMED_OUT

3.3
Location : equals
Killed by : com.renomad.minum.EqualsTests.equalsTest(com.renomad.minum.EqualsTests)
replaced boolean return with true for com/renomad/minum/web/UrlEncodedKeyValue::equals → KILLED

32

1.1
Location : equals
Killed by : none
replaced boolean return with true for com/renomad/minum/web/UrlEncodedKeyValue::equals → TIMED_OUT

2.2
Location : equals
Killed by : none
negated conditional → TIMED_OUT

3.3
Location : equals
Killed by : com.renomad.minum.EqualsTests.equalsTest(com.renomad.minum.EqualsTests)
negated conditional → KILLED

37

1.1
Location : hashCode
Killed by : com.renomad.minum.EqualsTests.equalsTest(com.renomad.minum.EqualsTests)
replaced int return with 0 for com/renomad/minum/web/UrlEncodedKeyValue::hashCode → KILLED

Active mutators

Tests examined


Report generated by PIT 1.17.0