Replies: 4 comments
-
Hi! In future, please only post your question to one place. The recommended practice for testing is to use a fake in-process server, for which you can use the same API as Java. To instantiate a new stub, use the constructor; you can see an example here. |
Beta Was this translation helpful? Give feedback.
-
@lowasser thanks, can you provide an example of how to use the java api to create an instance of |
Beta Was this translation helpful? Give feedback.
-
You don't use the Java API to create an instance of
|
Beta Was this translation helpful? Give feedback.
-
The example test might also be helpful: https://github.com/grpc/grpc-kotlin/blob/master/examples/server/src/test/kotlin/io/grpc/examples/routeguide/RouteGuideServerTest.kt |
Beta Was this translation helpful? Give feedback.
-
Hi team, new to grpc-kotlin so would appreciate any help!
I'm going through the gRPC kotlin tutorial here. It seems easy to create a client stub and call it like follows:
However, I can't figure out how to create a "fake" stub for testing / running locally. Is there a way to create a fake
RouteGuideCoroutineStub
object? Or a way of binding this stub to call a fake in-process server?I see in the non-kt offering of grpc that there exists a function
RouteGuideCoroutine.newFutureStub
that would let us instantiate a new stub. Does something like this exist for grpc Kt?fyi (also posted this question to stack overflow)
Beta Was this translation helpful? Give feedback.
All reactions