gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: Testing account reconfig. idempotence.


From: gnunet
Subject: [libeufin] branch master updated: Testing account reconfig. idempotence.
Date: Thu, 05 Oct 2023 09:36:54 +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 532b705f Testing account reconfig. idempotence.
532b705f is described below

commit 532b705fa31848c7118fefe9a10bbe0d32d9327f
Author: MS <ms@taler.net>
AuthorDate: Thu Oct 5 09:36:23 2023 +0200

    Testing account reconfig. idempotence.
---
 bank/src/test/kotlin/LibeuFinApiTest.kt | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/bank/src/test/kotlin/LibeuFinApiTest.kt 
b/bank/src/test/kotlin/LibeuFinApiTest.kt
index 9cb827fa..5c84fe03 100644
--- a/bank/src/test/kotlin/LibeuFinApiTest.kt
+++ b/bank/src/test/kotlin/LibeuFinApiTest.kt
@@ -722,28 +722,33 @@ class LibeuFinApiTest {
                 corebankWebApp(db, ctx)
             }
             assertNotNull(db.customerCreate(customerFoo))
-            val validReq = json {
-                "is_exchange" to true
-            }
             // First call expects 500, because foo lacks a bank account
             client.patch("/accounts/foo") {
                 basicAuth("foo", "pw")
-                jsonBody(validReq)
+                jsonBody(json {
+                    "is_exchange" to true
+                })
             }.assertStatus(HttpStatusCode.InternalServerError)
             // Creating foo's bank account.
             assertNotNull(db.bankAccountCreate(genBankAccount(1L)))
             // Successful attempt now.
+            val validReq = AccountReconfiguration(
+                cashout_address = "payto://new-cashout-address",
+                challenge_contact_data = ChallengeContactData(
+                    email = "new@example.com",
+                    phone = "+987"
+                ),
+                is_exchange = true,
+                name = null
+            )
             client.patch("/accounts/foo") {
                 basicAuth("foo", "pw")
-                jsonBody(AccountReconfiguration(
-                    cashout_address = "payto://new-cashout-address",
-                    challenge_contact_data = ChallengeContactData(
-                        email = "new@example.com",
-                        phone = "+987"
-                    ),
-                    is_exchange = true,
-                    name = null
-                ))
+                jsonBody(validReq)
+            }.assertStatus(HttpStatusCode.NoContent)
+            // Checking idempotence.
+            client.patch("/accounts/foo") {
+                basicAuth("foo", "pw")
+                jsonBody(validReq)
             }.assertStatus(HttpStatusCode.NoContent)
             // Checking ordinary user doesn't get to patch their name.
             client.patch("/accounts/foo") {

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