diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-03-16 17:35:56 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-03-17 01:37:12 +0100 |
commit | 3d93e641817bdbd6d0d0b4af51447661416fc03d (patch) | |
tree | ea5ebc504015bbf0a533db37a797d15bdb16949a | |
parent | 8284c9aa2ca7380368c3ee1da334bef0132b3f38 (diff) | |
download | merchant-3d93e641817bdbd6d0d0b4af51447661416fc03d.tar.gz merchant-3d93e641817bdbd6d0d0b4af51447661416fc03d.tar.bz2 merchant-3d93e641817bdbd6d0d0b4af51447661416fc03d.zip |
cause invalid proposal-lookup response.
-rw-r--r-- | src/lib/test_merchant_api_twisted.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/lib/test_merchant_api_twisted.c b/src/lib/test_merchant_api_twisted.c index 23455675..1882aa22 100644 --- a/src/lib/test_merchant_api_twisted.c +++ b/src/lib/test_merchant_api_twisted.c @@ -313,6 +313,47 @@ run (void *cls, NULL, "does-not-exist"), + /* Generating a proposal-lookup response which doesn't pass + * validation, by removing a field that is expected by the + * library. The library will call the callback with a status + * code of 0. */ + + /* First step is to create a _valid_ proposal, so that + * we can lookup for it later. */ + TALER_TESTING_cmd_proposal + ("create-proposal-5", + twister_merchant_url, + is->ctx, + MHD_HTTP_OK, + "{\"max_fee\":\ + {\"currency\":\"EUR\",\ + \"value\":0,\ + \"fraction\":50000000},\ + \"order_id\":\"5\",\ + \"refund_deadline\":\"\\/Date(0)\\/\",\ + \"pay_deadline\":\"\\/Date(99999999999)\\/\",\ + \"amount\":\ + {\"currency\":\"EUR\",\ + \"value\":5,\ + \"fraction\":0},\ + \"summary\": \"merchant-lib testcase\",\ + \"products\": [ {\"description\":\"ice cream\",\ + \"value\":\"{EUR:5}\"} ] }", + NULL), + + /* Remove expected field. */ + TALER_TESTING_cmd_delete_object ("remove-contract-terms", + PROXY_MERCHANT_CONFIG_FILE, + "contract_terms"), + + /* lookup! */ + TALER_TESTING_cmd_proposal_lookup ("lookup-5", + is->ctx, + twister_merchant_url, + // expected response code. + 0, + "create-proposal-5", + NULL), /**** Covering /history lib ****/ /** |