tokers commented on a change in pull request #1675:
URL: https://github.com/apache/apisix-dashboard/pull/1675#discussion_r602318828



##########
File path: api/test/e2enew/route/route_with_methods_test.go
##########
@@ -110,73 +111,66 @@ func TestRoute_with_methods(t *testing.T) {
                                                 }]
                                         }
                                 }`,
-                       Headers:      map[string]string{"Authorization": token},
+                       Headers:      map[string]string{"Authorization": 
base.GetToken()},
                        ExpectStatus: http.StatusOK,
-               },
-               {
-                       Desc:         "verify route by post",
-                       Object:       APISIXExpect(t),
+               }),
+               table.Entry("verify route by post", base.HttpTestCase{
+                       Object:       base.APISIXExpect(),
                        Method:       http.MethodPost,
                        Path:         "/hello",
                        Body:         `test=test`,
-                       Headers:      map[string]string{"Authorization": token},
+                       Headers:      map[string]string{"Authorization": 
base.GetToken()},
                        ExpectStatus: http.StatusOK,
                        ExpectBody:   "hello world",
-                       Sleep:        sleepTime,
-               },
-               {
-                       Desc:         "verify route by put",
-                       Object:       APISIXExpect(t),
+                       Sleep:        base.SleepTime,
+               }),
+               table.Entry("verify route by put", base.HttpTestCase{
+                       Object:       base.APISIXExpect(),
                        Method:       http.MethodPut,
                        Path:         "/hello",
                        Body:         `test=test`,
-                       Headers:      map[string]string{"Authorization": token},
+                       Headers:      map[string]string{"Authorization": 
base.GetToken()},
                        ExpectStatus: http.StatusOK,
                        ExpectBody:   "hello world",
-                       Sleep:        sleepTime,
-               },
-               {
-                       Desc:         "verify route by get",
-                       Object:       APISIXExpect(t),
+                       Sleep:        base.SleepTime,
+               }),
+               table.Entry("verify route by get", base.HttpTestCase{
+                       Object:       base.APISIXExpect(),
                        Method:       http.MethodGet,
                        Path:         "/hello",
-                       Headers:      map[string]string{"Authorization": token},
+                       Headers:      map[string]string{"Authorization": 
base.GetToken()},
                        ExpectStatus: http.StatusOK,
                        ExpectBody:   "hello world",
-                       Sleep:        sleepTime,
-               },
-               {
-                       Desc:         "verify route by delete",
-                       Object:       APISIXExpect(t),
+                       Sleep:        base.SleepTime,
+               }),
+               table.Entry("verify route by delete", base.HttpTestCase{
+                       Object:       base.APISIXExpect(),
                        Method:       http.MethodDelete,
                        Path:         "/hello",
-                       Headers:      map[string]string{"Authorization": token},
+                       Headers:      map[string]string{"Authorization": 
base.GetToken()},
                        ExpectStatus: http.StatusOK,
                        ExpectBody:   "hello world",
-                       Sleep:        sleepTime,
-               },
-               {
-                       Desc:         "verify route by patch",
-                       Object:       APISIXExpect(t),
+                       Sleep:        base.SleepTime,
+               }),
+               table.Entry("verify route by patch", base.HttpTestCase{
+                       Object:       base.APISIXExpect(),
                        Method:       http.MethodPatch,
                        Path:         "/hello",
                        Body:         `test=test`,
-                       Headers:      map[string]string{"Authorization": token},
+                       Headers:      map[string]string{"Authorization": 
base.GetToken()},
                        ExpectStatus: http.StatusOK,
                        ExpectBody:   "hello world",
-                       Sleep:        sleepTime,
-               },
-               {
-                       Desc:         "delete route",
-                       Object:       ManagerApiExpect(t),
+                       Sleep:        base.SleepTime,
+               }),

Review comment:
       Also, we may update the `methods` list and verify the change.

##########
File path: api/test/e2enew/route/route_with_methods_test.go
##########
@@ -71,30 +75,27 @@ func TestRoute_with_methods(t *testing.T) {
                                                 }]
                                         }
                                 }`,
-                       Headers:      map[string]string{"Authorization": token},
+                       Headers:      map[string]string{"Authorization": 
base.GetToken()},
                        ExpectStatus: http.StatusOK,
-               },
-               {
-                       Desc:         "verify route",
-                       Object:       APISIXExpect(t),
+               }),
+               table.Entry("verify route", base.HttpTestCase{
+                       Object:       base.APISIXExpect(),
                        Method:       http.MethodGet,
                        Path:         "/hello",
-                       Headers:      map[string]string{"Authorization": token},
+                       Headers:      map[string]string{"Authorization": 
base.GetToken()},
                        ExpectStatus: http.StatusOK,
                        ExpectBody:   "hello world",
-                       Sleep:        sleepTime,
-               },
-               {
-                       Desc:         "delete route",
-                       Object:       ManagerApiExpect(t),
+                       Sleep:        base.SleepTime,
+               }),
+               table.Entry("delete route", base.HttpTestCase{

Review comment:
       It seems the update of these routes is missing, we should add it.




-- 
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