b
I found the error, I should allow to download the plugins from dependecies in the composer install, But now I got an error from provider-states-setup-url. How could I "prepare/code" this state provider in my application? I found some examples in doc but they are out of date..
m
When setting up the testing of a provider you will also need to setup the management of these provider states. The Pact verifier does this by making additional HTTP requests to the
--provider-states-setup-url
you provide. This URL could be on the provider application or a separate one. Some strategies for managing state include: • Having endpoints in your application that are not active in production that create and delete your datastore state • A separate application that has access to the same datastore to create and delete, like a separate App Engine module or Docker container pointing to the same datastore • A standalone application that can start and stop the other server with different datastore states So, TL;DR - you need to register a new route e.g.
/_pact/provider-states
that will receive requests from Pact during verification. In that route, you should do what is needed to setup the state
b
Hmm, so in this step I must implement an endpoint that returns the response registered in my contract that is stored in my Pact Broker? When I changed the provider-base-url to localhost:80 I didn't get this error, Is there an explanation for this situation? In this port, It's running an API with Docker.
m
Correct
the explanation is that, presumably, port
80
is where your API is running and the Pact test is able to communicate to port
80
and check that your endpoints match the contract
I’m confused as to why you’re confused 😆
b
I am confused about how to implement and endpoint if I decide to change my base provider url in the code, But I think I understand for now. ahshashas
🙏 1
Thanks Matt.