gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: DD50 compliance.


From: gnunet
Subject: [libeufin] branch master updated: DD50 compliance.
Date: Tue, 24 Oct 2023 15:42:02 +0200

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

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new df45bda1 DD50 compliance.
df45bda1 is described below

commit df45bda1e6fcff81f07ae1e1d322979d2eb95cbe
Author: MS <ms@taler.net>
AuthorDate: Tue Oct 24 15:40:44 2023 +0200

    DD50 compliance.
    
    Making the initiated payments subject Kotlin-nullable.
---
 nexus/src/main/kotlin/tech/libeufin/nexus/Database.kt | 2 +-
 nexus/src/test/kotlin/Common.kt                       | 2 +-
 nexus/src/test/kotlin/DatabaseTest.kt                 | 8 ++++++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Database.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Database.kt
index e8d8bd83..50242e8c 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Database.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Database.kt
@@ -40,7 +40,7 @@ data class IncomingPayment(
  */
 data class InitiatedPayment(
     val amount: TalerAmount,
-    val wireTransferSubject: String,
+    val wireTransferSubject: String?,
     val creditPaytoUri: String,
     val initiationTime: Instant,
     val clientRequestUuid: String? = null
diff --git a/nexus/src/test/kotlin/Common.kt b/nexus/src/test/kotlin/Common.kt
index 23faab6b..fe4bdcd2 100644
--- a/nexus/src/test/kotlin/Common.kt
+++ b/nexus/src/test/kotlin/Common.kt
@@ -72,7 +72,7 @@ fun getPofiConfig(userId: String, partnerId: String) = """
 """.trimIndent()
 
 // Generates a payment initiation, given its subject.
-fun genInitPay(subject: String, rowUuid: String? = null) =
+fun genInitPay(subject: String? = null, rowUuid: String? = null) =
     InitiatedPayment(
         amount = TalerAmount(44, 0, "KUDOS"),
         creditPaytoUri = "payto://iban/not-used",
diff --git a/nexus/src/test/kotlin/DatabaseTest.kt 
b/nexus/src/test/kotlin/DatabaseTest.kt
index 367aa650..d2a2a92d 100644
--- a/nexus/src/test/kotlin/DatabaseTest.kt
+++ b/nexus/src/test/kotlin/DatabaseTest.kt
@@ -4,6 +4,7 @@ import tech.libeufin.nexus.*
 import java.time.Instant
 import kotlin.test.assertEquals
 import kotlin.test.assertFalse
+import kotlin.test.assertNull
 import kotlin.test.assertTrue
 
 
@@ -25,7 +26,7 @@ class OutgoingPaymentsTest {
             // inserting trying to reconcile with a non-existing initiated 
payment.
             assertEquals(
                 OutgoingPaymentOutcome.INITIATED_COUNTERPART_NOT_FOUND,
-                db.outgoingPaymentCreate(genOutPay("paid by nexus"), 5)
+                db.outgoingPaymentCreate(genOutPay(), 5)
             )
             // initiating a payment to reconcile later.  Takes row ID == 1
             assertEquals(
@@ -95,6 +96,7 @@ class IncomingPaymentsTest {
     }
 }
 class PaymentInitiationsTest {
+
     // Tests the flagging of payments as submitted.
     @Test
     fun paymentInitiationSetAsSubmitted() {
@@ -165,6 +167,7 @@ class PaymentInitiationsTest {
             assertEquals(db.initiatedPaymentCreate(genInitPay("#2")), 
PaymentInitiationOutcome.SUCCESS)
             assertEquals(db.initiatedPaymentCreate(genInitPay("#3")), 
PaymentInitiationOutcome.SUCCESS)
             assertEquals(db.initiatedPaymentCreate(genInitPay("#4")), 
PaymentInitiationOutcome.SUCCESS)
+            assertEquals(db.initiatedPaymentCreate(genInitPay()), 
PaymentInitiationOutcome.SUCCESS) // checking the nullable subject
 
             // Marking one as submitted, hence not expecting it in the results.
             db.runConn { conn ->
@@ -177,10 +180,11 @@ class PaymentInitiationsTest {
 
             // Expecting all the payments BUT the #3 in the result.
             db.initiatedPaymentsUnsubmittedGet("KUDOS").apply {
-                assertEquals(3, this.size)
+                assertEquals(4, this.size)
                 assertEquals("#1", this[1]?.wireTransferSubject)
                 assertEquals("#2", this[2]?.wireTransferSubject)
                 assertEquals("#4", this[4]?.wireTransferSubject)
+                assertNull(this[5]?.wireTransferSubject)
             }
         }
     }

-- 
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]