DRepServiceImpl.java

1
package org.cardanofoundation.explorer.api.service.impl;
2
3
import java.math.BigInteger;
4
import java.sql.Timestamp;
5
import java.time.LocalDateTime;
6
import java.time.ZoneOffset;
7
import java.util.*;
8
import java.util.function.BinaryOperator;
9
import java.util.function.Function;
10
import java.util.stream.Collectors;
11
12
import lombok.RequiredArgsConstructor;
13
import lombok.extern.log4j.Log4j2;
14
15
import org.springframework.data.domain.Page;
16
import org.springframework.data.domain.PageRequest;
17
import org.springframework.data.domain.Pageable;
18
import org.springframework.data.domain.Sort;
19
import org.springframework.data.util.Pair;
20
import org.springframework.stereotype.Service;
21
22
import org.cardanofoundation.explorer.api.exception.BusinessCode;
23
import org.cardanofoundation.explorer.api.mapper.DRepCertificateMapper;
24
import org.cardanofoundation.explorer.api.mapper.DRepMapper;
25
import org.cardanofoundation.explorer.api.model.request.drep.DRepFilterRequest;
26
import org.cardanofoundation.explorer.api.model.response.BaseFilterResponse;
27
import org.cardanofoundation.explorer.api.model.response.dashboard.EpochSummary;
28
import org.cardanofoundation.explorer.api.model.response.drep.DRepCertificateHistoryResponse;
29
import org.cardanofoundation.explorer.api.model.response.drep.DRepDelegatorsResponse;
30
import org.cardanofoundation.explorer.api.model.response.drep.DRepDetailsResponse;
31
import org.cardanofoundation.explorer.api.model.response.drep.DRepFilterResponse;
32
import org.cardanofoundation.explorer.api.model.response.drep.DRepOverviewResponse;
33
import org.cardanofoundation.explorer.api.model.response.drep.DRepRangeValuesResponse;
34
import org.cardanofoundation.explorer.api.model.response.drep.VotingProcedureChartResponse;
35
import org.cardanofoundation.explorer.api.model.response.drep.projection.DRepCertificateProjection;
36
import org.cardanofoundation.explorer.api.model.response.drep.projection.DRepStatusCountProjection;
37
import org.cardanofoundation.explorer.api.projection.DRepDelegatorProjection;
38
import org.cardanofoundation.explorer.api.projection.DRepRangeProjection;
39
import org.cardanofoundation.explorer.api.projection.StakeAddressBalanceProjection;
40
import org.cardanofoundation.explorer.api.projection.VotingProcedureProjection;
41
import org.cardanofoundation.explorer.api.repository.ledgersync.DRepRegistrationRepository;
42
import org.cardanofoundation.explorer.api.repository.ledgersync.DelegationVoteRepository;
43
import org.cardanofoundation.explorer.api.repository.ledgersync.DrepInfoRepository;
44
import org.cardanofoundation.explorer.api.repository.ledgersync.VotingProcedureRepository;
45
import org.cardanofoundation.explorer.api.repository.ledgersyncagg.StakeAddressBalanceRepository;
46
import org.cardanofoundation.explorer.api.service.DRepService;
47
import org.cardanofoundation.explorer.api.service.EpochService;
48
import org.cardanofoundation.explorer.api.service.FetchRewardDataService;
49
import org.cardanofoundation.explorer.common.entity.enumeration.DRepStatus;
50
import org.cardanofoundation.explorer.common.entity.enumeration.GovActionType;
51
import org.cardanofoundation.explorer.common.entity.enumeration.Vote;
52
import org.cardanofoundation.explorer.common.entity.ledgersync.DRepInfo;
53
import org.cardanofoundation.explorer.common.exception.BusinessException;
54
55
@Service
56
@RequiredArgsConstructor
57
@Log4j2
58
public class DRepServiceImpl implements DRepService {
59
60
  public static final String MIN_TIME = "1970-01-01 00:00:00";
61
62
  private final DRepRegistrationRepository dRepRegistrationRepository;
63
  private final DRepCertificateMapper dRepCertificateMapper;
64
  private final VotingProcedureRepository votingProcedureRepository;
65
  private final DrepInfoRepository drepInfoRepository;
66
  private final DelegationVoteRepository delegationVoteRepository;
67
  private final FetchRewardDataService fetchRewardDataService;
68
  private final DRepMapper dRepMapper;
69
  private final StakeAddressBalanceRepository stakeAddressBalanceRepository;
70
71
  private final EpochService epochService;
72
73
  @Override
74
  public BaseFilterResponse<DRepCertificateHistoryResponse> getTxDRepCertificateHistory(
75
      String drepHashOrDrepId, Pageable pageable) {
76
    List<DRepCertificateProjection> dRepCertificateProjections =
77
        dRepRegistrationRepository.getDRepCertificateByDRepIdOrHash(drepHashOrDrepId);
78
    List<DRepCertificateHistoryResponse> dRepCertificateHistoryResponses =
79
        dRepCertificateProjections.stream()
80
            .collect(Collectors.groupingBy(DRepCertificateProjection::getTxHash))
81
            .values()
82
            .stream()
83
            .map(
84
                dRepCertificateProjectionList -> {
85
                  DRepCertificateHistoryResponse dRepCertificateHistoryResponse;
86
                  dRepCertificateHistoryResponse =
87
                      dRepCertificateMapper.fromDRepCertProjection(
88
                          dRepCertificateProjectionList.get(0));
89 1 1. lambda$getTxDRepCertificateHistory$0 : removed call to org/cardanofoundation/explorer/api/model/response/drep/DRepCertificateHistoryResponse::setActionTypes → KILLED
                  dRepCertificateHistoryResponse.setActionTypes(
90
                      dRepCertificateProjectionList.stream()
91
                          .map(DRepCertificateProjection::getType)
92
                          .toList());
93 1 1. lambda$getTxDRepCertificateHistory$0 : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::lambda$getTxDRepCertificateHistory$0 → KILLED
                  return dRepCertificateHistoryResponse;
94
                })
95
            .sorted(
96 1 1. getTxDRepCertificateHistory : negated conditional → SURVIVED
                Sort.Direction.DESC.equals(
97
                        pageable.getSort().getOrderFor("createdAt").getDirection())
98
                    ? Comparator.comparing(DRepCertificateHistoryResponse::getCreatedAt).reversed()
99
                    : Comparator.comparing(DRepCertificateHistoryResponse::getCreatedAt))
100
            .toList();
101
102 1 1. getTxDRepCertificateHistory : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getTxDRepCertificateHistory → KILLED
    return new BaseFilterResponse<>(
103
        BaseFilterResponse.getPageImpl(dRepCertificateHistoryResponses, pageable));
104
  }
105
106
  @Override
107
  public VotingProcedureChartResponse getVoteProcedureChart(
108
      String dRepHashOrId, GovActionType govActionType) {
109
    List<VotingProcedureProjection> votingProcedureProjectionListResponse;
110
    Map<Vote, Long> counted;
111
112
    DRepInfo dRepInfo =
113
        drepInfoRepository
114
            .findByDRepHashOrDRepId(dRepHashOrId)
115 1 1. lambda$getVoteProcedureChart$1 : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::lambda$getVoteProcedureChart$1 → NO_COVERAGE
            .orElseThrow(() -> new BusinessException(BusinessCode.DREP_NOT_FOUND));
116
117
    // if dRepHashOrId is a DRep id
118
    dRepHashOrId = dRepInfo.getDrepHash();
119
    List<VotingProcedureProjection> votingProcedureProjections =
120
        votingProcedureRepository.findVotingProcedureByVoterHashAndGovActionType(
121
            dRepHashOrId,
122 1 1. getVoteProcedureChart : negated conditional → KILLED
            govActionType.equals(GovActionType.ALL) ? null : govActionType,
123
            dRepInfo.getCreatedAt());
124
    votingProcedureProjectionListResponse =
125
        votingProcedureProjections.stream()
126
            .collect(
127
                Collectors.toMap(
128 1 1. lambda$getVoteProcedureChart$2 : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::lambda$getVoteProcedureChart$2 → KILLED
                    e -> Pair.of(e.getGovActionTxHash(), e.getGovActionIndex()),
129
                    Function.identity(),
130
                    BinaryOperator.maxBy(
131
                        Comparator.comparing(VotingProcedureProjection::getBlockTime))))
132
            .values()
133
            .stream()
134
            .toList();
135
    counted =
136
        votingProcedureProjectionListResponse.stream()
137
            .collect(
138
                Collectors.groupingBy(VotingProcedureProjection::getVote, Collectors.counting()));
139
140 1 1. getVoteProcedureChart : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getVoteProcedureChart → KILLED
    return VotingProcedureChartResponse.builder()
141
        .dRepHash(dRepHashOrId)
142
        .govActionType(govActionType)
143
        .numberOfYesVote(counted.getOrDefault(Vote.YES, 0L))
144
        .numberOfNoVotes(counted.getOrDefault(Vote.NO, 0L))
145
        .numberOfAbstainVotes(counted.getOrDefault(Vote.ABSTAIN, 0L))
146
        .build();
147
  }
148
149
  @Override
150
  public DRepDetailsResponse getDRepDetails(String dRepHashOrDRepId) {
151
    DRepInfo dRepInfo =
152
        drepInfoRepository
153
            .findByDRepHashOrDRepId(dRepHashOrDRepId)
154 1 1. lambda$getDRepDetails$3 : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::lambda$getDRepDetails$3 → NO_COVERAGE
            .orElseThrow(() -> new BusinessException(BusinessCode.DREP_NOT_FOUND));
155 1 1. getDRepDetails : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepDetails → KILLED
    return dRepMapper.fromDrepInfo(dRepInfo);
156
  }
157
158
  @Override
159
  public DRepOverviewResponse getDRepOverview() {
160
    EpochSummary epochSummary = epochService.getCurrentEpochSummary();
161
162
    Map<DRepStatus, DRepStatusCountProjection> dRepStatusCountMap =
163
        drepInfoRepository.getDRepStatusCount().stream()
164
            .collect(Collectors.toMap(DRepStatusCountProjection::getStatus, Function.identity()));
165
166
    long countDownTime =
167
        Timestamp.valueOf(epochSummary.getEndTime()).getTime()
168 1 1. getDRepOverview : Replaced long subtraction with addition → SURVIVED
            - Timestamp.valueOf(LocalDateTime.now(ZoneOffset.UTC)).getTime();
169
170
    Long totalDReps =
171
        dRepStatusCountMap.values().stream().mapToLong(DRepStatusCountProjection::getCnt).sum();
172
    Long activeDReps =
173 1 1. getDRepOverview : negated conditional → KILLED
        dRepStatusCountMap.containsKey(DRepStatus.ACTIVE)
174
            ? dRepStatusCountMap.get(DRepStatus.ACTIVE).getCnt()
175
            : 0L;
176
    Long inactiveDReps =
177 1 1. getDRepOverview : negated conditional → KILLED
        dRepStatusCountMap.containsKey(DRepStatus.INACTIVE)
178
            ? dRepStatusCountMap.get(DRepStatus.INACTIVE).getCnt()
179
            : 0L;
180
    Long retiredDReps =
181 1 1. getDRepOverview : negated conditional → KILLED
        dRepStatusCountMap.containsKey(DRepStatus.RETIRED)
182
            ? dRepStatusCountMap.get(DRepStatus.RETIRED).getCnt()
183
            : 0L;
184
185
    // TODO: implement abstainDReps and noConfidenceDReps and registeredDReps
186
    Long abstainDReps = null;
187
    Long noConfidenceDReps = null;
188
    Long registeredDReps = null;
189
190
    // TODO: implement activeStake
191
    BigInteger activeStake = null;
192
    Long delegators = drepInfoRepository.getDelegateCount();
193
194 1 1. getDRepOverview : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepOverview → KILLED
    return DRepOverviewResponse.builder()
195
        .epochNo(epochSummary.getNo())
196
        .countDownEndTime(countDownTime)
197
        .epochSlotNo(epochSummary.getSlot())
198
        .activeStake(activeStake)
199
        .delegators(delegators)
200
        .totalDReps(totalDReps)
201
        .activeDReps(activeDReps)
202
        .inactiveDReps(inactiveDReps)
203
        .retiredDReps(retiredDReps)
204
        .abstainDReps(abstainDReps)
205
        .noConfidenceDReps(noConfidenceDReps)
206
        .registeredDReps(registeredDReps)
207
        .build();
208
  }
209
210
  @Override
211
  public BaseFilterResponse<DRepFilterResponse> getDRepsByFilter(
212
      DRepFilterRequest dRepFilterRequest, Pageable pageable) {
213
214 1 1. getDRepsByFilter : Replaced long division with multiplication → SURVIVED
    long fromDate = Timestamp.valueOf(MIN_TIME).getTime() / 1000;
215 2 1. getDRepsByFilter : negated conditional → SURVIVED
2. getDRepsByFilter : changed conditional boundary → SURVIVED
    fromDate = fromDate < 0 ? 0 : fromDate;
216
    long toDate = LocalDateTime.now().toEpochSecond(ZoneOffset.UTC);
217
218 1 1. getDRepsByFilter : negated conditional → KILLED
    if (Objects.nonNull(dRepFilterRequest.getFromDate())) {
219
      fromDate = dRepFilterRequest.getFromDate().toEpochSecond(ZoneOffset.UTC);
220
    }
221 1 1. getDRepsByFilter : negated conditional → KILLED
    if (Objects.nonNull(dRepFilterRequest.getToDate())) {
222
      long to = dRepFilterRequest.getToDate().toEpochSecond(ZoneOffset.UTC);
223
      toDate = Math.min(to, toDate);
224
    }
225
226 1 1. getDRepsByFilter : negated conditional → SURVIVED
    if (dRepFilterRequest.getActiveStakeFrom() == null) {
227 1 1. getDRepsByFilter : removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setActiveStakeFrom → NO_COVERAGE
      dRepFilterRequest.setActiveStakeFrom(BigInteger.ZERO);
228
    }
229
230 1 1. getDRepsByFilter : negated conditional → SURVIVED
    if (dRepFilterRequest.getActiveStakeTo() == null) {
231 1 1. getDRepsByFilter : removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setActiveStakeTo → NO_COVERAGE
      dRepFilterRequest.setActiveStakeTo(BigInteger.valueOf(Long.MAX_VALUE));
232
    }
233
234 1 1. getDRepsByFilter : negated conditional → SURVIVED
    if (dRepFilterRequest.getVotingPowerFrom() == null) {
235 1 1. getDRepsByFilter : removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setVotingPowerFrom → NO_COVERAGE
      dRepFilterRequest.setVotingPowerFrom(0.0);
236
    }
237
238 1 1. getDRepsByFilter : negated conditional → SURVIVED
    if (dRepFilterRequest.getVotingPowerTo() == null) {
239 1 1. getDRepsByFilter : removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setVotingPowerTo → NO_COVERAGE
      dRepFilterRequest.setVotingPowerTo(1.0);
240
    }
241
242 1 1. getDRepsByFilter : negated conditional → SURVIVED
    if (dRepFilterRequest.getMinGovParticipationRate() == null) {
243 1 1. getDRepsByFilter : removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setMinGovParticipationRate → SURVIVED
      dRepFilterRequest.setMinGovParticipationRate(0.0);
244
    }
245
246 1 1. getDRepsByFilter : negated conditional → SURVIVED
    if (dRepFilterRequest.getMaxGovParticipationRate() == null) {
247 1 1. getDRepsByFilter : removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setMaxGovParticipationRate → SURVIVED
      dRepFilterRequest.setMaxGovParticipationRate(1.0);
248
    }
249
250
    Page<DRepFilterResponse> dRepInfoPage =
251
        drepInfoRepository
252
            .getDRepInfoByFilterRequest(
253
                dRepFilterRequest.getDrepIdOrHash(),
254
                dRepFilterRequest.getAnchorText(),
255
                dRepFilterRequest.getActiveStakeFrom(),
256
                dRepFilterRequest.getActiveStakeTo(),
257
                dRepFilterRequest.getVotingPowerFrom(),
258
                dRepFilterRequest.getVotingPowerTo(),
259
                dRepFilterRequest.getDrepStatus(),
260
                fromDate,
261
                toDate,
262
                dRepFilterRequest.getMinGovParticipationRate(),
263
                dRepFilterRequest.getMaxGovParticipationRate(),
264
                pageable)
265
            .map(dRepMapper::fromDRepInfo);
266
267 1 1. getDRepsByFilter : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepsByFilter → KILLED
    return new BaseFilterResponse<>(dRepInfoPage);
268
  }
269
270
  @Override
271
  public DRepRangeValuesResponse getDRepRangeValues() {
272
    DRepRangeProjection projection = drepInfoRepository.getDRepRangeValues();
273 1 1. getDRepRangeValues : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepRangeValues → NO_COVERAGE
    return dRepMapper.fromDRepRangeProjection(projection);
274
  }
275
276
  @Override
277
  public BaseFilterResponse<DRepDelegatorsResponse> getDRepDelegators(
278
      String drepHashOrDrepId, Pageable pageable) {
279
    Sort sort = pageable.getSort();
280
    for (Sort.Order order : sort) {
281 1 1. getDRepDelegators : negated conditional → SURVIVED
      if (order.getProperty().equals("createdAt")) {
282
        pageable =
283
            PageRequest.of(
284
                pageable.getPageNumber(),
285
                pageable.getPageSize(),
286
                Sort.by(order.getDirection(), "t.id"));
287
        break;
288
      }
289
    }
290
291
    BaseFilterResponse<DRepDelegatorsResponse> delegatorResponse = new BaseFilterResponse<>();
292 1 1. getDRepDelegators : removed call to org/cardanofoundation/explorer/api/model/response/BaseFilterResponse::setData → SURVIVED
    delegatorResponse.setData(List.of());
293
294
    Page<DRepDelegatorProjection> dRepDelegatorProjections =
295
        delegationVoteRepository.getDelegationVoteByDRepHashOrDRepId(drepHashOrDrepId, pageable);
296
297
    List<DRepDelegatorsResponse> dRepDelegatorsResponseList =
298
        dRepDelegatorProjections.stream().map(dRepMapper::fromDRepDelegatorProjection).toList();
299
    // return when no data found
300 1 1. getDRepDelegators : negated conditional → KILLED
    if (dRepDelegatorProjections.isEmpty()) {
301 1 1. getDRepDelegators : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepDelegators → NO_COVERAGE
      return delegatorResponse;
302
    }
303
    // for preview network using Koios
304 1 1. getDRepDelegators : negated conditional → KILLED
    if (fetchRewardDataService.useKoios()) {
305
      List<StakeAddressBalanceProjection> stakeAddressBalanceProjections =
306
          stakeAddressBalanceRepository.findLatestBalanceByStakeAddressIn(
307
              dRepDelegatorProjections.stream()
308
                  .map(DRepDelegatorProjection::getStakeAddress)
309
                  .collect(Collectors.toList()));
310
      Map<String, BigInteger> stakeAddressBalanceMap =
311
          stakeAddressBalanceProjections.stream()
312
              .collect(
313
                  Collectors.toMap(
314
                      StakeAddressBalanceProjection::getAddress,
315
                      StakeAddressBalanceProjection::getBalance));
316 1 1. getDRepDelegators : removed call to java/util/List::forEach → NO_COVERAGE
      dRepDelegatorsResponseList.forEach(
317
          dRepDelegatorResponse -> {
318 1 1. lambda$getDRepDelegators$4 : removed call to org/cardanofoundation/explorer/api/model/response/drep/DRepDelegatorsResponse::setTotalStake → NO_COVERAGE
            dRepDelegatorResponse.setTotalStake(
319
                stakeAddressBalanceMap.getOrDefault(dRepDelegatorResponse.getStakeAddress(), null));
320
          });
321
    }
322 1 1. getDRepDelegators : removed call to org/cardanofoundation/explorer/api/model/response/BaseFilterResponse::setTotalItems → KILLED
    delegatorResponse.setTotalItems(dRepDelegatorProjections.getTotalElements());
323 1 1. getDRepDelegators : removed call to org/cardanofoundation/explorer/api/model/response/BaseFilterResponse::setData → KILLED
    delegatorResponse.setData(dRepDelegatorsResponseList);
324 1 1. getDRepDelegators : removed call to org/cardanofoundation/explorer/api/model/response/BaseFilterResponse::setTotalPages → SURVIVED
    delegatorResponse.setTotalPages(dRepDelegatorProjections.getTotalPages());
325 1 1. getDRepDelegators : removed call to org/cardanofoundation/explorer/api/model/response/BaseFilterResponse::setCurrentPage → SURVIVED
    delegatorResponse.setCurrentPage(pageable.getPageNumber());
326 1 1. getDRepDelegators : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepDelegators → KILLED
    return delegatorResponse;
327
  }
328
}

Mutations

89

1.1
Location : lambda$getTxDRepCertificateHistory$0
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepCertificateHistory()]
removed call to org/cardanofoundation/explorer/api/model/response/drep/DRepCertificateHistoryResponse::setActionTypes → KILLED

93

1.1
Location : lambda$getTxDRepCertificateHistory$0
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepCertificateHistory()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::lambda$getTxDRepCertificateHistory$0 → KILLED

96

1.1
Location : getTxDRepCertificateHistory
Killed by : none
negated conditional → SURVIVED

102

1.1
Location : getTxDRepCertificateHistory
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepCertificateHistory()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getTxDRepCertificateHistory → KILLED

115

1.1
Location : lambda$getVoteProcedureChart$1
Killed by : none
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::lambda$getVoteProcedureChart$1 → NO_COVERAGE

122

1.1
Location : getVoteProcedureChart
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetVoteProcedureChart()]
negated conditional → KILLED

128

1.1
Location : lambda$getVoteProcedureChart$2
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetVoteProcedureChart()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::lambda$getVoteProcedureChart$2 → KILLED

140

1.1
Location : getVoteProcedureChart
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetVoteProcedureChart()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getVoteProcedureChart → KILLED

154

1.1
Location : lambda$getDRepDetails$3
Killed by : none
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::lambda$getDRepDetails$3 → NO_COVERAGE

155

1.1
Location : getDRepDetails
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepDetail()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepDetails → KILLED

168

1.1
Location : getDRepOverview
Killed by : none
Replaced long subtraction with addition → SURVIVED

173

1.1
Location : getDRepOverview
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepOverview()]
negated conditional → KILLED

177

1.1
Location : getDRepOverview
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepOverview()]
negated conditional → KILLED

181

1.1
Location : getDRepOverview
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepOverview()]
negated conditional → KILLED

194

1.1
Location : getDRepOverview
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepOverview()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepOverview → KILLED

214

1.1
Location : getDRepsByFilter
Killed by : none
Replaced long division with multiplication → SURVIVED

215

1.1
Location : getDRepsByFilter
Killed by : none
negated conditional → SURVIVED

2.2
Location : getDRepsByFilter
Killed by : none
changed conditional boundary → SURVIVED

218

1.1
Location : getDRepsByFilter
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepListByFilter()]
negated conditional → KILLED

221

1.1
Location : getDRepsByFilter
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepListByFilter()]
negated conditional → KILLED

226

1.1
Location : getDRepsByFilter
Killed by : none
negated conditional → SURVIVED

227

1.1
Location : getDRepsByFilter
Killed by : none
removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setActiveStakeFrom → NO_COVERAGE

230

1.1
Location : getDRepsByFilter
Killed by : none
negated conditional → SURVIVED

231

1.1
Location : getDRepsByFilter
Killed by : none
removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setActiveStakeTo → NO_COVERAGE

234

1.1
Location : getDRepsByFilter
Killed by : none
negated conditional → SURVIVED

235

1.1
Location : getDRepsByFilter
Killed by : none
removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setVotingPowerFrom → NO_COVERAGE

238

1.1
Location : getDRepsByFilter
Killed by : none
negated conditional → SURVIVED

239

1.1
Location : getDRepsByFilter
Killed by : none
removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setVotingPowerTo → NO_COVERAGE

242

1.1
Location : getDRepsByFilter
Killed by : none
negated conditional → SURVIVED

243

1.1
Location : getDRepsByFilter
Killed by : none
removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setMinGovParticipationRate → SURVIVED

246

1.1
Location : getDRepsByFilter
Killed by : none
negated conditional → SURVIVED

247

1.1
Location : getDRepsByFilter
Killed by : none
removed call to org/cardanofoundation/explorer/api/model/request/drep/DRepFilterRequest::setMaxGovParticipationRate → SURVIVED

267

1.1
Location : getDRepsByFilter
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepListByFilter()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepsByFilter → KILLED

273

1.1
Location : getDRepRangeValues
Killed by : none
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepRangeValues → NO_COVERAGE

281

1.1
Location : getDRepDelegators
Killed by : none
negated conditional → SURVIVED

292

1.1
Location : getDRepDelegators
Killed by : none
removed call to org/cardanofoundation/explorer/api/model/response/BaseFilterResponse::setData → SURVIVED

300

1.1
Location : getDRepDelegators
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testDRepGetDelegators()]
negated conditional → KILLED

301

1.1
Location : getDRepDelegators
Killed by : none
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepDelegators → NO_COVERAGE

304

1.1
Location : getDRepDelegators
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testDRepGetDelegators()]
negated conditional → KILLED

316

1.1
Location : getDRepDelegators
Killed by : none
removed call to java/util/List::forEach → NO_COVERAGE

318

1.1
Location : lambda$getDRepDelegators$4
Killed by : none
removed call to org/cardanofoundation/explorer/api/model/response/drep/DRepDelegatorsResponse::setTotalStake → NO_COVERAGE

322

1.1
Location : getDRepDelegators
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testDRepGetDelegators()]
removed call to org/cardanofoundation/explorer/api/model/response/BaseFilterResponse::setTotalItems → KILLED

323

1.1
Location : getDRepDelegators
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testDRepGetDelegators()]
removed call to org/cardanofoundation/explorer/api/model/response/BaseFilterResponse::setData → KILLED

324

1.1
Location : getDRepDelegators
Killed by : none
removed call to org/cardanofoundation/explorer/api/model/response/BaseFilterResponse::setTotalPages → SURVIVED

325

1.1
Location : getDRepDelegators
Killed by : none
removed call to org/cardanofoundation/explorer/api/model/response/BaseFilterResponse::setCurrentPage → SURVIVED

326

1.1
Location : getDRepDelegators
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testDRepGetDelegators()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/DRepServiceImpl::getDRepDelegators → KILLED

Active mutators

Tests examined


Report generated by PIT 1.14.2