@Test
void testOnHeadersRead_preflightOptionsRequest() {

  CorsConfig corsConfig =
      CorsConfigBuilder.forOrigin("test.domain")
          .allowCredentials()
          .allowedRequestMethods(HttpMethod.GET)
          .build();
  Http2CorsHandler corsHandler = new Http2CorsHandler(corsConfig);
  testHandler = new Http2Handler(mockEncoder, MAX_PAYLOAD, corsHandler);
  headers
      .method("OPTIONS")
      .add("origin", "test.domain")
      .add("access-control-request-method", "GET")
      .path(OK_PATH);
  testHandler.onHeadersRead(mockContext, STREAM_ID, headers, 1, true);
  assertEquals(1L, requestMeter.getCount());
  verifyResponse(
      HttpResponseStatus.OK,
      ImmutableMap.of(
          "access-control-allow-methods",
          "GET",
          "access-control-allow-origin",
          corsConfig.origin(),
          "access-control-allow-credentials",
          "true"),
      Optional.empty(),
      STREAM_ID);
}