gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: Testing.


From: gnunet
Subject: [libeufin] branch master updated: Testing.
Date: Mon, 13 Mar 2023 19:54:06 +0100

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 a1b00dd9 Testing.
a1b00dd9 is described below

commit a1b00dd99136ca4387cbb63990a5fa3481498d1b
Author: MS <ms@taler.net>
AuthorDate: Mon Mar 13 19:53:08 2023 +0100

    Testing.
    
    Checking that debit threshold shows up
    along the balance response offered by the
    Access API.
---
 nexus/src/test/kotlin/SandboxAccessApiTest.kt  | 27 ++++++++++++++++++++++++++
 nexus/src/test/kotlin/SandboxCircuitApiTest.kt |  4 ++--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/nexus/src/test/kotlin/SandboxAccessApiTest.kt 
b/nexus/src/test/kotlin/SandboxAccessApiTest.kt
index f924a5fe..b5182bd1 100644
--- a/nexus/src/test/kotlin/SandboxAccessApiTest.kt
+++ b/nexus/src/test/kotlin/SandboxAccessApiTest.kt
@@ -210,6 +210,33 @@ class SandboxAccessApiTest {
         }
     }
 
+    // Checks that the debit threshold belongs to the balance response.
+    @Test
+    fun debitInfoCheck() {
+        withTestDatabase {
+            prepSandboxDb()
+            testApplication {
+                application(sandboxApp)
+                var r = 
client.get("/demobanks/default/access-api/accounts/foo") {
+                    expectSuccess = true
+                    basicAuth("foo", "foo")
+                }
+                // Checking that the response holds the debit threshold.
+                val mapper = ObjectMapper()
+                var respJson = mapper.readTree(r.bodyAsText())
+                var debitThreshold = respJson.get("debitThreshold").asText()
+                assert(debitThreshold == "1000")
+                r = client.get("/demobanks/default/access-api/accounts/admin") 
{
+                    expectSuccess = true
+                    basicAuth("admin", "foo")
+                }
+                respJson = mapper.readTree(r.bodyAsText())
+                debitThreshold = respJson.get("debitThreshold").asText()
+                assert(debitThreshold == "10000")
+            }
+        }
+    }
+
     @Test
     fun registerTest() {
         // Test IBAN conflict detection.
diff --git a/nexus/src/test/kotlin/SandboxCircuitApiTest.kt 
b/nexus/src/test/kotlin/SandboxCircuitApiTest.kt
index 0de4121c..83a63104 100644
--- a/nexus/src/test/kotlin/SandboxCircuitApiTest.kt
+++ b/nexus/src/test/kotlin/SandboxCircuitApiTest.kt
@@ -40,12 +40,12 @@ class SandboxCircuitApiTest {
             prepSandboxDb()
             testApplication {
                 application(sandboxApp)
-                val R = 
client.get("/demobanks/default/circuit-api/accounts/bar") {
+                var R = 
client.get("/demobanks/default/circuit-api/accounts/bar") {
                     basicAuth("foo", "foo")
                     expectSuccess = false
                 }
                 assert(R.status.value == HttpStatusCode.Forbidden.value)
-                client.get("/demobanks/default/circuit-api/accounts/bar") {
+                R = client.get("/demobanks/default/circuit-api/accounts/bar") {
                     basicAuth("admin", "foo")
                     expectSuccess = true
                 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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