CryptoPrice.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
8
import java.io.Serializable;
9
import java.math.BigDecimal;
10
11
public class CryptoPrice implements Serializable {
12
13
    private static final long serialVersionUID = 2703606379124034042L;
14
15
    private final BigDecimal price;
16
    private final String symbol;
17
18
    @JsonCreator
19
    public CryptoPrice(
20
            @JsonProperty("price") final BigDecimal price,
21
            @JsonProperty("symbol") final String symbol) {
22
        this.price = price;
23
        this.symbol = symbol;
24
    }
25
26
    public BigDecimal getPrice() {
27 1 1. getPrice : replaced return value with null for pl/zankowski/iextrading4j/api/alternative/CryptoPrice::getPrice → KILLED
        return price;
28
    }
29
30
    public String getSymbol() {
31 1 1. getSymbol : replaced return value with "" for pl/zankowski/iextrading4j/api/alternative/CryptoPrice::getSymbol → KILLED
        return symbol;
32
    }
33
34
    @Override
35
    public boolean equals(final Object o) {
36 1 1. equals : negated conditional → KILLED
        if (this == o) {
37 1 1. equals : replaced boolean return with false for pl/zankowski/iextrading4j/api/alternative/CryptoPrice::equals → KILLED
            return true;
38
        }
39 2 1. equals : negated conditional → KILLED
2. equals : negated conditional → KILLED
        if (o == null || getClass() != o.getClass()) {
40 1 1. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/alternative/CryptoPrice::equals → KILLED
            return false;
41
        }
42
        final CryptoPrice that = (CryptoPrice) o;
43 2 1. equals : negated conditional → KILLED
2. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/alternative/CryptoPrice::equals → KILLED
        return Objects.equal(price, that.price) &&
44 1 1. equals : negated conditional → KILLED
                Objects.equal(symbol, that.symbol);
45
    }
46
47
    @Override
48
    public int hashCode() {
49 1 1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/api/alternative/CryptoPrice::hashCode → KILLED
        return Objects.hashCode(price, symbol);
50
    }
51
52
    @Override
53
    public String toString() {
54 1 1. toString : replaced return value with "" for pl/zankowski/iextrading4j/api/alternative/CryptoPrice::toString → KILLED
        return MoreObjects.toStringHelper(this)
55
                .add("price", price)
56
                .add("symbol", symbol)
57
                .toString();
58
    }
59
60
}

Mutations

27

1.1
Location : getPrice
Killed by : pl.zankowski.iextrading4j.api.alternative.CryptoPriceTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.alternative.CryptoPriceTest]/[method:constructor()]
replaced return value with null for pl/zankowski/iextrading4j/api/alternative/CryptoPrice::getPrice → KILLED

31

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

36

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

37

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

39

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

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

40

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

43

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

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

44

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

49

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

54

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

Active mutators

Tests examined


Report generated by PIT 1.7.1