Skip to content

Commit

Permalink
fix 1.1.x basic-auth plugin testcase
Browse files Browse the repository at this point in the history
Signed-off-by: Jintao Zhang <[email protected]>
  • Loading branch information
tao12345666333 committed Apr 2, 2019
1 parent 4025ffc commit d16aac7
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/cases/plugins/basic-auth.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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.')
}
Expand Down

0 comments on commit d16aac7

Please sign in to comment.