HealthUpdateStrategyList.java

1
package edu.ucsb.cs156.happiercows.models;
2
3
import edu.ucsb.cs156.happiercows.strategies.CowHealthUpdateStrategies;
4
import lombok.Builder;
5
import lombok.Data;
6
7
import java.util.Arrays;
8
import java.util.List;
9
10
@Data
11
@Builder
12
public class HealthUpdateStrategyList {
13
    private List<HealthUpdateStrategyInfo> strategies;
14
    private String defaultAboveCapacity;
15
    private String defaultBelowCapacity;
16
17
18
    public static HealthUpdateStrategyList create() {
19
        var strategies = CowHealthUpdateStrategies.values();
20
        var strategiesAsInfo = Arrays.stream(strategies)
21 1 1. lambda$create$0 : replaced return value with null for edu/ucsb/cs156/happiercows/models/HealthUpdateStrategyList::lambda$create$0 → KILLED
                .map(strategy -> new HealthUpdateStrategyInfo(
22
                        strategy.name(),
23
                        strategy.getDisplayName(),
24
                        strategy.getDescription()
25
                ))
26
                .toList();
27
28 1 1. create : replaced return value with null for edu/ucsb/cs156/happiercows/models/HealthUpdateStrategyList::create → KILLED
        return HealthUpdateStrategyList.builder()
29
                .strategies(strategiesAsInfo)
30
                .defaultAboveCapacity(CowHealthUpdateStrategies.DEFAULT_ABOVE_CAPACITY.name())
31
                .defaultBelowCapacity(CowHealthUpdateStrategies.DEFAULT_BELOW_CAPACITY.name())
32
                .build();
33
    }
34
}

Mutations

21

1.1
Location : lambda$create$0
Killed by : edu.ucsb.cs156.happiercows.models.HealthUpdateStrategyListTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.models.HealthUpdateStrategyListTests]/[method:strategiesListMatchesEnumValues()]
replaced return value with null for edu/ucsb/cs156/happiercows/models/HealthUpdateStrategyList::lambda$create$0 → KILLED

28

1.1
Location : create
Killed by : edu.ucsb.cs156.happiercows.models.HealthUpdateStrategyListTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.models.HealthUpdateStrategyListTests]/[method:strategiesListMatchesEnumValues()]
replaced return value with null for edu/ucsb/cs156/happiercows/models/HealthUpdateStrategyList::create → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3