### Question:
AccountModelMapper { @Mapping(target = "currencyExchange", expression = "java(mapToReportExchanges(transactions.getExchangeRate()))") @Mapping(target = "bankTransactionCode", source = "bankTransactionCodeCode.code") @Mapping(target = "transactionAmount", source = "amount") @Mapping(target = "links", ignore = true) @Mapping(target = "_links", ignore = true) public abstract TransactionDetails mapToTransaction(Transactions transactions);  @Mapping(target = "currency", source = "currency.currencyCode") abstract de.adorsys.psd2.model.AccountReference mapToAccountReference(AccountReference accountReference); abstract List<de.adorsys.psd2.model.AccountReference> mapToAccountReferences(List<AccountReference> accountReferences); AccountList mapToAccountList(Xs2aAccountListHolder xs2aAccountListHolder); InlineResponse200 mapToInlineResponse200(Xs2aAccountDetailsHolder 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 AccountDetails mapToAccountDetails(Xs2aAccountDetails accountDetails); @Mapping(target = "balanceType", expression = "java(mapToBalanceType(balance.getBalanceType()))") @Mapping(target = "lastChangeDateTime", expression = "java(mapToOffsetDateTime(balance.getLastChangeDateTime()))") abstract Balance mapToBalance(Xs2aBalance balance); @Mapping(target = "account", source = "xs2aAccountReference") abstract ReadAccountBalanceResponse200 mapToBalance(Xs2aBalancesReport balancesReport); @Mapping(target = "_links", ignore = true) @Mapping(target = "links", expression = "java(hrefLinkMapper.mapToLinksMap(accountReport.getLinks()))") abstract AccountReport mapToAccountReport(Xs2aAccountReport accountReport); @Mapping(target = "_links", ignore = true) @Mapping(target = "links", expression = "java(hrefLinkMapper.mapToLinksMap(transactionsReport.getLinks()))") @Mapping(target = "transactions", source = "accountReport") @Mapping(target = "account", source = "accountReference") abstract TransactionsResponse200Json mapToTransactionsResponse200Json(Xs2aTransactionsReport transactionsReport); byte[] mapToTransactionsResponseRaw(Xs2aTransactionsReport transactionsReport); @Mapping(target = "currencyExchange", expression = "java(mapToReportExchanges(transactions.getExchangeRate()))") @Mapping(target = "bankTransactionCode", source = "bankTransactionCodeCode.code") @Mapping(target = "transactionAmount", source = "amount") @Mapping(target = "links", ignore = true) @Mapping(target = "_links", ignore = true) abstract TransactionDetails mapToTransaction(Transactions transactions); InlineResponse2001 mapToTransactionDetails(Transactions transactions);  }### Answer:
@Test void mapToTransaction_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); Transactions transactions = jsonReader.getObjectFromFile("json/service/mapper/account-model-mapper/AccountModelMapper-transactions.json", Transactions.class); TransactionDetails actualTransactionDetails = mapper.mapToTransaction(transactions); TransactionDetails expectedReportTransactionDetails = jsonReader.getObjectFromFile("json/service/mapper/account-model-mapper/AccountModelMapper-transaction-details-expected.json", TransactionDetails.class); assertEquals(expectedReportTransactionDetails, actualTransactionDetails); }