Open tl-madhulika-mitra opened 2 years ago
you can whitelist headers in your consumer tests, see the wiremock-pact-generator docs
https://bitbucket.org/atlassian/wiremock-pact-generator/src/master/
Whitelist request/response headers You can define what request/response headers should be recorded in the interactions by providing a whitelist of header names (case insensitive).
By default, if no whitelist is provided, all headers are captured.
WireMockPactGenerator
.builder("myConsumer", "myProvider")
.withRequestHeaderWhitelist("header-1", "header-2")
.withResponseHeaderWhitelist("header-3")
.build()
Just jumping in here to say that I would not recommend using the wiremock generator with a pact provider verification as there are no matching rues which can make verification very brittle (it will only match exact values).
It's designed for use with another schema comparison tool, or with Pactflow's bidirectional contract testing feature.
@tl-madhulika-mitra are you sorted with this issue and can I close it, as wiremock-pact-generator
will not work for traditional consumer driven contract tests with a Pact provided verifier
@uglyog - We use Wiremock pact generator to generate our pact and the header content-length auto generates. And when we try to test the provider side, the test fails with 408. We are using a Pact Broker to test, so cannot remove headers at runtime(not sure if there exists a way). Imagining this thread is quite old, is there a way to work around this.
PS: Test works completely fine, without this header
Originally posted by @tl-madhulika-mitra in https://github.com/pact-foundation/pact-jvm/issues/255#issuecomment-1112503131