TEST_P(ProtocolIntegrationTest, LargeRequestMethod) {
  // There will be no upstream connections for HTTP/1 downstream, we need to
  // test the full mesh regardless.
  testing_upstream_intentionally_ = true;
  const std::string long_method = std::string(48 * 1024, 'a');
  const Http::TestRequestHeaderMapImpl request_headers{{":method", long_method},
                                                       {":path", "/test/long/url"},
                                                       {":scheme", "http"},
                                                       {":authority", "host"}};

  initialize();
  codec_client_ = makeHttpConnection(lookupPort("http"));

  if (downstreamProtocol() == Http::CodecClient::Type::HTTP1) {
    auto encoder_decoder = codec_client_->startRequest(request_headers);
    request_encoder_ = &encoder_decoder.first;
    auto response = std::move(encoder_decoder.second);
    ASSERT_TRUE(codec_client_->waitForDisconnect());
    EXPECT_TRUE(response->complete());
    EXPECT_EQ("400", response->headers().getStatusValue());
  } else {
    ASSERT(downstreamProtocol() >= Http::CodecClient::Type::HTTP2);
    if (upstreamProtocol() == FakeHttpConnection::Type::HTTP1) {
      auto response = codec_client_->makeHeaderOnlyRequest(request_headers);
      ASSERT_TRUE(
          fake_upstreams_[0]->waitForHttpConnection(*dispatcher_, fake_upstream_connection_));
      ASSERT_TRUE(response->waitForEndStream());
      EXPECT_TRUE(response->complete());
      EXPECT_EQ("400", response->headers().getStatusValue());
    } else {
      ASSERT(upstreamProtocol() >= FakeHttpConnection::Type::HTTP2);
      auto response =
          sendRequestAndWaitForResponse(request_headers, 0, default_response_headers_, 0);
      EXPECT_TRUE(response->complete());
    }
  }
}
TEST_P(ProtocolIntegrationTest, LargeRequestMethod) {
   
   
  testing_upstream_intentionally_ = true;
  const std::string long_method = std::string(48 * 1024, 'a');
  const Http::TestRequestHeaderMapImpl request_headers{{":method", long_method},
                                                       {":path", "/test/long/url"},
                                                       {":scheme", "http"},
                                                       {":authority", "host"}};

  initialize();
  codec_client_ = makeHttpConnection(lookupPort("http"));

  if (downstreamProtocol() == Http::CodecClient::Type::HTTP1) {
    auto encoder_decoder = codec_client_->startRequest(request_headers);
    request_encoder_ = &encoder_decoder.first;
    auto response = std::move(encoder_decoder.second);
    ASSERT_TRUE(codec_client_->waitForDisconnect());
    EXPECT_TRUE(response->complete());
    EXPECT_EQ("400", response->headers().getStatusValue());
  } else {
    ASSERT(downstreamProtocol() >= Http::CodecClient::Type::HTTP2);
    if (upstreamProtocol() == FakeHttpConnection::Type::HTTP1) {
      auto response = codec_client_->makeHeaderOnlyRequest(request_headers);
      ASSERT_TRUE(
          fake_upstreams_[0]->waitForHttpConnection(*dispatcher_, fake_upstream_connection_));
      ASSERT_TRUE(response->waitForEndStream());
      EXPECT_TRUE(response->complete());
      EXPECT_EQ("400", response->headers().getStatusValue());
    } else {
      ASSERT(upstreamProtocol() >= FakeHttpConnection::Type::HTTP2);
      auto response =
          sendRequestAndWaitForResponse(request_headers, 0, default_response_headers_, 0);
      EXPECT_TRUE(response->complete());
    }
  }
}