gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: Testing previous change.


From: gnunet
Subject: [libeufin] branch master updated: Testing previous change.
Date: Sat, 23 Sep 2023 09:39:06 +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 9ed61b31 Testing previous change.
9ed61b31 is described below

commit 9ed61b31ae7793310f5ae33e39a59aa452a34650
Author: MS <ms@taler.net>
AuthorDate: Sat Sep 23 09:38:52 2023 +0200

    Testing previous change.
---
 bank/src/test/kotlin/DatabaseTest.kt    | 11 +++++++++++
 bank/src/test/kotlin/LibeuFinApiTest.kt |  3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/bank/src/test/kotlin/DatabaseTest.kt 
b/bank/src/test/kotlin/DatabaseTest.kt
index 75614118..45466947 100644
--- a/bank/src/test/kotlin/DatabaseTest.kt
+++ b/bank/src/test/kotlin/DatabaseTest.kt
@@ -19,6 +19,7 @@
 
 import org.junit.Test
 import tech.libeufin.bank.*
+import tech.libeufin.util.CryptoUtil
 import tech.libeufin.util.getNowUs
 import java.util.Random
 import java.util.UUID
@@ -80,13 +81,23 @@ class DatabaseTest {
     fun createAdminTest() {
         val db = initDb()
         val ctx = getTestContext()
+        // No admin accounts is expected.
         val noAdminCustomer = db.customerGetFromLogin("admin")
         assert(noAdminCustomer == null)
+        // Now creating one.
         assert(maybeCreateAdminAccount(db, ctx))
+        // Now expecting one.
         val yesAdminCustomer = db.customerGetFromLogin("admin")
         assert(yesAdminCustomer != null)
+        // Expecting also its _bank_ account.
         assert(db.bankAccountGetFromOwnerId(yesAdminCustomer!!.expectRowId()) 
!= null)
+        // Checking idempotency.
         assert(maybeCreateAdminAccount(db, ctx))
+        // Checking that the random password blocks a login.
+        assert(!CryptoUtil.checkpw(
+            "likely-wrong",
+            yesAdminCustomer.passwordHash
+        ))
     }
 
     /**
diff --git a/bank/src/test/kotlin/LibeuFinApiTest.kt 
b/bank/src/test/kotlin/LibeuFinApiTest.kt
index ef77c82e..87d73985 100644
--- a/bank/src/test/kotlin/LibeuFinApiTest.kt
+++ b/bank/src/test/kotlin/LibeuFinApiTest.kt
@@ -326,7 +326,8 @@ class LibeuFinApiTest {
                     "CFO"
                 )
             ) != null)
-            assert(maybeCreateAdminAccount(db, ctx)) // customer exists, this 
makes only the bank account.
+            // customer exists, this makes only the bank account:
+            assert(maybeCreateAdminAccount(db, ctx))
             resp = client.post("/accounts") {
                 expectSuccess = false
                 basicAuth("admin", "pass")

-- 
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]