write tests for RpcCodec encode