Closed 0xbeefbeef closed 3 years ago
gRPC Java and Kotlin do not have mock Stub, that's something only exists in C++. The recommended way for testing gRPC-Java/Kotlin is to use the Inprocess transport. It is using much of the "real" code and its behavior closely matches a real transport. You can see its usage in gRPC's example.
Okay, thank you for your help. I will have a look at that.
I am using the following plugins in my build.gradle:
gRPC and protobuf generation works as expected, however, I would like to auto-generate mocking code as explained in grpc unit testing. I tried to add the
option 'generate_mock_code=true'
in thetask.plugins {
sections, both ingrpc
andgrpckt
. However, that doesn't seem to work. Can anyone give me a hint how to trigger the grpc mock autogeneration from the protobuf-gradle-plugin? Any help is very much appreciated!