Comments (4)
the kong-plugin
repo was lacking updates for both the change to routes and services, as well as the older update with the new dao.
I updated that repo, so please pull the latest master and try again.
from kong-vagrant.
Running tests for other plugins works fine though. Running the following passes all the tests.
bin/busted /kong/spec/03-plugins/17-jwt
I'm thinking it still might have something to do with the new services and routes and helpers.dao.apis:insert
doesn't work anymore.
from kong-vagrant.
I fixed the myplugin tests by using a route instead of an api and removing the mockbin dependency.
If you like I can pull request this, but it won't work with older versions of Kong so I'm not sure how you want to handle it.
local helpers = require "spec.helpers"
for _, strategy in helpers.each_strategy() do
describe("Demo-Plugin: myplugin (access) [#" .. strategy .. "]", function()
local client
setup(function()
local bp = helpers.get_db_utils(strategy)
local route1 = bp.routes:insert {
hosts = { "test1.com" },
}
bp.plugins:insert {
name = "myplugin",
route_id = route1.id,
}
-- start kong, while setting the config item `custom_plugins` to make sure our
-- plugin gets loaded
assert(helpers.start_kong {
database = strategy,
nginx_conf = "spec/fixtures/custom_nginx.template",
custom_plugins = "myplugin",
})
end)
teardown(function()
helpers.stop_kong()
end)
before_each(function()
client = helpers.proxy_client()
end)
after_each(function()
if client then client:close() end
end)
describe("request", function()
it("gets a 'hello-world' header", function()
local r = assert(client:send {
method = "GET",
path = "/status/200",
headers = {
host = "test1.com"
}
})
-- validate that the request succeeded, response status 200
assert.response(r).has.status(200)
-- now check the request to have the header
local header_value = assert.request(r).has.header("hello-world")
-- validate the value of that header
assert.equal("this is on a request", header_value)
end)
end)
describe("response", function()
it("gets a 'bye-world' header", function()
local r = assert(client:send {
method = "GET",
path = "/status/200",
headers = {
host = "test1.com"
}
})
-- validate that the request succeeded, response status 200
assert.response(r).has.status(200)
-- now check the response to have the header
local header_value = assert.response(r).has.header("bye-world")
-- validate the value of that header
assert.equal("this is on the response", header_value)
end)
end)
end)
end
from kong-vagrant.
@Tieske Looks like I was on the right track with the changes I made above. Thank you for the update. I tested it and it works fine now.
from kong-vagrant.
Related Issues (20)
- License not present HOT 1
- "Try Kong" instructions not working HOT 6
- no file at: /etc/kong/kong.conf HOT 6
- Make dev fails with latest Kong rockspec (1.1.0) due to dependency on lyaml HOT 2
- Package 'oracle-java8-installer' has no installation candidate HOT 8
- invalid parameter "transparent" in nginx-kong.conf HOT 3
- reuseport: command not found HOT 3
- `kong migrations bootstrap` fails with `Error: proxy_listen must be of form:...` HOT 2
- dev does not correspond to KONG_VERSION HOT 4
- I am curious how to recognize the external folder path of customs plugin. HOT 9
- KONG_VERSION 1.4.3 installation does not work due missing deb package HOT 2
- Tagging kong-vagrant stable versions to avoid breaking changes HOT 1
- Guru-Meditation Error on VirtualBox 6.1 HOT 3
- I can not load my custom plugins on Windows platform HOT 3
- on plugin 'myplugin': myplugin plugin is enabled but not installed HOT 2
- kong-vagrant tag policy and bintray sunset effect on older tags. HOT 3
- Silent Error HOT 3
- Installing from Vagrant idle installing HOT 5
- vagrant up fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kong-vagrant.