diff options
author | zuul <zuul@gerrit.asterisk.org> | 2017-01-26 18:46:19 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-01-26 18:46:19 -0600 |
commit | cac5ee2517cc7a4bcdf45af5227716f7e55500b1 (patch) | |
tree | fc970fca81df9c06d515e64a1e68e202a6933be0 /tests | |
parent | 23e5fd709ae0aba510f4a0724f85775d47652226 (diff) | |
parent | 1d890874f39a5a81b20da44358143ed9b54ab0fe (diff) |
Merge "ari: Implement 'debug all' and request/response logging" into 14
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_ari.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/tests/test_ari.c b/tests/test_ari.c index da889ec45..a5000803a 100644 --- a/tests/test_ari.c +++ b/tests/test_ari.c @@ -63,6 +63,7 @@ static void handler(const char *name, struct ast_variable *get_params, struct ast_variable *path_vars, struct ast_variable *headers, + struct ast_json *body, struct ast_ari_response *response) { struct ast_json *message = ast_json_pack("{s: s, s: {}, s: {}, s: {}}", @@ -100,9 +101,10 @@ static void handler(const char *name, struct ast_variable *get_params, \ struct ast_variable *path_vars, \ struct ast_variable *headers, \ + struct ast_json *body, \ struct ast_ari_response *response) \ { \ - handler(#name, response_code, get_params, path_vars, headers, response); \ + handler(#name, response_code, get_params, path_vars, headers, body, response); \ } HANDLER(bang_get, 200) @@ -345,7 +347,8 @@ AST_TEST_DEFINE(invoke_get) "head2", "head-two", "path_vars"); - ast_ari_invoke(NULL, "foo", AST_HTTP_GET, get_params, headers, response); + ast_ari_invoke(NULL, "foo", AST_HTTP_GET, get_params, headers, + ast_json_null(), response); ast_test_validate(test, 1 == invocation_count); ast_test_validate(test, 200 == response->response_code); @@ -382,7 +385,8 @@ AST_TEST_DEFINE(invoke_wildcard) "path_vars", "bam", "foshizzle"); - ast_ari_invoke(NULL, "foo/foshizzle", AST_HTTP_GET, get_params, headers, response); + ast_ari_invoke(NULL, "foo/foshizzle", AST_HTTP_GET, get_params, headers, + ast_json_null(), response); ast_test_validate(test, 1 == invocation_count); ast_test_validate(test, 200 == response->response_code); @@ -419,7 +423,8 @@ AST_TEST_DEFINE(invoke_delete) "path_vars", "bam", "foshizzle"); - ast_ari_invoke(NULL, "foo/foshizzle/bang", AST_HTTP_DELETE, get_params, headers, response); + ast_ari_invoke(NULL, "foo/foshizzle/bang", AST_HTTP_DELETE, get_params, headers, + ast_json_null(), response); ast_test_validate(test, 1 == invocation_count); ast_test_validate(test, 204 == response->response_code); @@ -469,7 +474,8 @@ AST_TEST_DEFINE(invoke_post) "head2", "head-two", "path_vars"); - ast_ari_invoke(NULL, "foo/bar", AST_HTTP_POST, get_params, headers, response); + ast_ari_invoke(NULL, "foo/bar", AST_HTTP_POST, get_params, headers, + ast_json_null(), response); ast_test_validate(test, 1 == invocation_count); ast_test_validate(test, 200 == response->response_code); @@ -498,7 +504,8 @@ AST_TEST_DEFINE(invoke_bad_post) fixture = setup_invocation_test(); response = response_alloc(); - ast_ari_invoke(NULL, "foo", AST_HTTP_POST, get_params, headers, response); + ast_ari_invoke(NULL, "foo", AST_HTTP_POST, get_params, headers, + ast_json_null(), response); ast_test_validate(test, 0 == invocation_count); ast_test_validate(test, 405 == response->response_code); @@ -526,7 +533,8 @@ AST_TEST_DEFINE(invoke_not_found) fixture = setup_invocation_test(); response = response_alloc(); - ast_ari_invoke(NULL, "foo/fizzle/i-am-not-a-resource", AST_HTTP_GET, get_params, headers, response); + ast_ari_invoke(NULL, "foo/fizzle/i-am-not-a-resource", AST_HTTP_GET, get_params, headers, + ast_json_null(), response); ast_test_validate(test, 0 == invocation_count); ast_test_validate(test, 404 == response->response_code); |