proxygen
fizz::MockPlaintextWriteRecordLayer Class Reference

#include <Mocks.h>

Inheritance diagram for fizz::MockPlaintextWriteRecordLayer:
fizz::PlaintextWriteRecordLayer fizz::WriteRecordLayer

Public Member Functions

 MOCK_CONST_METHOD1 (_write, TLSContent(TLSMessage &msg))
 
TLSContent write (TLSMessage &&msg) const override
 
 MOCK_CONST_METHOD1 (_writeInitialClientHello, TLSContent(Buf &))
 
TLSContent writeInitialClientHello (Buf encoded) const override
 
void setDefaults ()
 
- Public Member Functions inherited from fizz::PlaintextWriteRecordLayer
 ~PlaintextWriteRecordLayer () override=default
 
EncryptionLevel getEncryptionLevel () const override
 
- Public Member Functions inherited from fizz::WriteRecordLayer
virtual ~WriteRecordLayer ()=default
 
TLSContent writeAlert (Alert &&alert) const
 
TLSContent writeAppData (std::unique_ptr< folly::IOBuf > &&appData) const
 
template<typename... Args>
TLSContent writeHandshake (Buf &&encodedHandshakeMsg, Args &&...args) const
 
void setProtocolVersion (ProtocolVersion version) const
 

Additional Inherited Members

- Protected Attributes inherited from fizz::WriteRecordLayer
ProtocolVersion recordVersion_ {ProtocolVersion::tls_1_2}
 
bool useAdditionalData_ {true}
 

Detailed Description

Definition at line 67 of file Mocks.h.

Member Function Documentation

fizz::MockPlaintextWriteRecordLayer::MOCK_CONST_METHOD1 ( _write  ,
TLSContent(TLSMessage &msg)   
)
fizz::MockPlaintextWriteRecordLayer::MOCK_CONST_METHOD1 ( _writeInitialClientHello  ,
TLSContent(Buf &)   
)
void fizz::MockPlaintextWriteRecordLayer::setDefaults ( )
inline

Definition at line 79 of file Mocks.h.

References testing::_, fizz::TLSContent::contentType, folly::IOBuf::copyBuffer(), fizz::TLSContent::data, fizz::TLSContent::encryptionLevel, testing::InvokeWithoutArgs(), ON_CALL, and fizz::setWriteDefaults().

79  {
80  setWriteDefaults(this);
81  ON_CALL(*this, _writeInitialClientHello(_))
82  .WillByDefault(InvokeWithoutArgs([]() {
83  TLSContent record;
84  record.contentType = ContentType::handshake;
85  record.data = folly::IOBuf::copyBuffer("handshake");
86  record.encryptionLevel = EncryptionLevel::Plaintext;
87  return record;
88  }));
89  }
void setWriteDefaults(T *obj)
Definition: Mocks.h:21
PolymorphicAction< internal::InvokeWithoutArgsAction< FunctionImpl > > InvokeWithoutArgs(FunctionImpl function_impl)
#define ON_CALL(obj, call)
const internal::AnythingMatcher _
static std::unique_ptr< IOBuf > copyBuffer(const void *buf, std::size_t size, std::size_t headroom=0, std::size_t minTailroom=0)
Definition: IOBuf.h:1587
TLSContent fizz::MockPlaintextWriteRecordLayer::write ( TLSMessage &&  msg) const
inlineoverridevirtual

Reimplemented from fizz::PlaintextWriteRecordLayer.

Definition at line 70 of file Mocks.h.

References MOCK_CONST_METHOD1.

70  {
71  return _write(msg);
72  }
TLSContent fizz::MockPlaintextWriteRecordLayer::writeInitialClientHello ( Buf  encodedClientHello) const
inlineoverridevirtual

Write the initial ClientHello handshake message. This is a separate method as the record encoding can be slightly different since the version has not been negotiated yet.

Reimplemented from fizz::PlaintextWriteRecordLayer.

Definition at line 75 of file Mocks.h.

75  {
76  return _writeInitialClientHello(encoded);
77  }

The documentation for this class was generated from the following file: