WithdrawalMapperImpl.java

1
package org.cardanofoundation.explorer.api.mapper;
2
3
import javax.annotation.processing.Generated;
4
import org.cardanofoundation.explorer.api.model.response.tx.WithdrawalResponse;
5
import org.cardanofoundation.explorer.common.entity.ledgersync.StakeAddress;
6
import org.cardanofoundation.explorer.common.entity.ledgersync.Withdrawal;
7
import org.springframework.stereotype.Component;
8
9
@Generated(
10
    value = "org.mapstruct.ap.MappingProcessor",
11
    date = "2024-11-05T06:00:27+0000",
12
    comments = "version: 1.5.3.Final, compiler: javac, environment: Java 18.0.2.1 (Eclipse Adoptium)"
13
)
14
@Component
15
public class WithdrawalMapperImpl implements WithdrawalMapper {
16
17
    @Override
18
    public WithdrawalResponse fromWithdrawal(Withdrawal withdrawal) {
19 1 1. fromWithdrawal : negated conditional → NO_COVERAGE
        if ( withdrawal == null ) {
20
            return null;
21
        }
22
23
        WithdrawalResponse.WithdrawalResponseBuilder withdrawalResponse = WithdrawalResponse.builder();
24
25
        withdrawalResponse.stakeAddressFrom( withdrawalAddrView( withdrawal ) );
26
        withdrawalResponse.amount( withdrawal.getAmount() );
27
28 1 1. fromWithdrawal : replaced return value with null for org/cardanofoundation/explorer/api/mapper/WithdrawalMapperImpl::fromWithdrawal → NO_COVERAGE
        return withdrawalResponse.build();
29
    }
30
31
    private String withdrawalAddrView(Withdrawal withdrawal) {
32 1 1. withdrawalAddrView : negated conditional → NO_COVERAGE
        if ( withdrawal == null ) {
33 1 1. withdrawalAddrView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/WithdrawalMapperImpl::withdrawalAddrView → NO_COVERAGE
            return null;
34
        }
35
        StakeAddress addr = withdrawal.getAddr();
36 1 1. withdrawalAddrView : negated conditional → NO_COVERAGE
        if ( addr == null ) {
37 1 1. withdrawalAddrView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/WithdrawalMapperImpl::withdrawalAddrView → NO_COVERAGE
            return null;
38
        }
39
        String view = addr.getView();
40 1 1. withdrawalAddrView : negated conditional → NO_COVERAGE
        if ( view == null ) {
41 1 1. withdrawalAddrView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/WithdrawalMapperImpl::withdrawalAddrView → NO_COVERAGE
            return null;
42
        }
43 1 1. withdrawalAddrView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/WithdrawalMapperImpl::withdrawalAddrView → NO_COVERAGE
        return view;
44
    }
45
}

Mutations

19

1.1
Location : fromWithdrawal
Killed by : none
negated conditional → NO_COVERAGE

28

1.1
Location : fromWithdrawal
Killed by : none
replaced return value with null for org/cardanofoundation/explorer/api/mapper/WithdrawalMapperImpl::fromWithdrawal → NO_COVERAGE

32

1.1
Location : withdrawalAddrView
Killed by : none
negated conditional → NO_COVERAGE

33

1.1
Location : withdrawalAddrView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/WithdrawalMapperImpl::withdrawalAddrView → NO_COVERAGE

36

1.1
Location : withdrawalAddrView
Killed by : none
negated conditional → NO_COVERAGE

37

1.1
Location : withdrawalAddrView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/WithdrawalMapperImpl::withdrawalAddrView → NO_COVERAGE

40

1.1
Location : withdrawalAddrView
Killed by : none
negated conditional → NO_COVERAGE

41

1.1
Location : withdrawalAddrView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/WithdrawalMapperImpl::withdrawalAddrView → NO_COVERAGE

43

1.1
Location : withdrawalAddrView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/WithdrawalMapperImpl::withdrawalAddrView → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.14.2