void HttpConnectionManagerImplTest::testPathNormalization(
    const RequestHeaderMap& request_headers, const ResponseHeaderMap& expected_response) {
  InSequence s;
  setup(false, "");

  EXPECT_CALL(*codec_, dispatch(_)).WillOnce(Invoke([&](Buffer::Instance& data) -> Http::Status {
    decoder_ = &conn_manager_->newStream(response_encoder_);
    RequestHeaderMapPtr headers{std::make_unique<TestRequestHeaderMapImpl>(request_headers)};
    decoder_->decodeHeaders(std::move(headers), true);
    data.drain(4);
    return Http::okStatus();
  }));

  EXPECT_CALL(response_encoder_, encodeHeaders(_, true))
      .WillOnce(Invoke([&](const ResponseHeaderMap& headers, bool) -> void {
        TestResponseHeaderMapImpl copy{headers};
        copy.remove(Envoy::Http::LowerCaseString{"date"});
        copy.remove(Envoy::Http::LowerCaseString{"server"});
        EXPECT_THAT(&copy, HeaderMapEqualIgnoreOrder(&expected_response));
      }));

  Buffer::OwnedImpl fake_input("1234");
  conn_manager_->onData(fake_input, false);
}
void HttpConnectionManagerImplTest::testPathNormalization(
    const RequestHeaderMap& request_headers, const ResponseHeaderMap& expected_response) {
  InSequence s;
  setup(false, "");

  EXPECT_CALL(*codec_, dispatch(_)).WillOnce(Invoke([&](Buffer::Instance& data) -> Http::Status {
    decoder_ = &conn_manager_->newStream(response_encoder_);
    RequestHeaderMapPtr headers{std::make_unique<TestRequestHeaderMapImpl>(request_headers)};
    decoder_->decodeHeaders(std::move(headers), true);
    data.drain(4);
    return Http::okStatus();
  }));

  EXPECT_CALL(response_encoder_, encodeHeaders(_, true))
      .WillOnce(Invoke([&](const ResponseHeaderMap& headers, bool) -> void {
        TestResponseHeaderMapImpl copy{headers};
        copy.remove(Envoy::Http::LowerCaseString{"date"});
        copy.remove(Envoy::Http::LowerCaseString{"server"});
        EXPECT_THAT(&copy, HeaderMapEqualIgnoreOrder(&expected_response));
      }));

  Buffer::OwnedImpl fake_input("1234");
  conn_manager_->onData(fake_input, false);
}