AbstractSymbolSseRequestBuilder.java

1
package pl.zankowski.iextrading4j.client.sse.request;
2
3
import java.util.Arrays;
4
import java.util.HashSet;
5
import java.util.Set;
6
7
import static java.util.stream.Collectors.joining;
8
9
public abstract class AbstractSymbolSseRequestBuilder<R, B extends ISseRequestBuilder<R>>
10
        extends AbstractSseRequestBuilder<R, B> {
11
12
    protected static final String SYMBOL_PARAM = "symbols";
13
14
    private Set<String> symbols = new HashSet<>();
15
16
    protected Set<String> getSymbols() {
17 1 1. getSymbols : replaced return value with Collections.emptySet for pl/zankowski/iextrading4j/client/sse/request/AbstractSymbolSseRequestBuilder::getSymbols → NO_COVERAGE
        return symbols;
18
    }
19
20
    protected String getSymbol() {
21 1 1. getSymbol : replaced return value with "" for pl/zankowski/iextrading4j/client/sse/request/AbstractSymbolSseRequestBuilder::getSymbol → KILLED
        return symbols.stream().collect(joining(","));
22
    }
23
24
    public B withSymbol(String symbol) {
25
        this.symbols.add(symbol);
26 1 1. withSymbol : replaced return value with null for pl/zankowski/iextrading4j/client/sse/request/AbstractSymbolSseRequestBuilder::withSymbol → KILLED
        return (B) this;
27
    }
28
29
    public B withSymbols(String... symbols) {
30
        this.symbols.addAll(Arrays.asList(symbols));
31 1 1. withSymbols : replaced return value with null for pl/zankowski/iextrading4j/client/sse/request/AbstractSymbolSseRequestBuilder::withSymbols → KILLED
        return (B) this;
32
    }
33
34
    public B withAllSymbols() {
35 1 1. withAllSymbols : removed call to java/util/Set::clear → NO_COVERAGE
        this.symbols.clear();
36
        this.symbols.add("firehose");
37 1 1. withAllSymbols : replaced return value with null for pl/zankowski/iextrading4j/client/sse/request/AbstractSymbolSseRequestBuilder::withAllSymbols → NO_COVERAGE
        return (B) this;
38
    }
39
40
}

Mutations

17

1.1
Location : getSymbols
Killed by : none
replaced return value with Collections.emptySet for pl/zankowski/iextrading4j/client/sse/request/AbstractSymbolSseRequestBuilder::getSymbols → NO_COVERAGE

21

1.1
Location : getSymbol
Killed by : pl.zankowski.iextrading4j.client.sse.request.alternative.CryptoBookSseRequestBuilderTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.client.sse.request.alternative.CryptoBookSseRequestBuilderTest]/[method:shouldSuccessfullyCreateRequest()]
replaced return value with "" for pl/zankowski/iextrading4j/client/sse/request/AbstractSymbolSseRequestBuilder::getSymbol → KILLED

26

1.1
Location : withSymbol
Killed by : pl.zankowski.iextrading4j.client.sse.request.alternative.CryptoBookSseRequestBuilderTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.client.sse.request.alternative.CryptoBookSseRequestBuilderTest]/[method:shouldSuccessfullyCreateRequest()]
replaced return value with null for pl/zankowski/iextrading4j/client/sse/request/AbstractSymbolSseRequestBuilder::withSymbol → KILLED

31

1.1
Location : withSymbols
Killed by : pl.zankowski.iextrading4j.client.sse.request.marketdata.AbstractSymbolSseRequestBuilderTest.[engine:junit-jupiter]/[class:pl.zankowski.iextrading4j.client.sse.request.marketdata.AbstractSymbolSseRequestBuilderTest]/[method:shouldSuccessfullyCreateSseRequestWithMultipleSymbols()]
replaced return value with null for pl/zankowski/iextrading4j/client/sse/request/AbstractSymbolSseRequestBuilder::withSymbols → KILLED

35

1.1
Location : withAllSymbols
Killed by : none
removed call to java/util/Set::clear → NO_COVERAGE

37

1.1
Location : withAllSymbols
Killed by : none
replaced return value with null for pl/zankowski/iextrading4j/client/sse/request/AbstractSymbolSseRequestBuilder::withAllSymbols → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.7.1