Skip to content

Commit 1686c86

Browse files
Sets GET as a default method. Closes #17
1 parent 7fa876c commit 1686c86

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

msgraph-chaos-proxy/ChaosProxyConfiguration.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ public void LoadResponses()
4545
var responsesString = File.ReadAllText(_responsesFilePath);
4646
var responsesConfig = JsonSerializer.Deserialize<ChaosProxyConfiguration>(responsesString);
4747
IEnumerable<ChaosProxyMockResponse>? configResponses = responsesConfig?.Responses;
48-
if (configResponses is not null)
48+
if (configResponses is not null) {
4949
Responses = configResponses;
50+
}
5051
}
5152
catch (Exception ex)
5253
{
@@ -97,7 +98,7 @@ public class ChaosProxyMockResponse {
9798
[JsonPropertyName("url")]
9899
public string Url { get; set; } = string.Empty;
99100
[JsonPropertyName("method")]
100-
public string Method { get; set; } = string.Empty;
101+
public string Method { get; set; } = "GET";
101102
[JsonPropertyName("responseCode")]
102103
public int? ResponseCode { get; set; } = 200;
103104
[JsonPropertyName("responseBody")]

msgraph-chaos-proxy/responses.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"responses": [
33
{
44
"url": "/v1.0/me",
5-
"method": "GET",
65
"responseBody": {
76
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
87
"businessPhones": [
@@ -28,7 +27,6 @@
2827
},
2928
{
3029
"url": "/v1.0/users/48d31887-5fad-4d73-a9f5-3c356e68a038",
31-
"method": "GET",
3230
"responseBody": {
3331
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
3432
"businessPhones": [
@@ -48,20 +46,17 @@
4846
},
4947
{
5048
"url": "/v1.0/me/photo",
51-
"method": "GET",
5249
"responseCode": 404
5350
},
5451
{
5552
"url": "/v1.0/users/*/photo/$value",
56-
"method": "GET",
5753
"responseBody": "@picture.jpg",
5854
"responseHeaders": {
5955
"content-type": "image/jpeg"
6056
}
6157
},
6258
{
6359
"url": "/v1.0/users/*",
64-
"method": "GET",
6560
"responseBody": {
6661
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
6762
"businessPhones": [

0 commit comments

Comments
 (0)