From ca4d6060c2a0714c22aee509de8d31f3d2f15826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20H=C3=BCbner?= Date: Thu, 26 Oct 2023 11:45:38 +0200 Subject: [PATCH] fix(test): remove external dependency --- .../24-reconfiguration-completion_spec.lua | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/spec/02-integration/04-admin_api/24-reconfiguration-completion_spec.lua b/spec/02-integration/04-admin_api/24-reconfiguration-completion_spec.lua index c3c70775e3a3..9f528c4bb46b 100644 --- a/spec/02-integration/04-admin_api/24-reconfiguration-completion_spec.lua +++ b/spec/02-integration/04-admin_api/24-reconfiguration-completion_spec.lua @@ -10,10 +10,22 @@ describe("Admin API - Reconfiguration Completion -", function() local function run_tests() - local res = admin_client:post("/services", { + local res = admin_client:post("/plugins", { + body = { + name = "request-termination", + config = { + status_code = 200, + body = "kong terminated the request", + } + }, + headers = { ["Content-Type"] = "application/json" }, + }) + assert.res_status(201, res) + + res = admin_client:post("/services", { body = { name = "test-service", - url = "http://example.com", + url = "http://127.0.0.1", }, headers = { ["Content-Type"] = "application/json" }, }) @@ -67,7 +79,8 @@ describe("Admin API - Reconfiguration Completion -", function() ["X-If-Kong-Transaction-Id"] = kong_transaction_id } }) - assert.res_status(200, res) + body = assert.res_status(200, res) + assert.equals("kong terminated the request", body) end) .has_no_error() end