From 2eff08d08e2d0ce131aa8e25d77044e94875f6e6 Mon Sep 17 00:00:00 2001 From: bono007 Date: Thu, 10 Dec 2020 03:37:44 -0600 Subject: [PATCH] Adds info note in Wiremock docs around use of WireMock.resetToDefaultMappings (#1577) * Adds info note in Wiremock docs around use of WireMock.resetToDefaultMappings when using '_stubs' property. Fixes gh-1451 * Polished newly added docs w/ proper tense. --- docs/src/main/asciidoc/_project-features-wiremock.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/main/asciidoc/_project-features-wiremock.adoc b/docs/src/main/asciidoc/_project-features-wiremock.adoc index 2a20669bef..b9b254b559 100644 --- a/docs/src/main/asciidoc/_project-features-wiremock.adoc +++ b/docs/src/main/asciidoc/_project-features-wiremock.adoc @@ -63,6 +63,12 @@ NOTE: Actually, WireMock always loads mappings from `src/test/resources/mappings well as* the custom locations in the `stubs` attribute. To change this behavior, you can also specify a files root, as described in the next section of this document. +NOTE: Also, the mappings in the `stubs` location are not considered part of Wiremock's "default mappings" and calls +to `com.github.tomakehurst.wiremock.client.WireMock.resetToDefaultMappings` during a test do not result in the mappings +in the `stubs` location being included. However, the `org.springframework.cloud.contract.wiremock.WireMockTestExecutionListener` +does reset the mappings (including adding the ones from the stubs location) after every test class and, optionally, +after every test method (guarded by the `wiremock.reset-mappings-after-each-test` property). + If you use Spring Cloud Contract's default stub jars, your stubs are stored in the `/META-INF/group-id/artifact-id/versions/mappings/` folder. If you want to register all stubs from that location, from all embedded JARs, you can use