Fixed getTanMediaList()
This commit is contained in:
parent
6b2434fe3b
commit
5af1557642
|
@ -17,6 +17,7 @@ import net.dankito.banking.fints.messages.segmente.id.CustomerSegmentId
|
||||||
import net.dankito.banking.fints.model.*
|
import net.dankito.banking.fints.model.*
|
||||||
import net.dankito.banking.fints.response.client.AddAccountResponse
|
import net.dankito.banking.fints.response.client.AddAccountResponse
|
||||||
import net.dankito.banking.fints.response.client.FinTsClientResponse
|
import net.dankito.banking.fints.response.client.FinTsClientResponse
|
||||||
|
import net.dankito.banking.fints.response.client.GetTanMediaListResponse
|
||||||
import net.dankito.banking.fints.response.client.GetTransactionsResponse
|
import net.dankito.banking.fints.response.client.GetTransactionsResponse
|
||||||
import net.dankito.banking.fints.util.PureKotlinBase64Service
|
import net.dankito.banking.fints.util.PureKotlinBase64Service
|
||||||
import net.dankito.banking.fints.webclient.KtorWebClient
|
import net.dankito.banking.fints.webclient.KtorWebClient
|
||||||
|
@ -176,11 +177,22 @@ open class FinTsClientTestBase {
|
||||||
|
|
||||||
// this test is only senseful for accounts using chipTAN / TAN generator as TAN method
|
// this test is only senseful for accounts using chipTAN / TAN generator as TAN method
|
||||||
|
|
||||||
underTest.getAnonymousBankInfo(Bank) { }
|
// given
|
||||||
|
val response = AtomicReference<GetTanMediaListResponse>()
|
||||||
|
val countDownLatch = CountDownLatch(1)
|
||||||
|
val anonymousBankInfoCountDownLatch = CountDownLatch(1)
|
||||||
|
|
||||||
|
|
||||||
|
underTest.getAnonymousBankInfo(Bank) {
|
||||||
|
anonymousBankInfoCountDownLatch.countDown()
|
||||||
|
}
|
||||||
|
anonymousBankInfoCountDownLatch.await(30, TimeUnit.SECONDS)
|
||||||
|
|
||||||
|
|
||||||
val supportsRetrievingTanMedia = Bank.supportedJobs.firstOrNull { it.jobName == "HKTAB" } != null
|
val supportsRetrievingTanMedia = Bank.supportedJobs.firstOrNull { it.jobName == "HKTAB" } != null
|
||||||
|
|
||||||
if (supportsRetrievingTanMedia == false) { // accounts with appTAN, pushTAN, smsTAN, ... would fail here -> simply return
|
if (supportsRetrievingTanMedia == false) { // accounts with appTAN, pushTAN, smsTAN, ... would fail here -> simply return
|
||||||
|
println("Bank ${Bank.bankName} does not support retrieving TAN media. Therefore cannot execute test getTanMediaList()")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,8 +201,14 @@ open class FinTsClientTestBase {
|
||||||
|
|
||||||
// when
|
// when
|
||||||
underTest.getTanMediaList(Bank, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien) { result ->
|
underTest.getTanMediaList(Bank, TanMedienArtVersion.Alle, TanMediumKlasse.AlleMedien) { result ->
|
||||||
|
response.set(result)
|
||||||
|
countDownLatch.countDown()
|
||||||
|
}
|
||||||
|
|
||||||
// then
|
// then
|
||||||
|
countDownLatch.await(30, TimeUnit.SECONDS)
|
||||||
|
val result = response.get()
|
||||||
|
|
||||||
expect(result.successful).isTrue()
|
expect(result.successful).isTrue()
|
||||||
|
|
||||||
expect(result.tanMediaList).notToBeNull()
|
expect(result.tanMediaList).notToBeNull()
|
||||||
|
@ -199,7 +217,6 @@ open class FinTsClientTestBase {
|
||||||
|
|
||||||
expect(Bank.tanMedia).isNotEmpty()
|
expect(Bank.tanMedia).isNotEmpty()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Ignore // only works with banks that don't support HKTAB version 5
|
@Ignore // only works with banks that don't support HKTAB version 5
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue