Justin Wood
03/22/2024, 7:25 PMJoshua Ellis
03/22/2024, 10:01 PMJustin Wood
03/22/2024, 11:07 PMMatt Glover
03/23/2024, 1:43 AMJustin Wood
03/23/2024, 5:03 PMPriyaranjan Mudliar
03/24/2024, 8:33 AM/pactStateChange
api and the “pact mock consumer” which is the pact verifier cli will call this api with the the below payload:
{
"state": GivenInTheConsumerPact,
"params": StateJSON
}
Priyaranjan Mudliar
03/24/2024, 8:35 AMJustin Wood
03/25/2024, 1:51 PMJoshua Ellis
03/25/2024, 8:33 PMgiven user 1 exists
.
On the provider side, Pact allows for the state to be changed through a callback. The callback more specifically is a dedicated API endpoint available during testing which is designed to alter the provider's internal state (e.g. /_test/callback
). In order to avoid the need to spin up databases and actually mutate other services, it is also best practice to mock sources of data external to the provider.
There are examples of this setup on various languages, for example Python, JavaScript.Justin Wood
03/25/2024, 8:36 PM