Fadelis / grpcmock

A gRPC Java testing tool to easily mock endpoints of gRPC services for IT or Unit testing
http://grpcmock.org
Apache License 2.0
144 stars 13 forks source link

How to make GrpcMock work for Armeria defined clients #13

Closed sachinstar2010 closed 1 year ago

sachinstar2010 commented 2 years ago

I am using Armeria https://armeria.dev/docs/client-grpc and creating a Grpc Client like this

val client = Clients .builder(url) .decorator(LoggingClient.newDecorator()) .build(DownstreamServiceGrpc.DownstreamServiceBlockingStub::class.java)

And then making a call with,

client.someGrpcMethod()

I am running integration test with SpringBootTest and I am not able to stub the downstream call.

Also the url looks like, in application.yml, as:

url: gproto+https://localhost:${grpcmock.server.port:443}

I have tried adding the grpcmock.server.port this way, but it doesn't seem to take effect. Any way around this?

Fadelis commented 2 years ago

Hi @sachinstar2010 I haven't used Armeria personally, so it's hard to tell what wrong based on the info you've provided. If you could provide your full test setup or a sample project to reproduce it I could look into it.