Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates macros to avoid deprecation warnings #76

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions rpc/src/main/scala/internal/service/service.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 5 additions & 6 deletions rpc/src/test/scala/client/RpcClientTestSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down