-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1725 from CrowleyRajapakse/new-basepath
Merge main and fix tests
- Loading branch information
Showing
3 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...ber-tests/src/test/resources/artifacts/apk-confs/circuit-breaker-max-request-test-v1.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,47 @@ | ||
--- | ||
name: "CircuitBreakerMaxRequest" | ||
basePath: "/circuit-breaker-max-request-v1" | ||
id: "circuit-breaker-max-request-test-v1" | ||
version: "3.14" | ||
type: "REST" | ||
defaultVersion: false | ||
endpointConfigurations: | ||
production: | ||
endpoint: "http://backend:80" | ||
resiliency: | ||
timeout: | ||
downstreamRequestIdleTimeout: 50 | ||
upstreamResponseTimeout: 30 | ||
circuitBreaker: | ||
maxConnectionPools: 1000 | ||
maxConnections: 1024 | ||
maxPendingRequests: 10 | ||
maxRequests: 3 | ||
maxRetries: 2 | ||
operations: | ||
- target: "/get" | ||
verb: "GET" | ||
authTypeEnabled: true | ||
scopes: [ ] | ||
- target: "/anything/{path}" | ||
verb: "GET" | ||
authTypeEnabled: true | ||
scopes: [ ] | ||
- target: "/delay/{delay}" | ||
verb: "GET" | ||
authTypeEnabled: true | ||
scopes: [ ] | ||
- target: "/delay/{delay}" | ||
verb: "POST" | ||
authTypeEnabled: true | ||
scopes: [ ] | ||
- target: "/delay/{delay}" | ||
verb: "PUT" | ||
authTypeEnabled: true | ||
scopes: [ ] | ||
authentication: | ||
- authType: JWT | ||
enabled: true | ||
sendTokenToUpstream: true | ||
headerName: Authorization | ||
headerEnable: true |
47 changes: 47 additions & 0 deletions
47
...cumber-tests/src/test/resources/artifacts/apk-confs/circuit-breaker-max-request-test.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,47 @@ | ||
--- | ||
name: "CircuitBreakerMaxRequest" | ||
basePath: "/circuit-breaker-max-request" | ||
id: "circuit-breaker-max-request-test" | ||
version: "3.14" | ||
type: "REST" | ||
defaultVersion: false | ||
endpointConfigurations: | ||
production: | ||
endpoint: "http://backend:80" | ||
resiliency: | ||
timeout: | ||
downstreamRequestIdleTimeout: 50 | ||
upstreamResponseTimeout: 30 | ||
circuitBreaker: | ||
maxConnectionPools: 1000 | ||
maxConnections: 1024 | ||
maxPendingRequests: 10 | ||
maxRequests: 2 | ||
maxRetries: 2 | ||
operations: | ||
- target: "/get" | ||
verb: "GET" | ||
authTypeEnabled: true | ||
scopes: [ ] | ||
- target: "/anything/{path}" | ||
verb: "GET" | ||
authTypeEnabled: true | ||
scopes: [ ] | ||
- target: "/delay/{delay}" | ||
verb: "GET" | ||
authTypeEnabled: true | ||
scopes: [ ] | ||
- target: "/delay/{delay}" | ||
verb: "POST" | ||
authTypeEnabled: true | ||
scopes: [ ] | ||
- target: "/delay/{delay}" | ||
verb: "PUT" | ||
authTypeEnabled: true | ||
scopes: [ ] | ||
authentication: | ||
- authType: JWT | ||
enabled: true | ||
sendTokenToUpstream: true | ||
headerName: Authorization | ||
headerEnable: true |
47 changes: 47 additions & 0 deletions
47
test/cucumber-tests/src/test/resources/tests/api/CircuitBreakerMaxRequest.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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Feature: circuitBreakerMaxRequest | ||
Scenario: Testing backend timeout | ||
Given The system is ready | ||
And I have a valid subscription | ||
When I use the APK Conf file "artifacts/apk-confs/circuit-breaker-max-request-test.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/circuit-breaker-max-request/3.14/anything/test" with body "" | ||
And I eventually receive 200 response code, not accepting | ||
|429| | ||
|500| | ||
And I send "GET" async request to "https://default.gw.wso2.com:9095/circuit-breaker-max-request/3.14/delay/10" with body "" | ||
And I send "GET" async request to "https://default.gw.wso2.com:9095/circuit-breaker-max-request/3.14/delay/10" with body "" | ||
And I wait for 2 seconds | ||
And I send "GET" request to "https://default.gw.wso2.com:9095/circuit-breaker-max-request/3.14/delay/10" with body "" | ||
Then the response status code should be 503 | ||
|
||
When I use the APK Conf file "artifacts/apk-confs/circuit-breaker-max-request-test-v1.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/circuit-breaker-max-request-v1/3.14/anything/test" with body "" | ||
And I eventually receive 200 response code, not accepting | ||
|429| | ||
|500| | ||
And I send "GET" async request to "https://default.gw.wso2.com:9095/circuit-breaker-max-request-v1/3.14/delay/10" with body "" | ||
And I send "GET" async request to "https://default.gw.wso2.com:9095/circuit-breaker-max-request-v1/3.14/delay/10" with body "" | ||
And I wait for 2 seconds | ||
And I send "GET" request to "https://default.gw.wso2.com:9095/circuit-breaker-max-request-v1/3.14/delay/10" with body "" | ||
Then the response status code should be 200 | ||
|
||
|
||
|
||
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 | | ||
| circuit-breaker-max-request-test | 202 | |