From 7dbfe4a6b83ef2eeb37bbc5880ab7d7f20a790ce Mon Sep 17 00:00:00 2001
From: buildmaster
< server port can be bound in the test application context with the "wiremock.server.port" property. Using@AutoConfigureWireMockadds a bean of typeWiremockConfigurationto your test application context, where it will be cached in between methods and classes -having the same context, the same as for Spring integration tests.If you use
@AutoConfigureWireMock, it registers WireMock JSON stubs from the file +having the same context, the same as for Spring integration tests. Also you can inject a bean of typeWireMockServerinto your test.If you use
@AutoConfigureWireMock, it registers WireMock JSON stubs from the file system or classpath (by default, fromfile:src/test/resources/mappings). You can customize the locations using thestubsattribute in the annotation, which can be an Ant-style resource pattern or a directory. In the case of a directory,*/.jsonis diff --git a/single/spring-cloud-contract.html b/single/spring-cloud-contract.html index 221128beb1..ac154bb64f 100644 --- a/single/spring-cloud-contract.html +++ b/single/spring-cloud-contract.html @@ -5922,7 +5922,7 @@ your test. The following code shows an example:< server port can be bound in the test application context with the "wiremock.server.port" property. Using@AutoConfigureWireMockadds a bean of typeWiremockConfigurationto your test application context, where it will be cached in between methods and classes -having the same context, the same as for Spring integration tests.If you use
@AutoConfigureWireMock, it registers WireMock JSON stubs from the file +having the same context, the same as for Spring integration tests. Also you can inject a bean of typeWireMockServerinto your test.If you use
@AutoConfigureWireMock, it registers WireMock JSON stubs from the file system or classpath (by default, fromfile:src/test/resources/mappings). You can customize the locations using thestubsattribute in the annotation, which can be an Ant-style resource pattern or a directory. In the case of a directory,*/.jsonis diff --git a/spring-cloud-contract.xml b/spring-cloud-contract.xml index 4c9608e8f9..06946d5ead 100644 --- a/spring-cloud-contract.xml +++ b/spring-cloud-contract.xml @@ -9418,7 +9418,7 @@ public class WiremockForDocsTests { server port can be bound in the test application context with the "wiremock.server.port" property. Using@AutoConfigureWireMock adds a bean of typeWiremockConfiguration to your test application context, where it will be cached in between methods and classes -having the same context, the same as for Spring integration tests. +having the same context, the same as for Spring integration tests. Also you can inject a bean of typeWireMockServer into your test.Registering Stubs Automatically If you use @AutoConfigureWireMock , it registers WireMock JSON stubs from the file