From b8efb5d32fd104a794cd632ab6504d4d82054925 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 3 Aug 2021 15:16:49 -0300 Subject: fix tests for issue #6845 --- src/backend/taler-merchant-httpd.c | 2 +- src/backend/taler-merchant-httpd_private-delete-instances-ID.h | 2 +- src/backend/taler-merchant-httpd_private-get-instances-ID.h | 2 +- src/lib/merchant_api_delete_instance.c | 2 +- src/lib/merchant_api_get_instances.c | 2 +- src/lib/merchant_api_patch_instance.c | 2 +- src/lib/merchant_api_post_instance_auth.c | 2 +- src/lib/merchant_api_post_instances.c | 4 ++-- src/testing/Makefile.am | 1 + src/testing/test_key_rotation.sh | 2 +- src/testing/test_merchant_instance_response.sh | 2 +- src/testing/test_merchant_order_creation.sh | 2 +- src/testing/test_merchant_product_creation.sh | 2 +- src/testing/test_merchant_reserve_creation.sh | 2 +- 14 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index eac7b733..7a2e2775 100644 --- a/src/backend/taler-merchant-httpd.c +++ b/src/backend/taler-merchant-httpd.c @@ -1165,7 +1165,7 @@ url_handler (void *cls, .have_id_segment = true, .handler = &TMH_private_get_instances_default_ID }, - /* DELETE /private/instances/$ID */ + /* DELETE /instances/$ID */ { .url_prefix = "/instances/", .method = MHD_HTTP_METHOD_DELETE, diff --git a/src/backend/taler-merchant-httpd_private-delete-instances-ID.h b/src/backend/taler-merchant-httpd_private-delete-instances-ID.h index 42add77c..59b645e4 100644 --- a/src/backend/taler-merchant-httpd_private-delete-instances-ID.h +++ b/src/backend/taler-merchant-httpd_private-delete-instances-ID.h @@ -39,7 +39,7 @@ TMH_private_delete_instances_ID (const struct TMH_RequestHandler *rh, /** - * Handle a DELETE "/private/instances/$ID" request. + * Handle a DELETE "/management/instances/$ID" request. * * @param rh context of the handler * @param connection the MHD connection to handle diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID.h b/src/backend/taler-merchant-httpd_private-get-instances-ID.h index b2a0262a..42229a42 100644 --- a/src/backend/taler-merchant-httpd_private-get-instances-ID.h +++ b/src/backend/taler-merchant-httpd_private-get-instances-ID.h @@ -39,7 +39,7 @@ TMH_private_get_instances_ID (const struct TMH_RequestHandler *rh, /** - * Handle a GET "/private/instances/$ID" request. + * Handle a GET "/management/instances/$ID" request. * * @param rh context of the handler * @param connection the MHD connection to handle diff --git a/src/lib/merchant_api_delete_instance.c b/src/lib/merchant_api_delete_instance.c index b0458a62..684f2c75 100644 --- a/src/lib/merchant_api_delete_instance.c +++ b/src/lib/merchant_api_delete_instance.c @@ -147,7 +147,7 @@ instance_delete (struct GNUNET_CURL_Context *ctx, char *path; GNUNET_asprintf (&path, - "private/instances/%s", + "management/instances/%s", instance_id); idh->url = TALER_url_join (backend_url, path, diff --git a/src/lib/merchant_api_get_instances.c b/src/lib/merchant_api_get_instances.c index a8eaa608..6869f89b 100644 --- a/src/lib/merchant_api_get_instances.c +++ b/src/lib/merchant_api_get_instances.c @@ -241,7 +241,7 @@ TALER_MERCHANT_instances_get (struct GNUNET_CURL_Context *ctx, igh->cb = instances_cb; igh->cb_cls = instances_cb_cls; igh->url = TALER_url_join (backend_url, - "private/instances", + "management/instances", NULL); if (NULL == igh->url) { diff --git a/src/lib/merchant_api_patch_instance.c b/src/lib/merchant_api_patch_instance.c index 5515e5e1..810eff72 100644 --- a/src/lib/merchant_api_patch_instance.c +++ b/src/lib/merchant_api_patch_instance.c @@ -217,7 +217,7 @@ TALER_MERCHANT_instance_patch ( char *path; GNUNET_asprintf (&path, - "private/instances/%s", + "management/instances/%s", instance_id); iph->url = TALER_url_join (backend_url, path, diff --git a/src/lib/merchant_api_post_instance_auth.c b/src/lib/merchant_api_post_instance_auth.c index bda209ee..870448b7 100644 --- a/src/lib/merchant_api_post_instance_auth.c +++ b/src/lib/merchant_api_post_instance_auth.c @@ -145,7 +145,7 @@ TALER_MERCHANT_instance_auth_post ( char *path; GNUNET_asprintf (&path, - "private/instances/%s/auth", + "management/instances/%s/auth", instance_id); iaph->url = TALER_url_join (backend_url, path, diff --git a/src/lib/merchant_api_post_instances.c b/src/lib/merchant_api_post_instances.c index 6101e192..78287797 100644 --- a/src/lib/merchant_api_post_instances.c +++ b/src/lib/merchant_api_post_instances.c @@ -93,7 +93,7 @@ handle_post_instances_finished (void *cls, iph->job = NULL; GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "POST /private/instances completed with response code %u\n", + "POST /management/instances completed with response code %u\n", (unsigned int) response_code); switch (response_code) { @@ -255,7 +255,7 @@ TALER_MERCHANT_instances_post ( iph->cb = cb; iph->cb_cls = cb_cls; iph->url = TALER_url_join (backend_url, - "private/instances", + "management2/instances", NULL); if (NULL == iph->url) { diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am index d4e41bd2..a5d1f24e 100644 --- a/src/testing/Makefile.am +++ b/src/testing/Makefile.am @@ -11,6 +11,7 @@ check_SCRIPTS = \ test-merchant-walletharness.sh \ test_merchant_instance_response.sh \ test_merchant_product_creation.sh \ + test_merchant_reserve_creation.sh \ test_merchant_order_creation.sh lib_LTLIBRARIES = \ diff --git a/src/testing/test_key_rotation.sh b/src/testing/test_key_rotation.sh index 07251e5f..9e8e7eb0 100755 --- a/src/testing/test_key_rotation.sh +++ b/src/testing/test_key_rotation.sh @@ -172,7 +172,7 @@ echo "OK" echo -n "Setting up merchant instance" STATUS=$(curl -H "Content-Type: application/json" -X POST \ - http://localhost:9966/private/instances \ + http://localhost:9966/management/instances \ -d '{"auth":{"method":"external"},"payto_uris":["payto://x-taler-bank/localhost/43"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_ms" : 3600000},"default_pay_delay":{"d_ms": 3600000}}' \ -w "%{http_code}" -s -o /dev/null) diff --git a/src/testing/test_merchant_instance_response.sh b/src/testing/test_merchant_instance_response.sh index b89c7325..d3863642 100755 --- a/src/testing/test_merchant_instance_response.sh +++ b/src/testing/test_merchant_instance_response.sh @@ -28,7 +28,7 @@ fi STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer secret-token:super_secret' \ - http://localhost:9966/private/instances \ + http://localhost:9966/management/instances \ -d '{"auth":{"method":"token","token":"secret-token:other_secret"},"payto_uris":["payto://x-taler-bank/localhost/43"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_ms" : 3600000},"default_pay_delay":{"d_ms": 3600000}}' \ -w "%{http_code}" -s -o /dev/null) diff --git a/src/testing/test_merchant_order_creation.sh b/src/testing/test_merchant_order_creation.sh index ec929c2e..0b629426 100755 --- a/src/testing/test_merchant_order_creation.sh +++ b/src/testing/test_merchant_order_creation.sh @@ -27,7 +27,7 @@ echo -n "Configuring merchant instance ..." # create with 2 address STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer secret-token:super_secret' \ - http://localhost:9966/private/instances \ + http://localhost:9966/management/instances \ -d '{"auth":{"method":"external"},"payto_uris":["payto://x-taler-bank/localhost:8082/43","payto://x-taler-bank/localhost:8082/44"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_ms" : 50000},"default_pay_delay":{"d_ms": 60000}}' \ -w "%{http_code}" -s -o /dev/null) diff --git a/src/testing/test_merchant_product_creation.sh b/src/testing/test_merchant_product_creation.sh index e089dcb8..b36d9fad 100755 --- a/src/testing/test_merchant_product_creation.sh +++ b/src/testing/test_merchant_product_creation.sh @@ -6,7 +6,7 @@ echo -n "Configuring merchant instance ..." STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer secret-token:super_secret' \ - http://localhost:9966/private/instances \ + http://localhost:9966/management/instances \ -d '{"auth":{"method":"external"},"payto_uris":["payto://x-taler-bank/localhost:8082/43"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_ms" : 50000},"default_pay_delay":{"d_ms": 60000}}' \ -w "%{http_code}" -s -o /dev/null) diff --git a/src/testing/test_merchant_reserve_creation.sh b/src/testing/test_merchant_reserve_creation.sh index a575c236..35915591 100755 --- a/src/testing/test_merchant_reserve_creation.sh +++ b/src/testing/test_merchant_reserve_creation.sh @@ -8,7 +8,7 @@ echo -n "Configuring merchant instance ..." # create instance STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer secret-token:super_secret' \ - http://localhost:9966/private/instances \ + http://localhost:9966/management/instances \ -d '{"auth":{"method":"external"},"payto_uris":["payto://x-taler-bank/'$BANK_URL'/43"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_ms" : 50000},"default_pay_delay":{"d_ms": 60000}}' \ -w "%{http_code}" -s -o /dev/null) -- cgit v1.2.3