### Question:
CardAccountModelMapper { @Mapping(target = "currencyExchange", expression = "java(mapToReportExchanges(transactions.getCurrencyExchange()))") public abstract CardTransaction mapToCardTransaction(de.adorsys.psd2.xs2a.domain.CardTransaction transactions);  CardAccountList mapToCardAccountList(Xs2aCardAccountListHolder xs2aCardAccountListHolder); InlineResponse2002 mapToInlineResponse202(Xs2aCardAccountDetailsHolder xs2aAccountDetailsHolder); @Mapping(target = "_links", ignore = true) @Mapping(target = "links", expression = "java(hrefLinkMapper.mapToLinksMap(accountDetails.getLinks()))") @Mapping(target = "status", source = "accountStatus") @Mapping(target = "usage", source = "usageType") @Mapping(target = "currency", expression = "java(mapToAccountDetailsCurrency(accountDetails.getCurrency()))") abstract CardAccountDetails mapToCardAccountDetails(Xs2aCardAccountDetails accountDetails); @Mapping(target = "balanceType", expression = "java(mapToBalanceType(balance.getBalanceType()))") @Mapping(target = "lastChangeDateTime", expression = "java(mapToOffsetDateTime(balance.getLastChangeDateTime()))") abstract Balance mapToBalance(Xs2aBalance balance); @Mapping(target = "cardAccount", source = "xs2aAccountReference") abstract ReadCardAccountBalanceResponse200 mapToBalance(Xs2aBalancesReport balancesReport); @Mapping(target = "_links", ignore = true) @Mapping(target = "links", expression = "java(hrefLinkMapper.mapToLinksMap(accountReport.getLinks()))") abstract CardAccountReport mapToCardAccountReport(Xs2aCardAccountReport accountReport); @Mapping(target = "_links", ignore = true) @Mapping(target = "links", expression = "java(hrefLinkMapper.mapToLinksMap(cardTransactionsReport.getLinks()))") @Mapping(target = "cardTransactions", source = "cardAccountReport") @Mapping(target = "cardAccount", source = "accountReference") abstract CardAccountsTransactionsResponse200 mapToTransactionsResponse200Json(Xs2aCardTransactionsReport cardTransactionsReport); byte[] mapToTransactionsResponseRaw(Xs2aCardTransactionsReport transactionsReport); @Mapping(target = "currencyExchange", expression = "java(mapToReportExchanges(transactions.getCurrencyExchange()))") abstract CardTransaction mapToCardTransaction(de.adorsys.psd2.xs2a.domain.CardTransaction transactions);  }### Answer:
@Test void mapToCardTransaction_success() { Xs2aAmount xs2aAmount = jsonReader.getObjectFromFile(XS2A_AMOUNT_JSON_PATH, Xs2aAmount.class); Amount amount = jsonReader.getObjectFromFile(AMOUNT_JSON_PATH, Amount.class); when(mockedAmountModelMapper.mapToAmount(xs2aAmount)).thenReturn(amount); when(mockedPurposeCodeMapper.mapToPurposeCode(PurposeCode.BKDF)).thenReturn(de.adorsys.psd2.model.PurposeCode.BKDF); de.adorsys.psd2.xs2a.domain.CardTransaction transaction = jsonReader.getObjectFromFile("json/service/mapper/card-account-model-mapper/CardAccountModelMapper-card-transaction.json", de.adorsys.psd2.xs2a.domain.CardTransaction.class); CardTransaction actualCardTransaction = mapper.mapToCardTransaction(transaction); CardTransaction expectedReportTransactionDetails = jsonReader.getObjectFromFile("json/service/mapper/card-account-model-mapper/CardAccountModelMapper-card-transaction-expected.json", CardTransaction.class); assertEquals(expectedReportTransactionDetails, actualCardTransaction); }