From a40c2cf646f7eac59b11d0661a174bbb7a51672d Mon Sep 17 00:00:00 2001 From: Alan Frindell Date: Thu, 14 Sep 2023 10:47:37 -0700 Subject: [PATCH] Only one mockCodec in MockHTTPTransaction Summary: This was confusing Reviewed By: hanidamlaj Differential Revision: D49213450 fbshipit-source-id: f324b0ed7029c64b0b6afc7d5eaa1b24461a169b --- proxygen/lib/http/session/test/HTTPTransactionMocks.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/proxygen/lib/http/session/test/HTTPTransactionMocks.h b/proxygen/lib/http/session/test/HTTPTransactionMocks.h index 7052e312f7..d17921ced1 100644 --- a/proxygen/lib/http/session/test/HTTPTransactionMocks.h +++ b/proxygen/lib/http/session/test/HTTPTransactionMocks.h @@ -293,7 +293,7 @@ class MockHTTPTransaction : public HTTPTransaction { EXPECT_CALL(mockTransport_, getPeerAddressNonConst()) .WillRepeatedly(testing::ReturnRef(defaultAddress_)); EXPECT_CALL(mockTransport_, getCodecNonConst()) - .WillRepeatedly(testing::ReturnRef(mockCodec_)); + .WillRepeatedly(testing::ReturnRef(mockTransport_.mockCodec_)); EXPECT_CALL(mockTransport_, getSetupTransportInfoNonConst()) .WillRepeatedly(testing::ReturnRef(setupTransportInfo_)); EXPECT_CALL(mockTransport_, getUnderlyingTransportNonConst()) @@ -410,19 +410,18 @@ class MockHTTPTransaction : public HTTPTransaction { MOCK_METHOD(void, updateAndSendPriority, (HTTPPriority)); MOCK_METHOD((bool), addBufferMeta, (), (noexcept)); void enablePush() { - EXPECT_CALL(mockCodec_, supportsPushTransactions()) + EXPECT_CALL(mockTransport_.mockCodec_, supportsPushTransactions()) .WillRepeatedly(testing::Return(true)); } void setupCodec(CodecProtocol protocol) { - EXPECT_CALL(mockCodec_, getProtocol()) + EXPECT_CALL(mockTransport_.mockCodec_, getProtocol()) .WillRepeatedly(testing::Return(protocol)); } testing::NiceMock mockTransport_; testing::NiceMock mockAsyncTransport_; testing::NiceMock mockPeerCertificate_; const folly::SocketAddress defaultAddress_; - MockHTTPCodec mockCodec_; wangle::TransportInfo setupTransportInfo_; };