@Test
  @Ignore
  public void testSendAndReceive() throws Exception {
    EmbeddedChannelPool channelPool = new EmbeddedChannelPool();
    InetSocketAddress address = new InetSocketAddress("localhost", 2021);
    Http2BlockingChannel blockingChannel = new Http2BlockingChannel(channelPool, address, createHttp2ClientConfig());

    int sendSize = 1234;
    byte[] byteArray = new byte[sendSize];
    new Random().nextBytes(byteArray);
    ByteBuf content = PooledByteBufAllocator.DEFAULT.heapBuffer(sendSize).writeBytes(byteArray);
    MockSend send = new MockSend(content);
    ScheduledFuture<ChannelOutput> future =
        service.schedule(() -> blockingChannel.sendAndReceive(send), 0, TimeUnit.MILLISECONDS);

    EmbeddedChannel channel = channelPool.getCurrentChannel();
    int responseSize = 100;
    byteArray = new byte[responseSize];
    new Random().nextBytes(byteArray);
    ByteBuf response =
        PooledByteBufAllocator.DEFAULT.heapBuffer(responseSize + 8).writeLong(responseSize + 8).writeBytes(byteArray);
    channel.writeInbound(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, response));

    ChannelOutput output = future.get();
    int streamSize = (int) output.getStreamSize();
    Assert.assertEquals(responseSize, streamSize);
    byte[] obtainedResponse = new byte[streamSize];
    output.getInputStream().read(obtainedResponse);
    Assert.assertArrayEquals(byteArray, obtainedResponse);

    // Make sure the channel is released
    Assert.assertNull(channelPool.getCurrentChannelNow());
    content.release();
    response.release();
  }
Test for the basic functions for Http2BlockingChannel, sendAndReceive
@throws Exception
ambry-network/src/test/java/com/github/ambry/network/http2/Http2BlockingChannelTest.java