Coverage Report

Created: 2024-09-19 09:45

/proc/self/cwd/test/mocks/server/instance.cc
Line
Count
Source (jump to first uncovered line)
1
#include "test/mocks/server/instance.h"
2
3
#include "source/common/singleton/manager_impl.h"
4
5
#include "gmock/gmock.h"
6
#include "gtest/gtest.h"
7
8
namespace Envoy {
9
namespace Server {
10
11
using ::testing::Return;
12
using ::testing::ReturnRef;
13
14
MockInstance::MockInstance()
15
    : secret_manager_(std::make_unique<Secret::SecretManagerImpl>(admin_.getConfigTracker())),
16
      cluster_manager_(timeSource()), singleton_manager_(new Singleton::ManagerImpl()),
17
      grpc_context_(stats_store_.symbolTable()), http_context_(stats_store_.symbolTable()),
18
      router_context_(stats_store_.symbolTable()), quic_stat_names_(stats_store_.symbolTable()),
19
      stats_config_(std::make_shared<NiceMock<Configuration::MockStatsConfig>>()),
20
      server_factory_context_(
21
          std::make_shared<NiceMock<Configuration::MockServerFactoryContext>>()),
22
      transport_socket_factory_context_(
23
          std::make_shared<NiceMock<Configuration::MockTransportSocketFactoryContext>>()),
24
0
      ssl_context_manager_(*server_factory_context_) {
25
0
  ON_CALL(*this, threadLocal()).WillByDefault(ReturnRef(thread_local_));
26
0
  ON_CALL(*this, stats()).WillByDefault(ReturnRef(stats_store_));
27
0
  ON_CALL(*this, grpcContext()).WillByDefault(ReturnRef(grpc_context_));
28
0
  ON_CALL(*this, httpContext()).WillByDefault(ReturnRef(http_context_));
29
0
  ON_CALL(*this, routerContext()).WillByDefault(ReturnRef(router_context_));
30
0
  ON_CALL(*this, dnsResolver()).WillByDefault(Return(dns_resolver_));
31
0
  ON_CALL(*this, api()).WillByDefault(ReturnRef(api_));
32
0
  ON_CALL(*this, admin()).WillByDefault(Return(OptRef<Server::Admin>{admin_}));
33
0
  ON_CALL(*this, clusterManager()).WillByDefault(ReturnRef(cluster_manager_));
34
0
  ON_CALL(*this, httpServerPropertiesCacheManager())
35
0
      .WillByDefault(ReturnRef(http_server_properties_cache_manager_));
36
0
  ON_CALL(*this, sslContextManager()).WillByDefault(ReturnRef(ssl_context_manager_));
37
0
  ON_CALL(*this, accessLogManager()).WillByDefault(ReturnRef(access_log_manager_));
38
0
  ON_CALL(*this, runtime()).WillByDefault(ReturnRef(runtime_loader_));
39
0
  ON_CALL(*this, dispatcher()).WillByDefault(ReturnRef(dispatcher_));
40
0
  ON_CALL(*this, hotRestart()).WillByDefault(ReturnRef(hot_restart_));
41
0
  ON_CALL(*this, lifecycleNotifier()).WillByDefault(ReturnRef(lifecycle_notifier_));
42
0
  ON_CALL(*this, localInfo()).WillByDefault(ReturnRef(local_info_));
43
0
  ON_CALL(*this, options()).WillByDefault(ReturnRef(options_));
44
0
  ON_CALL(*this, drainManager()).WillByDefault(ReturnRef(drain_manager_));
45
0
  ON_CALL(*this, initManager()).WillByDefault(ReturnRef(init_manager_));
46
0
  ON_CALL(*this, listenerManager()).WillByDefault(ReturnRef(listener_manager_));
47
0
  ON_CALL(*this, mutexTracer()).WillByDefault(Return(nullptr));
48
0
  ON_CALL(*this, singletonManager()).WillByDefault(ReturnRef(*singleton_manager_));
49
0
  ON_CALL(*this, overloadManager()).WillByDefault(ReturnRef(overload_manager_));
50
0
  ON_CALL(*this, nullOverloadManager()).WillByDefault(ReturnRef(null_overload_manager_));
51
0
  ON_CALL(*this, messageValidationContext()).WillByDefault(ReturnRef(validation_context_));
52
0
  ON_CALL(*this, statsConfig()).WillByDefault(ReturnRef(*stats_config_));
53
0
  ON_CALL(*this, regexEngine()).WillByDefault(ReturnRef(regex_engine_));
54
0
  ON_CALL(*this, serverFactoryContext()).WillByDefault(ReturnRef(*server_factory_context_));
55
0
  ON_CALL(*this, transportSocketFactoryContext())
56
0
      .WillByDefault(ReturnRef(*transport_socket_factory_context_));
57
0
  ON_CALL(*this, enableReusePortDefault()).WillByDefault(Return(true));
58
0
}
59
60
0
MockInstance::~MockInstance() = default;
61
62
} // namespace Server
63
} // namespace Envoy