imjoey commented on a change in pull request #1218:
URL: https://github.com/apache/apisix-dashboard/pull/1218#discussion_r553716644



##########
File path: api/test/e2e/global_rule_test.go
##########
@@ -282,3 +288,108 @@ func TestGlobalRule(t *testing.T) {
                testCaseCheck(tc, t)
        }
 }
+
+func TestGlobalRule_with_createtime_updatetime(t *testing.T) {
+       tests := []HttpTestCase{
+               {
+                       Desc:   "create global rule",
+                       Object: ManagerApiExpect(t),
+                       Path:   "/apisix/admin/global_rules/1",
+                       Method: http.MethodPut,
+                       Body: `{
+                                    "plugins": {
+                                          "response-rewrite": {
+                                            "headers": {
+                                                  "X-VERSION":"1.0"
+                                                }
+                                          },
+                                          "uri-blocker": {
+                                            "block_rules": 
["select.+(from|limit)", "(?:(union(.*?)select))"]
+                                          }
+                                        }
+                                  }`,
+                       Headers:      map[string]string{"Authorization": token},
+                       ExpectStatus: http.StatusOK,
+                       Sleep:        sleepTime,
+               },
+       }
+
+       for _, tc := range tests {
+               testCaseCheck(tc, t)
+       }
+
+       basepath := "http://127.0.0.1:9000/apisix/admin/global_rules/1";
+       time.Sleep(time.Duration(1) * time.Second)
+
+       // get the global_rule, save createtime and updatetime
+       request, _ := http.NewRequest("GET", basepath, nil)
+       request.Header.Add("Authorization", token)
+       resp, err := http.DefaultClient.Do(request)
+       if err != nil {
+               fmt.Printf("server not responding %s", err.Error())

Review comment:
       @starsz Good catch. Will renew it soon. Thanks.




----------------------------------------------------------------
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:
[email protected]


Reply via email to