-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mock-service-host: use discriminatorMaps (#2311)
* use discriminatorMaps * fix boolean response * fix arrary response * use snapshot
- Loading branch information
1 parent
1408568
commit 6ad560d
Showing
9 changed files
with
118 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ | |
}, | ||
"liveResponse": { | ||
"statusCode": "200", | ||
"headers": {}, | ||
"body": {} | ||
"headers": {} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
tools/mock-service-host/test/testData/payloads/valid_input_delete.json.new
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,23 @@ | ||
{ | ||
"liveRequest": { | ||
"headers": { | ||
"strict-Transport-Security": "max-age=31536000; includeSubDomains", | ||
"x-ms-request-id": "8e3485b6-c8a7-45c2-a9f5-59b826e42880", | ||
"x-ms-correlation-request-id": "8e3485b6-c8a7-45c2-a9f5-59b826e42880", | ||
"date": "Tue, 11 Sep 2018 18:45:41 GMT", | ||
"eTag": "\"AAAAAAAAjAIAAAAAAACL/A==\"", | ||
"server": "Microsoft-HTTPAPI/2.0", | ||
"Content-Type": "application/json", | ||
"If-Match": "dddd" | ||
}, | ||
"method": "DELETE", | ||
"url": "/subscriptions/randomSub/resourceGroups/randomRG/providers/Microsoft.ApiManagement/service/randomService/users/randomUsers?api-version=2018-01-01", | ||
"query": { | ||
"api-version": "2018-01-01" | ||
} | ||
}, | ||
"liveResponse": { | ||
"statusCode": "200", | ||
"headers": {} | ||
} | ||
} |
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
45 changes: 45 additions & 0 deletions
45
tools/mock-service-host/test/unittest/__snapshots__/testcoordinator.ts.snap
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`generateResponse() special rule of GET locations 1`] = ` | ||
VirtualServerResponse { | ||
"body": Object { | ||
"id": "/subscriptions/randomSub/resourceGroups/randomRG", | ||
"location": "eastus", | ||
"managedBy": null, | ||
"name": "randomRG", | ||
"properties": Object { | ||
"provisioningState": "Succeeded", | ||
}, | ||
"tags": Object {}, | ||
"type": "Microsoft.Resources/resourceGroups", | ||
}, | ||
"headers": Object {}, | ||
"statusCode": "200", | ||
} | ||
`; | ||
|
||
exports[`generateResponse() special rule of GET resourceGroup 1`] = ` | ||
VirtualServerResponse { | ||
"body": Object { | ||
"id": "/subscriptions/randomSub/resourceGroups/randomRG", | ||
"location": "eastus", | ||
"managedBy": null, | ||
"name": "randomRG", | ||
"properties": Object { | ||
"provisioningState": "Succeeded", | ||
}, | ||
"tags": Object {}, | ||
"type": "Microsoft.Resources/resourceGroups", | ||
}, | ||
"headers": Object {}, | ||
"statusCode": "200", | ||
} | ||
`; | ||
|
||
exports[`generateResponse() validate DELETE input 1`] = ` | ||
VirtualServerResponse { | ||
"body": undefined, | ||
"headers": Object {}, | ||
"statusCode": "200", | ||
} | ||
`; |
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