From 0bd73e3f9f6b418e44943dc969e39c88619c43c6 Mon Sep 17 00:00:00 2001 From: danzh Date: Wed, 6 Mar 2024 19:10:11 -0500 Subject: [PATCH] mobile: fix quic_test_server_test (#32755) Commit Message: the test failed after #32260 because the test server uses a mocked MockTransportSocketFactoryContext which doesn't return a real ContextManager object in sslContextManager(). The mocked object returns nullptr in createSslServerContext(), thus fail to initialize the new member ssl_ctx_ in QuicServerTransportSocketFactory. Additional Description: bazel test //test/java/io/envoyproxy/envoymobile/engine/testing:quic_test_server_test passes in this PR Risk Level: low, test only Testing: existing tests pass Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Dan Zhang --- mobile/test/common/integration/test_server.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mobile/test/common/integration/test_server.cc b/mobile/test/common/integration/test_server.cc index 9e43cc605fcd..5c478560fa55 100644 --- a/mobile/test/common/integration/test_server.cc +++ b/mobile/test/common/integration/test_server.cc @@ -78,6 +78,8 @@ TestServer::TestServer() ON_CALL(factory_context_.server_context_, api()).WillByDefault(testing::ReturnRef(*api_)); ON_CALL(factory_context_, statsScope()) .WillByDefault(testing::ReturnRef(*stats_store_.rootScope())); + ON_CALL(factory_context_, sslContextManager()) + .WillByDefault(testing::ReturnRef(context_manager_)); } void TestServer::startTestServer(TestServerType test_server_type) {