You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/10/15 05:17:06 UTC

[GitHub] [apisix] juzhiyuan commented on a change in pull request #2421: feat:limit-count plugin supports consumer name field

juzhiyuan commented on a change in pull request #2421:
URL: https://github.com/apache/apisix/pull/2421#discussion_r505169189



##########
File path: t/plugin/limit-count.t
##########
@@ -834,3 +834,45 @@ passed
 [200, 200, 200, 503, 200, 200, 200, 503]
 --- no_error_log
 [error]
+
+
+
+=== TEST 24: set route(key: consumer_name)
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/1',
+                 ngx.HTTP_PUT,
+                 [[{
+                        "methods": ["GET"],
+                        "plugins": {
+                            "limit-count": {
+                                "count": 2,
+                                "time_window": 60,
+                                "rejected_code": 503,
+                                "key": "consumer_name"
+                            }
+                        },
+                        "upstream": {
+                            "nodes": {
+                                "127.0.0.1:1980": 1
+                            },
+                            "type": "roundrobin"
+                        },
+                        "uri": "/hello"
+                }]]
+                )
+
+            if code >= 300 then
+                ngx.status = code
+            end
+            ngx.say(body)
+        }
+    }
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]

Review comment:
       could you please give some test cases? so Jaycean would implement them 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org