-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YAML config can be loaded from sub includes, thus reduces the main YA…
…ML size (#152)
- Loading branch information
1 parent
da71d0b
commit 1edca93
Showing
21 changed files
with
2,157 additions
and
42 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
1,012 changes: 1,012 additions & 0 deletions
1,012
src/functional-test/java/io/github/azagniotov/stubby4j/MultiIncludeStubsPortalTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
217 changes: 217 additions & 0 deletions
217
src/functional-test/resources/yaml/service-1-stubs.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,217 @@ | ||
- request: | ||
method: | ||
- GET | ||
- POST | ||
- PUT | ||
url: ^/resources/asn/.*$ | ||
|
||
response: | ||
status: 200 | ||
body: > | ||
{"status": "ASN found!"} | ||
headers: | ||
content-type: application/json | ||
|
||
|
||
- request: | ||
method: | ||
- GET | ||
- POST | ||
- PUT | ||
url: /this/stub/should/always/be/second/in/this/file | ||
|
||
response: | ||
status: 200 | ||
body: OK | ||
headers: | ||
content-type: application/json | ||
|
||
|
||
- request: | ||
method: [GET, POST, PUT] | ||
url: ^/[a-z]{3}-[a-z]{3}/[0-9]{2}/[A-Z]{2}/[a-z0-9]+\?paramOne=[a-zA-Z]{3,8}¶mTwo=[a-zA-Z]{3,8}$ | ||
|
||
response: | ||
status: 200 | ||
body: > | ||
{"status": "The regex with query params works!"} | ||
headers: | ||
content-type: application/json | ||
|
||
- request: | ||
method: GET | ||
url: ^/[a-z]{3}-[a-z]{3}/[0-9]{2}/[A-Z]{2}/[a-z0-9]+$ | ||
|
||
response: | ||
status: 200 | ||
body: > | ||
{"status": "The regex works!"} | ||
headers: | ||
content-type: application/json | ||
|
||
- request: | ||
method: GET | ||
url: /entity.find.again | ||
query: | ||
type_name: user | ||
client_id: id | ||
client_secret: secret | ||
attributes: '[id,uuid,created,lastUpdated,displayName,email,givenName,familyName]' | ||
|
||
response: | ||
status: 200 | ||
body: > | ||
{"status": "hello world"} | ||
headers: | ||
content-type: application/json | ||
|
||
- request: | ||
method: GET | ||
url: /entity.find | ||
query: | ||
type_name: user | ||
client_id: id | ||
client_secret: secret | ||
attributes: '["id","uuid","created","lastUpdated","displayName","email","givenName","familyName"]' | ||
|
||
response: | ||
status: 200 | ||
body: > | ||
{"status": "hello world"} | ||
headers: | ||
content-type: application/json | ||
|
||
|
||
- request: | ||
method: GET | ||
url: /entity.find.single.quote | ||
query: | ||
type_name: user | ||
client_id: id | ||
client_secret: secret | ||
attributes: "['id','uuid','created','lastUpdated','displayName','email','givenName','familyName']" | ||
|
||
response: | ||
status: 200 | ||
body: > | ||
{"status": "hello world with single quote"} | ||
headers: | ||
content-type: application/json | ||
|
||
- request: | ||
method: GET | ||
url: /entity.find.spaces.within | ||
query: | ||
key: "stalin and truman are best buddies" | ||
|
||
response: | ||
status: 200 | ||
body: > | ||
{"status": "hello world with spaces within values"} | ||
headers: | ||
content-type: application/json | ||
|
||
|
||
- request: | ||
method: GET | ||
url: /entity.find.single.quote.spaces.within | ||
query: | ||
key: "['stalin and truman','are best friends']" | ||
|
||
response: | ||
status: 200 | ||
body: > | ||
{"status": "hello world with single quote and spaces within"} | ||
headers: | ||
content-type: application/json | ||
|
||
|
||
- request: | ||
method: GET | ||
url: /pdf/hello-world | ||
|
||
response: | ||
headers: | ||
content-type: application/pdf | ||
content-disposition: attachment; filename=hello-world.pdf | ||
pragma: no-cache | ||
status: 200 | ||
file: ../binary/hello-world.pdf | ||
|
||
- request: | ||
method: GET | ||
url: /invoice | ||
query: | ||
status: active | ||
type: full | ||
response: | ||
headers: | ||
content-type: application/json | ||
pragma: no-cache | ||
status: 200 | ||
file: ../json/response.json | ||
|
||
|
||
- request: | ||
method: PUT | ||
url: /invoice/123 | ||
headers: | ||
content-type: application/json | ||
post: > | ||
{"name": "milk", "description": "full", "department": "savoury"} | ||
response: | ||
headers: | ||
content-type: application/json | ||
pragma: no-cache | ||
status: 200 | ||
body: > | ||
{"id": "123", "status": "updated"} | ||
- request: | ||
method: POST | ||
url: /invoice/new | ||
headers: | ||
content-type: application/json | ||
post: > | ||
{"name": "chocolate", "description": "full", "department": "savoury"} | ||
response: | ||
headers: | ||
content-type: application/json | ||
pragma: no-cache | ||
status: 201 | ||
body: > | ||
{"id": "456", "status": "created"} | ||
- request: | ||
method: POST | ||
url: /post-body-as-json | ||
headers: | ||
content-type: application/json | ||
post: > | ||
{"userId":"19","requestId":"(.*)","transactionDate":"(.*)","transactionTime":"(.*)"} | ||
response: | ||
headers: | ||
content-type: application/json | ||
status: 200 | ||
body: > | ||
{"requestId": "<%post.1%>", "transactionDate": "<%post.2%>", "transactionTime": "<%post.3%>"} | ||
- request: | ||
method: POST | ||
url: /post-body-as-json-2 | ||
headers: | ||
content-type: application/json | ||
post: > | ||
{"objects": [{"key": "value"}, {"key": "value"}, {"key": {"key": "(.*)"}}]} | ||
response: | ||
headers: | ||
content-type: application/json | ||
status: 200 | ||
body: > | ||
{"internalKey": "<%post.1%>"} | ||
Oops, something went wrong.