summaryrefslogtreecommitdiff
path: root/testbench
diff options
context:
space:
mode:
authorAntoine A <>2024-04-23 15:39:42 +0900
committerAntoine A <>2024-04-23 15:39:42 +0900
commit0c7b0d7ce73c43eff03302f6c986689c8091fb1f (patch)
tree06814a20352c78bed5d2cb9f981037903b49d58a /testbench
parentda656c2d89d09e3829b7884d5dc5f976c78bc088 (diff)
downloadlibeufin-0c7b0d7ce73c43eff03302f6c986689c8091fb1f.tar.gz
libeufin-0c7b0d7ce73c43eff03302f6c986689c8091fb1f.tar.bz2
libeufin-0c7b0d7ce73c43eff03302f6c986689c8091fb1f.zip
Use better unique bank provided ID for incoming transactions and parse return's reason
Diffstat (limited to 'testbench')
-rw-r--r--testbench/src/main/kotlin/Main.kt5
-rw-r--r--testbench/src/test/kotlin/Iso20022Test.kt10
2 files changed, 8 insertions, 7 deletions
diff --git a/testbench/src/main/kotlin/Main.kt b/testbench/src/main/kotlin/Main.kt
index 7ba9c7e3..3b4a6957 100644
--- a/testbench/src/main/kotlin/Main.kt
+++ b/testbench/src/main/kotlin/Main.kt
@@ -135,10 +135,7 @@ class Cli : CliktCommand("Run integration tests on banks provider") {
val payto = benchCfg.payto[currency] ?: dummyPayto
?: throw Exception("Missing test payto for $currency")
- val recoverDoc = when (cfg.requireString("nexus-ebics", "bank_dialect")) {
- "gls" -> "statement"
- else -> "notification"
- }
+ val recoverDoc = "notification statement"
runBlocking {
step("Init ${kind.name}")
diff --git a/testbench/src/test/kotlin/Iso20022Test.kt b/testbench/src/test/kotlin/Iso20022Test.kt
index c51bfd64..99d20d45 100644
--- a/testbench/src/test/kotlin/Iso20022Test.kt
+++ b/testbench/src/test/kotlin/Iso20022Test.kt
@@ -22,6 +22,7 @@ import tech.libeufin.nexus.parseCustomerAck
import tech.libeufin.nexus.parseCustomerPaymentStatusReport
import tech.libeufin.nexus.parseTx
import tech.libeufin.nexus.loadConfig
+import tech.libeufin.nexus.ebics.Dialect
import java.nio.file.Files
import kotlin.io.path.Path
import kotlin.io.path.exists
@@ -40,7 +41,7 @@ class Iso20022Test {
} else if (name.contains("pain.002") || name.contains("pain002") ) {
parseCustomerPaymentStatusReport(content)
} else {
- parseTx(content, "CHF")
+ parseTx(content, "CHF", Dialect.postfinance)
}
}
}
@@ -57,6 +58,7 @@ class Iso20022Test {
if (!fetch.exists()) continue
val cfg = loadConfig(platform.resolve("ebics.conf"))
val currency = cfg.requireString("nexus-ebics", "currency")
+ val dialect = Dialect.valueOf(cfg.requireString("nexus-ebics", "bank_dialect"))
for (log in fetch.listDirectoryEntries()) {
val content = Files.newInputStream(log)
val name = log.toString()
@@ -65,8 +67,10 @@ class Iso20022Test {
parseCustomerAck(content)
} else if (name.contains("pain.002")) {
parseCustomerPaymentStatusReport(content)
- } else if (!name.contains("camt.052") && !name.contains("_C52_") && !name.contains("_Z01_")) {
- parseTx(content, currency)
+ } else if (
+ !name.contains("camt.052") && !name.contains("_C52_") && !name.contains("_Z01_")
+ ) {
+ parseTx(content, currency, dialect)
}
}
}