From f4e454f457692082e118c908533d6d33d8077e63 Mon Sep 17 00:00:00 2001 From: Kyle Winkelman Date: Wed, 17 Jan 2024 08:30:22 -0600 Subject: [PATCH 1/8] Allow matchesJsonSchema to be supplied as a json object. --- _docs/request-matching.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/_docs/request-matching.md b/_docs/request-matching.md index 73b06d58..eee3fd2e 100644 --- a/_docs/request-matching.md +++ b/_docs/request-matching.md @@ -800,7 +800,38 @@ stubFor( .willReturn(ok())); ``` -JSON: +JSON (supported in 3.4+): + +```json +{ + "request" : { + "urlPath" : "/schema-match", + "method" : "POST", + "bodyPatterns" : [ { + "matchesJsonSchema" : { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "schemaVersion" : "V202012" + } ] + }, + "response" : { + "status" : 200 + } +} +``` + +JSON with string literal: ```json { From cd0e7423d6bbedb8eac581f66202d061898b46cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20N=C3=BA=C3=B1ez=20Silva?= Date: Fri, 2 Feb 2024 17:50:35 +0100 Subject: [PATCH 2/8] Remove extra stubFor() in spring-boot example (#241) This commit removes an extra stubFor() in the code example. It was added twice by mistake and causes a compilation error. --- _docs/solutions/spring-boot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_docs/solutions/spring-boot.md b/_docs/solutions/spring-boot.md index bb27b622..ebbb1439 100644 --- a/_docs/solutions/spring-boot.md +++ b/_docs/solutions/spring-boot.md @@ -37,14 +37,14 @@ class TodoControllerTests { void aTest() { // returns a URL to WireMockServer instance env.getProperty("user-client.url"); - wiremock.stubFor(stubFor(get("/todolist").willReturn(aResponse() + wiremock.stubFor(get("/todolist").willReturn(aResponse() .withHeader("Content-Type", "application/json") .withBody(""" [ { "id": 1, "userId": 1, "title": "my todo" }, ] """) - ))); + )); } } ``` From 0aa0eb836649c0a6bb8f6e1fc78a0d25cbe7bcb9 Mon Sep 17 00:00:00 2001 From: Prithvi Date: Fri, 2 Feb 2024 22:21:33 +0530 Subject: [PATCH 3/8] Corrected getRequestURI to url for wiremock server. (#243) --- _docs/quickstart/java-junit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_docs/quickstart/java-junit.md b/_docs/quickstart/java-junit.md index d9bc384a..b661057e 100644 --- a/_docs/quickstart/java-junit.md +++ b/_docs/quickstart/java-junit.md @@ -100,7 +100,7 @@ public void exampleTest() { // Setup HTTP POST request (with HTTP Client embedded in Java 11+) final HttpClient client = HttpClient.newBuilder().build(); final HttpRequest request = HttpRequest.newBuilder() - .uri(wiremockServer.getRequestURI("/my/resource")) + .uri(wiremockServer.url("/my/resource")) .header("Content-Type", "text/xml") .POST().build(); From 9973f3a32a7b6639c5166a77d348ec317ff35cd0 Mon Sep 17 00:00:00 2001 From: Dmitrii Khoziainov <87916143+dkhozyainov@users.noreply.github.com> Date: Fri, 2 Feb 2024 19:52:20 +0300 Subject: [PATCH 4/8] #2071 doc for GzipDisabled (#251) Co-authored-by: d.khoziainov --- _docs/stubbing.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/_docs/stubbing.md b/_docs/stubbing.md index 154b8b69..f23efdff 100644 --- a/_docs/stubbing.md +++ b/_docs/stubbing.md @@ -653,3 +653,20 @@ This can be changed by setting `duplicatePolicy` in the JSON to `IGNORE` or call If you want to ensure that the only stubs loaded after the import has completed are the ones it contains, you can set `"deleteAllNotInImport": true` in the JSON or call `deleteAllExistingStubsNotInImport()` on the Java builder. + +### Disabling Gzip at the ResponseDefinitionBuilder + +If you want to user Gzip disabled response option at the ResponseDefinitionBuilder level. +You can use `.withGzipDisabled(true)` + +```java + +wireMockServer.stubFor(get(urlEqualTo("/todo/items")) + .willReturn(aResponse() + .withStatus(200) + .withGzipDisabled(true) + .withBody( + "Here is some kind of response body" + + "Here is some kind of response body" + + "Here is some kind of response body"))); +``` From cf0b2b27b37763384ad392e9d85fa7d9519ac5fb Mon Sep 17 00:00:00 2001 From: Tom Akehurst Date: Fri, 2 Feb 2024 16:54:44 +0000 Subject: [PATCH 5/8] Disabled automatic publishing of the site on push to main to avoid docs for releases features being released from PR merges --- .github/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index f108dd10..b641376f 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -2,8 +2,8 @@ name: Deploy Jekyll site to Pages on: # Runs on pushes targeting the default branch - push: - branches: ["main"] + # push: + # branches: ["main"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: From 76e2f77d71673534f2f5e0e034e114f63abd68c9 Mon Sep 17 00:00:00 2001 From: Sam Williams <71648138+sam-williams-cko@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:55:43 +0000 Subject: [PATCH 6/8] Update stub mappings URL in administration.md (#255) * Update suggested URL in administration.md * Fix wording --- _docs/standalone/administration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_docs/standalone/administration.md b/_docs/standalone/administration.md index ff573545..9a8ae8ad 100644 --- a/_docs/standalone/administration.md +++ b/_docs/standalone/administration.md @@ -10,7 +10,7 @@ You can find the key use-cases and the full specification below. ## Fetching all of your stub mappings (and checking WireMock is working) -A GET request to the root admin URL e.g `http://localhost:8080/__admin` +A GET request to the mappings admin URL e.g `http://localhost:8080/__admin/mappings` will return all currently registered stub mappings. This is a useful way to check whether WireMock is running on the host and port you expect. From d8eab7186c1fb4f2cba1a30fa5499e35918ff06d Mon Sep 17 00:00:00 2001 From: Ethan Jones Date: Sat, 10 Feb 2024 07:58:39 -0500 Subject: [PATCH 7/8] Updating OSS comparison --- index.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 60320d44..b977b61c 100644 --- a/index.html +++ b/index.html @@ -173,15 +173,16 @@

alt="wiremock cloud logo" class="logo" /> -

Hosted API mocking for everyone

- +

Rapidly create and Share API Mocks

+
    -
  • SaaS, nothing to install
  • -
  • For individuals, teams and enterprises
  • -
  • Intuitive web UI for developers
  • -
  • OpenAPI, Swagger and Postman import
  • -
  • NEW: Chaos Engineering
  • -
  • Generous free plan
  • +
  • Intuitive UI for complex API mock creation
  • +
  • For larger teams or API volume
  • +
  • Easy start with OpenAPI, Swagger, Postman imports
  • +
  • Pre-built templates for common industry APIs
  • +
  • Enhance API resilience with negative and chaos testing
  • +
  • Alerts for API mock and real API discrepancies
  • +
  • RBAC, security, and event logs
From 0ea3a5263c27821fe1acf2b85a5e53c6fd98bd1a Mon Sep 17 00:00:00 2001 From: Tom Akehurst Date: Fri, 16 Feb 2024 20:42:56 +0000 Subject: [PATCH 8/8] Updated WireMock version --- _config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 0dc9f33e..d0d13d85 100644 --- a/_config.yml +++ b/_config.yml @@ -234,7 +234,7 @@ compress_html: ignore: envs: development -wiremock_version: 3.3.1 +wiremock_version: 3.4.0 wiremock_baseline: 3.x pageEditPrefix: https://github.com/wiremock/wiremock.org/edit/main/