Skip to content

WireMock.Org

Stef Heyenrath edited this page Feb 19, 2022 · 3 revisions

Info

This project mimics the functionality from the JAVA based WireMock.Org

Support

Note that there is some support for mappings generated by WireMock.Org.

Examples

Get

{
  "id" : "ef53ea56-f118-4b3a-8c69-a9484851d99a",
  "name" : "weatherforecast",
  "request" : {
    "url" : "/WeatherForecast",
    "method" : "GET"
  },
  "response" : {
    "status" : 200,
    "body" : "[{\"date\":\"2021-09-09T20:44:48.0992639-03:00\",\"temperatureC\":51,\"temperatureF\":123,\"summary\":\"Hot\"},{\"date\":\"2021-09-10T20:44:48.0992692-03:00\",\"temperatureC\":34,\"temperatureF\":93,\"summary\":\"Mild\"},{\"date\":\"2021-09-11T20:44:48.0992696-03:00\",\"temperatureC\":43,\"temperatureF\":109,\"summary\":\"Sweltering\"},{\"date\":\"2021-09-12T20:44:48.0992698-03:00\",\"temperatureC\":46,\"temperatureF\":114,\"summary\":\"Cool\"},{\"date\":\"2021-09-13T20:44:48.0992701-03:00\",\"temperatureC\":3,\"temperatureF\":37,\"summary\":\"Freezing\"}]",
    "headers" : {
      "Date" : "Wed, 08 Sep 2021 23:44:47 GMT",
      "Content-Type" : "application/json; charset=utf-8",
      "Server" : "Kestrel"
    }
  },
  "uuid" : "ef53ea56-f118-4b3a-8c69-a9484851d99a",
  "persistent" : true,
  "insertionIndex" : 1
}

Post

{
  "id" : "365dd908-dc67-4f27-9e41-15d908206d81",
  "name" : "weatherforecast_register-city",
  "request" : {
    "url" : "/WeatherForecast/register-city",
    "method" : "POST",
    "bodyPatterns" : [ {
      "equalToJson" : "{ \"cityName\": \"São Paulo\", \"cityCode\": 5001 }",
      "ignoreArrayOrder" : true,
      "ignoreExtraElements" : true
    } ]
  },
  "response" : {
    "status" : 200,
    "headers" : {
      "Date" : "Wed, 08 Sep 2021 23:48:33 GMT",
      "Server" : "Kestrel"
    }
  },
  "uuid" : "365dd908-dc67-4f27-9e41-15d908206d81",
  "persistent" : true,
  "insertionIndex" : 4
}
Clone this wiki locally