From 6a46b13e80659cbc9917b46f74d21b4f4aaf6c3b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 20 Mar 2020 14:01:59 +0530 Subject: make recoup idempotent and simplify response --- src/testing/test_exchange_api_revocation.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/testing/test_exchange_api_revocation.c') diff --git a/src/testing/test_exchange_api_revocation.c b/src/testing/test_exchange_api_revocation.c index 467b93e9..05ec06b1 100644 --- a/src/testing/test_exchange_api_revocation.c +++ b/src/testing/test_exchange_api_revocation.c @@ -117,27 +117,31 @@ run (void *cls, TALER_TESTING_cmd_recoup ("recoup-1a", MHD_HTTP_OK, "refresh-reveal-1#0", - "EUR:1", "refresh-melt-1"), TALER_TESTING_cmd_recoup ("recoup-1b", MHD_HTTP_OK, "refresh-reveal-1#1", - "EUR:1", "refresh-melt-1"), TALER_TESTING_cmd_recoup ("recoup-1c", MHD_HTTP_OK, "refresh-reveal-1#2", - "EUR:1", + "refresh-melt-1"), + /* Repeat recoup to test idempotency */ + TALER_TESTING_cmd_recoup ("recoup-1c", + MHD_HTTP_OK, + "refresh-reveal-1#2", + "refresh-melt-1"), + TALER_TESTING_cmd_recoup ("recoup-1c", + MHD_HTTP_OK, + "refresh-reveal-1#2", "refresh-melt-1"), TALER_TESTING_cmd_recoup ("recoup-1c", MHD_HTTP_OK, "refresh-reveal-1#2", - "EUR:1", "refresh-melt-1"), TALER_TESTING_cmd_recoup ("recoup-1c", MHD_HTTP_OK, "refresh-reveal-1#2", - "EUR:1", "refresh-melt-1"), /* Now we have EUR:3.83 EUR back after 3x EUR:1 in recoups */ /* Melt original coin AGAIN, but only create one 0.1 EUR coin; @@ -168,14 +172,12 @@ run (void *cls, TALER_TESTING_cmd_recoup ("recoup-2", MHD_HTTP_OK, "refresh-reveal-2", - "EUR:0.1", "refresh-melt-2"), /* Due to recoup, original coin is now at EUR:3.79 */ /* Refund original (now zombie) coin to reserve */ TALER_TESTING_cmd_recoup ("recoup-3", MHD_HTTP_OK, "withdraw-revocation-coin-1", - "EUR:3.79", NULL), /* Check the money is back with the reserve */ TALER_TESTING_cmd_status ("recoup-reserve-status-1", -- cgit v1.2.3