I'm researching Pact contract testing and I've got a question whether the business logic should be mocked during this test.
Let's say I have an endpoint
POST /user
{
"name": "first name"
"accountID": "12345678"
}
Assume I've written the consumer test and verified it with a provider. However, to verify it I need to have the actual API running. The problem is that when I'm running in my local environment accountID
of 12345678
does exist. However, when another dev will run it in his env - it might not exist.
My question is - how do I get around this problem? Do I need to mock the business logic inside the endpoint? But in that case doesn't it just become a payload validator essentially which protobuf could do?