Guillaume Camus
04/21/2022, 1:30 PMStateHandlers
but I don’t see how I can change the response status code. Do you have an example?Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
404
you make sure a resource isn’t in the database vs a 200
where you ensure the resource does existMatt (pactflow.io / pact-js / pact-go)
Guillaume Camus
04/22/2022, 7:34 AMProviderStateV3Response
https://github.com/pact-foundation/pact-go/blob/2.x.x/examples/provider_test.go#L74-L88
My Pb is that ProviderStateV3Response is a map of fields used to generate the response body. But I cannot interact with other parts of the response. And If I return nil
instead of the ProviderStateV3Response, that doesn’t call my ms.
Do you have an example to interact with the database and ProviderStateV3Response
?Matt (pactflow.io / pact-js / pact-go)
StateHandlers
don’t have access to the request/response at allMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
RequestFilters
can do that, but it’s not really used for this purpose)Matt (pactflow.io / pact-js / pact-go)
My Pb is that ProviderStateV3Response is a map of fields used to generate the response bodyno, the
ProviderStateV3Response
is not a response body for the provider test. It’s parameters to configure the current state setupGuillaume Camus
04/22/2022, 12:51 PM