I'm writing a consumer test that uses the gRPC plu...
# protobufs
r
I'm writing a consumer test that uses the gRPC plugin and for some reason it's having trouble with a
Timestamp
field in the request. Is this supported?
Copy code
Pact Test function failed with an exception: Bad type on operand stack
Exception Details:
  Reason:
    Type 'com/google/protobuf/Timestamp' (current frame, stack[2]) is not assignable to 'com/google/protobuf/GeneratedMessageLite'
My request looks like this (Kotlin):
Copy code
"timestamp" to mapOf(
  "seconds" to "0",
  "nanos" to "0"
)
My message in the proto looks like this:
Copy code
message SomeMessage {
  ... Other fields ...
  google.protobuf.Timestamp timestamp = 4;
}
This might be a self inflicted wound because we have both protobuf and protobuf-lite in our project, but that hasn't caused an issue so far with other fields, so wonder what's different here.
Update: The exception isn't in Pact but rather parsing the proto bytes from the V4 interaction object into a concrete proto object. Looks like this is my fault.
👍 1
m
Thanks for updating/clarifying (and love the rubberduck debugging - this will hopefully help others!)
r
For posterity, we had the protobuf-javalite library as a transitive dependency and solve the issue by replacing it with the full version via a gradle configuration block.
👍 1