diff --git a/multi/multi__spring_cloud_contract_wiremock.html b/multi/multi__spring_cloud_contract_wiremock.html index 3f660d5e67..e9dff9d7a7 100644 --- a/multi/multi__spring_cloud_contract_wiremock.html +++ b/multi/multi__spring_cloud_contract_wiremock.html @@ -52,7 +52,8 @@ public class WiremockImportApplicationTests { }
[Note]Note

Actually, WireMock always loads mappings from src/test/resources/mappings as 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.

11.2 Using Files to Specify the Stub Bodies

WireMock can read response bodies from files on the classpath or the file system. In that +also specify a files root as described in the next section of this document.

If you’re using Spring Cloud Contract’s default stub jars, then your +stubs are stored under /META-INF/group-id/artifact-id/versions/mappings/ folder. If you want to register all stubs from that location, from all embedded JARs, then it’s enough to use the following syntax.

@AutoConfigureWireMock(port = 0, stubs = "classpath*:/META-INF/**/mappings/**/*.json")

11.2 Using Files to Specify the Stub Bodies

WireMock can read response bodies from files on the classpath or the file system. In that case, you can see in the JSON DSL that the response has a bodyFileName instead of a (literal) body. The files are resolved relative to a root directory (by default, src/test/resources/__files). To customize this location you can set the files diff --git a/single/spring-cloud-contract.html b/single/spring-cloud-contract.html index cd904bf239..08a2768291 100644 --- a/single/spring-cloud-contract.html +++ b/single/spring-cloud-contract.html @@ -6436,7 +6436,8 @@ public class WiremockImportApplicationTests { }

[Note]Note

Actually, WireMock always loads mappings from src/test/resources/mappings as 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.

11.2 Using Files to Specify the Stub Bodies

WireMock can read response bodies from files on the classpath or the file system. In that +also specify a files root as described in the next section of this document.

If you’re using Spring Cloud Contract’s default stub jars, then your +stubs are stored under /META-INF/group-id/artifact-id/versions/mappings/ folder. If you want to register all stubs from that location, from all embedded JARs, then it’s enough to use the following syntax.

@AutoConfigureWireMock(port = 0, stubs = "classpath*:/META-INF/**/mappings/**/*.json")

11.2 Using Files to Specify the Stub Bodies

WireMock can read response bodies from files on the classpath or the file system. In that case, you can see in the JSON DSL that the response has a bodyFileName instead of a (literal) body. The files are resolved relative to a root directory (by default, src/test/resources/__files). To customize this location you can set the files diff --git a/spring-cloud-contract.xml b/spring-cloud-contract.xml index 945ae68a63..84d781ac16 100644 --- a/spring-cloud-contract.xml +++ b/spring-cloud-contract.xml @@ -10172,6 +10172,9 @@ public class WiremockImportApplicationTests { 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. +If you’re using Spring Cloud Contract’s default stub jars, then your +stubs are stored under /META-INF/group-id/artifact-id/versions/mappings/ folder. If you want to register all stubs from that location, from all embedded JARs, then it’s enough to use the following syntax. +@AutoConfigureWireMock(port = 0, stubs = "classpath*:/META-INF/**/mappings/**/*.json")

Using Files to Specify the Stub Bodies