gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: (half) testing mock payments


From: gnunet
Subject: [libeufin] branch master updated: (half) testing mock payments
Date: Wed, 20 May 2020 18:42:03 +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 05a705b  (half) testing mock payments
05a705b is described below

commit 05a705b79d0bc297ffae6d5a936fa23f4c83db36
Author: MS <address@hidden>
AuthorDate: Wed May 20 18:41:58 2020 +0200

    (half) testing mock payments
---
 integration-tests/test-sandbox.py                     | 15 ++++++++++++++-
 sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt |  4 ++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/integration-tests/test-sandbox.py 
b/integration-tests/test-sandbox.py
index 4cb5800..47bcab5 100755
--- a/integration-tests/test-sandbox.py
+++ b/integration-tests/test-sandbox.py
@@ -46,7 +46,6 @@ def assertResponse(response):
         # stdout/stderr from both services is A LOT of text.
         # Confusing to dump all that to console.
         print("Check nexus.log and sandbox.log, probably under /tmp")
-        nexus.terminate()
         sandbox.terminate()
         exit(1)
     # Allows for finer grained checks.
@@ -105,5 +104,19 @@ assertResponse(
         ),
     )
 )
+
+# Generate a few payments related to such account.
+assertResponse(
+    post(
+        "http://localhost:5000/admin/payments";,
+        json=dict(
+            creditorIban="ES9121000418450200051332",
+            debitorIban="GB33BUKB20201555555555",
+            amount="EUR:0.99",
+            subject="test service"
+        )
+    )
+)
+
 sandbox.terminate()
 print("Test passed!")
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 0ce5682..f7650e7 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -60,6 +60,9 @@ import 
com.fasterxml.jackson.databind.exc.MismatchedInputException
 import com.fasterxml.jackson.module.kotlin.KotlinModule
 import com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException
 import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
+import java.time.Instant
+import java.time.LocalDate
+import java.time.LocalDateTime
 
 class CustomerNotFound(id: String?) : Exception("Customer ${id} not found")
 class BadInputData(inputData: String?) : Exception("Customer provided invalid 
input data: ${inputData}")
@@ -168,6 +171,7 @@ fun main() {
                        debitorIban = body.debitorIban
                        subject = body.subject
                        amount = body.amount
+                       date = Instant.now().toEpochMilli()
                    }
                 }
                 call.respondText("Payment created")

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]