commit c8bcfc1cf0b0ab3ed1b5d548873346edd1c674c2
parent 69e96d87deb72e02e1dfb1cca542117a80620a04
Author: MS <ms@taler.net>
Date: Thu, 3 Dec 2020 16:54:03 +0100
adapt unit test to new camt-parser policy
Diffstat:
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/iso20022/Iso20022.kt
@@ -323,10 +323,10 @@ data class CamtBankAccountEntry(
*/
val instructedAmount: CurrencyAmount?,
- /**
- * Details of the underlying transaction for type=Simple.
- */
+ // This field got recently obsoleted.
val details: TransactionDetails? = null,
+
+ // list of sub-transactions participating in this money movement.
val batches: List<Batch>?
)
diff --git a/nexus/src/test/kotlin/Iso20022Test.kt b/nexus/src/test/kotlin/Iso20022Test.kt
@@ -54,11 +54,17 @@ class Iso20022Test {
assertEquals(null, r.reports[0].entries[0].entryRef)
assertEquals("acctsvcrref-001", r.reports[0].entries[0].accountServicerRef)
assertEquals("PMNT-RCDT-ESCT", r.reports[0].entries[0].bankTransactionCode)
- assertNotNull(r.reports[0].entries[0].details)
- assertEquals("unstructured info one", r.reports[0].entries[0].details?.unstructuredRemittanceInformation)
+ assertNotNull(r.reports[0].entries[0].batches?.get(0))
+ assertEquals(
+ "unstructured info one",
+ r.reports[0].entries[0].batches?.get(0)?.batchTransactions?.get(0)?.details?.unstructuredRemittanceInformation
+ )
// Second Entry
- assertEquals("unstructured info across lines", r.reports[0].entries[1].details?.unstructuredRemittanceInformation)
+ assertEquals(
+ "unstructured info across lines",
+ r.reports[0].entries[1].batches?.get(0)?.batchTransactions?.get(0)?.details?.unstructuredRemittanceInformation
+ )
// Third Entry