TEST_F(HttpHealthCheckerImplTest, NoTransportSocketMatchCriteria) {
  const std::string host = "fake_cluster";
  const std::string path = "/healthcheck";
  const std::string yaml = R"EOF(
    timeout: 1s
    interval: 1s
    no_traffic_interval: 1s
    interval_jitter_percent: 40
    unhealthy_threshold: 2
    healthy_threshold: 2
    http_health_check:
      service_name_matcher:
        prefix: locations
      path: /healthcheck
    )EOF";

  auto default_socket_factory = std::make_unique<Network::MockTransportSocketFactory>();
  // The default_socket_factory should be used to create a transport socket for the health check
  // connection.
  EXPECT_CALL(*default_socket_factory, createTransportSocket(_));
  EXPECT_CALL(*default_socket_factory, implementsSecureTransport()).WillRepeatedly(Return(true));
  auto transport_socket_match =
      std::make_unique<Upstream::MockTransportSocketMatcher>(std::move(default_socket_factory));
  // We expect resolve() to be called exactly once for endpoint socket matching. We should not
  // attempt to match again for health checks since there is not match criteria in the config.
  EXPECT_CALL(*transport_socket_match, resolve(nullptr));

  cluster_->info_->transport_socket_matcher_ = std::move(transport_socket_match);

  allocHealthChecker(yaml);

  cluster_->prioritySet().getMockHostSet(0)->hosts_ = {
      makeTestHost(cluster_->info_, "tcp://127.0.0.1:80", simTime())};
  cluster_->info_->stats().upstream_cx_total_.inc();
  expectSessionCreate();
  expectStreamCreate(0);
  EXPECT_CALL(*test_sessions_[0]->timeout_timer_, enableTimer(_, _));
  health_checker_->start();
}
TEST_F(HttpHealthCheckerImplTest, NoTransportSocketMatchCriteria) {
  const std::string host = "fake_cluster";
  const std::string path = "/healthcheck";
  const std::string yaml = R"EOF(
    timeout: 1s
    interval: 1s
    no_traffic_interval: 1s
    interval_jitter_percent: 40
    unhealthy_threshold: 2
    healthy_threshold: 2
    http_health_check:
      service_name_matcher:
        prefix: locations
      path: /healthcheck
    )EOF";

  auto default_socket_factory = std::make_unique<Network::MockTransportSocketFactory>();
   
   
  EXPECT_CALL(*default_socket_factory, createTransportSocket(_));
  EXPECT_CALL(*default_socket_factory, implementsSecureTransport()).WillRepeatedly(Return(true));
  auto transport_socket_match =
      std::make_unique<Upstream::MockTransportSocketMatcher>(std::move(default_socket_factory));
   
   
  EXPECT_CALL(*transport_socket_match, resolve(nullptr));

  cluster_->info_->transport_socket_matcher_ = std::move(transport_socket_match);

  allocHealthChecker(yaml);

  cluster_->prioritySet().getMockHostSet(0)->hosts_ = {
      makeTestHost(cluster_->info_, "tcp://127.0.0.1:80", simTime())};
  cluster_->info_->stats().upstream_cx_total_.inc();
  expectSessionCreate();
  expectStreamCreate(0);
  EXPECT_CALL(*test_sessions_[0]->timeout_timer_, enableTimer(_, _));
  health_checker_->start();
}