Closed dwhu closed 3 years ago
My preference would be to just setup an actual mock backend (which is rather simple to achieve using server part of the grpc package) instead of mocking the service class itself.
@mraleph would you mind elaborating on that a bit? So you mean to actually setup a server that you then run and that responds to the requests?
@enyo yep, exactly. if you want to test client logic then setup a mock server (with test mock services) that responds to requests from the client you want to test.
Advice on Testing gRPC Clients
grpc: ^3.0.0
Repro steps
Expected result: I would expect this test to work since I'm mocking out ResponseFuture
Actual result:
I continue to run into issues mocking or faking out ResponseFuture because it doesn't conform to the Future interface.
or even
Questions
If there is a recommended approach, I'm happy to contribute some docs on best practices here.
Appreciate the help & keep up the great work!