LatestVotingProcedureMapper.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.governanceAction.VotingOnGovActionResponse;
9
import org.cardanofoundation.explorer.api.projection.LatestVotingProcedureProjection;
10
11
@Mapper(componentModel = "spring")
12
public interface LatestVotingProcedureMapper {
13
14
  @Mapping(
15
      target = "timestamp",
16
      expression = "java(fromLong(latestVotingProcedureProjection.getBlockTime()))")
17
  @Mapping(target = "isRepeatVote", source = "repeatVote")
18
  VotingOnGovActionResponse fromLatestVotingProcedureProjection(
19
      LatestVotingProcedureProjection latestVotingProcedureProjection);
20
21
  default Date fromLong(Long value) {
22 3 1. fromLong : Replaced long multiplication with division → SURVIVED
2. fromLong : negated conditional → SURVIVED
3. fromLong : replaced return value with null for org/cardanofoundation/explorer/api/mapper/LatestVotingProcedureMapper::fromLong → SURVIVED
    return value == null ? null : new Date(value * 1000);
23
  }
24
}

Mutations

22

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

2.2
Location : fromLong
Killed by : none
negated conditional → SURVIVED

3.3
Location : fromLong
Killed by : none
replaced return value with null for org/cardanofoundation/explorer/api/mapper/LatestVotingProcedureMapper::fromLong → SURVIVED

Active mutators

Tests examined


Report generated by PIT 1.14.2