libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit ad770abf32e711e39b3af30089fa895387a5b82d
parent bcc5850e8da31a6b800a8e9f0f1428d08e8d13c5
Author: MS <ms@taler.net>
Date:   Wed, 30 Nov 2022 22:47:25 +0100

Integration tests.

Send Pain.001 with unsupported currency.

Diffstat:
Mnexus/src/test/kotlin/DownloadAndSubmit.kt | 35++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/nexus/src/test/kotlin/DownloadAndSubmit.kt b/nexus/src/test/kotlin/DownloadAndSubmit.kt @@ -240,7 +240,6 @@ class DownloadAndSubmit { fun invalidPain001() { withNexusAndSandboxUser { withTestApplication(sandboxApp) { - val conn = EbicsBankConnectionProtocol() runBlocking { // Create Pain.001 to be submitted. addPaymentInitiation( @@ -273,4 +272,38 @@ class DownloadAndSubmit { } } } + + @Test + fun unsupportedCurrency() { + withNexusAndSandboxUser { + withTestApplication(sandboxApp) { + runBlocking { + // Create Pain.001 to be submitted. + addPaymentInitiation( + Pain001Data( + creditorIban = getIban(), + creditorBic = "SANDBOXX", + creditorName = "Tester", + subject = "test payment", + sum = Amount(1), + currency = "EUR" + ), + transaction { + NexusBankAccountEntity.findByName( + "foo" + ) ?: throw Exception("Test failed") + } + ) + var thrown = false + try { + submitAllPaymentInitiations(client, "foo") + } catch (e: EbicsProtocolError) { + if (e.ebicsTechnicalCode == EbicsReturnCode.EBICS_PROCESSING_ERROR) + thrown = true + } + assert(thrown) + } + } + } + } } \ No newline at end of file