eclipse-vertx / vertx-grpc

Development of the gRPC component for Eclipse Vert.x
Eclipse Public License 2.0
42 stars 23 forks source link

Fixed IndexOutOfBoundsException in GrpcMethodCall.serviceName() #57

Closed SG-O closed 1 year ago

SG-O commented 1 year ago

This should fix the issue https://github.com/eclipse-vertx/vertx-grpc/issues/56

vietj commented 1 year ago

can you add a test @SG-O ?

SG-O commented 1 year ago

I added test for the whole GrpcMethodCall class.

Implementing these revealed that the output of the fullyQualifiedName() method in ServiceNameImpl wasn't formatted well for service names without dots. I fixed this corner case so it now outputs "MyService" instead of ".MyService".

SG-O commented 1 year ago

I found another two minor bugs.

In the implementation of GrpcMethodCall.methodName() the name would have a leading slash (e.g. /Method1) which is not compatible with ServiceName.pathOf(String method). I changed the output to not include this slash.

The ServiceName.packageName() and .pathOf() methods did not handle fully qualified names without a package name correctly. I fixed this and added a lot more tests for the whole ServiceName class.

Both GrpcMethodCall and ServiceName now have full coverage from their respective tests.

This should be ready to merge.

vietj commented 1 year ago

can you resolved the conflict due to merging https://github.com/eclipse-vertx/vertx-grpc/pull/59 ? @SG-O

SG-O commented 1 year ago

On it

vietj commented 1 year ago

can you provide a backport to 4.x branch @SG-O ?