@Test
void testOnHeadersRead_softRateLimited() {

  testHandler = new Http2Handler(mockEncoder, MAX_PAYLOAD, NO_CORS);
  channel.attr(XrpcConstants.XRPC_SOFT_RATE_LIMITED).set(Boolean.TRUE);
  testHandler.onHeadersRead(mockContext, STREAM_ID, headers, 1, false);
  // Verify that a request was counted.
  assertEquals(1L, requestMeter.getCount());
  // Verify a TOO_MANY_REQUESTS response.
  verifyResponse(
      HttpResponseStatus.TOO_MANY_REQUESTS,
      ImmutableMap.of(),
      Optional.of(Unpooled.wrappedBuffer(XrpcConstants.RATE_LIMIT_RESPONSE)),
      STREAM_ID);
}