Skip to content

Commit

Permalink
Only one mockCodec in MockHTTPTransaction
Browse files Browse the repository at this point in the history
Summary: This was confusing

Reviewed By: hanidamlaj

Differential Revision: D49213450

fbshipit-source-id: f324b0ed7029c64b0b6afc7d5eaa1b24461a169b
  • Loading branch information
afrind authored and facebook-github-bot committed Sep 14, 2023
1 parent dba965a commit a40c2cf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions proxygen/lib/http/session/test/HTTPTransactionMocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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<MockHTTPTransactionTransport> mockTransport_;
testing::NiceMock<folly::test::MockAsyncTransport> mockAsyncTransport_;
testing::NiceMock<MockAsyncTransportCertificate> mockPeerCertificate_;
const folly::SocketAddress defaultAddress_;
MockHTTPCodec mockCodec_;
wangle::TransportInfo setupTransportInfo_;
};

Expand Down

0 comments on commit a40c2cf

Please sign in to comment.