gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] 08/08: testing the implementation of #7521


From: gnunet
Subject: [libeufin] 08/08: testing the implementation of #7521
Date: Wed, 08 Feb 2023 14:32:24 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

commit 6726bb63376a074dd5c8a4af0f17d80150d097fd
Author: MS <ms@taler.net>
AuthorDate: Wed Feb 8 14:31:44 2023 +0100

    testing the implementation of #7521
---
 nexus/src/test/kotlin/SandboxCircuitApiTest.kt | 35 ++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/nexus/src/test/kotlin/SandboxCircuitApiTest.kt 
b/nexus/src/test/kotlin/SandboxCircuitApiTest.kt
index 85a41714..31955ff4 100644
--- a/nexus/src/test/kotlin/SandboxCircuitApiTest.kt
+++ b/nexus/src/test/kotlin/SandboxCircuitApiTest.kt
@@ -122,6 +122,41 @@ class SandboxCircuitApiTest {
         }
     }
 
+    // Testing that only the admin can change an account legal name.
+    @Test
+    fun patchPerm() {
+        withTestDatabase {
+            prepSandboxDb()
+            testApplication {
+                application(sandboxApp)
+                val R 
=client.patch("/demobanks/default/circuit-api/accounts/foo") {
+                    contentType(ContentType.Application.Json)
+                    basicAuth("foo", "foo")
+                    expectSuccess = false
+                    setBody("""
+                        {
+                          "name": "new name",
+                          "contact_data": {},
+                          "cashout_address": "payto://iban/OUTSIDE"
+                        }
+                    """.trimIndent())
+                }
+                assert(R.status.value == HttpStatusCode.Forbidden.value)
+                client.patch("/demobanks/default/circuit-api/accounts/foo") {
+                    contentType(ContentType.Application.Json)
+                    basicAuth("admin", "foo")
+                    expectSuccess = true
+                    setBody("""
+                        {
+                          "name": "new name",
+                          "contact_data": {},
+                          "cashout_address": "payto://iban/OUTSIDE"
+                        }
+                    """.trimIndent())
+                }
+            }
+        }
+    }
     // Tests the creation and confirmation of a cash-out operation.
     @Test
     fun cashout() {

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