gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] 02/02: Tests.


From: gnunet
Subject: [libeufin] 02/02: Tests.
Date: Sat, 07 Jan 2023 14:07:11 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

commit cbe4ce3f2853b4113d0550396a9b37b3bdc7bec2
Author: MS <ms@taler.net>
AuthorDate: Sat Jan 7 14:03:47 2023 +0100

    Tests.
    
    Testing that some pain.001-valid amounts
    are still rejected after the XML validation.
    That happens because pain.001 allows more
    than 2 fractional digits, whereas Taler has a
    limit of 2.
---
 nexus/src/test/kotlin/DownloadAndSubmit.kt | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/nexus/src/test/kotlin/DownloadAndSubmit.kt 
b/nexus/src/test/kotlin/DownloadAndSubmit.kt
index 0b8b5914..d656711b 100644
--- a/nexus/src/test/kotlin/DownloadAndSubmit.kt
+++ b/nexus/src/test/kotlin/DownloadAndSubmit.kt
@@ -302,6 +302,34 @@ class DownloadAndSubmit {
         }
     }
 
+    /**
+     * Test that pain.001 amounts ALSO have max 2 fractional digits, like 
Taler's.
+     * That makes Sandbox however NOT completely compatible with the pain.001 
standard,
+     * since this allows up to 5 fractional digits.  */
+    @Test
+    fun testFractionalDigits() {
+        withNexusAndSandboxUser {
+            testApplication {
+                application(sandboxApp)
+                runBlocking {
+                    // Create Pain.001 with excessive amount.
+                    addPaymentInitiation(
+                        Pain001Data(
+                            creditorIban = getIban(),
+                            creditorBic = "SANDBOXX",
+                            creditorName = "Tester",
+                            subject = "test payment",
+                            sum = "1.001", // wrong 3 fractional digits.
+                            currency = "TESTKUDOS"
+                        ),
+                        "foo"
+                    )
+                    assertException<EbicsProtocolError> { 
submitAllPaymentInitiations(client, "foo") }
+                }
+            }
+        }
+    }
+
     // Test the EBICS error message in case of debt threshold being surpassed
     @Test
     fun testDebit() {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]