I am exploring API event driven contract testing u...
# pactflow
l
I am exploring API event driven contract testing using pact contract testing and is using pactflow as my pact broker to host the contract. my query is if I have a few message broker/queue such as AWS lambda or azure service bus, In my provider/producer codebase, do I need to run the verification against the actual producer?
m
yes. You don’t need to actually run it in the cloud service, but you should be testing the piece of code that produces the event.
see example projects (howtoexamples) on how you should abstract your code base to simplify this
s
m
There is an AMA video listed on our docs site somewhere that talks about this too, as well as Yousaf’s message pact talk from Pactober:

https://www.youtube.com/watch?v=81N25-4x27E▾

l
I am looking thro the consumer sns example code. https://docs.pactflow.io/docs/examples/aws/sns/consumer, is it becos I am using the lambda handler so I need to setup/install the SAM? I notice this script at the package.json
Copy code
"test:integration": "sam local invoke ProductEventHandler --event  ./__tests__/events/update.json",
this is to trigger the event to update to the SNS topics? this is different from running yarn test which is to generate the pact file?