diff --git a/test/common/quic/client_connection_factory_impl_test.cc b/test/common/quic/client_connection_factory_impl_test.cc index c919aa9165b0d..87e6111cc870e 100644 --- a/test/common/quic/client_connection_factory_impl_test.cc +++ b/test/common/quic/client_connection_factory_impl_test.cc @@ -10,11 +10,23 @@ #include "test/mocks/upstream/host.h" #include "test/test_common/simulated_time_system.h" +using testing::Return; + namespace Envoy { namespace Quic { class QuicNetworkConnectionTest : public Event::TestUsingSimulatedTime, public testing::Test { protected: + void initialize() { + Ssl::ClientContextSharedPtr context{new Ssl::MockClientContext()}; + EXPECT_CALL(context_.context_manager_, createSslClientContext(_, _, _)) + .WillOnce(Return(context)); + factory_ = std::make_unique( + std::unique_ptr( + new NiceMock), + context_); + } + NiceMock dispatcher_; std::shared_ptr cluster_{new NiceMock()}; Upstream::HostSharedPtr host_{new NiceMock}; @@ -23,13 +35,13 @@ class QuicNetworkConnectionTest : public Event::TestUsingSimulatedTime, public t Network::Address::InstanceConstSharedPtr test_address_ = Network::Utility::resolveUrl("tcp://127.0.0.1:3000"); NiceMock context_; - Quic::QuicClientTransportSocketFactory factory_{ - std::unique_ptr(new NiceMock), - context_}; + std::unique_ptr factory_; }; TEST_F(QuicNetworkConnectionTest, BufferLimits) { - PersistentQuicInfoImpl info{dispatcher_, factory_, simTime(), test_address_}; + initialize(); + + PersistentQuicInfoImpl info{dispatcher_, *factory_, simTime(), test_address_}; std::unique_ptr client_connection = createQuicNetworkConnection(info, dispatcher_, test_address_, test_address_);