Hi, how to modify the request endpoint in the prov...
# pact-broker
m
Hi, how to modify the request endpoint in the provider side? I’m using the junit5spring …
m
Hi @Yousaf Nabi (pactflow.io)@Yousaf Nabi (pactflow.io)@Yousaf Nabi (pactflow.io)@Yousaf Nabi (pactflow.io)@Yousaf Nabi (pactflow.io) this document is for adding/modifying the headers only..for me i want to modify the request endpoint url…
👋 1
problem: my consumer test using api gateway url for their contract test. But my provider using the internal url for their contract test. Example: consumer using /user/v2 and api gateway redirect this url to /customer/v1/details ..but request body and headers are same. My question: how can i modify the request endpoint url in the provider side before executing pact test in the provider side?
y
Modify the
HttpRequest
document as per the docs
Can you not set the request path, to your new path in that method? the example just shows a header, but the table below shows you the objects that you have available to you in the test template.
Here was some guidance we mentioned on testing pass throughs, with non http pacts https://docs.pact.io/getting_started/what_is_pact_good_for#why-pact-may-not-be-the-best-tool-for-testing-pass-through-apis-like-bffs If I wanted a quick method and it wasn't available to me via the Pact library (Pact-Js was always my go to), I would just modify the paths in the pact file, before providing the file to my verifier. do you have a contract between the api gateway and your provider? if your provider changes the internal URL, how is the api gateway kept in sync? is that tied to the providers deployment infra?
m
Thank you..it worked
🙌 1