Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add different sand and prod endpoint test #1734

Merged
merged 4 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: "APIDifferentSandProdEndpoint"
context: "/test-different-sand-prod-endpoint"
id: "test-different-sand-prod-endpoint"
version: "3.14"
type: "REST"
defaultVersion: true
endpointConfigurations:
production:
endpoint: "http://backend:80/anything/prod"
sandbox:
endpoint: "http://backend:80/anything/sand"
operations:
- target: "/endpoint1"
verb: "GET"
authTypeEnabled: true
scopes: []
endpointConfigurations:
production:
endpoint: "http://backend:80/anything/prodr"
sandbox:
endpoint: "http://backend:80/anything/sandr"
- target: "/endpoint2"
verb: "GET"
authTypeEnabled: true
scopes: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Feature: API different endpoint resource level
Scenario: Testing different endpoint resource level
Given The system is ready
And I have a valid subscription
When I use the APK Conf file "artifacts/apk-confs/different_sand_prod_endpoint.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.gw.wso2.com:9095/test-different-sand-prod-endpoint/3.14/endpoint1" with body ""
And I eventually receive 200 response code, not accepting
|429|
And the response body should contain "https://backend/anything/prodr/endpoint1"
And I send "GET" request to "https://default.gw.wso2.com:9095/test-different-sand-prod-endpoint/endpoint2" with body ""
Then the response status code should be 200
And the response body should contain "https://backend/anything/prod/endpoint2"
And I send "GET" request to "https://default.sandbox.gw.wso2.com:9095/test-different-sand-prod-endpoint/3.14/endpoint1" with body ""
Then the response status code should be 200
And the response body should contain "https://backend/anything/sandr/endpoint1"
And I send "GET" request to "https://default.sandbox.gw.wso2.com:9095/test-different-sand-prod-endpoint/endpoint2" with body ""
Then the response status code should be 200
And the response body should contain "https://backend/anything/sand/endpoint2"


Scenario Outline: Undeploy API
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>

Examples:
| apiID | expectedStatusCode |
| test-different-sand-prod-endpoint | 202 |