DRepCertificateMapper.java

1
package org.cardanofoundation.explorer.api.mapper;
2
3
import java.util.Date;
4
5
import org.mapstruct.Mapper;
6
import org.mapstruct.Mapping;
7
8
import org.cardanofoundation.explorer.api.model.response.drep.DRepCertificateHistoryResponse;
9
import org.cardanofoundation.explorer.api.model.response.drep.projection.DRepCertificateProjection;
10
11
@Mapper(componentModel = "spring")
12
public interface DRepCertificateMapper {
13
14
  @Mapping(source = "blockTime", target = "createdAt")
15
  DRepCertificateHistoryResponse fromDRepCertProjection(
16
      DRepCertificateProjection dRepCertificateProjection);
17
18
  default Date fromLong(Long value) {
19 3 1. fromLong : Replaced long multiplication with division → SURVIVED
2. fromLong : negated conditional → KILLED
3. fromLong : replaced return value with null for org/cardanofoundation/explorer/api/mapper/DRepCertificateMapper::fromLong → KILLED
    return value == null ? null : new Date(value * 1000);
20
  }
21
}

Mutations

19

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

2.2
Location : fromLong
Killed by : none
Replaced long multiplication with division → SURVIVED

3.3
Location : fromLong
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/mapper/DRepCertificateMapper::fromLong → KILLED

Active mutators

Tests examined


Report generated by PIT 1.14.2