summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_post_webhooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_post_webhooks.c')
-rw-r--r--src/testing/testing_api_cmd_post_webhooks.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/testing/testing_api_cmd_post_webhooks.c b/src/testing/testing_api_cmd_post_webhooks.c
index d1628429..c3a8d1b3 100644
--- a/src/testing/testing_api_cmd_post_webhooks.c
+++ b/src/testing/testing_api_cmd_post_webhooks.c
@@ -78,7 +78,7 @@ struct PostWebhooksState
* body of the webhook
*/
const char *body_template;
-
+
/**
* Expected HTTP response code.
*/
@@ -148,16 +148,17 @@ post_webhooks_run (void *cls,
struct PostWebhooksState *wis = cls;
wis->is = is;
- wis->iph = TALER_MERCHANT_webhooks_post (is->ctx,
- wis->merchant_url,
- wis->webhook_id,
- wis->event_type,
- wis->url,
- wis->http_method,
- wis->header_template,
- wis->body_template,
- &post_webhooks_cb,
- wis);
+ wis->iph = TALER_MERCHANT_webhooks_post (
+ TALER_TESTING_interpreter_get_context (is),
+ wis->merchant_url,
+ wis->webhook_id,
+ wis->event_type,
+ wis->url,
+ wis->http_method,
+ wis->header_template,
+ wis->body_template,
+ &post_webhooks_cb,
+ wis);
GNUNET_assert (NULL != wis->iph);
}
@@ -180,12 +181,12 @@ post_webhooks_traits (void *cls,
{
struct PostWebhooksState *pws = cls;
struct TALER_TESTING_Trait traits[] = {
- TALER_TESTING_make_trait_event_type (&pws->event_type),
- TALER_TESTING_make_trait_url (&pws->url),
- TALER_TESTING_make_trait_http_method (&pws->http_method),
- TALER_TESTING_make_trait_header_template (&pws->header_template),
- TALER_TESTING_make_trait_body_template (&pws->body_template),
- TALER_TESTING_make_trait_webhook_id (&pws->webhook_id),
+ TALER_TESTING_make_trait_event_type (pws->event_type),
+ TALER_TESTING_make_trait_url (pws->url),
+ TALER_TESTING_make_trait_http_method (pws->http_method),
+ TALER_TESTING_make_trait_header_template (pws->header_template),
+ TALER_TESTING_make_trait_body_template (pws->body_template),
+ TALER_TESTING_make_trait_webhook_id (pws->webhook_id),
TALER_TESTING_trait_end (),
};
@@ -240,8 +241,8 @@ TALER_TESTING_cmd_merchant_post_webhooks2 (
wis->event_type = event_type;
wis->url = url;
wis->http_method = http_method;
- wis->header_template = header_template;
- wis->body_template = body_template;
+ wis->header_template = (NULL==header_template) ? NULL : header_template;
+ wis->body_template = (NULL==body_template) ? NULL : body_template;
{
struct TALER_TESTING_Command cmd = {
.cls = wis,
@@ -268,10 +269,10 @@ TALER_TESTING_cmd_merchant_post_webhooks (const char *label,
merchant_url,
webhook_id,
event_type,
- "https://example.com",
+ "http://localhost:12345/",
"POST",
- "Authorization:EFEHYJS",
- "$amount",
+ "Taler-test-header: EFEHYJS-Bakery",
+ "5.0 EUR",
http_status);
}