Sonali Sharma
07/20/2023, 12:21 AMMatt (pactflow.io / pact-js / pact-go)
since all examples use a repositorythey do that because they are examples that have a CRUD database. Whatever the repository equivalent is you should implement in your state handlers. If the state involved stubbing a 3rd party API, do that. If it involves stubbing a database, you could inject data into the database or replace it with a stub. The provider state is orthogonal to implementation (by design). Consumers need not know the implementation detail of the provider (information hiding). So do whatever is most natural in the provider code base (I prefer stubbing, FWIW)
Sonali Sharma
07/20/2023, 12:45 AMSonali Sharma
07/20/2023, 10:30 AMif (context.Request.Method == HttpMethod.Get.Method)
{
// ... (handle GET request provider states)
}Sonali Sharma
07/20/2023, 10:30 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)