wiremock / wiremock-grpc-extension

WireMock Extension: gRPC mocking
https://wiremock.org/docs/grpc/
Apache License 2.0
15 stars 8 forks source link

Crash when attempting to record gRPC interaction #48

Open silverjam opened 8 months ago

silverjam commented 8 months ago

Proposal

I'm attempting to record an interaction with a gRPC server, I've setup the server with the required descriptor files, but I'm seeing a crash when running in record mode:

wiremock-llama-1     | Exception in thread "grpc-default-executor-3" wiremock.com.google.protobuf.InvalidProtocolBufferException: Expect message object but got: "Network"
wiremock-llama-1     |  at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl.mergeMessage(JsonFormat.java:1458)
wiremock-llama-1     |  at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1435)
wiremock-llama-1     |  at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1317)
wiremock-llama-1     |  at wiremock.com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:449)
wiremock-llama-1     |  at org.wiremock.grpc.internal.JsonMessageUtils.lambda$toMessage$1(JsonMessageUtils.java:36)
wiremock-llama-1     |  at com.github.tomakehurst.wiremock.common.Exceptions.uncheck(Exceptions.java:72)
wiremock-llama-1     |  at org.wiremock.grpc.internal.JsonMessageUtils.toMessage(JsonMessageUtils.java:36)
wiremock-llama-1     |  at org.wiremock.grpc.internal.UnaryServerCallHandler.lambda$invoke$0(UnaryServerCallHandler.java:92)
wiremock-llama-1     |  at com.github.tomakehurst.wiremock.http.AbstractRequestHandler.handle(AbstractRequestHandler.java:101)
wiremock-llama-1     |  at org.wiremock.grpc.internal.UnaryServerCallHandler.invoke(UnaryServerCallHandler.java:60)
wiremock-llama-1     |  at org.wiremock.grpc.internal.UnaryServerCallHandler.invoke(UnaryServerCallHandler.java:31)
wiremock-llama-1     |  at wiremock.grpc.io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
wiremock-llama-1     |  at wiremock.grpc.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:351)
wiremock-llama-1     |  at wiremock.grpc.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:860)
wiremock-llama-1     |  at wiremock.grpc.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
wiremock-llama-1     |  at wiremock.grpc.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
wiremock-llama-1     |  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
wiremock-llama-1     |  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
wiremock-llama-1     |  at java.base/java.lang.Thread.run(Unknown Source)

Reproduction steps

References

No response

tomakehurst commented 8 months ago

Recording isn't implemented yet, so retagging as an enhancement request.

sebradloff commented 3 months ago

Just want to say I'm also interested in this enhancement request. Happy to be an early tester when the time comes 😄