Difficulty writing a provider test for a kafka event flow

31 views Asked by At

I'm fairly new to pact and indeed pact-go, and I'm trying to write some tests for both restful and kafka/event-driven interactions. I really like the idea, but the implementation of this is stumping me right now.

I have successfully written a consumer/provider test for a restful interaction, although I'm still learning about how the matchers work (any useful docs out there about this stuff?) and with the event driven side I've written a consumer test but am stumped with what to do with the provider.

I think my confusion comes from which versions of which structs to use, and the difference between the rest/messaging logic. I'm trying to follow this article https://github.com/pact-foundation/pact-go/blob/master/docs/messages.md as it was the only thing I could find (maybe there is something more upto date or better?), but the structs it mentions do not seem to be available, unless I am missing something. Event the restful tests required a bit of guesswork.

I'm using github.com/pact-foundation/pact-go/v2 v2.0.2

... as i say the versions seem confusing as v2.0.2 of pact-go seems to incorporate v4 of message (github.com/pact-foundation/pact-go/v2/message/v4), and the example talks of v3 (ProviderStateV3 for example).

Any help, gratefully received

0

There are 0 answers