Skip to content

How to create "fake" client stub? #356

@lhluo

Description

@lhluo

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:

val channel = ManagedChannelBuilder.forAddress("localhost", 8980).usePlaintext().build()
val stub = RouteGuideCoroutineStub(channel)

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions