@Test void accountAccess() { AisAccountAccess result = obaAisConsentMapper.accountAccess(getAisAccountAccessInfoTO(), Collections.singletonList(getAccountDetailsTO())); assertEquals(getAisAccountAccess(), result); }
public AisAccountAccess accountAccess(AisAccountAccessInfoTO access, List<AccountDetailsTO> accountDetails) { List<AccountReference> accounts = mapToAccountReference(access.getAccounts(), accountDetails); List<AccountReference> balances = mapToAccountReference(access.getBalances(), accountDetails); List<AccountReference> transactions = mapToAccountReference(access.getTransactions(), accountDetails); String availableAccounts = Optional.ofNullable(access.getAvailableAccounts()) .map(Enum::name) .orElse(null); String allPsd2 = Optional.ofNullable(access.getAllPsd2()) .map(Enum::name) .orElse(null); return new AisAccountAccess(accounts, balances, transactions, availableAccounts, allPsd2, null, null); }
ObaAisConsentMapper { public AisAccountAccess accountAccess(AisAccountAccessInfoTO access, List<AccountDetailsTO> accountDetails) { List<AccountReference> accounts = mapToAccountReference(access.getAccounts(), accountDetails); List<AccountReference> balances = mapToAccountReference(access.getBalances(), accountDetails); List<AccountReference> transactions = mapToAccountReference(access.getTransactions(), accountDetails); String availableAccounts = Optional.ofNullable(access.getAvailableAccounts()) .map(Enum::name) .orElse(null); String allPsd2 = Optional.ofNullable(access.getAllPsd2()) .map(Enum::name) .orElse(null); return new AisAccountAccess(accounts, balances, transactions, availableAccounts, allPsd2, null, null); } }
ObaAisConsentMapper { public AisAccountAccess accountAccess(AisAccountAccessInfoTO access, List<AccountDetailsTO> accountDetails) { List<AccountReference> accounts = mapToAccountReference(access.getAccounts(), accountDetails); List<AccountReference> balances = mapToAccountReference(access.getBalances(), accountDetails); List<AccountReference> transactions = mapToAccountReference(access.getTransactions(), accountDetails); String availableAccounts = Optional.ofNullable(access.getAvailableAccounts()) .map(Enum::name) .orElse(null); String allPsd2 = Optional.ofNullable(access.getAllPsd2()) .map(Enum::name) .orElse(null); return new AisAccountAccess(accounts, balances, transactions, availableAccounts, allPsd2, null, null); }  }
ObaAisConsentMapper { public AisAccountAccess accountAccess(AisAccountAccessInfoTO access, List<AccountDetailsTO> accountDetails) { List<AccountReference> accounts = mapToAccountReference(access.getAccounts(), accountDetails); List<AccountReference> balances = mapToAccountReference(access.getBalances(), accountDetails); List<AccountReference> transactions = mapToAccountReference(access.getTransactions(), accountDetails); String availableAccounts = Optional.ofNullable(access.getAvailableAccounts()) .map(Enum::name) .orElse(null); String allPsd2 = Optional.ofNullable(access.getAllPsd2()) .map(Enum::name) .orElse(null); return new AisAccountAccess(accounts, balances, transactions, availableAccounts, allPsd2, null, null); }  AisConsentTO toTo(CmsAisAccountConsent consent); AisAccountAccess accountAccess(AisAccountAccessInfoTO access, List<AccountDetailsTO> accountDetails); }
ObaAisConsentMapper { public AisAccountAccess accountAccess(AisAccountAccessInfoTO access, List<AccountDetailsTO> accountDetails) { List<AccountReference> accounts = mapToAccountReference(access.getAccounts(), accountDetails); List<AccountReference> balances = mapToAccountReference(access.getBalances(), accountDetails); List<AccountReference> transactions = mapToAccountReference(access.getTransactions(), accountDetails); String availableAccounts = Optional.ofNullable(access.getAvailableAccounts()) .map(Enum::name) .orElse(null); String allPsd2 = Optional.ofNullable(access.getAllPsd2()) .map(Enum::name) .orElse(null); return new AisAccountAccess(accounts, balances, transactions, availableAccounts, allPsd2, null, null); }  AisConsentTO toTo(CmsAisAccountConsent consent); AisAccountAccess accountAccess(AisAccountAccessInfoTO access, List<AccountDetailsTO> accountDetails);  }