commit 52c3a9e8a85f0e6f5aeaed47004327241a1379d5
parent 05bbd2001bdc26b1aa0e8a25efa282e607cffb8c
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 7 Feb 2026 21:59:50 +0100
add API test for new /exchanges endpoint, fixes #10988 in merchant backend
Diffstat:
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_get-exchanges.c b/src/backend/taler-merchant-httpd_get-exchanges.c
@@ -101,8 +101,8 @@ MH_handler_exchanges (const struct TMH_RequestHandler *rh,
return TALER_MHD_REPLY_JSON_PACK (
connection,
MHD_HTTP_OK,
- GNUNET_JSON_pack_object_steal ("exchanges",
- exchanges));
+ GNUNET_JSON_pack_array_steal ("exchanges",
+ exchanges));
}
diff --git a/src/testing/test_merchant_kyc.sh b/src/testing/test_merchant_kyc.sh
@@ -137,4 +137,19 @@ fi
echo " OK"
+echo -n "Getting exchange status information ..."
+
+STATUS=$(curl -H "Content-Type: application/json" -X GET \
+ http://localhost:9966/exchanges \
+ -w "%{http_code}" -s -o "$LAST_RESPONSE")
+
+if [ "$STATUS" != "200" ]
+then
+ jq < "$LAST_RESPONSE"
+ exit_fail "Expected 200. got: $STATUS"
+fi
+
+echo " OK"
+echo "TEST PASSED"
+
exit 0