[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: Including CAMT-generation test.
From: |
gnunet |
Subject: |
[libeufin] branch master updated: Including CAMT-generation test. |
Date: |
Tue, 17 Mar 2020 18:46:20 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new fbbe514 Including CAMT-generation test.
fbbe514 is described below
commit fbbe514d84fedfc99c1c2069839199d93cae4661
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Mar 17 18:46:02 2020 +0100
Including CAMT-generation test.
---
.../tech/libeufin/sandbox/EbicsProtocolBackend.kt | 2 +-
sandbox/src/test/kotlin/CamtGeneration.kt | 45 ++++++++++++++++++++++
2 files changed, 46 insertions(+), 1 deletion(-)
diff --git
a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
index 72e28de..fdc5724 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/EbicsProtocolBackend.kt
@@ -139,7 +139,7 @@ private suspend fun
ApplicationCall.respondEbicsKeyManagement(
respondText(text, ContentType.Application.Xml, HttpStatusCode.OK)
}
-private fun buildCamtString(history: SizedIterable<BankTransactionEntity>,
type: Int): String {
+fun buildCamtString(history: SizedIterable<BankTransactionEntity>, type: Int):
String {
return constructXml(indent = true) {
root("Document") {
diff --git a/sandbox/src/test/kotlin/CamtGeneration.kt
b/sandbox/src/test/kotlin/CamtGeneration.kt
new file mode 100644
index 0000000..adcec09
--- /dev/null
+++ b/sandbox/src/test/kotlin/CamtGeneration.kt
@@ -0,0 +1,45 @@
+package tech.libeufin.sandbox
+
+import org.jetbrains.exposed.sql.transactions.transaction
+import org.joda.time.DateTime
+import org.junit.Test
+import org.junit.Before
+import tech.libeufin.util.Amount
+import org.jetbrains.exposed.sql.SchemaUtils
+import org.jetbrains.exposed.sql.Database
+
+class CamtGeneration {
+
+ @Before
+ fun connectAndMakeTables() {
+ Database.connect("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", driver =
"org.h2.Driver")
+ transaction {
+ SchemaUtils.create(BankCustomersTable)
+ SchemaUtils.create(BankTransactionsTable)
+ }
+ }
+
+ @Test
+ fun generateCamt() {
+ transaction {
+ val customer = BankCustomerEntity.new {
+ customerName = "payer"
+ }
+ for (iter in 1..5) {
+ BankTransactionEntity.new {
+ localCustomer = customer
+ counterpart = "IBAN${iter}"
+ subject = "subject #${iter}"
+ operationDate = DateTime.parse("3000-01-01").millis
+ valueDate = DateTime.parse("3000-01-02").millis
+ amount = Amount("${iter}.0")
+ }
+ }
+ val string = buildCamtString(
+ BankTransactionEntity.all(),
+ 52
+ )
+ println(string)
+ }
+ }
+}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: Including CAMT-generation test.,
gnunet <=