-
Notifications
You must be signed in to change notification settings - Fork 221
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 #3428 from ChinthakaJ98/samples
Fix integration samples by updating folder structure
- Loading branch information
Showing
81 changed files
with
3,295 additions
and
168 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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
102 changes: 49 additions & 53 deletions
102
samples/APITesting/src/main/wso2mi/artifacts/apis/RESTApi.xml
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,55 +1,51 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<api context="/api" name="RESTApi" xmlns="http://ws.apache.org/ns/synapse"> | ||
<resource methods="GET" url-mapping="/unittest"> | ||
<inSequence> | ||
<property name="HTTP_SC" scope="transport" type="STRING" value="200"/> | ||
<payloadFactory media-type="text" template-type="default"> | ||
<format>GET RESPONSE</format> | ||
<args> | ||
</args> | ||
</payloadFactory> | ||
<respond/> | ||
</inSequence> | ||
<faultSequence> | ||
</faultSequence> | ||
</resource> | ||
<resource methods="POST" url-mapping="/unittest"> | ||
<inSequence> | ||
<property name="HTTP_SC" scope="axis2" type="STRING" value="201"/> | ||
<payloadFactory media-type="text" template-type="default"> | ||
<format>POST RESPONSE</format> | ||
<args> | ||
</args> | ||
</payloadFactory> | ||
<respond/> | ||
</inSequence> | ||
<faultSequence> | ||
</faultSequence> | ||
</resource> | ||
<resource methods="PUT" url-mapping="/unittest"> | ||
<inSequence> | ||
<property name="HTTP_SC" scope="axis2" type="STRING" value="201"/> | ||
<payloadFactory media-type="text" template-type="default"> | ||
<format>PUT RESPONSE</format> | ||
<args> | ||
</args> | ||
</payloadFactory> | ||
<respond/> | ||
</inSequence> | ||
<faultSequence> | ||
</faultSequence> | ||
</resource> | ||
<resource methods="DELETE" url-mapping="/unittest"> | ||
<inSequence> | ||
<property name="HTTP_SC" scope="transport" type="STRING" value="200"/> | ||
<payloadFactory media-type="text" template-type="default"> | ||
<format>DELETE RESPONSE</format> | ||
<args> | ||
</args> | ||
</payloadFactory> | ||
<respond/> | ||
</inSequence> | ||
<faultSequence> | ||
</faultSequence> | ||
</resource> | ||
</api> | ||
<resource methods="GET" url-mapping="/unittest"> | ||
<inSequence> | ||
<property name="HTTP_SC" scope="transport" type="STRING" value="200"/> | ||
<payloadFactory media-type="text"> | ||
<format>GET RESPONSE</format> | ||
<args/> | ||
</payloadFactory> | ||
<respond/> | ||
</inSequence> | ||
<outSequence/> | ||
<faultSequence/> | ||
</resource> | ||
<resource methods="POST" url-mapping="/unittest"> | ||
<inSequence> | ||
<property name="HTTP_SC" scope="axis2" type="STRING" value="201"/> | ||
<payloadFactory media-type="text"> | ||
<format>POST RESPONSE</format> | ||
<args/> | ||
</payloadFactory> | ||
<respond/> | ||
</inSequence> | ||
<outSequence/> | ||
<faultSequence/> | ||
</resource> | ||
<resource methods="PUT" url-mapping="/unittest"> | ||
<inSequence> | ||
<property name="HTTP_SC" scope="axis2" type="STRING" value="201"/> | ||
<payloadFactory media-type="text"> | ||
<format>PUT RESPONSE</format> | ||
<args/> | ||
</payloadFactory> | ||
<respond/> | ||
</inSequence> | ||
<outSequence/> | ||
<faultSequence/> | ||
</resource> | ||
<resource methods="DELETE" url-mapping="/unittest"> | ||
<inSequence> | ||
<property name="HTTP_SC" scope="transport" type="STRING" value="200"/> | ||
<payloadFactory media-type="text"> | ||
<format>DELETE RESPONSE</format> | ||
<args/> | ||
</payloadFactory> | ||
<respond/> | ||
</inSequence> | ||
<outSequence/> | ||
<faultSequence/> | ||
</resource> | ||
</api> |
10 changes: 10 additions & 0 deletions
10
samples/APITesting/src/main/wso2mi/resources/metadata/RESTApi_metadata.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,10 @@ | ||
--- | ||
key: "RESTApi-1.0.0" | ||
name : "RESTApi" | ||
displayName : "RESTApi" | ||
description: "Sample API" | ||
version: "1.0.0" | ||
serviceUrl: "https://{host}:{port}/api" | ||
definitionType: "OAS3" | ||
securityType: "BASIC" | ||
mutualSSLEnabled: false |
45 changes: 45 additions & 0 deletions
45
samples/APITesting/src/main/wso2mi/resources/metadata/RESTApi_swagger.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,45 @@ | ||
openapi: 3.0.1 | ||
info: | ||
title: RESTApi | ||
description: API Definition of RESTApi | ||
version: 1.0.0 | ||
servers: | ||
- url: http://localhost:8290/api | ||
paths: | ||
/unittest: | ||
get: | ||
responses: | ||
default: | ||
description: Default response | ||
put: | ||
requestBody: | ||
description: Sample Payload | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
payload: | ||
type: object | ||
required: false | ||
responses: | ||
default: | ||
description: Default response | ||
post: | ||
requestBody: | ||
description: Sample Payload | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
payload: | ||
type: object | ||
required: false | ||
responses: | ||
default: | ||
description: Default response | ||
delete: | ||
responses: | ||
default: | ||
description: Default response |
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,85 @@ | ||
<unit-test> | ||
<artifacts> | ||
<test-artifact> | ||
<artifact>src/main/wso2mi/artifacts/apis/RESTApi.xml</artifact> | ||
</test-artifact> | ||
<supportive-artifacts></supportive-artifacts> | ||
<registry-resources></registry-resources> | ||
<connector-resources></connector-resources> | ||
</artifacts> | ||
<test-cases> | ||
<test-case name="TestCaseForResource_GET"> | ||
<input> | ||
<request-path>/unittest</request-path> | ||
<request-method>GET</request-method> | ||
</input> | ||
<assertions> | ||
<assertEquals> | ||
<actual>$body</actual> | ||
<expected>GET RESPONSE</expected> | ||
<message>The response payload is not correct!</message> | ||
</assertEquals> | ||
<assertEquals> | ||
<actual>$statusCode</actual> | ||
<expected>200</expected> | ||
<message>The HTTP Status code is not correct!</message> | ||
</assertEquals> | ||
</assertions> | ||
</test-case> | ||
<test-case name="TestCaseForResource_POST"> | ||
<input> | ||
<request-path>/unittest</request-path> | ||
<request-method>POST</request-method> | ||
</input> | ||
<assertions> | ||
<assertEquals> | ||
<actual>$body</actual> | ||
<expected>POST RESPONSE</expected> | ||
<message>The response payload is not correct!</message> | ||
</assertEquals> | ||
<assertEquals> | ||
<actual>$statusCode</actual> | ||
<expected>201</expected> | ||
<message>The HTTP Status code is not correct!</message> | ||
</assertEquals> | ||
</assertions> | ||
</test-case> | ||
<test-case name="TestCaseForResource_PUT"> | ||
<input> | ||
<request-path>/unittest</request-path> | ||
<request-method>PUT</request-method> | ||
</input> | ||
<assertions> | ||
<assertEquals> | ||
<actual>$body</actual> | ||
<expected>PUT RESPONSE</expected> | ||
<message>The response payload is not correct!</message> | ||
</assertEquals> | ||
<assertEquals> | ||
<actual>$statusCode</actual> | ||
<expected>201</expected> | ||
<message>The HTTP Status code is not correct!</message> | ||
</assertEquals> | ||
</assertions> | ||
</test-case> | ||
<test-case name="TestCaseForResource_DELETE"> | ||
<input> | ||
<request-path>/unittest</request-path> | ||
<request-method>DELETE</request-method> | ||
</input> | ||
<assertions> | ||
<assertEquals> | ||
<actual>$body</actual> | ||
<expected>DELETE RESPONSE</expected> | ||
<message>The response payload is not correct!</message> | ||
</assertEquals> | ||
<assertEquals> | ||
<actual>$statusCode</actual> | ||
<expected>200</expected> | ||
<message>The HTTP Status code is not correct!</message> | ||
</assertEquals> | ||
</assertions> | ||
</test-case> | ||
</test-cases> | ||
<mock-services></mock-services> | ||
</unit-test> |
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
Oops, something went wrong.