From d16aac71fcdaffc275a9036eb1e174156d9cd101 Mon Sep 17 00:00:00 2001 From: Jintao Zhang Date: Tue, 2 Apr 2019 16:51:23 +0800 Subject: [PATCH] fix 1.1.x basic-auth plugin testcase Signed-off-by: Jintao Zhang --- tests/cases/plugins/basic-auth.spec.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/cases/plugins/basic-auth.spec.js b/tests/cases/plugins/basic-auth.spec.js index c8d38b0..2c3fe13 100644 --- a/tests/cases/plugins/basic-auth.spec.js +++ b/tests/cases/plugins/basic-auth.spec.js @@ -72,7 +72,7 @@ describe('Basic Auth plugin testing:', () => { 'config': {'hide_credentials': true, 'anonymous': anonymousConsumer.id}, 'enabled': true }; - } else if (semver.satisfies(process.env.KONG_VERSION, '>=0.15.0 < 2.0.0')) { + } else if (semver.satisfies(process.env.KONG_VERSION, '>=0.15.0 < 1.1.0')) { inputs = { 'name': 'basic-auth', 'run_on' : 'first', @@ -92,6 +92,24 @@ describe('Basic Auth plugin testing:', () => { if (semver.satisfies(process.env.KONG_VERSION, '>=0.15.0 < 1.0.0')) { expectedPluginParams['api'] = null; } + } else if (semver.satisfies(process.env.KONG_VERSION, '>=1.1.0 < 2.0.0')) { + inputs = { + 'name': 'basic-auth', + 'run_on' : 'first', + 'config-hide_credentials': true, + 'config-anonymous': anonymousConsumer.id + }; + expectedPluginParams = { + 'name': 'basic-auth', + 'run_on': 'first', + 'config': {'hide_credentials': true, 'anonymous': anonymousConsumer.id}, + 'enabled': true, + 'service': null, + 'consumer': null, + 'route': null, + 'protocols': ['http', 'https'] + }; + } else { throw new Error('Kong version not supported in unit tests.') }