From b08d3066dc01123b71912aa708d3e35e7e4c257b Mon Sep 17 00:00:00 2001 From: Jonathan Buchanan Date: Thu, 9 Jul 2020 17:34:40 -0400 Subject: handle insufficient stock in post orders --- src/testing/test_merchant_api.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/testing') diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c index 33de86ed..9fee2e3e 100644 --- a/src/testing/test_merchant_api.c +++ b/src/testing/test_merchant_api.c @@ -310,6 +310,21 @@ run (void *cls, "a product", "EUR:1", MHD_HTTP_NO_CONTENT), + TALER_TESTING_cmd_merchant_patch_product ("patch-products-p3", + merchant_url, + "product-3", + "a product", + json_object (), + "can", + "EUR:1", + json_object (), + json_object (), + 5, + 0, + json_object (), + GNUNET_TIME_relative_to_absolute ( + GNUNET_TIME_UNIT_MINUTES), + MHD_HTTP_NO_CONTENT), TALER_TESTING_cmd_merchant_lock_product ("lock-product-p3", merchant_url, "product-3", @@ -346,6 +361,22 @@ run (void *cls, "x-taler-bank", "unknown-product/2", ""), + TALER_TESTING_cmd_merchant_post_orders2 ( + "create-proposal-p3-not-enough-stock", + merchant_url, + MHD_HTTP_GONE, + "{\"max_fee\":\"EUR:0.5\",\ + \"order_id\":\"order-p3\",\ + \"refund_deadline\": {\"t_ms\": 0},\ + \"pay_deadline\": {\"t_ms\": \"never\" },\ + \"amount\":\"EUR:5.0\",\ + \"summary\": \"merchant-lib testcase\",\ + \"fulfillment_url\": \"https://example.com/\",\ + \"products\": [ {\"description\":\"ice cream\",\ + \"value\":\"{EUR:5}\"} ] }", + "x-taler-bank", + "product-3/24", + ""), TALER_TESTING_cmd_merchant_post_orders2 ("create-proposal-p3", merchant_url, MHD_HTTP_OK, -- cgit v1.2.3