Morning folks! I've been tasked to look into event...
# pact-jvm
d
Morning folks! I've been tasked to look into event based contract testing for the team, and have a few questions that would be invaluable to know. 1. Does Pact-JVM support it? If so, a. Is there a link to an example(s)? This is handy, but need a little more help with the java implementation b. We're working on SNS, SQS and AWS Lambdas is bi-directional contract testing supported for these? c. AsyncAPI is on our radar, and appreciate it's on your roadmap for directional support. Is this supported via traditional means (consumer driven?) and if we were to integrate the AsyncAPI with swagger would that then enable bi-directional contract testing? Huge thanks in advance!
👋 1
m
a. Is there a link to an example(s)? This is handy, but need a little more help with the java implementation
Yes, here’s an example: https://docs.pactflow.io/docs/examples/kafka/java/consumer + https://docs.pactflow.io/docs/examples/kafka/java/provider The principles are the same for SNS/SQS (see also the Node examples for AWS)
1. We’re working on SNS, SQS and AWS Lambdas is bi-directional contract testing supported for these?
bi-directional contract testing (if by that you mean https://docs.pactflow.io/docs/bi-directional-contract-testing/) does not support this, it currently only supports HTTP
1. AsyncAPI is on our radar, and appreciate it’s on your roadmap for directional support. Is this supported via traditional means (consumer driven?) and if we were to integrate the AsyncAPI with swagger would that then enable bi-directional contract testing?
could you elaborate here? How would you integrate AsyncAPI with Swagger? You can do message based testing with Pact, yes, but it doesn’t have any AsyncAPI integration.
d
Thanks Matt for the prompt replies! Really appreciate it 🙇 Regarding the AsyncAPI, that stemmed from this blog: https://swagger.io/blog/using-event-driven-asyncapi-specifications-with-sw/
Where this info is presented, but was asked to follow up; PactFlow, the leading contract testing tool, makes it simple to catch breaking changes relating to your AsyncAPIs before they cause issues later in the SDLC – you can use contract testing for your Async services. Currently, PactFlow does not support AsyncAPI but work to create this capability is on the roadmap.
m
PactFlow, the leading contract testing tool, makes it simple to catch breaking changes relating to your AsyncAPIs before they cause issues later in the SDLC – you can use contract testing for your Async services. Currently, PactFlow does not support AsyncAPI but work to create this capability is on the roadmap.
the wording of that is unfortunate, to say the least given the context. But it is true - it’s on the roadmap and you can test services documented by AsyncAPI - we just don’t care about the AsyncAPI document. It’s unfortunate because AsyncAPI is used both as a noun to denote the AsyncAPI document (and presumably also the open source initiative), and also as an adjective to describe a type of API that is asynchronous
Pact supports the adjective version.
All of that is to say - you can test async (and sync) services now with Pact, and support for AsyncAPI in our BDCT feature is something we would like to support in the future 🙂
d
Yeah, probably why i'm getting confused by it. Again, much appreciated! Truly invaluable insights and direction 🙇
🙌 1
m
I reckon! You’re welcome, hopefully that gets you going 👍