Hi, all, I have a question about pact Gradle plugi...
# pact-jvm
i
Hi, all, I have a question about pact Gradle plugin, 4.1.39 version in use. I am wondering, how can I change some content of pact file that coming from Pactflow broker? We have endpoints, where user id changes instantly, so we decided to keep placeholder in pact file, like
path/to/endpoint/userId/12345
and then replace it on the fly. When storing pact file locally, we used to use
sed
for replacing placeholder with actual id, like
sed s/12345/$ACTUAL_USERID/g
, but it’s not the case when switching to pact broker. Could this be done via
requestFilter
from plugin or somehow else? I know it’s not the best practice, but we need some workaround for now
m
There is a
fromProviderState
matcher you could use for this, or as you note, request filters could also work
Looks like you want the path variant
i
Thank you!
👍 1
btw, requestFilter in Gradle plugin also can do the trick, with methods
setHeader
,
setURI
etc.
👍 1