Coverage Report

Created: 2023-11-12 09:30

/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()), ssl_context_manager_(timeSource()),
17
      singleton_manager_(new Singleton::ManagerImpl(Thread::threadFactoryForTest())),
18
      grpc_context_(stats_store_.symbolTable()), http_context_(stats_store_.symbolTable()),
19
      router_context_(stats_store_.symbolTable()), quic_stat_names_(stats_store_.symbolTable()),
20
      stats_config_(std::make_shared<NiceMock<Configuration::MockStatsConfig>>()),
21
      server_factory_context_(
22
          std::make_shared<NiceMock<Configuration::MockServerFactoryContext>>()),
23
      transport_socket_factory_context_(
24
0
          std::make_shared<NiceMock<Configuration::MockTransportSocketFactoryContext>>()) {
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, sslContextManager()).WillByDefault(ReturnRef(ssl_context_manager_));
35
0
  ON_CALL(*this, accessLogManager()).WillByDefault(ReturnRef(access_log_manager_));
36
0
  ON_CALL(*this, runtime()).WillByDefault(ReturnRef(runtime_loader_));
37
0
  ON_CALL(*this, dispatcher()).WillByDefault(ReturnRef(dispatcher_));
38
0
  ON_CALL(*this, hotRestart()).WillByDefault(ReturnRef(hot_restart_));
39
0
  ON_CALL(*this, lifecycleNotifier()).WillByDefault(ReturnRef(lifecycle_notifier_));
40
0
  ON_CALL(*this, localInfo()).WillByDefault(ReturnRef(local_info_));
41
0
  ON_CALL(*this, options()).WillByDefault(ReturnRef(options_));
42
0
  ON_CALL(*this, drainManager()).WillByDefault(ReturnRef(drain_manager_));
43
0
  ON_CALL(*this, initManager()).WillByDefault(ReturnRef(init_manager_));
44
0
  ON_CALL(*this, listenerManager()).WillByDefault(ReturnRef(listener_manager_));
45
0
  ON_CALL(*this, mutexTracer()).WillByDefault(Return(nullptr));
46
0
  ON_CALL(*this, singletonManager()).WillByDefault(ReturnRef(*singleton_manager_));
47
0
  ON_CALL(*this, overloadManager()).WillByDefault(ReturnRef(overload_manager_));
48
0
  ON_CALL(*this, messageValidationContext()).WillByDefault(ReturnRef(validation_context_));
49
0
  ON_CALL(*this, statsConfig()).WillByDefault(ReturnRef(*stats_config_));
50
0
  ON_CALL(*this, serverFactoryContext()).WillByDefault(ReturnRef(*server_factory_context_));
51
0
  ON_CALL(*this, transportSocketFactoryContext())
52
0
      .WillByDefault(ReturnRef(*transport_socket_factory_context_));
53
0
  ON_CALL(*this, enableReusePortDefault()).WillByDefault(Return(true));
54
0
}
55
56
0
MockInstance::~MockInstance() = default;
57
58
} // namespace Server
59
} // namespace Envoy