@Test
  public void testCompressCellBlock() throws IOException, ServiceException {
    Configuration clientConf = new Configuration(CONF);
    clientConf.set("hbase.client.rpc.compressor", GzipCodec.class.getCanonicalName());
    List<ExtendedCell> cells = new ArrayList<>();
    int count = 3;
    for (int i = 0; i < count; i++) {
      cells.add(CELL);
    }
    RpcServer rpcServer = createRpcServer("testRpcServer",
      Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(SERVICE, null)),
      new InetSocketAddress("localhost", 0), CONF, new FifoRpcScheduler(CONF, 1));

    try (AbstractRpcClient<?> client = createRpcClient(clientConf)) {
      rpcServer.start();
      BlockingInterface stub = newBlockingStub(client, rpcServer.getListenerAddress());
      HBaseRpcController pcrc =
        new HBaseRpcControllerImpl(PrivateCellUtil.createExtendedCellScanner(cells));
      String message = "hello";
      assertEquals(message,
        stub.echo(pcrc, EchoRequestProto.newBuilder().setMessage(message).build()).getMessage());
      int index = 0;
      CellScanner cellScanner = pcrc.cellScanner();
      assertNotNull(cellScanner);
      while (cellScanner.advance()) {
        assertEquals(CELL, cellScanner.current());
        index++;
      }
      assertEquals(count, index);
    } finally {
      rpcServer.stop();
    }
  }
It is hard to verify the compression is actually happening under the wraps. Hope that if
unsupported, we'll get an exception out of some time (meantime, have to trace it manually to
confirm that compression is happening down in the client and server).
hbase-server/src/test/java/org/apache/hadoop/hbase/ipc/AbstractTestIPC.java