StakeKeyReportServiceImpl.java

1
package org.cardanofoundation.explorer.api.service.impl;
2
3
import static org.cardanofoundation.explorer.api.common.constant.CommonConstant.UNLIMITED_REPORT;
4
5
import java.io.ByteArrayInputStream;
6
import java.sql.Timestamp;
7
import java.time.Duration;
8
import java.time.Instant;
9
10
import lombok.RequiredArgsConstructor;
11
import lombok.extern.log4j.Log4j2;
12
13
import org.springframework.data.domain.Page;
14
import org.springframework.data.domain.Pageable;
15
import org.springframework.stereotype.Service;
16
import org.springframework.transaction.annotation.Transactional;
17
18
import org.cardanofoundation.explorer.api.common.enumeration.ExportType;
19
import org.cardanofoundation.explorer.api.exception.BusinessCode;
20
import org.cardanofoundation.explorer.api.exception.FetchRewardException;
21
import org.cardanofoundation.explorer.api.interceptor.auth.UserPrincipal;
22
import org.cardanofoundation.explorer.api.mapper.StakeKeyReportMapper;
23
import org.cardanofoundation.explorer.api.model.request.stake.StakeLifeCycleFilterRequest;
24
import org.cardanofoundation.explorer.api.model.request.stake.report.ReportHistoryFilterRequest;
25
import org.cardanofoundation.explorer.api.model.request.stake.report.StakeKeyReportRequest;
26
import org.cardanofoundation.explorer.api.model.response.BaseFilterResponse;
27
import org.cardanofoundation.explorer.api.model.response.stake.lifecycle.StakeDelegationFilterResponse;
28
import org.cardanofoundation.explorer.api.model.response.stake.lifecycle.StakeRegistrationFilterResponse;
29
import org.cardanofoundation.explorer.api.model.response.stake.lifecycle.StakeRewardResponse;
30
import org.cardanofoundation.explorer.api.model.response.stake.lifecycle.StakeWalletActivityResponse;
31
import org.cardanofoundation.explorer.api.model.response.stake.lifecycle.StakeWithdrawalFilterResponse;
32
import org.cardanofoundation.explorer.api.model.response.stake.report.StakeKeyReportHistoryResponse;
33
import org.cardanofoundation.explorer.api.model.response.stake.report.StakeKeyReportResponse;
34
import org.cardanofoundation.explorer.api.repository.explorer.StakeKeyReportHistoryRepository;
35
import org.cardanofoundation.explorer.api.repository.ledgersync.RewardRepository;
36
import org.cardanofoundation.explorer.api.repository.ledgersync.StakeAddressRepository;
37
import org.cardanofoundation.explorer.api.service.FetchRewardDataService;
38
import org.cardanofoundation.explorer.api.service.ReportHistoryService;
39
import org.cardanofoundation.explorer.api.service.RoleService;
40
import org.cardanofoundation.explorer.api.service.StakeKeyLifeCycleService;
41
import org.cardanofoundation.explorer.api.service.StakeKeyReportService;
42
import org.cardanofoundation.explorer.api.service.StorageService;
43
import org.cardanofoundation.explorer.api.util.DataUtil;
44
import org.cardanofoundation.explorer.common.entity.enumeration.ReportStatus;
45
import org.cardanofoundation.explorer.common.entity.enumeration.ReportType;
46
import org.cardanofoundation.explorer.common.entity.explorer.StakeKeyReportHistory;
47
import org.cardanofoundation.explorer.common.exception.BusinessException;
48
49
@Service
50
@RequiredArgsConstructor
51
@Log4j2
52
public class StakeKeyReportServiceImpl implements StakeKeyReportService {
53
54
  public static final String MIN_TIME = "1970-01-01 00:00:00";
55
  private final StakeKeyLifeCycleService stakeKeyLifeCycleService;
56
  private final StakeKeyReportHistoryRepository stakeKeyReportHistoryRepository;
57
  private final RewardRepository rewardRepository;
58
  private final StakeKeyReportMapper stakeKeyReportMapper;
59
  private final StakeAddressRepository stakeAddressRepository;
60
  private final StorageService storageService;
61
  private final FetchRewardDataService fetchRewardDataService;
62
  private final ReportHistoryService reportHistoryService;
63
  private final RoleService roleService;
64
65
  @Override
66
  @Transactional
67
  public StakeKeyReportHistoryResponse generateStakeKeyReport(
68
      StakeKeyReportRequest stakeKeyReportRequest, UserPrincipal userPrincipal) {
69
    stakeAddressRepository
70
        .findByView(stakeKeyReportRequest.getStakeKey())
71 1 1. lambda$generateStakeKeyReport$0 : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::lambda$generateStakeKeyReport$0 → KILLED
        .orElseThrow(() -> new BusinessException(BusinessCode.STAKE_ADDRESS_NOT_FOUND));
72
73
    StakeKeyReportHistory stakeKeyReportHistory =
74
        stakeKeyReportMapper.toStakeKeyReportHistory(stakeKeyReportRequest);
75
76
    int reportLimit = roleService.getReportLimit(userPrincipal.getRoleDescription());
77 1 1. generateStakeKeyReport : negated conditional → KILLED
    if (reportLimit != UNLIMITED_REPORT) { // "-1" it's mean unlimited report
78 1 1. generateStakeKeyReport : negated conditional → KILLED
      if (Boolean.TRUE.equals(
79
          reportHistoryService.isLimitReached(userPrincipal.getUsername(), reportLimit))) {
80
        throw new BusinessException(BusinessCode.REPORT_LIMIT_REACHED);
81
      }
82
    }
83
84 1 1. generateStakeKeyReport : negated conditional → SURVIVED
    if (DataUtil.isNullOrEmpty(stakeKeyReportRequest.getReportName())) {
85
      String reportName = generateReportName(stakeKeyReportHistory);
86 1 1. generateStakeKeyReport : removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setReportName → SURVIVED
      stakeKeyReportHistory.getReportHistory().setReportName(reportName);
87
    }
88
89 1 1. generateStakeKeyReport : removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setStatus → SURVIVED
    stakeKeyReportHistory.getReportHistory().setStatus(ReportStatus.IN_PROGRESS);
90 1 1. generateStakeKeyReport : removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setType → SURVIVED
    stakeKeyReportHistory.getReportHistory().setType(ReportType.STAKE_KEY);
91 1 1. generateStakeKeyReport : removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setUsername → SURVIVED
    stakeKeyReportHistory.getReportHistory().setUsername(userPrincipal.getUsername());
92 1 1. generateStakeKeyReport : removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setDateFormat → SURVIVED
    stakeKeyReportHistory.getReportHistory().setDateFormat(stakeKeyReportRequest.getDateFormat());
93 1 1. generateStakeKeyReport : removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setZoneOffset → SURVIVED
    stakeKeyReportHistory.getReportHistory().setZoneOffset(stakeKeyReportRequest.getZoneOffset());
94 1 1. generateStakeKeyReport : removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setTimePattern → SURVIVED
    stakeKeyReportHistory.getReportHistory().setTimePattern(stakeKeyReportRequest.getTimePattern());
95
    try {
96
      StakeKeyReportHistory successReport =
97
          stakeKeyReportHistoryRepository.saveAndFlush(stakeKeyReportHistory);
98 1 1. generateStakeKeyReport : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::generateStakeKeyReport → KILLED
      return stakeKeyReportMapper.toStakeKeyReportHistoryResponse(successReport);
99
    } catch (Exception e) {
100
      throw new BusinessException(BusinessCode.CREATE_REPORT_ERROR);
101
    }
102
  }
103
104
  @Override
105
  public BaseFilterResponse<StakeKeyReportHistoryResponse> getStakeKeyReportHistory(
106
      String username, ReportHistoryFilterRequest filterRequest, Pageable pageable) {
107
    Timestamp timestamp = new Timestamp(Instant.now().minus(Duration.ofDays(7)).toEpochMilli());
108
    String reportName = DataUtil.makeLikeQuery(filterRequest.getReportName());
109
    Timestamp fromDate = Timestamp.valueOf(MIN_TIME);
110
    Timestamp toDate = Timestamp.from(Instant.now());
111 1 1. getStakeKeyReportHistory : negated conditional → KILLED
    if (!DataUtil.isNullOrEmpty(filterRequest.getFromDate())) {
112
      fromDate = Timestamp.from(filterRequest.getFromDate().toInstant());
113
    }
114 1 1. getStakeKeyReportHistory : negated conditional → KILLED
    if (!DataUtil.isNullOrEmpty(filterRequest.getToDate())) {
115
      toDate = Timestamp.from(filterRequest.getToDate().toInstant());
116
    }
117
118
    Page<StakeKeyReportHistoryResponse> stakeKeyReportHistoriesResponse =
119
        stakeKeyReportHistoryRepository
120
            .getStakeKeyReportHistoryByFilter(reportName, fromDate, toDate, username, pageable)
121
            .map(
122
                stakeKeyReportHistory -> {
123
                  StakeKeyReportHistoryResponse response =
124
                      stakeKeyReportMapper.toStakeKeyReportHistoryResponse(stakeKeyReportHistory);
125
126 1 1. lambda$getStakeKeyReportHistory$1 : negated conditional → KILLED
                  if (response.getCreatedAt().before(timestamp)) {
127 1 1. lambda$getStakeKeyReportHistory$1 : removed call to org/cardanofoundation/explorer/api/model/response/stake/report/StakeKeyReportHistoryResponse::setStatus → KILLED
                    response.setStatus(ReportStatus.EXPIRED);
128
                  }
129 1 1. lambda$getStakeKeyReportHistory$1 : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::lambda$getStakeKeyReportHistory$1 → KILLED
                  return response;
130
                });
131
132 1 1. getStakeKeyReportHistory : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeKeyReportHistory → KILLED
    return new BaseFilterResponse<>(stakeKeyReportHistoriesResponse);
133
  }
134
135
  @Override
136
  public BaseFilterResponse<StakeKeyReportHistoryResponse> getStakeKeyReportHistoryByStakeKey(
137
      String stakeKey, String username, Pageable pageable) {
138
139
    Page<StakeKeyReportHistoryResponse> stakeKeyReportHistoriesResponse =
140
        stakeKeyReportHistoryRepository
141
            .findByUsernameAndStakeKey(stakeKey, username, pageable)
142
            .map(stakeKeyReportMapper::toStakeKeyReportHistoryResponse);
143 1 1. getStakeKeyReportHistoryByStakeKey : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeKeyReportHistoryByStakeKey → KILLED
    return new BaseFilterResponse<>(stakeKeyReportHistoriesResponse);
144
  }
145
146
  @Override
147
  public StakeKeyReportResponse exportStakeKeyReport(
148
      Long reportId, String username, ExportType exportType) {
149 1 1. exportStakeKeyReport : negated conditional → KILLED
    if (!ExportType.EXCEL.equals(exportType)) {
150
      throw new BusinessException(BusinessCode.EXPORT_TYPE_NOT_SUPPORTED);
151
    }
152
153
    StakeKeyReportHistory stakeKeyReportHistory = getStakeKeyReportHistory(reportId, username);
154
    String storageKey = stakeKeyReportHistory.getReportHistory().getStorageKey();
155
    String reportName = stakeKeyReportHistory.getReportHistory().getReportName();
156
    ReportStatus reportStatus = stakeKeyReportHistory.getReportHistory().getStatus();
157 2 1. exportStakeKeyReport : negated conditional → KILLED
2. exportStakeKeyReport : negated conditional → KILLED
    if (DataUtil.isNullOrEmpty(storageKey) || ReportStatus.IN_PROGRESS.equals(reportStatus)) {
158
      throw new BusinessException(BusinessCode.REPORT_IS_IN_PROGRESS);
159
    } else {
160
      byte[] bytes = storageService.downloadFile(storageKey + exportType.getValue());
161 1 1. exportStakeKeyReport : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::exportStakeKeyReport → KILLED
      return StakeKeyReportResponse.builder()
162
          .fileName(reportName + exportType.getValue())
163
          .byteArrayInputStream(new ByteArrayInputStream(bytes))
164
          .build();
165
    }
166
  }
167
168
  @Override
169
  public StakeKeyReportHistoryResponse getStakeKeyReportHistoryByReportId(
170
      Long reportId, String username) {
171
    StakeKeyReportHistory stakeKeyReportHistory = getStakeKeyReportHistory(reportId, username);
172
173 1 1. getStakeKeyReportHistoryByReportId : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeKeyReportHistoryByReportId → KILLED
    return stakeKeyReportMapper.toStakeKeyReportHistoryResponse(stakeKeyReportHistory);
174
  }
175
176
  private StakeKeyReportHistory getStakeKeyReportHistory(Long reportId, String username) {
177
    StakeKeyReportHistory stakeKeyReportHistory =
178
        stakeKeyReportHistoryRepository
179
            .findById(reportId)
180 1 1. lambda$getStakeKeyReportHistory$2 : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::lambda$getStakeKeyReportHistory$2 → KILLED
            .orElseThrow(() -> new BusinessException(BusinessCode.STAKE_REPORT_HISTORY_NOT_FOUND));
181
182 1 1. getStakeKeyReportHistory : negated conditional → KILLED
    if (DataUtil.isNullOrEmpty(username)
183 1 1. getStakeKeyReportHistory : negated conditional → KILLED
        || !username.equals(stakeKeyReportHistory.getReportHistory().getUsername())) {
184
      throw new BusinessException(BusinessCode.STAKE_REPORT_HISTORY_NOT_FOUND);
185
    }
186 1 1. getStakeKeyReportHistory : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeKeyReportHistory → KILLED
    return stakeKeyReportHistory;
187
  }
188
189
  @Override
190
  public BaseFilterResponse<StakeRegistrationFilterResponse> getStakeRegistrationsByReportId(
191
      Long reportId, String username, Pageable pageable) {
192
    StakeKeyReportHistory stakeKeyReportHistory = getStakeKeyReportHistory(reportId, username);
193
    StakeLifeCycleFilterRequest stakeLifeCycleFilterRequest =
194
        getStakeLifeCycleFilterRequest(stakeKeyReportHistory);
195
    String stakeKey = stakeKeyReportHistory.getStakeKey();
196 1 1. getStakeRegistrationsByReportId : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeRegistrationsByReportId → KILLED
    return stakeKeyLifeCycleService.getStakeRegistrations(
197
        stakeKey, stakeLifeCycleFilterRequest, pageable);
198
  }
199
200
  @Override
201
  public BaseFilterResponse<StakeRegistrationFilterResponse> getStakeDeRegistrationsByReportId(
202
      Long reportId, String username, Pageable pageable) {
203
    StakeKeyReportHistory stakeKeyReportHistory = getStakeKeyReportHistory(reportId, username);
204
    StakeLifeCycleFilterRequest stakeLifeCycleFilterRequest =
205
        getStakeLifeCycleFilterRequest(stakeKeyReportHistory);
206
    String stakeKey = stakeKeyReportHistory.getStakeKey();
207 1 1. getStakeDeRegistrationsByReportId : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeDeRegistrationsByReportId → KILLED
    return stakeKeyLifeCycleService.getStakeDeRegistrations(
208
        stakeKey, stakeLifeCycleFilterRequest, pageable);
209
  }
210
211
  @Override
212
  public BaseFilterResponse<StakeDelegationFilterResponse> getStakeDelegationsByReportId(
213
      Long reportId, String username, Pageable pageable) {
214
    StakeKeyReportHistory stakeKeyReportHistory = getStakeKeyReportHistory(reportId, username);
215
    StakeLifeCycleFilterRequest stakeLifeCycleFilterRequest =
216
        getStakeLifeCycleFilterRequest(stakeKeyReportHistory);
217
    String stakeKey = stakeKeyReportHistory.getStakeKey();
218 1 1. getStakeDelegationsByReportId : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeDelegationsByReportId → KILLED
    return stakeKeyLifeCycleService.getStakeDelegations(
219
        stakeKey, stakeLifeCycleFilterRequest, pageable);
220
  }
221
222
  @Override
223
  public BaseFilterResponse<StakeRewardResponse> getStakeRewardsByReportId(
224
      Long reportId, String username, Pageable pageable) {
225
    StakeKeyReportHistory stakeKeyReportHistory = getStakeKeyReportHistory(reportId, username);
226
    String stakeKey = stakeKeyReportHistory.getStakeKey();
227 1 1. getStakeRewardsByReportId : negated conditional → KILLED
    if (Boolean.FALSE.equals(fetchRewardDataService.useKoios())) {
228 1 1. getStakeRewardsByReportId : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeRewardsByReportId → KILLED
      return new BaseFilterResponse<>();
229
    }
230
231 1 1. getStakeRewardsByReportId : removed call to org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::fetchReward → KILLED
    fetchReward(stakeKey);
232
    StakeLifeCycleFilterRequest stakeLifeCycleFilterRequest =
233
        getStakeLifeCycleFilterRequest(stakeKeyReportHistory);
234
235
    Page<StakeRewardResponse> stakeRewardResponses =
236
        rewardRepository.findRewardByStake(
237
            stakeKey,
238
            Timestamp.from(stakeLifeCycleFilterRequest.getFromDate().toInstant()),
239
            Timestamp.from(stakeLifeCycleFilterRequest.getToDate().toInstant()),
240
            pageable);
241
242 1 1. getStakeRewardsByReportId : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeRewardsByReportId → KILLED
    return new BaseFilterResponse<>(stakeRewardResponses);
243
  }
244
245
  @Override
246
  public BaseFilterResponse<StakeWithdrawalFilterResponse> getStakeWithdrawalsByReportId(
247
      Long reportId, String username, Pageable pageable) {
248
    StakeKeyReportHistory stakeKeyReportHistory = getStakeKeyReportHistory(reportId, username);
249
    StakeLifeCycleFilterRequest stakeLifeCycleFilterRequest =
250
        getStakeLifeCycleFilterRequest(stakeKeyReportHistory);
251
    String stakeKey = stakeKeyReportHistory.getStakeKey();
252 1 1. getStakeWithdrawalsByReportId : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeWithdrawalsByReportId → KILLED
    return stakeKeyLifeCycleService.getStakeWithdrawals(
253
        stakeKey, stakeLifeCycleFilterRequest, pageable);
254
  }
255
256
  @Override
257
  public BaseFilterResponse<StakeWalletActivityResponse> getWalletActivitiesByReportId(
258
      Long reportId, String username, Pageable pageable) {
259
    StakeKeyReportHistory stakeKeyReportHistory = getStakeKeyReportHistory(reportId, username);
260
    String stakeKey = stakeKeyReportHistory.getStakeKey();
261
    StakeLifeCycleFilterRequest stakeLifeCycleFilterRequest =
262
        getStakeLifeCycleFilterRequest(stakeKeyReportHistory);
263 1 1. getWalletActivitiesByReportId : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getWalletActivitiesByReportId → KILLED
    return stakeKeyLifeCycleService.getStakeWalletActivitiesByDateRange(
264
        stakeKey, stakeLifeCycleFilterRequest, pageable);
265
  }
266
267
  private StakeLifeCycleFilterRequest getStakeLifeCycleFilterRequest(
268
      StakeKeyReportHistory stakeKeyReportHistory) {
269
    StakeLifeCycleFilterRequest stakeLifeCycleFilterRequest = new StakeLifeCycleFilterRequest();
270 1 1. getStakeLifeCycleFilterRequest : removed call to org/cardanofoundation/explorer/api/model/request/stake/StakeLifeCycleFilterRequest::setFromDate → KILLED
    stakeLifeCycleFilterRequest.setFromDate(stakeKeyReportHistory.getFromDate());
271 1 1. getStakeLifeCycleFilterRequest : removed call to org/cardanofoundation/explorer/api/model/request/stake/StakeLifeCycleFilterRequest::setToDate → KILLED
    stakeLifeCycleFilterRequest.setToDate(stakeKeyReportHistory.getToDate());
272 1 1. getStakeLifeCycleFilterRequest : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeLifeCycleFilterRequest → KILLED
    return stakeLifeCycleFilterRequest;
273
  }
274
275
  private String generateReportName(StakeKeyReportHistory stakeKeyReportHistory) {
276
    String dateTimePattern = "yyyyMMdd";
277 1 1. generateReportName : replaced return value with "" for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::generateReportName → SURVIVED
    return "report_stake_"
278
        + stakeKeyReportHistory.getStakeKey()
279
        + "_"
280
        + DataUtil.localDateTimeToString(
281
            stakeKeyReportHistory.getFromDate().toLocalDateTime(), dateTimePattern)
282
        + "_"
283
        + DataUtil.localDateTimeToString(
284
            stakeKeyReportHistory.getFromDate().toLocalDateTime(), dateTimePattern);
285
  }
286
287
  private void fetchReward(String stakeKey) {
288
    stakeAddressRepository
289
        .findByView(stakeKey)
290 1 1. lambda$fetchReward$3 : replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::lambda$fetchReward$3 → NO_COVERAGE
        .orElseThrow(() -> new BusinessException(BusinessCode.STAKE_ADDRESS_NOT_FOUND));
291 1 1. fetchReward : negated conditional → KILLED
    if (!fetchRewardDataService.checkRewardAvailable(stakeKey)) {
292
      boolean fetchRewardResponse = fetchRewardDataService.fetchReward(stakeKey);
293 1 1. fetchReward : negated conditional → KILLED
      if (!fetchRewardResponse) {
294
        throw new FetchRewardException(BusinessCode.FETCH_REWARD_ERROR);
295
      }
296
    }
297
  }
298
}

Mutations

71

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

77

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

78

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

84

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

86

1.1
Location : generateStakeKeyReport
Killed by : none
removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setReportName → SURVIVED

89

1.1
Location : generateStakeKeyReport
Killed by : none
removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setStatus → SURVIVED

90

1.1
Location : generateStakeKeyReport
Killed by : none
removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setType → SURVIVED

91

1.1
Location : generateStakeKeyReport
Killed by : none
removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setUsername → SURVIVED

92

1.1
Location : generateStakeKeyReport
Killed by : none
removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setDateFormat → SURVIVED

93

1.1
Location : generateStakeKeyReport
Killed by : none
removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setZoneOffset → SURVIVED

94

1.1
Location : generateStakeKeyReport
Killed by : none
removed call to org/cardanofoundation/explorer/common/entity/explorer/ReportHistory::setTimePattern → SURVIVED

98

1.1
Location : generateStakeKeyReport
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:generateStakeKeyReport_shouldGenerateStakeReportHistory()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::generateStakeKeyReport → KILLED

111

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

114

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

126

1.1
Location : lambda$getStakeKeyReportHistory$1
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeKeyReportHistory_shouldReturnStakeKeyReportHistory()]
negated conditional → KILLED

127

1.1
Location : lambda$getStakeKeyReportHistory$1
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeKeyReportHistory_shouldReturnStakeKeyReportHistory()]
removed call to org/cardanofoundation/explorer/api/model/response/stake/report/StakeKeyReportHistoryResponse::setStatus → KILLED

129

1.1
Location : lambda$getStakeKeyReportHistory$1
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeKeyReportHistory_shouldReturnStakeKeyReportHistory()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::lambda$getStakeKeyReportHistory$1 → KILLED

132

1.1
Location : getStakeKeyReportHistory
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeKeyReportHistory_shouldReturnStakeKeyReportHistory()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeKeyReportHistory → KILLED

143

1.1
Location : getStakeKeyReportHistoryByStakeKey
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeKeyReportHistoryByStakeKey_shouldReturnStakeKeyReportHistory()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeKeyReportHistoryByStakeKey → KILLED

149

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

157

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

2.2
Location : exportStakeKeyReport
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:exportStakeKeyReport_shouldThrowExceptionWhenReportNotYetPersistToStorage()]
negated conditional → KILLED

161

1.1
Location : exportStakeKeyReport
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:exportStakeKeyReport_shouldReturnResponse()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::exportStakeKeyReport → KILLED

173

1.1
Location : getStakeKeyReportHistoryByReportId
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeKeyReportHistoryByReportId_shouldReturnResponse()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeKeyReportHistoryByReportId → KILLED

180

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

182

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

183

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

186

1.1
Location : getStakeKeyReportHistory
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeRewardsByReportId_shouldReturnRewardNotAvailable()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeKeyReportHistory → KILLED

196

1.1
Location : getStakeRegistrationsByReportId
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeRegistrationsByReportId_shouldReturnResponse()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeRegistrationsByReportId → KILLED

207

1.1
Location : getStakeDeRegistrationsByReportId
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeDeRegistrationsByReportId_shouldReturnResponse()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeDeRegistrationsByReportId → KILLED

218

1.1
Location : getStakeDelegationsByReportId
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeDelegationsByReportId_shouldReturnResponse()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeDelegationsByReportId → KILLED

227

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

228

1.1
Location : getStakeRewardsByReportId
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeRewardsByReportId_shouldReturnRewardNotAvailable()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeRewardsByReportId → KILLED

231

1.1
Location : getStakeRewardsByReportId
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeRewardsByReportId_shouldReturnResponse()]
removed call to org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::fetchReward → KILLED

242

1.1
Location : getStakeRewardsByReportId
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeRewardsByReportId_shouldReturnResponse()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeRewardsByReportId → KILLED

252

1.1
Location : getStakeWithdrawalsByReportId
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeWithdrawalsByReportId_shouldReturnResponse()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeWithdrawalsByReportId → KILLED

263

1.1
Location : getWalletActivitiesByReportId
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getWalletActivitiesByReportId_shouldReturnResponse()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getWalletActivitiesByReportId → KILLED

270

1.1
Location : getStakeLifeCycleFilterRequest
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeRewardsByReportId_shouldReturnResponse()]
removed call to org/cardanofoundation/explorer/api/model/request/stake/StakeLifeCycleFilterRequest::setFromDate → KILLED

271

1.1
Location : getStakeLifeCycleFilterRequest
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeRewardsByReportId_shouldReturnResponse()]
removed call to org/cardanofoundation/explorer/api/model/request/stake/StakeLifeCycleFilterRequest::setToDate → KILLED

272

1.1
Location : getStakeLifeCycleFilterRequest
Killed by : org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.StakeKeyReportServiceTest]/[method:getStakeWithdrawalsByReportId_shouldReturnResponse()]
replaced return value with null for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::getStakeLifeCycleFilterRequest → KILLED

277

1.1
Location : generateReportName
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/service/impl/StakeKeyReportServiceImpl::generateReportName → SURVIVED

290

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

291

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

293

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

Active mutators

Tests examined


Report generated by PIT 1.14.2