#pragma once #include "envoy/server/configuration.h" #include "extensions/transport_sockets/tls/context_manager_impl.h" #include "admin.h" #include "drain_manager.h" #include "gmock/gmock.h" #include "instance.h" #include "overload_manager.h" #include "server_lifecycle_notifier.h" #include "transport_socket_factory_context.h" namespace Envoy { namespace Server { namespace Configuration { class MockFactoryContext : public virtual FactoryContext { public: MockFactoryContext(); ~MockFactoryContext() override; MOCK_METHOD(ServerFactoryContext&, getServerFactoryContext, (), (const)); MOCK_METHOD(TransportSocketFactoryContext&, getTransportSocketFactoryContext, (), (const)); MOCK_METHOD(AccessLog::AccessLogManager&, accessLogManager, ()); MOCK_METHOD(Upstream::ClusterManager&, clusterManager, ()); MOCK_METHOD(Event::Dispatcher&, dispatcher, ()); MOCK_METHOD(const Network::DrainDecision&, drainDecision, ()); MOCK_METHOD(bool, healthCheckFailed, ()); MOCK_METHOD(Init::Manager&, initManager, ()); MOCK_METHOD(ServerLifecycleNotifier&, lifecycleNotifier, ()); MOCK_METHOD(Envoy::Runtime::Loader&, runtime, ()); MOCK_METHOD(Stats::Scope&, scope, ()); MOCK_METHOD(Singleton::Manager&, singletonManager, ()); MOCK_METHOD(OverloadManager&, overloadManager, ()); MOCK_METHOD(ThreadLocal::Instance&, threadLocal, ()); MOCK_METHOD(Server::Admin&, admin, ()); MOCK_METHOD(Stats::Scope&, listenerScope, ()); MOCK_METHOD(const LocalInfo::LocalInfo&, localInfo, (), (const)); MOCK_METHOD(const envoy::config::core::v3::Metadata&, listenerMetadata, (), (const)); MOCK_METHOD(envoy::config::core::v3::TrafficDirection, direction, (), (const)); MOCK_METHOD(TimeSource&, timeSource, ()); Event::TestTimeSystem& timeSystem() { return time_system_; } Grpc::Context& grpcContext() override { return grpc_context_; } Http::Context& httpContext() override { return http_context_; } MOCK_METHOD(ProcessContextOptRef, processContext, ()); MOCK_METHOD(ProtobufMessage::ValidationContext&, messageValidationContext, ()); MOCK_METHOD(ProtobufMessage::ValidationVisitor&, messageValidationVisitor, ()); MOCK_METHOD(Api::Api&, api, ()); testing::NiceMock server_factory_context_; testing::NiceMock access_log_manager_; testing::NiceMock cluster_manager_; testing::NiceMock transport_socket_factory_context_; testing::NiceMock dispatcher_; testing::NiceMock drain_manager_; testing::NiceMock init_manager_; testing::NiceMock lifecycle_notifier_; testing::NiceMock local_info_; testing::NiceMock runtime_loader_; testing::NiceMock scope_; testing::NiceMock thread_local_; Singleton::ManagerPtr singleton_manager_; testing::NiceMock admin_; Stats::IsolatedStoreImpl listener_scope_; Event::GlobalTimeSystem time_system_; testing::NiceMock validation_context_; testing::NiceMock overload_manager_; Grpc::ContextImpl grpc_context_; Http::ContextImpl http_context_; testing::NiceMock api_; }; } // namespace Configuration } // namespace Server } // namespace Envoy