mangoGoForward commented on a change in pull request #6155:
URL: https://github.com/apache/apisix/pull/6155#discussion_r789279722
##########
File path: t/admin/global-rules2.t
##########
@@ -61,3 +61,91 @@ __DATA__
}
--- response_body
{"action":"get","count":0,"node":{"dir":true,"key":"/apisix/global_rules","nodes":{}}}
+
+
+
+=== TEST 2: set global rule
+--- config
+ location /t {
+ content_by_lua_block {
+ local json = require("toolkit.json")
+ local t = require("lib.test_admin").test
+ local code, message, res = t('/apisix/admin/global_rules/1',
+ ngx.HTTP_PUT,
+ [[{
+ "plugins": {
+ "proxy-rewrite": {
+ "uri": "/"
+ }
+ }
+ }]]
+ )
+
+ if code >= 300 then
+ ngx.status = code
+ ngx.say(message)
+ return
+ end
+
+ res = json.decode(res)
+ res.node.value.create_time = nil
+ res.node.value.update_time = nil
+ ngx.say(json.encode(res))
+ }
+ }
+--- response_body
+{"action":"set","node":{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/"}}}}}
+--- request
Review comment:
I want to add a test cases for non-empty resources like `TEST 3`, so put
a new global rules.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]