Context I am trying to write pact test for a produ...
# protobufs
s
Context I am trying to write pact test for a producer/consumer setup where messages are consumed from a kinesis stream. The messages are defined in protobuf schema Current State I have the consumer side of the test working which is generating a pact json Issue I am struggling to write a test for the provider as am not sure how to setup it up. I tried following some examples provided in github but could not set it up for protobuf messages. Any help/pointers would be appriciated I am uisng pact-go (v2.0.0-beta.17) and protobuf plugin (0.2.4)
s
thank I will try this out. But as I understand this will require a call to cli to verify the message. I was hoping to be able to setup the test similar to this where the verification could be done in the test itself.
u
@Matt (pactflow.io / pact-js / pact-go) may be able to help here. But you'll need to provide the errors you are getting.
☝️ 1
m
Yes please. I think the standard message interface is the way to go, but it’s possible the types are not going to allow an
[]byte
, which is probably going to be needed for that
s
I have the provider test setup using the
VerifyProvider
, and defined a
MessageHandler
that returns back a constructed event and the required
contentType
in
Metadata
when I run the test I get below error
Copy code
1) Verifying a pact between Consumer and Provider Given event processing for transaction - an event for transaction processing
    1.1) has a matching body
           expected 'application/protobuf;message=Event' body but was 'application/json;charset=utf-8'
m
Thanks. Looks like we need to support the correct content type. Could you please raise a bug for us to fix?
s
Thanks @Matt (pactflow.io / pact-js / pact-go). I noticed there is a similar bug that was opened yesterday: https://github.com/pact-foundation/pact-go/issues/263 Checking if this is related above? if not I can open a new one
m
I think this is separate, as it relates to the use of messages. If they are the same I can merge, but a bug report with your setup would be really helpful thanks!
👍 1