summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-07-09 17:34:40 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-07-09 17:34:40 -0400
commitb08d3066dc01123b71912aa708d3e35e7e4c257b (patch)
tree3b4294a439cba0e021891d16917496bf847d9480 /src/testing
parent6737ee287534892ead4bfa6cea599886705b7afa (diff)
downloadmerchant-b08d3066dc01123b71912aa708d3e35e7e4c257b.tar.gz
merchant-b08d3066dc01123b71912aa708d3e35e7e4c257b.tar.bz2
merchant-b08d3066dc01123b71912aa708d3e35e7e4c257b.zip
handle insufficient stock in post orders
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_merchant_api.c31
1 files changed, 31 insertions, 0 deletions
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,