SudokuService.newReflectiveService(mockImpl));
RpcChannel channel = new RpcChannel(mockChannel);
channel.setServiceMap(services);
SudokuRequest sudokuRequest = SudokuRequest.newBuilder().setCheckerboard("001010").build();
RpcMessage request = RpcMessage.newBuilder()
.setType(MessageType.REQUEST)
.setId(2)
.setService(SudokuService.getDescriptor().getFullName())
.setMethod("Solve")
.setRequest(sudokuRequest.toByteString())
.build();
channel.messageReceived(null, new UpstreamMessageEvent(mockChannel, request, null));
assertEquals(sudokuRequest, gotRequest);
RpcMessage response = RpcMessage.newBuilder()
.setType(MessageType.RESPONSE)
.setId(2)
.setResponse(sudokuResponse.toByteString())
.build();
assertEquals(response, mockChannel.message);