Skip to content

Commit

Permalink
Merge pull request #1725 from CrowleyRajapakse/new-basepath
Browse files Browse the repository at this point in the history
Merge main and fix tests
  • Loading branch information
CrowleyRajapakse authored Sep 6, 2023
2 parents 31c71bc + f359706 commit 9c21be9
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 0 deletions.
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
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
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 |

0 comments on commit 9c21be9

Please sign in to comment.