diff --git a/samples/http-cats/README.md b/samples/http-cats/README.md index bd10a57..68261cc 100644 --- a/samples/http-cats/README.md +++ b/samples/http-cats/README.md @@ -25,6 +25,7 @@ Use this preset to return funny cat images when simulating erroneous HTTP status Version|Date|Comments -------|----|-------- +1.5|February 11, 2025|Updated to 0.24 schema 1.4|January 17, 2024|Updated plugin path 1.3|January 11, 2024|Updated to new format 1.2|December 22, 2023|Updated to new format diff --git a/samples/http-cats/assets/sample.json b/samples/http-cats/assets/sample.json index a98dea1..526490e 100644 --- a/samples/http-cats/assets/sample.json +++ b/samples/http-cats/assets/sample.json @@ -10,7 +10,7 @@ "Testing doesn't have to boring! Use this preset to return funny cat images when simulating erroneous HTTP status codes for Microsoft Graph. This preset contains images for the following HTTP status codes: 429, 500, 502, 503, 504 and 507. When you test your app in the browser, and the Dev Proxy returns one of these status codes, you will see a funny cat image instead of a boring error message. Have fun! 🐱 HTTP cat pictures by Tomomi Imura." ], "creationDateTime": "2023-08-10", - "updateDateTime": "2024-01-17", + "updateDateTime": "2025-02-11", "products": [ "Dev Proxy", "Microsoft Graph" diff --git a/samples/http-cats/http-cats-config.json b/samples/http-cats/http-cats-config.json index 949a590..7aaa24b 100644 --- a/samples/http-cats/http-cats-config.json +++ b/samples/http-cats/http-cats-config.json @@ -1,4 +1,5 @@ { + "$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.24.0/rc.schema.json", "plugins": [ { "name": "GenericRandomErrorPlugin", @@ -21,26 +22,10 @@ "https://*.sharepoint-df.*/*_api/*", "https://*.sharepoint-df.*/*_vti_bin/*" ], - "mocksPlugin": { - "mocksFile": "responses.json" - }, - "graphRandomErrorsPlugin": { - "allowedErrors": [ - 429, - 500, - 502, - 503, - 504, - 507 - ] - }, - "executionSummaryPlugin": { - "groupBy": "url" - }, "httpCats": { "errorsFile": "http-cats-responses.json" }, "rate": 50, "labelMode": "text", - "logLevel": "info" + "logLevel": "information" } \ No newline at end of file diff --git a/samples/http-cats/http-cats-responses.json b/samples/http-cats/http-cats-responses.json index 5a16eb7..2ce0a27 100644 --- a/samples/http-cats/http-cats-responses.json +++ b/samples/http-cats/http-cats-responses.json @@ -1,92 +1,100 @@ { - "responses": [ + "$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v0.24.0/genericrandomerrorplugin.schema.json", + "errors": [ { - "statusCode": 429, - "headers": [ + "request": { + "url": "https://*/*" + }, + "responses": [ { - "name": "content-type", - "value": "image/jpeg" + "statusCode": 429, + "headers": [ + { + "name": "content-type", + "value": "image/jpeg" + }, + { + "name": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "name": "Retry-After", + "value": "@dynamic" + } + ], + "body": "@http-cats/429.jpeg" }, { - "name": "Access-Control-Allow-Origin", - "value": "*" + "statusCode": 500, + "headers": [ + { + "name": "content-type", + "value": "image/jpeg" + }, + { + "name": "Access-Control-Allow-Origin", + "value": "*" + } + ], + "body": "@http-cats/500.jpeg" }, { - "name": "Retry-After", - "value": "@dynamic" - } - ], - "body": "@http-cats/429.jpeg" - }, - { - "statusCode": 500, - "headers": [ - { - "name": "content-type", - "value": "image/jpeg" + "statusCode": 502, + "headers": [ + { + "name": "content-type", + "value": "image/jpeg" + }, + { + "name": "Access-Control-Allow-Origin", + "value": "*" + } + ], + "body": "@http-cats/502.jpeg" }, { - "name": "Access-Control-Allow-Origin", - "value": "*" - } - ], - "body": "@http-cats/500.jpeg" - }, - { - "statusCode": 502, - "headers": [ - { - "name": "content-type", - "value": "image/jpeg" + "statusCode": 503, + "headers": [ + { + "name": "content-type", + "value": "image/jpeg" + }, + { + "name": "Access-Control-Allow-Origin", + "value": "*" + } + ], + "body": "@http-cats/503.jpeg" }, { - "name": "Access-Control-Allow-Origin", - "value": "*" - } - ], - "body": "@http-cats/502.jpeg" - }, - { - "statusCode": 503, - "headers": [ - { - "name": "content-type", - "value": "image/jpeg" - }, - { - "name": "Access-Control-Allow-Origin", - "value": "*" - } - ], - "body": "@http-cats/503.jpeg" - }, - { - "statusCode": 504, - "headers": [ - { - "name": "content-type", - "value": "image/jpeg" - }, - { - "name": "Access-Control-Allow-Origin", - "value": "*" - } - ], - "body": "@http-cats/504.jpeg" - }, - { - "statusCode": 507, - "headers": [ - { - "name": "content-type", - "value": "image/jpeg" + "statusCode": 504, + "headers": [ + { + "name": "content-type", + "value": "image/jpeg" + }, + { + "name": "Access-Control-Allow-Origin", + "value": "*" + } + ], + "body": "@http-cats/504.jpeg" }, { - "name": "Access-Control-Allow-Origin", - "value": "*" + "statusCode": 507, + "headers": [ + { + "name": "content-type", + "value": "image/jpeg" + }, + { + "name": "Access-Control-Allow-Origin", + "value": "*" + } + ], + "body": "@http-cats/507.jpeg" } - ], - "body": "@http-cats/507.jpeg" + ] } ] } \ No newline at end of file