-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added validations, tests, fixed bug. (#101)
* Added validations, tests, fixed bug. * Fix versions supported in e2e test * Removed unnecessary comment * fixed e2e tests & updated contributing.md * updated contributing.md --------- Co-authored-by: gustaaf jongbloed <[email protected]> Co-authored-by: ram <[email protected]>
- Loading branch information
1 parent
acc2245
commit d4e3e56
Showing
13 changed files
with
353 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/__tests__/e2e/invalid-publisher-visibility-invalid-option/serverless.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
service: serverless-wso2-apim | ||
provider: | ||
name: aws | ||
stackName: ${env:STACK_NAME} | ||
deploymentBucket: | ||
name: ${env:TEST_ID_NORMALIZED} | ||
plugins: | ||
- serverless-localstack | ||
- serverless-deployment-bucket | ||
- "../../../../src" | ||
|
||
#⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ Modify the configuration below to suit your test case. | ||
#⬇⬇⬇ START HERE ⬇⬇⬇⬇ Help: https://github.com/ramgrandhi/serverless-wso2-apim#configuration-reference | ||
#⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ For a full list of env vars that you can use, refer `src/__tests__/e2e/e2e.test.js` | ||
custom: | ||
wso2apim: | ||
enabled: true | ||
host: ${env:WSO2_HOST} | ||
port: ${env:WSO2_PORT} | ||
user: ${env:WSO2_USER} | ||
pass: ${env:WSO2_PASS} | ||
gatewayEnv: ${env:WSO2_ENV} | ||
apidefs: | ||
- name: ${env:TEST_ID}-1 | ||
description: ${env:TEST_ID}-1 | ||
rootContext: /${env:TEST_ID}-1 | ||
version: "1" | ||
publisherVisibility: "PRIVAT" | ||
backend: | ||
http: | ||
baseUrl: "https://baseUrl" | ||
maxTps: 10 | ||
tags: | ||
- ${env:TEST_ID}-1 | ||
swaggerSpec: | ||
swagger: "2.0" | ||
info: | ||
title: ${env:TEST_ID}-1 | ||
version: "v1" | ||
contact: | ||
name: ${env:TEST_ID}-1 | ||
email: ${env:TEST_ID}-1 | ||
paths: | ||
post: | ||
responses: | ||
"201": | ||
description: Created | ||
x-auth-type: "None" | ||
|
||
# Optionally, add your other AWS provider-specific resources below. | ||
# Make sure there is at least one resource listed below, otherwise stack deployment would fail. | ||
resources: | ||
Resources: | ||
Topic: | ||
Type: AWS::SNS::Topic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/__tests__/e2e/invalid-publisher-visibility-non-existing-roles/serverless.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
service: serverless-wso2-apim | ||
provider: | ||
name: aws | ||
stackName: ${env:STACK_NAME} | ||
deploymentBucket: | ||
name: ${env:TEST_ID_NORMALIZED} | ||
plugins: | ||
- serverless-localstack | ||
- serverless-deployment-bucket | ||
- "../../../../src" | ||
|
||
#⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ Modify the configuration below to suit your test case. | ||
#⬇⬇⬇ START HERE ⬇⬇⬇⬇ Help: https://github.com/ramgrandhi/serverless-wso2-apim#configuration-reference | ||
#⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ For a full list of env vars that you can use, refer `src/__tests__/e2e/e2e.test.js` | ||
# | ||
custom: | ||
wso2apim: | ||
enabled: true | ||
host: ${env:WSO2_HOST} | ||
port: ${env:WSO2_PORT} | ||
user: ${env:WSO2_USER} | ||
pass: ${env:WSO2_PASS} | ||
gatewayEnv: ${env:WSO2_ENV} | ||
apidefs: | ||
- name: ${env:TEST_ID}-1 | ||
description: ${env:TEST_ID}-1 | ||
rootContext: /${env:TEST_ID}-1 | ||
version: "1" | ||
publisherVisibility: "RESTRICTED" | ||
publisherVisibilityRoles: | ||
- "admin" | ||
- "non-existing-role" | ||
backend: | ||
http: | ||
baseUrl: "https://baseUrl" | ||
maxTps: 10 | ||
tags: | ||
- ${env:TEST_ID}-1 | ||
swaggerSpec: | ||
swagger: "2.0" | ||
info: | ||
title: ${env:TEST_ID}-1 | ||
version: "v1" | ||
contact: | ||
name: ${env:TEST_ID}-1 | ||
email: ${env:TEST_ID}-1 | ||
paths: | ||
/*: | ||
post: | ||
responses: | ||
"201": | ||
description: Created | ||
x-auth-type: "None" | ||
|
||
# Optionally, add your other AWS provider-specific resources below. | ||
# Make sure there is at least one resource listed below, otherwise stack deployment would fail. | ||
resources: | ||
Resources: | ||
Topic: | ||
Type: AWS::SNS::Topic |
60 changes: 60 additions & 0 deletions
60
src/__tests__/e2e/invalid-publisher-visibility-redundant-roles/serverless.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
service: serverless-wso2-apim | ||
provider: | ||
name: aws | ||
stackName: ${env:STACK_NAME} | ||
deploymentBucket: | ||
name: ${env:TEST_ID_NORMALIZED} | ||
plugins: | ||
- serverless-localstack | ||
- serverless-deployment-bucket | ||
- "../../../../src" | ||
|
||
#⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ Modify the configuration below to suit your test case. | ||
#⬇⬇⬇ START HERE ⬇⬇⬇⬇ Help: https://github.com/ramgrandhi/serverless-wso2-apim#configuration-reference | ||
#⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ For a full list of env vars that you can use, refer `src/__tests__/e2e/e2e.test.js` | ||
custom: | ||
wso2apim: | ||
enabled: true | ||
host: ${env:WSO2_HOST} | ||
port: ${env:WSO2_PORT} | ||
user: ${env:WSO2_USER} | ||
pass: ${env:WSO2_PASS} | ||
gatewayEnv: ${env:WSO2_ENV} | ||
apidefs: | ||
- name: ${env:TEST_ID}-1 | ||
description: ${env:TEST_ID}-1 | ||
rootContext: /${env:TEST_ID}-1 | ||
version: "1" | ||
subscriberVisibility: "RESTRICTED" | ||
subscriberVisibilityRoles: | ||
- "admin" | ||
publisherVisibility: "PRIVATE" | ||
publisherVisibilityRoles: "admin" | ||
backend: | ||
http: | ||
baseUrl: "https://baseUrl" | ||
maxTps: 10 | ||
tags: | ||
- ${env:TEST_ID}-1 | ||
swaggerSpec: | ||
swagger: "2.0" | ||
info: | ||
title: ${env:TEST_ID}-1 | ||
version: "v1" | ||
contact: | ||
name: ${env:TEST_ID}-1 | ||
email: ${env:TEST_ID}-1 | ||
paths: | ||
/*: | ||
post: | ||
responses: | ||
"201": | ||
description: Created | ||
x-auth-type: "None" | ||
|
||
# Optionally, add your other AWS provider-specific resources below. | ||
# Make sure there is at least one resource listed below, otherwise stack deployment would fail. | ||
resources: | ||
Resources: | ||
Topic: | ||
Type: AWS::SNS::Topic |
56 changes: 56 additions & 0 deletions
56
src/__tests__/e2e/invalid-subscriber-visibility-invalid-option/serverless.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
service: serverless-wso2-apim | ||
provider: | ||
name: aws | ||
stackName: ${env:STACK_NAME} | ||
deploymentBucket: | ||
name: ${env:TEST_ID_NORMALIZED} | ||
plugins: | ||
- serverless-localstack | ||
- serverless-deployment-bucket | ||
- "../../../../src" | ||
|
||
#⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ Modify the configuration below to suit your test case. | ||
#⬇⬇⬇ START HERE ⬇⬇⬇⬇ Help: https://github.com/ramgrandhi/serverless-wso2-apim#configuration-reference | ||
#⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ For a full list of env vars that you can use, refer `src/__tests__/e2e/e2e.test.js` | ||
custom: | ||
wso2apim: | ||
enabled: true | ||
host: ${env:WSO2_HOST} | ||
port: ${env:WSO2_PORT} | ||
user: ${env:WSO2_USER} | ||
pass: ${env:WSO2_PASS} | ||
gatewayEnv: ${env:WSO2_ENV} | ||
apidefs: | ||
- name: ${env:TEST_ID}-1 | ||
description: ${env:TEST_ID}-1 | ||
rootContext: /${env:TEST_ID}-1 | ||
version: "1" | ||
subscriberVisibility: "PRIVAT" | ||
backend: | ||
http: | ||
baseUrl: "https://baseUrl" | ||
maxTps: 10 | ||
tags: | ||
- ${env:TEST_ID}-1 | ||
swaggerSpec: | ||
swagger: "2.0" | ||
info: | ||
title: ${env:TEST_ID}-1 | ||
version: "v1" | ||
contact: | ||
name: ${env:TEST_ID}-1 | ||
email: ${env:TEST_ID}-1 | ||
paths: | ||
/*: | ||
post: | ||
responses: | ||
"201": | ||
description: Created | ||
x-auth-type: "None" | ||
|
||
# Optionally, add your other AWS provider-specific resources below. | ||
# Make sure there is at least one resource listed below, otherwise stack deployment would fail. | ||
resources: | ||
Resources: | ||
Topic: | ||
Type: AWS::SNS::Topic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.