From f20bd5f54208c48142cb439dead7e32b623ff182 Mon Sep 17 00:00:00 2001 From: sshniro Date: Thu, 12 Dec 2019 11:29:04 +0100 Subject: [PATCH] Adding unit test for key auth plugin with valid api key --- t/plugin/key-auth.t | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/t/plugin/key-auth.t b/t/plugin/key-auth.t index 1608f962f75e..a47292eb5053 100644 --- a/t/plugin/key-auth.t +++ b/t/plugin/key-auth.t @@ -147,7 +147,19 @@ passed -=== TEST 5: invalid consumer +=== TEST 5: valid consumer +--- request +GET /hello +--- more_headers +apikey: auth-one +--- response_body +hello world +--- no_error_log +[error] + + + +=== TEST 6: invalid consumer --- request GET /hello --- more_headers @@ -160,7 +172,7 @@ apikey: 123 -=== TEST 6: not found apikey header +=== TEST 7: not found apikey header --- request GET /hello --- error_code: 401 @@ -171,7 +183,7 @@ GET /hello -=== TEST 7: valid consumer +=== TEST 8: valid consumer --- config location /add_more_consumer { content_by_lua_block {