Moved pure test code (getBestAccountForRetrievingTransactions()) to tests

This commit is contained in:
dankito 2020-05-13 00:06:24 +02:00
parent 1169c510bf
commit a6cc51801e
2 changed files with 1 additions and 6 deletions

View File

@ -976,9 +976,4 @@ open class FinTsClient @JvmOverloads constructor(
return null return null
} }
internal fun getBestAccountForRetrievingTransactions(customer: CustomerData): AccountData? {
return customer.accounts.firstOrNull { it.allowedJobNames.contains(CustomerSegmentId.AccountTransactionsMt940.id) }
}
} }

View File

@ -139,7 +139,7 @@ class FinTsClientTest {
// given // given
underTest.addAccount(Bank, Customer) // retrieve basic data, e.g. accounts underTest.addAccount(Bank, Customer) // retrieve basic data, e.g. accounts
val account = underTest.getBestAccountForRetrievingTransactions(Customer) val account = Customer.accounts.firstOrNull { it.allowedJobNames.contains(CustomerSegmentId.AccountTransactionsMt940.id) }
assertThat(account).describedAs("We need at least one account that supports retrieving account transactions (${CustomerSegmentId.AccountTransactionsMt940.id})").isNotNull() assertThat(account).describedAs("We need at least one account that supports retrieving account transactions (${CustomerSegmentId.AccountTransactionsMt940.id})").isNotNull()
// when // when