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

Mutations

29

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

34

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

35

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

37

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

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

38

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

40

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

41

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

44

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

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

49

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

54

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

Active mutators

Tests examined


Report generated by PIT 1.7.1