[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] 06/06: tests
From: |
gnunet |
Subject: |
[libeufin] 06/06: tests |
Date: |
Thu, 09 Nov 2023 11:56:04 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
commit fbcd7e2e04e083fac1bc770a69f6be87aef6c2f8
Author: MS <ms@taler.net>
AuthorDate: Thu Nov 9 11:55:43 2023 +0100
tests
---
nexus/src/test/kotlin/Common.kt | 5 +--
nexus/src/test/kotlin/PostFinance.kt | 72 +++++++++++++++++++++++++-----------
2 files changed, 52 insertions(+), 25 deletions(-)
diff --git a/nexus/src/test/kotlin/Common.kt b/nexus/src/test/kotlin/Common.kt
index 0ae3847d..9d1778b9 100644
--- a/nexus/src/test/kotlin/Common.kt
+++ b/nexus/src/test/kotlin/Common.kt
@@ -71,9 +71,8 @@ fun getPofiConfig(
IBAN = CH9789144829733648596
BIC = POFICHBE
NAME = LibEuFin
- BANK_PUBLIC_KEYS_FILE = /tmp/enc-auth-keys.json
- CLIENT_PRIVATE_KEYS_FILE = /tmp/my-private-keys.json
- ACCOUNT_META_DATA_FILE = /tmp/ebics-meta.json
+ BANK_PUBLIC_KEYS_FILE = /tmp/pofi-testplatform-bank-keys.json
+ CLIENT_PRIVATE_KEYS_FILE = /tmp/pofi-testplatform-subscriber-keys.json
BANK_DIALECT = postfinance
""".trimIndent()
diff --git a/nexus/src/test/kotlin/PostFinance.kt
b/nexus/src/test/kotlin/PostFinance.kt
index f5d95533..aa79d111 100644
--- a/nexus/src/test/kotlin/PostFinance.kt
+++ b/nexus/src/test/kotlin/PostFinance.kt
@@ -1,6 +1,5 @@
import io.ktor.client.*
import kotlinx.coroutines.runBlocking
-import org.junit.Ignore
import org.junit.Test
import tech.libeufin.nexus.*
import tech.libeufin.nexus.ebics.*
@@ -8,6 +7,7 @@ import tech.libeufin.util.ebics_h005.Ebics3Request
import tech.libeufin.util.parsePayto
import java.io.File
import java.time.Instant
+import java.time.temporal.ChronoUnit
import kotlin.test.assertNotNull
import kotlin.test.assertTrue
@@ -22,7 +22,55 @@ private fun prep(): EbicsSetupConfig {
}
class Iso20022 {
- // Asks a camt.052 report to the test platform.
+
+ private val yesterday: Instant = Instant.now().minus(1, ChronoUnit.DAYS)
+
+ @Test // asks a pain.002, links with pain.001's MsgId
+ fun getAck() {
+ download(prepAckRequest(startDate = yesterday)
+ )?.unzipForEach { name, content ->
+ println(name)
+ println(content)
+ }
+ }
+
+ /**
+ * With the "mit Detailavisierung" option, each entry has an
+ * AcctSvcrRef & wire transfer subject.
+ */
+ @Test
+ fun getStatement() {
+ val inflatedBytes = download(prepStatementRequest(yesterday))
+ inflatedBytes?.unzipForEach { name, content ->
+ println(name)
+ println(content)
+ }
+ }
+
+ @Test
+ fun getNotification() {
+ val inflatedBytes = download(
+ prepNotificationRequest(
+ // startDate = yesterday,
+ isAppendix = true
+ )
+ )
+ inflatedBytes?.unzipForEach { name, content ->
+ println(name)
+ println(content)
+ }
+ }
+
+ /**
+ * Never shows the subject.
+ */
+ @Test
+ fun getReport() {
+ download(prepReportRequest(yesterday))?.unzipForEach { name, content ->
+ println(name)
+ println(content)
+ }
+ }
@Test
fun simulateIncoming() {
@@ -58,26 +106,6 @@ class Iso20022 {
}
}
- @Test // asks a pain.002
- fun getAck() {
- val pain002 = download(prepAckRequest())
- println(pain002)
- }
-
- @Test
- fun getStatement() {
- val inflatedBytes = download(prepStatementRequest())
- inflatedBytes?.unzipForEach { name, content ->
- println(name)
- println(content)
- }
- }
-
- @Test
- fun getReport() {
- println(download(prepReportRequest()))
- }
-
fun download(req: Ebics3Request.OrderDetails.BTOrderParams): ByteArray? {
val cfg = prep()
val bankKeys = loadBankKeys(cfg.bankPublicKeysFilename)!!
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libeufin] branch master updated (aa9d92d3 -> fbcd7e2e), gnunet, 2023/11/09
- [libeufin] 05/06: nexus fetch: crafting notification (camt.054) requests, gnunet, 2023/11/09
- [libeufin] 02/06: nexus fetch: indexing the execution_time column, gnunet, 2023/11/09
- [libeufin] 04/06: util: new EBICS EC, gnunet, 2023/11/09
- [libeufin] 01/06: storing pain.001 as log file, gnunet, 2023/11/09
- [libeufin] 06/06: tests,
gnunet <=
- [libeufin] 03/06: nexus fetch: not logging pain.001 to console, gnunet, 2023/11/09