grpc extension is not working
Opened this issue · 0 comments
SButterfly commented
Proposal
I wanted to use wiremock grpc for my project, but it wasn't working.
proto contained of multiple files:
myservice.proto
syntax = "proto3";
package wallet.myservice;
import "wallet/errors.proto";
service MyService {
rpc QueryEvents(QueryEventsRequest) returns (QueryEventsResponse) {}
}
message LogTruncated {}
message Error {
oneof error {
errors.OtherError other_error = 1;
LogTruncated log_truncated = 2;
}
}
message QueryEventsRequest {
uint64 from = 1;
uint64 to = 2;
}
message QueryEventsResponse {
Error error = 1;
uint64 from = 2;
uint64 to = 3;
repeated Event event = 4;
}
message Event {
EventPayload payload = 2;
}
message EventPayload {
}
errors.proto
syntax = "proto3";
package wallet.errors;
message OtherError {
string reason = 1;
}
mappings.json
{
"request": {
"method": "POST",
"urlPath": "/wallet.myservice.MyService/QueryEvents"
},
"response": {
"status": 200,
"body": "{\"from\": 0, \"to\": 0}",
"transformers": ["response-template"],
"headers" : {
"grpc-status-name" : "OK"
}
}
}
And run command
protoc \
--descriptor_set_out wiremock-data/grpc/services.dsc \
--proto_path proto_files \
proto_files/wallet/myservice.proto
docker run -it --rm \
-p 8080:8080 \
--name wiremock \
-v $PWD/wiremock-data:/home/wiremock \
-v $PWD/extensions:/var/wiremock/extensions \
wiremock/wiremock:3.9.1
Reproduction steps
I have created a sample project to reproduce the problem:
https://github.com/SButterfly/grpc-wiremock-bug
References
No response