ExchangeRate.java

1
package pl.zankowski.iextrading4j.api.forex;
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
import java.time.LocalDate;
11
12
public class ExchangeRate implements Serializable {
13
14
    private static final long serialVersionUID = -7550737092058691758L;
15
16
    private final LocalDate date;
17
    private final String fromCurrency;
18
    private final String toCurrency;
19
    private final BigDecimal rate;
20
21
    @JsonCreator
22
    public ExchangeRate(
23
            @JsonProperty("date") final LocalDate date,
24
            @JsonProperty("fromCurrency") final String fromCurrency,
25
            @JsonProperty("toCurrency") final String toCurrency,
26
            @JsonProperty("rate") final BigDecimal rate) {
27
        this.date = date;
28
        this.fromCurrency = fromCurrency;
29
        this.toCurrency = toCurrency;
30
        this.rate = rate;
31
    }
32
33
    public LocalDate getDate() {
34 1 1. getDate : replaced return value with null for pl/zankowski/iextrading4j/api/forex/ExchangeRate::getDate → KILLED
        return date;
35
    }
36
37
    public String getFromCurrency() {
38 1 1. getFromCurrency : replaced return value with "" for pl/zankowski/iextrading4j/api/forex/ExchangeRate::getFromCurrency → KILLED
        return fromCurrency;
39
    }
40
41
    public String getToCurrency() {
42 1 1. getToCurrency : replaced return value with "" for pl/zankowski/iextrading4j/api/forex/ExchangeRate::getToCurrency → KILLED
        return toCurrency;
43
    }
44
45
    public BigDecimal getRate() {
46 1 1. getRate : replaced return value with null for pl/zankowski/iextrading4j/api/forex/ExchangeRate::getRate → KILLED
        return rate;
47
    }
48
49
    @Override
50
    public boolean equals(final Object o) {
51 2 1. equals : negated conditional → KILLED
2. equals : replaced boolean return with false for pl/zankowski/iextrading4j/api/forex/ExchangeRate::equals → KILLED
        if (this == o) return true;
52 3 1. equals : negated conditional → KILLED
2. equals : negated conditional → KILLED
3. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/forex/ExchangeRate::equals → KILLED
        if (o == null || getClass() != o.getClass()) return false;
53
        final ExchangeRate that = (ExchangeRate) o;
54 2 1. equals : negated conditional → KILLED
2. equals : replaced boolean return with true for pl/zankowski/iextrading4j/api/forex/ExchangeRate::equals → KILLED
        return Objects.equal(date, that.date) &&
55 1 1. equals : negated conditional → KILLED
                Objects.equal(fromCurrency, that.fromCurrency) &&
56 1 1. equals : negated conditional → KILLED
                Objects.equal(toCurrency, that.toCurrency) &&
57 1 1. equals : negated conditional → KILLED
                Objects.equal(rate, that.rate);
58
    }
59
60
    @Override
61
    public int hashCode() {
62 1 1. hashCode : replaced int return with 0 for pl/zankowski/iextrading4j/api/forex/ExchangeRate::hashCode → KILLED
        return Objects.hashCode(date, fromCurrency, toCurrency, rate);
63
    }
64
65
    @Override
66
    public String toString() {
67 1 1. toString : replaced return value with "" for pl/zankowski/iextrading4j/api/forex/ExchangeRate::toString → KILLED
        return MoreObjects.toStringHelper(this)
68
                .add("date", date)
69
                .add("fromCurrency", fromCurrency)
70
                .add("toCurrency", toCurrency)
71
                .add("rate", rate)
72
                .toString();
73
    }
74
}

Mutations

34

1.1
Location : getDate
Killed by : pl.zankowski.iextrading4j.api.forex.ExchangeRateTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.forex.ExchangeRateTest]/[method:constructor()]
replaced return value with null for pl/zankowski/iextrading4j/api/forex/ExchangeRate::getDate → KILLED

38

1.1
Location : getFromCurrency
Killed by : pl.zankowski.iextrading4j.api.forex.ExchangeRateTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.forex.ExchangeRateTest]/[method:constructor()]
replaced return value with "" for pl/zankowski/iextrading4j/api/forex/ExchangeRate::getFromCurrency → KILLED

42

1.1
Location : getToCurrency
Killed by : pl.zankowski.iextrading4j.api.forex.ExchangeRateTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.forex.ExchangeRateTest]/[method:constructor()]
replaced return value with "" for pl/zankowski/iextrading4j/api/forex/ExchangeRate::getToCurrency → KILLED

46

1.1
Location : getRate
Killed by : pl.zankowski.iextrading4j.api.forex.ExchangeRateTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.forex.ExchangeRateTest]/[method:constructor()]
replaced return value with null for pl/zankowski/iextrading4j/api/forex/ExchangeRate::getRate → KILLED

51

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

2.2
Location : equals
Killed by : pl.zankowski.iextrading4j.api.forex.ExchangeRateTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.forex.ExchangeRateTest]/[method:equalsContract()]
replaced boolean return with false for pl/zankowski/iextrading4j/api/forex/ExchangeRate::equals → KILLED

52

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

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

3.3
Location : equals
Killed by : pl.zankowski.iextrading4j.api.forex.ExchangeRateTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.api.forex.ExchangeRateTest]/[method:equalsContract()]
replaced boolean return with true for pl/zankowski/iextrading4j/api/forex/ExchangeRate::equals → KILLED

54

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

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

55

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

56

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

57

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

62

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

67

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

Active mutators

Tests examined


Report generated by PIT 1.7.1