private FakeCallback callAsync(SocketRpcChannel rpcChannel,
Request request, ErrorReason reason) {
SocketRpcController controller = rpcChannel.newRpcController();
TestService service = TestService.newStub(rpcChannel);
FakeCallback callback = new FakeCallback();
service.testMethod(controller, request, callback);
if (reason != null) {
assertTrue(controller.failed());
assertEquals(reason, controller.errorReason());
assertTrue(callback.invoked);
assertNull(callback.response);