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

Mutations

28

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

33

1.1
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

34

1.1
Location : equals
Killed by : none
replaced boolean return with false for pl/zankowski/iextrading4j/api/forex/CurrencyConversion::equals → NO_COVERAGE

36

1.1
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

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

37

1.1
Location : equals
Killed by : none
replaced boolean return with true for pl/zankowski/iextrading4j/api/forex/CurrencyConversion::equals → NO_COVERAGE

39

1.1
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

40

1.1
Location : equals
Killed by : none
replaced boolean return with true for pl/zankowski/iextrading4j/api/forex/CurrencyConversion::equals → NO_COVERAGE

43

1.1
Location : equals
Killed by : none
replaced boolean return with false for pl/zankowski/iextrading4j/api/forex/CurrencyConversion::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
replaced boolean return with true for pl/zankowski/iextrading4j/api/forex/CurrencyConversion::equals → NO_COVERAGE

48

1.1
Location : hashCode
Killed by : none
replaced int return with 0 for pl/zankowski/iextrading4j/api/forex/CurrencyConversion::hashCode → NO_COVERAGE

53

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

Active mutators

Tests examined


Report generated by PIT 1.7.1