bzp2010 commented on code in PR #12317: URL: https://github.com/apache/apisix/pull/12317#discussion_r2144133888
########## t/admin/standalone.t: ########## @@ -208,3 +208,33 @@ x-apisix-conf-version-routes: 100 --- error_code: 400 --- response_body {"error_msg":"routes_conf_version must be greater than or equal to (1062)"} + + + +=== TEST 11: duplicate route id found +--- config + location /t11 {} +--- request +PUT /apisix/admin/configs +{"routes_conf_version":1063,"routes":[{"id":"r1","uri":"/r2","upstream_id":"u1","plugins":{"proxy-rewrite":{"uri":"/hello"}}}, +{"id":"r1","uri":"/r2","upstream_id":"u1","plugins":{"proxy-rewrite":{"uri":"/hello"}}}]} +--- more_headers +X-API-KEY: edd1c9f034335f136f87ad84b625c8f1 +--- error_code: 400 +--- response_body +{"error_msg":"duplicate id found r1"} Review Comment: Please include the resource type in error message. ########## t/admin/standalone.t: ########## @@ -208,3 +208,33 @@ x-apisix-conf-version-routes: 100 --- error_code: 400 --- response_body {"error_msg":"routes_conf_version must be greater than or equal to (1062)"} + + + +=== TEST 11: duplicate route id found +--- config + location /t11 {} +--- request +PUT /apisix/admin/configs +{"routes_conf_version":1063,"routes":[{"id":"r1","uri":"/r2","upstream_id":"u1","plugins":{"proxy-rewrite":{"uri":"/hello"}}}, +{"id":"r1","uri":"/r2","upstream_id":"u1","plugins":{"proxy-rewrite":{"uri":"/hello"}}}]} +--- more_headers +X-API-KEY: edd1c9f034335f136f87ad84b625c8f1 +--- error_code: 400 +--- response_body +{"error_msg":"duplicate id found r1"} + + + +=== TEST 12: duplicate consumer username found +--- config + location /t12 {} +--- request +PUT /apisix/admin/configs +{"consumers_conf_version":1064,"consumers":[{"username":"consumer1","plugins":{"key-auth":{"key":"consumer1"}}}, +{"username":"consumer1","plugins":{"key-auth":{"key":"consumer1"}}}]} +--- more_headers +X-API-KEY: edd1c9f034335f136f87ad84b625c8f1 +--- error_code: 400 +--- response_body +{"error_msg":"duplicate username found consumer1"} Review Comment: ditto -- 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: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org