-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
169 additions
and
27 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
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
4 changes: 2 additions & 2 deletions
4
...nfs/request_and_response_filters.apk-conf → ...apk-confs/header-modifier-filter.apk-conf
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
35 changes: 35 additions & 0 deletions
35
test/cucumber-tests/src/test/resources/artifacts/apk-confs/request-mirror-filter.apk-conf
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,35 @@ | ||
--- | ||
id: "api-with-request-mirror-filter" | ||
name: "EmployeeServiceAPI" | ||
basePath: "/request-mirror-filter" | ||
version: "3.14" | ||
type: "REST" | ||
defaultVersion: false | ||
endpointConfigurations: | ||
production: | ||
endpoint: "http://backend:80/anything" | ||
operations: | ||
- target: "/employee" | ||
verb: "GET" | ||
secured: false | ||
scopes: [] | ||
operationPolicies: | ||
request: | ||
- policyName: RequestMirror | ||
policyVersion: v1 | ||
parameters: | ||
urls: | ||
- "http://backend:80/anything" | ||
- "http://backend:80/anything" | ||
- target: "/employee" | ||
verb: "POST" | ||
secured: true | ||
scopes: [] | ||
- target: "/employee/{employeeId}" | ||
verb: "PUT" | ||
secured: true | ||
scopes: [] | ||
- target: "/employee/{employeeId}" | ||
verb: "DELETE" | ||
secured: true | ||
scopes: [] |
34 changes: 34 additions & 0 deletions
34
test/cucumber-tests/src/test/resources/artifacts/apk-confs/request-redirect-filter.apk-conf
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,34 @@ | ||
--- | ||
id: "api-with-request-redirect-filter" | ||
name: "EmployeeServiceAPI" | ||
basePath: "/request-redirect-filter" | ||
version: "3.14" | ||
type: "REST" | ||
defaultVersion: false | ||
endpointConfigurations: | ||
production: | ||
endpoint: "http://backend:80/anything" | ||
operations: | ||
- target: "/employee" | ||
verb: "GET" | ||
secured: false | ||
scopes: [] | ||
operationPolicies: | ||
request: | ||
- policyName: RequestRedirect | ||
policyVersion: v1 | ||
parameters: | ||
url: "http://backend:80/anything" | ||
statusCode: 301 | ||
- target: "/employee" | ||
verb: "POST" | ||
secured: true | ||
scopes: [] | ||
- target: "/employee/{employeeId}" | ||
verb: "PUT" | ||
secured: true | ||
scopes: [] | ||
- target: "/employee/{employeeId}" | ||
verb: "DELETE" | ||
secured: true | ||
scopes: [] |
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
21 changes: 21 additions & 0 deletions
21
test/cucumber-tests/src/test/resources/tests/api/RequestMirror.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,21 @@ | ||
Feature: Test HTTPRoute Filter Request Mirror functionality | ||
Scenario: Test request mirror functionality | ||
Given The system is ready | ||
And I have a valid subscription | ||
When I use the APK Conf file "artifacts/apk-confs/request-mirror-filter.apk-conf" | ||
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/request-mirror-filter/3.14/employee/" with body "" | ||
And I eventually receive 200 response code, not accepting | ||
| 401 | | ||
|
||
Scenario: Undeploy the API | ||
Given The system is ready | ||
And I have a valid subscription | ||
When I undeploy the API whose ID is "api-with-request-mirror-filter" | ||
Then the response status code should be 202 | ||
|
||
|
21 changes: 21 additions & 0 deletions
21
test/cucumber-tests/src/test/resources/tests/api/RequestRedirect.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,21 @@ | ||
Feature: Test HTTPRoute Filter Request Redirect functionality | ||
Scenario: Test request redirect functionality | ||
Given The system is ready | ||
And I have a valid subscription | ||
When I use the APK Conf file "artifacts/apk-confs/request-redirect-filter.apk-conf" | ||
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/request-redirect-filter/3.14/employee/" with body "" | ||
And I eventually receive 301 response code, not accepting | ||
| 401 | | ||
|
||
Scenario: Undeploy the API | ||
Given The system is ready | ||
And I have a valid subscription | ||
When I undeploy the API whose ID is "api-with-request-redirect-filter" | ||
Then the response status code should be 202 | ||
|
||
|