TEST_F(ConnectionManagerUtilityTest, PreseverExternalRequestIdNoReqId) {
  connection_.stream_info_.downstream_address_provider_->setRemoteAddress(
      std::make_shared<Network::Address::Ipv4Instance>("134.2.2.11"));
  ON_CALL(config_, useRemoteAddress()).WillByDefault(Return(true));
  ON_CALL(config_, preserveExternalRequestId()).WillByDefault(Return(true));
  TestRequestHeaderMapImpl headers{{"x-forwarded-for", "198.51.100.1"}};
  EXPECT_CALL(*request_id_extension_, set(testing::Ref(headers), false));
  EXPECT_CALL(*request_id_extension_, set(_, true)).Times(0);
  EXPECT_EQ((MutateRequestRet{"134.2.2.11:0", false, Tracing::Reason::NotTraceable}),
            callMutateRequestHeaders(headers, Protocol::Http2));
  EXPECT_EQ(random_.uuid_, headers.get_(Headers::get().RequestId));
}
TEST_F(ConnectionManagerUtilityTest, PreseverExternalRequestIdNoReqId) {
  connection_.stream_info_.downstream_address_provider_->setRemoteAddress(
      std::make_shared<Network::Address::Ipv4Instance>("134.2.2.11"));
  ON_CALL(config_, useRemoteAddress()).WillByDefault(Return(true));
  ON_CALL(config_, preserveExternalRequestId()).WillByDefault(Return(true));
  TestRequestHeaderMapImpl headers{{"x-forwarded-for", "198.51.100.1"}};
  EXPECT_CALL(*request_id_extension_, set(testing::Ref(headers), false));
  EXPECT_CALL(*request_id_extension_, set(_, true)).Times(0);
  EXPECT_EQ((MutateRequestRet{"134.2.2.11:0", false, Tracing::Reason::NotTraceable}),
            callMutateRequestHeaders(headers, Protocol::Http2));
  EXPECT_EQ(random_.uuid_, headers.get_(Headers::get().RequestId));
}