Hey! :four_leaf_clover: Recently started looking ...
# general
a
Hey! ๐Ÿ€ Recently started looking into WireMock and it's capabilities to stup out a service's API dependencies, which seems to be working pretty well, especially the record/snapshotting features looks very promising. I'd like to re-use/verify the mappings however, and can't find that there's support for this? ๐Ÿงต
Consider a simple example with two services, say
A
and
B
. By having WireMock proxy requests from
A
to
B
we can capture the traffic to seed the initial mappings, great. Now, we can use these mappings when testing
A
without having to also run
B
.
However, I'd like to close the loop, so to speak, by also using WireMock (or other tool consuming the mappings configuration) to also test
B
without using
A
This would help ensure that the mappings are kept correct and up-to-date as
B
evolves.
l
Hi, are you saying that you want to test
B
by using the mapping to send traffic to
B
?
Or are you thinking about some form of contract testing ?
a
yea, using the data from the mapping to send traffic to
B
, verifying the response from
B
to validate the configuration still being an accurate representation of what is being stubbed.
It does look a bit like contract testing.
and I do realize that if the mapping uses pattern matching and substrings etc in the matchers, this could become tricky.
but when the mappings are generated from captured traffic, it should be ok.
l
I don't think wiremock supports this out of the box.
a
This would help ensure that the mappings are kept correct and up-to-date as
B
evolves.
^^ this being my main problem to solve.
l
There is a
pact
extension that might be worth looking at - https://github.com/wiremock/wiremock-pact
๐Ÿ‘€ 1
a
thanks, will look at that. much appreciated ๐Ÿ™‚
๐Ÿ‘ 1