From f21227c5fa37fd923f95983ecea938fbc49324e7 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 12 May 2020 19:04:38 +0200 Subject: [PATCH] Made bank transfer usage unique to avoid 'Auftrag wegen Doppeleinreichung abgelehnt' error --- .../test/kotlin/net/dankito/fints/FinTsClientTest.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fints4k/src/test/kotlin/net/dankito/fints/FinTsClientTest.kt b/fints4k/src/test/kotlin/net/dankito/fints/FinTsClientTest.kt index ffd59906..1aac86a8 100644 --- a/fints4k/src/test/kotlin/net/dankito/fints/FinTsClientTest.kt +++ b/fints4k/src/test/kotlin/net/dankito/fints/FinTsClientTest.kt @@ -19,12 +19,20 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.Assert import org.junit.Ignore import org.junit.Test +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.util.* import java.util.concurrent.atomic.AtomicBoolean @Ignore // not an automatic test, supply your settings below class FinTsClientTest { + companion object { + val DateTimeFormatForUniqueBankTransferUsage = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS") + } + + private val didAskUserForTanProcedure = AtomicBoolean(false) private val didAskUserToEnterTan = AtomicBoolean(false) @@ -193,7 +201,8 @@ class FinTsClientTest { assertThat(account?.iban).describedAs("Account IBAN must be set").isNotNull() // transfer 1 cent to yourself. Transferring money to oneself also doesn't require to enter a TAN according to PSD2 - val BankTransferData = BankTransferData(Customer.name, account?.iban!!, Bank.bic, 0.01.toBigDecimal(), "Give it to me baby") + val BankTransferData = BankTransferData(Customer.name, account?.iban!!, Bank.bic, 0.01.toBigDecimal(), + "${DateTimeFormatForUniqueBankTransferUsage.format(LocalDateTime.now())} Test transaction ${UUID.randomUUID()}") // when