Skip to content

Commit

Permalink
our vertx grpc raises statusruntimeexceptions not grpcexceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Berman committed Dec 11, 2024
1 parent 8da3679 commit 0efe5a3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
4 changes: 4 additions & 0 deletions vertx-grpc/vertx-grpc-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ dependencies {
protocPlugin project(path: ':vertx-grpc:vertx-grpc-protoc-plugin2', configuration: 'shadow')
}

test {
dependsOn "generateProto"
}

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.5"
Expand Down
4 changes: 4 additions & 0 deletions vertx-grpc/vertx-grpc-it/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ dependencies {
}


test {
dependsOn "generateProto"
}

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
package io.vertx.grpc.it;

import com.google.protobuf.ByteString;
import io.grpc.Status;
import io.grpc.StatusRuntimeException;
import io.grpc.examples.helloworld.HelloReply;
import io.grpc.examples.helloworld.HelloRequest;
import io.grpc.examples.helloworld.VertxGreeterGrpcClient;
Expand Down Expand Up @@ -397,9 +399,9 @@ public ReadStream<Messages.StreamingOutputCallResponse> streamingOutputCall(Mess
.build();
client.streamingOutputCall(request)
.onComplete(should.asyncAssertFailure(err -> {
should.assertTrue(err instanceof GrpcException);
GrpcException grpcException = (GrpcException)err;
should.assertEquals(GrpcStatus.INTERNAL, grpcException.status());
should.assertTrue(err instanceof StatusRuntimeException);
var grpcException = (StatusRuntimeException)err;
should.assertEquals(Status.INTERNAL.getCode(), grpcException.getStatus().getCode());
test.complete();
}));
test.awaitSuccess();
Expand Down Expand Up @@ -532,9 +534,9 @@ public ReadStream<Messages.StreamingOutputCallResponse> fullDuplexCall(ReadStrea
req.end();
})
.onComplete(should.asyncAssertFailure(err -> {
should.assertTrue(err instanceof GrpcException);
GrpcException grpcException = (GrpcException)err;
should.assertEquals(GrpcStatus.INTERNAL, grpcException.status());
should.assertTrue(err instanceof StatusRuntimeException);
var grpcException = (StatusRuntimeException)err;
should.assertEquals(io.grpc.Status.INTERNAL.getCode(), grpcException.getStatus().getCode());
test.complete();
}));
test.awaitSuccess();
Expand Down
4 changes: 4 additions & 0 deletions vertx-grpc/vertx-grpc-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ dependencies {

}

test {
dependsOn "generateProto"
}

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.5"
Expand Down

0 comments on commit 0efe5a3

Please sign in to comment.