From f2e0fc24ba14a1352b2e3b740c7570648812fd64 Mon Sep 17 00:00:00 2001 From: baiyun <337531158@qq.com> Date: Fri, 29 Dec 2023 14:12:48 +0800 Subject: [PATCH] Fix the problem of missing category in the test --- t/admin/global-rules.t | 6 +++--- t/admin/global-rules2.t | 2 +- t/control/services.t | 2 +- t/plugin/ip-restriction.t | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/t/admin/global-rules.t b/t/admin/global-rules.t index 0819f2d3e86c..c9a5156177cc 100644 --- a/t/admin/global-rules.t +++ b/t/admin/global-rules.t @@ -403,7 +403,7 @@ passed } } --- response_body -{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}} +{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"category":"Transformation","uri":"/","use_real_request_uri_unsafe":false}}}} --- request GET /t @@ -439,7 +439,7 @@ GET /t } } --- response_body -{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}} +{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"category":"Transformation","proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}} --- request GET /t @@ -474,7 +474,7 @@ GET /t } } --- response_body -{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}} +{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"category":"Transformation","proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}} --- request GET /t diff --git a/t/admin/global-rules2.t b/t/admin/global-rules2.t index 345f67f62283..4eeae76723fa 100644 --- a/t/admin/global-rules2.t +++ b/t/admin/global-rules2.t @@ -94,7 +94,7 @@ __DATA__ } } --- response_body -{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"uri":"/","use_real_request_uri_unsafe":false}}}} +{"key":"/apisix/global_rules/1","value":{"id":"1","plugins":{"proxy-rewrite":{"category":"Transformation","uri":"/","use_real_request_uri_unsafe":false}}}} diff --git a/t/control/services.t b/t/control/services.t index 0003bcc9d1aa..fcdfb6060116 100644 --- a/t/control/services.t +++ b/t/control/services.t @@ -157,7 +157,7 @@ services: } } --- response_body -{"id":"5","plugins":{"limit-count":{"allow_degradation":false,"count":2,"key":"remote_addr","key_type":"var","policy":"local","rejected_code":503,"show_limit_quota_header":true,"time_window":60}},"upstream":{"hash_on":"vars","nodes":[{"host":"127.0.0.1","port":1980,"weight":1}],"pass_host":"pass","scheme":"http","type":"roundrobin"}} +{"id":"5","plugins":{"limit-count":{"allow_degradation":false,"category":"Traffic","count":2,"key":"remote_addr","key_type":"var","policy":"local","rejected_code":503,"show_limit_quota_header":true,"time_window":60}},"upstream":{"hash_on":"vars","nodes":[{"host":"127.0.0.1","port":1980,"weight":1}],"pass_host":"pass","scheme":"http","type":"roundrobin"}} diff --git a/t/plugin/ip-restriction.t b/t/plugin/ip-restriction.t index 11bcb52e55ce..000b6d92fb9e 100644 --- a/t/plugin/ip-restriction.t +++ b/t/plugin/ip-restriction.t @@ -57,7 +57,7 @@ __DATA__ --- request GET /t --- response_body -{"message":"Your IP address is not allowed","whitelist":["10.255.254.0/24","192.168.0.0/16"]} +{"category":"Security","message":"Your IP address is not allowed","whitelist":["10.255.254.0/24","192.168.0.0/16"]}