Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backport -> release/3.4.x] chore(tests): deprecate uses of mockbin.com #12028

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions spec/03-plugins/09-key-auth/02-access_spec.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
local helpers = require "spec.helpers"
local cjson = require "cjson"
local meta = require "kong.meta"
local utils = require "kong.tools.utils"
local helpers = require "spec.helpers"
local cjson = require "cjson"
local meta = require "kong.meta"
local utils = require "kong.tools.utils"
local http_mock = require "spec.helpers.http_mock"

local MOCK_PORT = helpers.get_available_port()

for _, strategy in helpers.each_strategy() do
describe("Plugin: key-auth (access) [#" .. strategy .. "]", function()
local proxy_client
local mock, proxy_client
local kong_cred

lazy_setup(function()
mock = http_mock.new(MOCK_PORT)
mock:start()
local bp = helpers.get_db_utils(strategy, {
"routes",
"services",
Expand Down Expand Up @@ -51,8 +56,8 @@ for _, strategy in helpers.each_strategy() do

local service7 = bp.services:insert{
protocol = "http",
port = 80,
host = "mockbin.com",
port = MOCK_PORT,
host = "localhost",
}

local route7 = bp.routes:insert {
Expand Down Expand Up @@ -183,6 +188,7 @@ for _, strategy in helpers.each_strategy() do
end

helpers.stop_kong()
mock:stop()
end)

describe("Unauthorized", function()
Expand Down
Loading