Open rholshausen opened 1 year ago
Thanks Ron - easy fix!
I was told this also will fix an issue with an empty request. Adding details here to track. So if request has no content:
grpcInteraction := `{
"pact:content-type": "application/protobuf",
"request": {
},
The consumer test incorrectly fails with this error:
2022/12/06 20:52:19 [DEBUG] GetMessageRequestContents
test.go:88:
Error Trace: /test.go:88
Error: Received unexpected error:
retreived an empty message
Test: TestMyRequest
It should allow for requests with no fields.
Software versions
go version
go env
Expected behaviour
Setup a gRPC consumer test, but have the JSON to configure the interaction to be invalid. Expect the test to fail with an invalid JSON error.
Actual behaviour
An error is logged about the JSON being invalid, but then the mock server is started anyway, which fails to start correctly. This hides the JSON error in the log output and the final error is:
Steps to reproduce
Any test should do it. Ie. break the JSON at https://github.com/pact-foundation/pact-go/blob/2.x.x/examples/grpc/grpc_consumer_test.go#L36
Relevent log files