diff --git a/rpc/src/main/scala/internal/service/service.scala b/rpc/src/main/scala/internal/service/service.scala index 818c5a3dc..7b4df2c04 100644 --- a/rpc/src/main/scala/internal/service/service.scala +++ b/rpc/src/main/scala/internal/service/service.scala @@ -148,13 +148,16 @@ private[internal] case class RPCRequest( def methodDescriptor = q""" - val ${Pat.Var.Term(descriptorName)}: _root_.io.grpc.MethodDescriptor[$requestType, $responseType] = - _root_.io.grpc.MethodDescriptor.create( - ${utils.methodType(streamingType)}, - _root_.io.grpc.MethodDescriptor.generateFullMethodName(${Lit.String(algName.value)}, ${Lit - .String(name.value)}), - implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[$requestType]], - implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[$responseType]]) + val ${Pat.Var.Term(descriptorName)}: _root_.io.grpc.MethodDescriptor[$requestType, $responseType] = + _root_.io.grpc.MethodDescriptor + .newBuilder( + implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[$requestType]], + implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[$responseType]]) + .setType(${utils.methodType(streamingType)}) + .setFullMethodName( + _root_.io.grpc.MethodDescriptor.generateFullMethodName(${Lit.String(algName.value)}, ${Lit + .String(name.value)})) + .build() """ val clientDef: Defn.Def = streamingType match { diff --git a/rpc/src/test/scala/client/RpcClientTestSuite.scala b/rpc/src/test/scala/client/RpcClientTestSuite.scala index 851e1daeb..2a779414e 100644 --- a/rpc/src/test/scala/client/RpcClientTestSuite.scala +++ b/rpc/src/test/scala/client/RpcClientTestSuite.scala @@ -33,12 +33,11 @@ trait RpcClientTestSuite extends RpcBaseTestSuite { val managedChannelMock: ManagedChannel = mock[ManagedChannel] val clientCallMock: C = stub[C] - val methodDescriptor: M = MethodDescriptor.create( - MethodDescriptor.MethodType.UNARY, - MethodDescriptor.generateFullMethodName("foo.Bar", "Bar"), - new StringMarshaller(), - new StringMarshaller() - ) + val methodDescriptor: M = MethodDescriptor + .newBuilder(new StringMarshaller(), new StringMarshaller()) + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName(MethodDescriptor.generateFullMethodName("foo.Bar", "Bar")) + .build() val host: String = "localhost" val port: Int = 8696