Jason Army
09/16/2022, 3:37 PMcommon.proto
into examples/gRPC/area_calculator/proto
2. Add import "common.proto"
into area_calculator.proto
and add DeviceContext
and ListenerContext
3. Modify the request
in PactConsumerTest.calculateRectangleArea
as follows:
"request", Map.of(
"device_context", Map.of(
"device_id", "matching(number, 4)",
"carrier_name", "matching(type, 'foo')"
)),
"listener_context", Map.of(
"listener_id", "matching(number, 1)"
),
Now when you run the PactConsumerTest
the generated grpc-consumer-jvm-area-calculator-provider.json
does not contain the listener_context.listener_id
. I'll attach the generated pact along with plugin.log in the threadJason Army
09/16/2022, 4:15 PMuglyog
uglyog
Matt (pactflow.io / pact-js / pact-go)
uglyog
Sri Naga Sai Krishna Sanka
09/20/2022, 3:26 PMSri Naga Sai Krishna Sanka
09/21/2022, 3:43 PMInvalidProtocolBufferException: Protobuf message had a invalid wire type
.
We are not very big on protobufs. Upon trying the example you’ve provided, it’s going through. With our example, it’s not.
The error is specifically happening at parseFrom
line in the pact test. Any help is appreciated. TIAJason Army
09/21/2022, 10:19 PMinvalid wire type
issue. The .proto we were using in the test did not match the version in the proto library so they were encoded differently