CryptoBookEvent.java

1
package pl.zankowski.iextrading4j.api.alternative;
2
3
import com.fasterxml.jackson.annotation.JsonCreator;
4
import com.fasterxml.jackson.annotation.JsonProperty;
5
import com.google.common.base.MoreObjects;
6
import com.google.common.base.Objects;
7
import pl.zankowski.iextrading4j.api.marketdata.BookEntry;
8
9
import java.io.Serializable;
10
import java.util.List;
11
12
import static pl.zankowski.iextrading4j.api.util.ListUtil.immutableList;
13
14
public class CryptoBookEvent implements Serializable {
15
16
    private static final long serialVersionUID = -2249655496972607126L;
17
18
    private final String symbol;
19
    private final List<BookEntry> bid;
20
    private final List<BookEntry> ask;
21
22
    @JsonCreator
23
    public CryptoBookEvent(
24
            @JsonProperty("bids") final List<BookEntry> bid,
25
            @JsonProperty("asks") final List<BookEntry> ask,
26
            @JsonProperty("symbol") final String symbol) {
27
        this.symbol = symbol;
28
        this.bid = immutableList(bid);
29
        this.ask = immutableList(ask);
30
    }
31
32
    public String getSymbol() {
33 1 1. getSymbol : replaced return value with "" for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::getSymbol → KILLED
        return symbol;
34
    }
35
36
    public List<BookEntry> getBid() {
37 1 1. getBid : replaced return value with Collections.emptyList for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::getBid → KILLED
        return bid;
38
    }
39
40
    public List<BookEntry> getAsk() {
41 1 1. getAsk : replaced return value with Collections.emptyList for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::getAsk → KILLED
        return ask;
42
    }
43
44
    @Override
45
    public boolean equals(final Object o) {
46 1 1. equals : negated conditional → KILLED
        if (this == o) {
47 1 1. equals : replaced boolean return with false for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::equals → KILLED
            return true;
48
        }
49 2 1. equals : negated conditional → KILLED
2. equals : negated conditional → KILLED
        if (o == null || getClass() != o.getClass()) {
50 1 1. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::equals → KILLED
            return false;
51
        }
52
        final CryptoBookEvent that = (CryptoBookEvent) o;
53 2 1. equals : negated conditional → KILLED
2. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::equals → KILLED
        return Objects.equal(symbol, that.symbol) &&
54 1 1. equals : negated conditional → KILLED
                Objects.equal(bid, that.bid) &&
55 1 1. equals : negated conditional → KILLED
                Objects.equal(ask, that.ask);
56
    }
57
58
    @Override
59
    public int hashCode() {
60 1 1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::hashCode → KILLED
        return Objects.hashCode(symbol, bid, ask);
61
    }
62
63
    @Override
64
    public String toString() {
65 1 1. toString : replaced return value with "" for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::toString → KILLED
        return MoreObjects.toStringHelper(this)
66
                .add("symbol", symbol)
67
                .add("bid", bid)
68
                .add("ask", ask)
69
                .toString();
70
    }
71
72
}

Mutations

33

1.1
Location : getSymbol
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:constructor()]
replaced return value with "" for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::getSymbol → KILLED

37

1.1
Location : getBid
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:constructor()]
replaced return value with Collections.emptyList for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::getBid → KILLED

41

1.1
Location : getAsk
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:constructor()]
replaced return value with Collections.emptyList for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::getAsk → KILLED

46

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:equalsContract()]
negated conditional → KILLED

47

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:equalsContract()]
replaced boolean return with false for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::equals → KILLED

49

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:equalsContract()]
negated conditional → KILLED

2.2
Location : equals
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:equalsContract()]
negated conditional → KILLED

50

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:equalsContract()]
replaced boolean return with true for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::equals → KILLED

53

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:equalsContract()]
negated conditional → KILLED

2.2
Location : equals
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:equalsContract()]
replaced boolean return with true for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::equals → KILLED

54

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:equalsContract()]
negated conditional → KILLED

55

1.1
Location : equals
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:equalsContract()]
negated conditional → KILLED

60

1.1
Location : hashCode
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:equalsContract()]
replaced int return with 0 for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::hashCode → KILLED

65

1.1
Location : toString
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoBookEventTest]/[method:toStringVerification()]
replaced return value with "" for pl/zankowski/iextrading4j/api/alternative/CryptoBookEvent::toString → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.1