Added WireMockConfigurationCustomizer

with this change it's possible to customize the WireMockConfiguration set up by Spring Cloud Contract

fixes gh-502
This commit is contained in:
Marcin Grzejszczak
2017-12-27 13:15:14 +01:00
parent 09a1de01aa
commit d6871beeb3
5 changed files with 93 additions and 0 deletions

View File

@@ -160,6 +160,19 @@ Spring Boot embedded servers, and Wiremock itself has "native" support for a par
version of Jetty (currently 9.2). To use the native Jetty, you need to add the native
Wiremock dependencies and exclude the Spring Boot container (if there is one).
=== Customization of WireMock configuration
You can register a bean of `org.springframework.cloud.contract.wiremock.WireMockConfigurationCustomizer` type
in order to customize the WireMock configuration (e.g. add custom transformers).
Example:
[source,java,indent=0]
----
include::{wiremock_tests}/src/test/java/org/springframework/cloud/contract/wiremock/AutoConfigureWireMockConfigurationCustomizerTests.java[tags=customizer_1]
// perform your customization here
include::{wiremock_tests}/src/test/java/org/springframework/cloud/contract/wiremock/AutoConfigureWireMockConfigurationCustomizerTests.java[tags=customizer_2]
----
=== Generating Stubs using REST Docs
https://projects.spring.io/spring-restdocs[Spring REST Docs] can be used to generate