@Test
void testOnDataRead_dataAggregated() {

  testHandler = new Http2Handler(mockEncoder, MAX_PAYLOAD, NO_CORS);
  // Create a fake request to aggregate data into.
  XrpcRequest fakeRequest = new XrpcRequest((Http2Headers) null, null, null, channel);
  testHandler.requests.put(STREAM_ID, fakeRequest);
  // Append several data frames.
  testHandler.onDataRead(
      mockContext, STREAM_ID, Unpooled.wrappedBuffer(new byte[] {1}), 0, false);
  testHandler.onDataRead(
      mockContext, STREAM_ID, Unpooled.wrappedBuffer(new byte[] {2}), 0, false);
  testHandler.onDataRead(
      mockContext, STREAM_ID, Unpooled.wrappedBuffer(new byte[] {3}), 0, false);
  // Assert that the request has all the data needed.
  assertEquals(Unpooled.wrappedBuffer(new byte[] {1, 2, 3}), fakeRequest.body());
}