Closed krmahadevan closed 2 years ago
I have raised a PR for this. It would be really great if this can be accepted and then an image released into docker hub.
I stumbled into this issue at work when I was trying to use this library for doing grpc mocking. I dont want to end up maintaining a docker image at work and would like to continue using this library with the fix.
Oh btw, thank you so much for this wonderful library. Awesome work π
@Adven27 - Thank you so much for helping with merging this PR and also in helping with a release as well. That was fast!! π
Describe the bug A clear and concise description of what the bug is.
The
grpc-wiremock
tool assumes that in the generated code from the protobuf messages, only service classes would have its name end withGrpc.java
. But a user can still end up defining a message which ends withGrpc
. So when a message ends withGrpc
, the tool ends up assuming that the message class is a service class and ends up adding a reference to the abstractImplBase
for it which does not exist.To Reproduce Steps to reproduce the behavior:
.proto
file./gradlew clean generateJava
src/main/java/io/adven/grpc/wiremock/Translator.java
In the above generated code, only
HelloWorldGrpc
is a valid service class and soHelloWorldImplBase
exists inside it. But this is not the case withInputGrpc
andOutputGrpc
Expected behavior
The tool should not just rely on file names to distinguish service classes from message classes but it should be able to skip such ambiguous message classes that look like a service class based on file name.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.