-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding test cases for token issuer with environments
- Loading branch information
Showing
5 changed files
with
167 additions
and
17 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
27 changes: 27 additions & 0 deletions
27
test/cucumber-tests/src/test/resources/artifacts/apk-confs/multi-env/employees_conf.yaml
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,27 @@ | ||
--- | ||
name: "EmployeeServiceAPIDev" | ||
basePath: "/withoutenv" | ||
version: "3.14" | ||
id: "without-env-api" | ||
type: "REST" | ||
defaultVersion: false | ||
endpointConfigurations: | ||
production: | ||
endpoint: "http://backend:80/anything" | ||
operations: | ||
- target: "/employee" | ||
verb: "GET" | ||
secured: true | ||
scopes: [] | ||
- target: "/employee" | ||
verb: "POST" | ||
secured: true | ||
scopes: [] | ||
- target: "/employee/{employeeId}" | ||
verb: "PUT" | ||
secured: true | ||
scopes: [] | ||
- target: "/employee/{employeeId}" | ||
verb: "DELETE" | ||
secured: true | ||
scopes: [] |
101 changes: 85 additions & 16 deletions
101
test/cucumber-tests/src/test/resources/tests/api/MultiEnvironment.feature
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 |
---|---|---|
@@ -1,37 +1,106 @@ | ||
Feature: Deploy APIs in multiple environments | ||
Scenario: Deploying an API in Dev Environment for Organization, test123 | ||
Scenario: Deploying an API without specifing an Environment and token issuer has no environments. | ||
Given The system is ready | ||
And I have a valid subscription | ||
When I use the APK Conf file "artifacts/apk-confs/multi-env/employees_conf_dev.yaml" | ||
When I use the APK Conf file "artifacts/apk-confs/multi-env/employees_conf.yaml" | ||
And the definition file "artifacts/definitions/employees_api.json" | ||
And make the API deployment request | ||
Then the response status code should be 200 | ||
Then I set headers | ||
|Authorization|bearer ${accessToken}| | ||
And I send "GET" request to "https://default-dev.gw.wso2.com:9095/multienv/3.14/employee/" with body "" | ||
And I send "GET" request to "https://default.gw.wso2.com:9095/withoutenv/3.14/employee/" with body "" | ||
And I eventually receive 200 response code, not accepting | ||
|429| | ||
When I undeploy the API whose ID is "without-env-api" | ||
Then the response status code should be 202 | ||
|
||
Scenario: Deploying an API without specifing an Environment and token issuer has all(*) environments. | ||
Given The system is ready | ||
And I have a valid token for organization "org3" | ||
When I use the APK Conf file "artifacts/apk-confs/multi-env/employees_conf.yaml" | ||
And the definition file "artifacts/definitions/employees_api.json" | ||
And make the API deployment request for organization "org3" | ||
Then the response status code should be 200 | ||
Then I set headers | ||
|Authorization|bearer ${org3}| | ||
And I send "GET" request to "https://org3.gw.wso2.com:9095/withoutenv/3.14/employee/" with body "" | ||
And I eventually receive 200 response code, not accepting | ||
|429| | ||
|
||
Scenario: Deploying the same API in QA Environment for Organization, test123 | ||
When I undeploy the API whose ID is "without-env-api" and organization "org3" | ||
Then the response status code should be 202 | ||
|
||
Scenario: Deploying an API without specifing an Environment and token issuer has only dev environment. | ||
Given The system is ready | ||
And I have a valid token for organization "org4" | ||
When I use the APK Conf file "artifacts/apk-confs/multi-env/employees_conf.yaml" | ||
And the definition file "artifacts/definitions/employees_api.json" | ||
And make the API deployment request for organization "org4" | ||
Then the response status code should be 200 | ||
Then I set headers | ||
|Authorization|bearer ${org4}| | ||
And I send "GET" request to "https://org4.gw.wso2.com:9095/withoutenv/3.14/employee/" with body "" | ||
And I eventually receive 401 response code, not accepting | ||
|200| | ||
When I undeploy the API whose ID is "without-env-api" and organization "org4" | ||
Then the response status code should be 202 | ||
|
||
Scenario: Deploying an API in Dev environment and token issuer has no environments. | ||
Given The system is ready | ||
And I have a valid subscription | ||
When I use the APK Conf file "artifacts/apk-confs/multi-env/employees_conf_qa.yaml" | ||
When I use the APK Conf file "artifacts/apk-confs/multi-env/employees_conf_dev.yaml" | ||
And the definition file "artifacts/definitions/employees_api.json" | ||
And make the API deployment request | ||
Then the response status code should be 200 | ||
Then I set headers | ||
|Authorization|bearer ${accessToken}| | ||
And I send "GET" request to "https://default-qa.gw.wso2.com:9095/multienv/3.14/employee/" with body "" | ||
And I send "GET" request to "https://default-dev.gw.wso2.com:9095/multienv/3.14/employee/" with body "" | ||
And I eventually receive 200 response code, not accepting | ||
|429| | ||
|
||
Scenario Outline: Undeploy API | ||
When I undeploy the API whose ID is "multi-env-dev-api" | ||
Then the response status code should be 202 | ||
|
||
Scenario: Deploying an API in QA environment and token issuer has all(*) environments. | ||
Given The system is ready | ||
And I have a valid subscription | ||
When I undeploy the API whose ID is "<apiID>" | ||
Then the response status code should be <expectedStatusCode> | ||
And I have a valid token for organization "org3" | ||
When I use the APK Conf file "artifacts/apk-confs/multi-env/employees_conf_qa.yaml" | ||
And the definition file "artifacts/definitions/employees_api.json" | ||
And make the API deployment request for organization "org3" | ||
Then the response status code should be 200 | ||
Then I set headers | ||
|Authorization|bearer ${org3}| | ||
And I send "GET" request to "https://org3-qa.gw.wso2.com:9095/multienv/3.14/employee/" with body "" | ||
And I eventually receive 200 response code, not accepting | ||
|401| | ||
When I undeploy the API whose ID is "multi-env-qa-api" and organization "org3" | ||
Then the response status code should be 202 | ||
|
||
Scenario: Deploying an API in QA environment and token issuer has only Dev environment. | ||
Given The system is ready | ||
And I have a valid token for organization "org4" | ||
When I use the APK Conf file "artifacts/apk-confs/multi-env/employees_conf_qa.yaml" | ||
And the definition file "artifacts/definitions/employees_api.json" | ||
And make the API deployment request for organization "org4" | ||
Then the response status code should be 200 | ||
Then I set headers | ||
|Authorization|bearer ${org4}| | ||
And I send "GET" request to "https://org4-qa.gw.wso2.com:9095/multienv/3.14/employee/" with body "" | ||
And I eventually receive 401 response code, not accepting | ||
|200| | ||
When I undeploy the API whose ID is "multi-env-qa-api" and organization "org4" | ||
Then the response status code should be 202 | ||
|
||
Examples: | ||
| apiID | expectedStatusCode | | ||
| multi-env-dev-api | 202 | | ||
| multi-env-qa-api | 202 | | ||
Scenario: Deploying an API in Dev environment and token issuer has only Dev environment. | ||
Given The system is ready | ||
And I have a valid token for organization "org4" | ||
When I use the APK Conf file "artifacts/apk-confs/multi-env/employees_conf_dev.yaml" | ||
And the definition file "artifacts/definitions/employees_api.json" | ||
And make the API deployment request for organization "org4" | ||
Then the response status code should be 200 | ||
Then I set headers | ||
|Authorization|bearer ${org4}| | ||
And I send "GET" request to "https://org4-dev.gw.wso2.com:9095/multienv/3.14/employee/" with body "" | ||
And I eventually receive 200 response code, not accepting | ||
|401| | ||
When I undeploy the API whose ID is "multi-env-dev-api" and organization "org4" | ||
Then the response status code should be 202 | ||
|